CN107015869B - Transaction keeps accounts control method and system - Google Patents

Transaction keeps accounts control method and system Download PDF

Info

Publication number
CN107015869B
CN107015869B CN201710027726.8A CN201710027726A CN107015869B CN 107015869 B CN107015869 B CN 107015869B CN 201710027726 A CN201710027726 A CN 201710027726A CN 107015869 B CN107015869 B CN 107015869B
Authority
CN
China
Prior art keywords
accounts
information
kept
keeps
credit entry
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.)
Active
Application number
CN201710027726.8A
Other languages
Chinese (zh)
Other versions
CN107015869A (en
Inventor
张元良
刘俊杰
高巍
黄劲霄
蔡俊杰
于立新
李�浩
刘经纬
陈梓培
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN201710027726.8A priority Critical patent/CN107015869B/en
Publication of CN107015869A publication Critical patent/CN107015869A/en
Application granted granted Critical
Publication of CN107015869B publication Critical patent/CN107015869B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/524Deadlock detection or avoidance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/52Program synchronisation; Mutual exclusion, e.g. by means of semaphores
    • G06F9/522Barrier synchronisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/02Banking, e.g. interest calculation or account maintenance

Abstract

The invention discloses a kind of control method and system of keeping accounts of merchandising, this method includes:Transaction keeps accounts control system after receiving a money transfer transactions request, it asks corresponding debit account to be withholdd the money transfer transactions and carries out the information processing of withholing of preset kind, ask the information to be kept accounts of corresponding credit entry to be added into the pending queue being generated in advance the money transfer transactions;It checks whether the credit entry meets the preset condition that keeps accounts, and after credit entry satisfaction keeps accounts condition, the mark that can keep accounts is generated for the information to be kept accounts of the credit entry;Asynchronous thread is enabled, scans the information to be kept accounts with the mark that can keep accounts in the pending queue, and the information to be kept accounts to scanning carries out the processing that keeps accounts according to preset rules, and carry out the information processing that keeps accounts of preset kind.The present invention improves transaction and executes speed and handling capacity, ensures the normal execution of business.

Description

Transaction keeps accounts control method and system
Technical field
The present invention relates to field of computer technology more particularly to a kind of control method and systems of keeping accounts of merchandising.
Background technology
Currently, if there are high emergency situations in the core transaction system of each bank, for example, money transfer transactions amount explodes suddenly; Mutually turn deadlock event of merchandising caused by (A turns B, and B turns A) between more two accounts of synchronization;A large amount of money transfer transactions need Update the data same Account History in library (for example, for electric business platform " for example, Alibaba's electric business platform ", quotient The spending amount for buying product is transferred to the specified intermediate account of electric business platform by family by electric business gondola sales product, consumer In, and by the specified intermediate account of electric business platform after preset time, the spending amount batch of consumer is transferred to the silver of trade company In row account), and the core transaction system needs is caused to fight for and wait for the Account History of the account to lock, it need to synchronize and be detained Money is completed to merchandise with processing is kept accounts, then the transaction execution of the core transaction system can be slack-off, and the time-consuming of bank transaction can increase Add, throughput of system can decline to a great extent, and the trading processing channel meeting blockage phenomenon of bank seriously affects other regular traffics Operation.
Invention content
The main purpose of the present invention is to provide a kind of control method and systems of keeping accounts of merchandising, it is intended to improve high emergency situations When transaction execute speed and handling capacity.
To achieve the above object, a kind of control method that keeps accounts of merchandising provided by the invention, the described method comprises the following steps:
A, transaction keeps accounts control system after receiving a money transfer transactions request, and corresponding debit is asked to the money transfer transactions Account is withholdd and carries out the information processing of withholing of preset kind, by the money transfer transactions ask corresponding credit entry wait for into Account information is added into the pending queue being generated in advance;
B, check whether the credit entry meets the preset condition that keeps accounts, and after credit entry satisfaction keeps accounts condition, The mark that can keep accounts is generated for the information to be kept accounts of the credit entry;
C, asynchronous thread is enabled, scans the information to be kept accounts with the mark that can keep accounts in the pending queue, and to scanning To information to be kept accounts carry out the processing that keeps accounts according to preset rules, and carry out the information processing that keeps accounts of preset kind;
The asynchronous thread include it is at least one in real time or in the timing scan pending queue with can keep accounts Mark information to be kept accounts scanning thread and it is at least one be used for the information to be kept accounts scanned is carried out according to preset rules Keep accounts processing, and carries out the worker thread of the information processing that keeps accounts of preset kind, and this method further includes:
In real time or the information content to be kept accounts with the mark that can keep accounts in the pending queue is detected in timing;If detecting Information content to be kept accounts is more than predetermined threshold value, then increases the scanning thread and/or worker thread of preset quantity, and is transferred to and executes institute State step C;
Ask the information to be kept accounts of corresponding credit entry that the active line in the asynchronous thread is added the money transfer transactions The algorithm of journey is:
Wherein, in formula (1) and (2), h0For preset second initial value, p is preset hash prime number, and n is credit side Total number of characters of account x;N is the positive integer more than 1, binary (xk) be credit entry x k-th of character byte Binary value;The range of k is from 1 to n;A is the sum of worker thread, and the information to be kept accounts that the value of f (x) is credit entry x is fallen The serial number of the worker thread entered.
Preferably, the preset rules are:
If the worker thread has multiple, it is only assigned in the information to be kept accounts of synchronization, the same credit entry The information to be kept accounts of the same worker thread processing, different credit entries distributes to different worker thread processing;
If the worker thread only there are one, the information to be kept accounts of the same credit entry is classified as identical waiting keeping accounts In information aggregate, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to it is each wait for into Account information aggregate is ranked up, and according to the sequence, information aggregate to be kept accounts is selected to carry out the processing that keeps accounts one by one, and carries out default class The information processing that keeps accounts of type.
Preferably, by the money transfer transactions ask corresponding credit entry information to be kept accounts be added be generated in advance it is pending The algorithm of queue is:
Wherein, in formula (3), h is preset first initial value, and p is preset hash prime number, and n is the total of credit entry x Number of characters, n are the positive integer more than 1, ascii (xk) be credit entry x+1 character of kth ascii values, the range of k is From 0 to n-1;A is the sum of pending queue;The value of f (x) is the pending queue that the information to be kept accounts of credit entry x is fallen into Serial number.
In addition, to achieve the above object, the present invention also provides a kind of control system that keeps accounts of merchandising, the control that keeps accounts of merchandising System includes:
It withholds module, for after receiving a money transfer transactions request, corresponding debit account to be asked to the money transfer transactions The money transfer transactions are asked the letter to be kept accounts of corresponding credit entry by the information processing of withholing for being withholdd and being carried out preset kind Breath is added into the pending queue being generated in advance;
It checks module, meets for checking whether the credit entry meets the preset condition that keeps accounts, and in the credit entry After the condition that keeps accounts, the mark that can keep accounts is generated for the information to be kept accounts of the credit entry;
The asynchronous module that keeps accounts, for enabling asynchronous thread, scan in the pending queue with the mark that can keep accounts wait for into Account information, and the information to be kept accounts to scanning carries out the processing that keeps accounts according to preset rules, and carry out the letter that keeps accounts of preset kind Breath processing;
The asynchronous thread include it is at least one in real time or in the timing scan pending queue with can keep accounts Mark information to be kept accounts scanning thread and it is at least one be used for the information to be kept accounts scanned is carried out according to preset rules Keep accounts processing, and carries out the worker thread of the information processing that keeps accounts of preset kind, and the transaction control system that keeps accounts further includes:
Increase module, for detecting the information to be kept accounts with the mark that can keep accounts in the pending queue in real time or periodically Quantity;If the information content to be kept accounts of detecting is more than predetermined threshold value, increase the scanning thread and/or active line of preset quantity Journey;
Ask the information to be kept accounts of corresponding credit entry that the active line in the asynchronous thread is added the money transfer transactions The algorithm of journey is:
Wherein, in formula (1) and (2), h0For preset second initial value, p is preset hash prime number, and n is credit side Total number of characters of account x;N is the positive integer more than 1, binary (xk) be credit entry x k-th of character byte Binary value;The range of k is from 1 to n;A is the sum of worker thread, and the information to be kept accounts that the value of f (x) is credit entry x is fallen The serial number of the worker thread entered.
Preferably, the preset rules are:
If the worker thread has multiple, it is only assigned in the information to be kept accounts of synchronization, the same credit entry The information to be kept accounts of the same worker thread processing, different credit entries distributes to different worker thread processing;
If the worker thread only there are one, the information to be kept accounts of the same credit entry is classified as identical waiting keeping accounts In information aggregate, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to it is each wait for into Account information aggregate is ranked up, and according to the sequence, information aggregate to be kept accounts is selected to carry out the processing that keeps accounts one by one, and carries out default class The information processing that keeps accounts of type.
Preferably, by the money transfer transactions ask corresponding credit entry information to be kept accounts be added be generated in advance it is pending The algorithm of queue is:
Wherein, in formula (3), h is preset first initial value, and p is preset hash prime number, and n is the total of credit entry x Number of characters, n are the positive integer more than 1, ascii (xk) be credit entry x+1 character of kth ascii values, the range of k is From 0 to n-1;A is the sum of pending queue;The value of f (x) is the pending queue that the information to be kept accounts of credit entry x is fallen into Serial number.
Keeping accounts control method and system proposed by the present invention of merchandising, after receiving money transfer transactions request, first to the friendship of transferring accounts It easily asks corresponding debit account to be withholdd and asks the information to be kept accounts of corresponding credit entry to be added the money transfer transactions Into the pending queue being generated in advance, if checking, the credit entry meets the preset condition that keeps accounts, for the credit entry Information to be kept accounts generates the mark that can keep accounts;And asynchronous thread is enabled, it scans in the pending queue and is waited for the mark that can keep accounts Keep accounts information, and carries out the processing that keeps accounts according to preset rules to the information to be kept accounts scanned.Due to being first by credit entry Information to be kept accounts is added in pending queue, and waits keeping accounts to meeting the condition that keeps accounts in the pending queue using asynchronous thread Information carries out the processing that keeps accounts, and keep accounts pressure of the transaction system in high emergency situations is alleviated by way of asynchronous keep accounts, is kept away Exempting from the transaction system in high emergency situations fights for and waits for the Account History of trading account to lock, and improves transaction and executes speed and gulp down The amount of spitting ensures the normal execution of business.
Description of the drawings
Fig. 1 is that present invention transaction keeps accounts the flow diagram of control method first embodiment;
Fig. 2 is that present invention transaction keeps accounts the flow diagram of control method second embodiment;
Fig. 3 is that present invention transaction keeps accounts the high-level schematic functional block diagram of control system first embodiment;
Fig. 4 is that present invention transaction keeps accounts the high-level schematic functional block diagram of control system second embodiment.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific implementation mode
In order to keep technical problems, technical solutions and advantages to be solved clearer, clear, tie below Drawings and examples are closed, the present invention will be described in further detail.It should be appreciated that specific embodiment described herein is only To explain the present invention, it is not intended to limit the present invention.
The present invention provides a kind of control method that keeps accounts of merchandising.
Referring to Fig.1, Fig. 1 is that present invention transaction keeps accounts the flow diagram of control method first embodiment.
In the first embodiment, the transaction control method that keeps accounts includes:
Step S10, transaction keep accounts control system after receiving a money transfer transactions request, ask to correspond to the money transfer transactions Debit account withholdd and carry out the information processing of withholing of preset kind, which is asked into corresponding credit entry Information to be kept accounts be added into the pending queue being generated in advance.
In the present embodiment, transaction keep accounts control system receive user send out money transfer transactions request, for example, receive user exist Relevant information is inputted in the terminals such as mobile phone, tablet computer, self-help terminal equipment (for example, the account of withholing of money transfer transactions, keep accounts account Family, transfer amounts, date of transferring accounts, type of transferring accounts etc.) send afterwards money transfer transactions request, such as receive user mobile phone, tablet electricity The money transfer transactions sent after relevant information are inputted in the terminals such as brain, self-help terminal equipment on preassembled transacting customer end to ask It asks, or receives user on browser in the terminals such as mobile phone, tablet computer, self-help terminal equipment after input relevant information The money transfer transactions request sent.
Transaction keeps accounts control system after receiving a money transfer transactions request, enables master transaction thread and is asked to the money transfer transactions Seek corresponding debit account (i.e.:Withhold account) it carries out in real time or timing is withholdd, i.e., after receiving money transfer transactions request at once It asks the account amount of money of corresponding debit account to deduct the money transfer transactions money transfer transactions and asks corresponding transfer amounts, and The information processing of withholing for carrying out preset kind, to complete the operation of withholing of debit account;Wherein, the letter of withholing of the preset kind Processing is ceased including but not limited to generate detailed, recognition folding processing of withholing, push and move account notice etc..Then, do not entered directly Account operates, but the money transfer transactions are asked corresponding credit entry (i.e.:Keep accounts account) information to be kept accounts (for example, wait for into The amount of money, debit account information, transaction remark information of account etc.) it is added into the pending queue being generated in advance.
Step S20, checks whether the credit entry meets the preset condition that keeps accounts, and meets the item that keeps accounts in the credit entry After part, the mark that can keep accounts is generated for the information to be kept accounts of the credit entry.
In real time or whether regular check credit entry meets the condition of keeping accounts, if for example, checking that the credit entry is frozen Knot, it is determined that the credit entry is unsatisfactory for the condition of keeping accounts;If alternatively, checking the credit entry by cancellation, it is determined that the credit side Account is unsatisfactory for condition of keeping accounts, etc., does not limit herein.After checking and determining that the credit entry meets the condition that keeps accounts, it is The information to be kept accounts for the credit entry being added in pending queue generates the mark that can keep accounts.
Step S30 enables asynchronous thread, scans the information to be kept accounts with the mark that can keep accounts in the pending queue, and The processing that keeps accounts is carried out according to preset rules to the information to be kept accounts scanned, and carries out the information processing that keeps accounts of preset kind.
The transaction control system that keeps accounts enables asynchronous thread, with can in real time or in the pending queue that generates of timing scan The information to be kept accounts for the mark that keeps accounts, the information to be kept accounts that should carry the mark that can keep accounts are to meet the loan for the condition that keeps accounts by checking The information to be kept accounts of square account.The processing that keeps accounts is carried out according to preset rules to the information to be kept accounts scanned, it such as can be to multiple phases The information to be kept accounts of same credit entry carries out parallel processing, can also be carried out to the information to be kept accounts of multiple and different credit entries Serial process does not limit herein.Also, to scanning when the information that keeps accounts keep accounts processing, also carry out default class The information processing that keeps accounts of type, for example, the information processing that keeps accounts of the preset kind includes but not limited to generate the detailed, recognition that keeps accounts Account notice etc. is moved in folding processing, push, to complete the asynchronous operation that keeps accounts.
The present embodiment first asks corresponding debit account to be withholdd the money transfer transactions after receiving money transfer transactions request And ask the information to be kept accounts of corresponding credit entry to be added into the pending queue being generated in advance the money transfer transactions, if inspection It looks into the credit entry and meets the preset condition that keeps accounts, then generate the mark that can keep accounts for the information to be kept accounts of the credit entry;And it opens With asynchronous thread, the information to be kept accounts with the mark that can keep accounts in the pending queue, and the letter to be kept accounts to scanning are scanned Breath carries out the processing that keeps accounts according to preset rules.First information to be kept accounts by credit entry is added in pending queue due to being, and The processing that keeps accounts is carried out to the information to be kept accounts for meeting the condition that keeps accounts in the pending queue using asynchronous thread, is kept accounts by asynchronous Mode alleviate keep accounts pressure of the transaction system in high emergency situations, avoid in high emergency situations transaction system fight for and The Account History lock for waiting for trading account, improves transaction and executes speed and handling capacity, ensure the normal execution of business.
As shown in Fig. 2, second embodiment of the invention proposes a kind of control method that keeps accounts of merchandising, on the basis of above-described embodiment On, further include before above-mentioned steps S30:
Step S40, in real time or the information content to be kept accounts with the mark that can keep accounts in the pending queue is detected in timing; If the information content to be kept accounts of detecting is more than predetermined threshold value, increase the scanning thread and/or worker thread of preset quantity.
In the present embodiment, for including at least one scanning thread and at least one work into the asynchronous thread that line asynchronous keeps accounts Make thread, wherein:The scanning thread with the mark that can keep accounts for waiting in real time or in the timing scan pending queue Keep accounts information;The worker thread is used for the information to be kept accounts to scanning and carries out the processing that keeps accounts according to preset rules, and carries out The information processing that keeps accounts of preset kind.It can to carry out carrying respectively by least one scanning thread and at least one worker thread The scan operation of the information to be kept accounts for the mark that keeps accounts and the operation that keeps accounts of the information to be kept accounts to scanning, the division of labor is clear, prevents Keep accounts conflict, improves the efficiency of the asynchronous processing that keeps accounts.
Further, the information to be kept accounts with the mark that can keep accounts in the pending queue can also in real time or be periodically detected Quantity;If detecting information content to be kept accounts be more than predetermined threshold value, illustrate the information to be kept accounts that currently need to be scanned and keep accounts compared with It is more, then increase the scanning thread and/or worker thread of preset quantity, to improve the speed of the asynchronous processing that keeps accounts, ensure it is asynchronous enter The high efficiency of account processing.
Further, in other embodiments, the preset rules are:
If the worker thread has multiple, it is only assigned in the information to be kept accounts of synchronization, the same credit entry The information to be kept accounts of the same worker thread processing, different credit entries distributes to different worker thread processing;
If the worker thread only there are one, the information to be kept accounts of the same credit entry is classified as identical waiting keeping accounts In information aggregate, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to it is each wait for into Account information aggregate is ranked up, and according to the sequence, information aggregate to be kept accounts is selected to carry out the processing that keeps accounts one by one, and carries out default class The information processing that keeps accounts of type.
In the present embodiment, waiting keeping accounts with the mark that can keep accounts to what is scanned by the worker thread in asynchronous thread Information keep accounts processing when, if the worker thread have it is multiple, in the one or more of same credit entry letter to be kept accounts Breath distributes to the processing of same worker thread, i.e., by multiple worker threads one to multiple and different credit entries or more respectively A information to be kept accounts carries out parallel processing.If there are one the worker threads, by one of the same credit entry or more A information to be kept accounts is classified as in identical information aggregate to be kept accounts, and the information to be kept accounts of different credit entries is classified as different In information aggregate to be kept accounts, the worker thread only needs in order each information aggregate to be kept accounts of serial process successively, can be effective Ground treats the information that keeps accounts and is classified and focused on by credit entry, simplifies process flow, processing speed is improved, to carry The efficiency of the high asynchronous processing that keeps accounts.
Further, in other embodiments, the information to be kept accounts of corresponding credit entry is asked to add the money transfer transactions The algorithm for entering the pending queue being generated in advance is:
Wherein, in formula (3), h is preset first initial value, could be provided as any integer value, may be set to be 0.P is preset hash prime number, can use 257.N is total number of characters of credit entry x, and n is the positive integer more than 1, ascii (xk) Range for the ascii values of+1 character of kth of credit entry x, k is from 0 to n-1.A is the sum of pending queue.
The pending queue that the information to be kept accounts that value by the calculated f (x) of above-mentioned algorithm is credit entry x is fallen into Serial number namely code name, such as the f (x) numbers pending queue, to which corresponding serial number is added in the information to be kept accounts of credit entry x successively Pending queue in.
Further, in other embodiments, the information to be kept accounts of corresponding credit entry is asked to add the money transfer transactions The algorithm for entering the worker thread in the asynchronous thread is:
Wherein, in formula (1) and (2), h0For preset second initial value, any integer value is could be provided as, such as Take -2128831035.P is preset hash prime number, can use 57885161.N is total number of characters of credit entry x;N is more than 1 Positive integer, binary (xk) be credit entry x k-th of character a byte binary value;The range of k be from 1 to n;A is the sum of worker thread.Wherein, ask information the to be kept accounts addition of corresponding credit entry described different the money transfer transactions The algorithm of worker thread in step thread is added in advance with the money transfer transactions to be asked to the information to be kept accounts of corresponding credit entry Hash prime number p in the algorithm of the pending queue generated could be provided as identical, may be set to be difference;First initial value H and the second initial value h0It could be provided as identical, may be set to be difference, do not limit herein.
The sequence for the worker thread that the information to be kept accounts that value by the calculated f (x) of above-mentioned algorithm is credit entry x is fallen into Number namely code name, such as the f (x) numbers worker thread, to which the information to be kept accounts of credit entry x to be added to the work of corresponding serial number successively Make in thread.
The present invention further provides a kind of control systems that keeps accounts of merchandising.
With reference to Fig. 3, Fig. 3 is that present invention transaction keeps accounts the high-level schematic functional block diagram of control system first embodiment.
In the first embodiment, the transaction control system that keeps accounts includes:
Module of withholing 01, for after receiving a money transfer transactions request, corresponding debit's account to be asked to the money transfer transactions Family withholdd and carries out the information processing of withholing of preset kind, asks corresponding credit entry to wait keeping accounts the money transfer transactions Information is added into the pending queue being generated in advance.
In the present embodiment, transaction keep accounts control system receive user send out money transfer transactions request, for example, receive user exist Relevant information is inputted in the terminals such as mobile phone, tablet computer, self-help terminal equipment (for example, the account of withholing of money transfer transactions, keep accounts account Family, transfer amounts, date of transferring accounts, type of transferring accounts etc.) send afterwards money transfer transactions request, such as receive user mobile phone, tablet electricity The money transfer transactions sent after relevant information are inputted in the terminals such as brain, self-help terminal equipment on preassembled transacting customer end to ask It asks, or receives user on browser in the terminals such as mobile phone, tablet computer, self-help terminal equipment after input relevant information The money transfer transactions request sent.
Transaction keeps accounts control system after receiving a money transfer transactions request, enables master transaction thread and is asked to the money transfer transactions Seek corresponding debit account (i.e.:Withhold account) it carries out in real time or timing is withholdd, i.e., after receiving money transfer transactions request at once It asks the account amount of money of corresponding debit account to deduct the money transfer transactions money transfer transactions and asks corresponding transfer amounts, and The information processing of withholing for carrying out preset kind, to complete the operation of withholing of debit account;Wherein, the letter of withholing of the preset kind Processing is ceased including but not limited to generate detailed, recognition folding processing of withholing, push and move account notice etc..Then, do not entered directly Account operates, but the money transfer transactions are asked corresponding credit entry (i.e.:Keep accounts account) information to be kept accounts (for example, wait for into The amount of money, debit account information, transaction remark information of account etc.) it is added into the pending queue being generated in advance.
Check module 02, for checking whether the credit entry meets the preset condition that keeps accounts, and it is full in the credit entry Foot keeps accounts after condition, and the mark that can keep accounts is generated for the information to be kept accounts of the credit entry.
In real time or whether regular check credit entry meets the condition of keeping accounts, if for example, checking that the credit entry is frozen Knot, it is determined that the credit entry is unsatisfactory for the condition of keeping accounts;If alternatively, checking the credit entry by cancellation, it is determined that the credit side Account is unsatisfactory for condition of keeping accounts, etc., does not limit herein.After checking and determining that the credit entry meets the condition that keeps accounts, it is The information to be kept accounts for the credit entry being added in pending queue generates the mark that can keep accounts.
The asynchronous module 03 that keeps accounts is scanned in the pending queue and is waited for the mark that can keep accounts for enabling asynchronous thread Keep accounts information, and the information to be kept accounts to scanning carries out the processing that keeps accounts according to preset rules, and carries out keeping accounts for preset kind Information processing.
The transaction control system that keeps accounts enables asynchronous thread, with can in real time or in the pending queue that generates of timing scan The information to be kept accounts for the mark that keeps accounts, the information to be kept accounts that should carry the mark that can keep accounts are to meet the loan for the condition that keeps accounts by checking The information to be kept accounts of square account.The processing that keeps accounts is carried out according to preset rules to the information to be kept accounts scanned, it such as can be to multiple phases The information to be kept accounts of same credit entry carries out parallel processing, can also be carried out to the information to be kept accounts of multiple and different credit entries Serial process does not limit herein.Also, to scanning when the information that keeps accounts keep accounts processing, also carry out default class The information processing that keeps accounts of type, for example, the information processing that keeps accounts of the preset kind includes but not limited to generate the detailed, recognition that keeps accounts Account notice etc. is moved in folding processing, push, to complete the asynchronous operation that keeps accounts.
The present embodiment first asks corresponding debit account to be withholdd the money transfer transactions after receiving money transfer transactions request And ask the information to be kept accounts of corresponding credit entry to be added into the pending queue being generated in advance the money transfer transactions, if inspection It looks into the credit entry and meets the preset condition that keeps accounts, then generate the mark that can keep accounts for the information to be kept accounts of the credit entry;And it opens With asynchronous thread, the information to be kept accounts with the mark that can keep accounts in the pending queue, and the letter to be kept accounts to scanning are scanned Breath carries out the processing that keeps accounts according to preset rules.First information to be kept accounts by credit entry is added in pending queue due to being, and The processing that keeps accounts is carried out to the information to be kept accounts for meeting the condition that keeps accounts in the pending queue using asynchronous thread, is kept accounts by asynchronous Mode alleviate keep accounts pressure of the transaction system in high emergency situations, avoid in high emergency situations transaction system fight for and The Account History lock for waiting for trading account, improves transaction and executes speed and handling capacity, ensure the normal execution of business.
As shown in figure 4, second embodiment of the invention proposes a kind of control system that keeps accounts of merchandising, on the basis of above-described embodiment On, further include:
Increase module 04, for detecting the letter to be kept accounts with the mark that can keep accounts in the pending queue in real time or periodically Cease quantity;If the information content to be kept accounts of detecting is more than predetermined threshold value, increase the scanning thread and/or active line of preset quantity Journey.
In the present embodiment, for including at least one scanning thread and at least one work into the asynchronous thread that line asynchronous keeps accounts Make thread, wherein:The scanning thread with the mark that can keep accounts for waiting in real time or in the timing scan pending queue Keep accounts information;The worker thread is used for the information to be kept accounts to scanning and carries out the processing that keeps accounts according to preset rules, and carries out The information processing that keeps accounts of preset kind.It can to carry out carrying respectively by least one scanning thread and at least one worker thread The scan operation of the information to be kept accounts for the mark that keeps accounts and the operation that keeps accounts of the information to be kept accounts to scanning, the division of labor is clear, prevents Keep accounts conflict, improves the efficiency of the asynchronous processing that keeps accounts.
Further, the information to be kept accounts with the mark that can keep accounts in the pending queue can also in real time or be periodically detected Quantity;If detecting information content to be kept accounts be more than predetermined threshold value, illustrate the information to be kept accounts that currently need to be scanned and keep accounts compared with It is more, then increase the scanning thread and/or worker thread of preset quantity, to improve the speed of the asynchronous processing that keeps accounts, ensure it is asynchronous enter The high efficiency of account processing.
Further, in other embodiments, the preset rules are:
If the worker thread has multiple, it is only assigned in the information to be kept accounts of synchronization, the same credit entry The information to be kept accounts of the same worker thread processing, different credit entries distributes to different worker thread processing;
If the worker thread only there are one, the information to be kept accounts of the same credit entry is classified as identical waiting keeping accounts In information aggregate, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to it is each wait for into Account information aggregate is ranked up, and according to the sequence, information aggregate to be kept accounts is selected to carry out the processing that keeps accounts one by one, and carries out default class The information processing that keeps accounts of type.
In the present embodiment, waiting keeping accounts with the mark that can keep accounts to what is scanned by the worker thread in asynchronous thread Information keep accounts processing when, if the worker thread have it is multiple, in the one or more of same credit entry letter to be kept accounts Breath distributes to the processing of same worker thread, i.e., by multiple worker threads one to multiple and different credit entries or more respectively A information to be kept accounts carries out parallel processing.If there are one the worker threads, by one of the same credit entry or more A information to be kept accounts is classified as in identical information aggregate to be kept accounts, and the information to be kept accounts of different credit entries is classified as different In information aggregate to be kept accounts, the worker thread only needs in order each information aggregate to be kept accounts of serial process successively, can be effective Ground treats the information that keeps accounts and is classified and focused on by credit entry, simplifies process flow, processing speed is improved, to carry The efficiency of the high asynchronous processing that keeps accounts.
Further, in other embodiments, the information to be kept accounts of corresponding credit entry is asked to add the money transfer transactions The algorithm for entering the pending queue being generated in advance is:
Wherein, in formula (3), h is preset first initial value, could be provided as any integer value, may be set to be 0.P is preset hash prime number, can use 257.N is total number of characters of credit entry x, and n is the positive integer more than 1, ascii (xk) Range for the ascii values of+1 character of kth of credit entry x, k is from 0 to n-1.A is the sum of pending queue.
The pending queue that the information to be kept accounts that value by the calculated f (x) of above-mentioned algorithm is credit entry x is fallen into Serial number namely code name, such as the f (x) numbers pending queue, to which corresponding serial number is added in the information to be kept accounts of credit entry x successively Pending queue in.
Further, in other embodiments, the information to be kept accounts of corresponding credit entry is asked to add the money transfer transactions The algorithm for entering the worker thread in the asynchronous thread is:
Wherein, in formula (1) and (2), h0For preset second initial value, any integer value is could be provided as, such as Take -2128831035.P is preset hash prime number, can use 57885161.N is total number of characters of credit entry x;N is more than 1 Positive integer, binary (xk) be credit entry x k-th of character a byte binary value;The range of k be from 1 to n;A is the sum of worker thread.Wherein, ask information the to be kept accounts addition of corresponding credit entry described different the money transfer transactions The algorithm of worker thread in step thread is added in advance with the money transfer transactions to be asked to the information to be kept accounts of corresponding credit entry Hash prime number p in the algorithm of the pending queue generated could be provided as identical, may be set to be difference;First initial value H and the second initial value h0It could be provided as identical, may be set to be difference, do not limit herein.
The sequence for the worker thread that the information to be kept accounts that value by the calculated f (x) of above-mentioned algorithm is credit entry x is fallen into Number namely code name, such as the f (x) numbers worker thread, to which the information to be kept accounts of credit entry x to be added to the work of corresponding serial number successively Make in thread.
It should be noted that herein, the terms "include", "comprise" or its any other variant are intended to non-row His property includes, so that process, method, article or device including a series of elements include not only those elements, and And further include other elements that are not explicitly listed, or further include for this process, method, article or device institute it is intrinsic Element.In the absence of more restrictions, the element limited by sentence "including a ...", it is not excluded that including this There is also other identical elements in the process of element, method, article or device.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side Method can add the mode of required general hardware platform to realize by software, naturally it is also possible to be realized by hardware, but very much In the case of the former be more preferably embodiment.Based on this understanding, technical scheme of the present invention is substantially in other words to existing The part that technology contributes can be expressed in the form of software products, which is stored in a storage In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are used so that a station terminal equipment (can be mobile phone, calculate Machine, server, air conditioner or network equipment etc.) execute method described in each embodiment of the present invention.
Above by reference to the preferred embodiment of the present invention has been illustrated, not thereby limit to the interest field of the present invention.On It is for illustration only to state serial number of the embodiment of the present invention, can not represent the quality of embodiment.It is patrolled in addition, though showing in flow charts Sequence is collected, but in some cases, it can be with the steps shown or described are performed in an order that is different from the one herein.
Those skilled in the art do not depart from the scope of the present invention and essence, can there are many variant scheme realize the present invention, It can be used for another embodiment for example as the feature of one embodiment and obtain another embodiment.All technologies with the present invention All any modification, equivalent and improvement made by within design, should all be within the interest field of the present invention.

Claims (6)

  1. The control method 1. a kind of transaction keeps accounts, which is characterized in that the described method comprises the following steps:
    A, transaction keeps accounts control system after receiving a money transfer transactions request, and corresponding debit account is asked to the money transfer transactions The money transfer transactions are asked the letter to be kept accounts of corresponding credit entry by the information processing of withholing for being withholdd and being carried out preset kind Breath is added into the pending queue being generated in advance;
    B, check whether the credit entry meets the preset condition that keeps accounts, and after credit entry satisfaction keeps accounts condition, for this The information to be kept accounts of credit entry generates the mark that can keep accounts;
    C, it asynchronous thread is enabled, scans with the information to be kept accounts of mark of can keeping accounts in the pending queue, and to scanning Information to be kept accounts carries out the processing that keeps accounts according to preset rules, and carries out the information processing that keeps accounts of preset kind;
    The asynchronous thread include it is at least one in real time or in the timing scan pending queue with the mark that can keep accounts The scanning thread of information to be kept accounts and at least one for keeping accounts according to preset rules to the information to be kept accounts scanned Processing, and the worker thread of the information processing that keeps accounts of preset kind is carried out, this method further includes:
    In real time or the information content to be kept accounts with the mark that can keep accounts in the pending queue is detected in timing;If detecting wait for into Account information content is more than predetermined threshold value, then increases the scanning thread and/or worker thread of preset quantity, and is transferred to and executes the step Rapid C;
    The money transfer transactions are asked into the worker thread that the information to be kept accounts of corresponding credit entry is added in the asynchronous thread Algorithm is:
    Wherein, in formula (1) and (2), h0For preset second initial value, p is preset hash prime number, and n is credit entry x Total number of characters;N is the positive integer more than 1, binary (xk) be credit entry x k-th of character a byte two into Value processed;The range of k is from 1 to n;A is the sum of worker thread, and the information to be kept accounts that the value of f (x) is credit entry x is fallen into The serial number of worker thread.
  2. The control method 2. transaction as described in claim 1 keeps accounts, which is characterized in that the preset rules are:
    If the worker thread has multiple, in synchronization, the information to be kept accounts of the same credit entry is only assigned to same The information to be kept accounts of a worker thread processing, different credit entries distributes to different worker thread processing;
    If there are one the worker threads, the information to be kept accounts of the same credit entry is classified as identical information to be kept accounts In set, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to each letter to be kept accounts Breath set is ranked up, and according to the sequence, selects information aggregate to be kept accounts to carry out the processing that keeps accounts one by one, and carry out preset kind Keep accounts information processing.
  3. The control method 3. transaction as claimed in claim 1 or 2 keeps accounts, which is characterized in that ask the money transfer transactions corresponding The algorithm that the pending queue being generated in advance is added in the information to be kept accounts of credit entry is:
    Wherein, in formula (3), h is preset first initial value, and p is preset hash prime number, and n is total character of credit entry x Number, n are the positive integer more than 1, ascii (xk) be credit entry x+1 character of kth ascii values, the range of k be from 0 to n-1;A is the sum of pending queue;The value of f (x) is the sequence for the pending queue that the information to be kept accounts of credit entry x is fallen into Number.
  4. 4. a kind of transaction keeps accounts control system, which is characterized in that the transaction control system that keeps accounts includes:
    It withholds module, for after receiving a money transfer transactions request, asking corresponding debit account to carry out the money transfer transactions The money transfer transactions are asked the information to be kept accounts of corresponding credit entry to add by the information processing of withholing for withholing and carrying out preset kind Enter into the pending queue being generated in advance;
    It checks module, keeps accounts for checking whether the credit entry meets the preset condition that keeps accounts, and in credit entry satisfaction After condition, the mark that can keep accounts is generated for the information to be kept accounts of the credit entry;
    The asynchronous module that keeps accounts scans the letter to be kept accounts with the mark that can keep accounts in the pending queue for enabling asynchronous thread Breath, and the information to be kept accounts to scanning carries out the processing that keeps accounts according to preset rules, and at the information that keeps accounts of progress preset kind Reason;
    The asynchronous thread include it is at least one in real time or in the timing scan pending queue with the mark that can keep accounts The scanning thread of information to be kept accounts and at least one for keeping accounts according to preset rules to the information to be kept accounts scanned Processing, and the worker thread of the information processing that keeps accounts of preset kind is carried out, the transaction control system that keeps accounts further includes:
    Increase module, for detecting the Information Number to be kept accounts with the mark that can keep accounts in the pending queue in real time or periodically Amount;If the information content to be kept accounts of detecting is more than predetermined threshold value, increase the scanning thread and/or worker thread of preset quantity;
    The money transfer transactions are asked into the worker thread that the information to be kept accounts of corresponding credit entry is added in the asynchronous thread Algorithm is:
    Wherein, in formula (1) and (2), h0For preset second initial value, p is preset hash prime number, and n is credit entry x Total number of characters;N is the positive integer more than 1, binary (xk) be credit entry x k-th of character a byte two into Value processed;The range of k is from 1 to n;A is the sum of worker thread, and the information to be kept accounts that the value of f (x) is credit entry x is fallen into The serial number of worker thread.
  5. The control system 5. transaction as claimed in claim 4 keeps accounts, which is characterized in that the preset rules are:
    If the worker thread has multiple, in synchronization, the information to be kept accounts of the same credit entry is only assigned to same The information to be kept accounts of a worker thread processing, different credit entries distributes to different worker thread processing;
    If there are one the worker threads, the information to be kept accounts of the same credit entry is classified as identical information to be kept accounts In set, the information to be kept accounts of different credit entries is classified as in different information aggregates to be kept accounts, to each letter to be kept accounts Breath set is ranked up, and according to the sequence, selects information aggregate to be kept accounts to carry out the processing that keeps accounts one by one, and carry out preset kind Keep accounts information processing.
  6. 6. the control system that keeps accounts of merchandising as described in claim 4 or 5, which is characterized in that ask the money transfer transactions corresponding The algorithm that the pending queue being generated in advance is added in the information to be kept accounts of credit entry is:
    Wherein, in formula (3), h is preset first initial value, and p is preset hash prime number, and n is total character of credit entry x Number, n are the positive integer more than 1, ascii (xk) be credit entry x+1 character of kth ascii values, the range of k be from 0 to n-1;A is the sum of pending queue;The value of f (x) is the sequence for the pending queue that the information to be kept accounts of credit entry x is fallen into Number.
CN201710027726.8A 2017-01-16 2017-01-16 Transaction keeps accounts control method and system Active CN107015869B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710027726.8A CN107015869B (en) 2017-01-16 2017-01-16 Transaction keeps accounts control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710027726.8A CN107015869B (en) 2017-01-16 2017-01-16 Transaction keeps accounts control method and system

Publications (2)

Publication Number Publication Date
CN107015869A CN107015869A (en) 2017-08-04
CN107015869B true CN107015869B (en) 2018-08-31

Family

ID=59440372

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710027726.8A Active CN107015869B (en) 2017-01-16 2017-01-16 Transaction keeps accounts control method and system

Country Status (1)

Country Link
CN (1) CN107015869B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256843B (en) * 2018-01-12 2022-06-07 上海瀚银信息技术有限公司 Payment-instead transaction method and payment-instead transaction system
CN108615184B (en) * 2018-03-29 2020-12-18 创新先进技术有限公司 Accounting method and device
CN109711958A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 It keeps accounts method, apparatus, terminal device and computer readable storage medium to public affairs
CN109376189A (en) * 2018-09-13 2019-02-22 阿里巴巴集团控股有限公司 Processing method, device and the equipment of batch data operation
CN109472577A (en) * 2018-09-26 2019-03-15 中国平安人寿保险股份有限公司 Account keeps accounts method, apparatus, computer equipment and storage medium
CN109636369A (en) * 2018-11-02 2019-04-16 深圳市快付通金融网络科技服务有限公司 Fund account accounting processing method, apparatus, computer equipment and storage medium
CN110310192A (en) * 2019-05-23 2019-10-08 平安银行股份有限公司 Transaction processing method, device, equipment and storage medium based on data analysis
CN110889687A (en) * 2019-11-18 2020-03-17 厦门网宿有限公司 Method and device for processing account balance under distributed architecture
CN112990900A (en) * 2019-12-02 2021-06-18 贝壳技术有限公司 Transfer method, device, storage medium and equipment
CN111352753B (en) * 2020-04-26 2023-08-18 中国银行股份有限公司 Accounting processing method and device
CN112561687A (en) * 2020-12-18 2021-03-26 厦门投融汇网络有限公司 Multithreading account fund asynchronous processing method
CN113362025A (en) * 2021-06-04 2021-09-07 北京京东振世信息技术有限公司 Data accounting system, method, computer readable storage medium, electronic device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5940813A (en) * 1996-07-26 1999-08-17 Citibank, N.A. Process facility management matrix and system and method for performing batch, processing in an on-line environment
CN101620703A (en) * 2008-07-04 2010-01-06 阿里巴巴集团控股有限公司 Buffer bookkeeping method and device
CN101639792A (en) * 2008-07-29 2010-02-03 阿里巴巴集团控股有限公司 Method and device for processing concurrent data and electronic accounting system
CN101673307A (en) * 2009-10-21 2010-03-17 中国农业大学 Space data index method and system
CN202373037U (en) * 2011-12-21 2012-08-08 成都英黎科技有限公司 Mobile-terminal-based account transfer system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5940813A (en) * 1996-07-26 1999-08-17 Citibank, N.A. Process facility management matrix and system and method for performing batch, processing in an on-line environment
CN101620703A (en) * 2008-07-04 2010-01-06 阿里巴巴集团控股有限公司 Buffer bookkeeping method and device
CN101639792A (en) * 2008-07-29 2010-02-03 阿里巴巴集团控股有限公司 Method and device for processing concurrent data and electronic accounting system
CN101673307A (en) * 2009-10-21 2010-03-17 中国农业大学 Space data index method and system
CN202373037U (en) * 2011-12-21 2012-08-08 成都英黎科技有限公司 Mobile-terminal-based account transfer system

Also Published As

Publication number Publication date
CN107015869A (en) 2017-08-04

Similar Documents

Publication Publication Date Title
CN107015869B (en) Transaction keeps accounts control method and system
US20210365926A1 (en) Settlement system, server device, terminal device, method and program
CN104504804B (en) Cash distribution method and device and financial self-service device
CN105468690A (en) Inventory data processing method and device
CN107908666A (en) A kind of method and apparatus of identification equipment mark
CN106033515B (en) The recognition methods of fraud and device
WO2014111540A1 (en) System and method for characterizing financial messages
US20220058608A1 (en) Redemption network with transaction sequencer
EP2984612A2 (en) Analytics rules engine for payment processing system
CN108171561A (en) A kind of full channel order merging treatment method
US20140012763A1 (en) Money transfer fraud prevention methods and systems
CN109670934A (en) Personal identification method, equipment, storage medium and device based on user behavior
CN106952085A (en) A kind of method and device of data storage and Business Processing
CN110288465A (en) Object determines method and device, storage medium, electronic device
CN107885754A (en) The method and apparatus for extracting credit variable from transaction data based on LDA models
CN108648036A (en) Commodity recognition method, system and storage medium on a kind of shelf
US20150019410A1 (en) Fraud Management System and Method
US20220148001A1 (en) Patching security vulnerabilities using machine learning
CN109636581A (en) Processing method and processing device, storage medium, the computer equipment of loan application information
CN108171562A (en) A kind of full channel order sorts out automatic processing method
CN116805265A (en) Wind control threshold selection method and device, computer equipment and readable storage medium
CN108280606A (en) A kind of wholesale market method of commerce and system
CN102567416A (en) Load-balanced distribution type data statistical method and system
CN111401971A (en) Method and system for providing incentives through associated routes
CN110706109A (en) Deposit receipt pairing method and device

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
GR01 Patent grant
GR01 Patent grant