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

Transaction keeps accounts control method and system Download PDF

Info

Publication number
CN107015869A
CN107015869A CN201710027726.8A CN201710027726A CN107015869A CN 107015869 A CN107015869 A CN 107015869A CN 201710027726 A CN201710027726 A CN 201710027726A CN 107015869 A CN107015869 A CN 107015869A
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.)
Granted
Application number
CN201710027726.8A
Other languages
Chinese (zh)
Other versions
CN107015869B (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 a money transfer transactions request is received, ask the money transfer transactions corresponding debit account to be withholdd and carry out the information processing of withholing of preset kind, the information to be kept accounts that the money transfer transactions ask corresponding credit entry is added into the pending queue previously generated;Check whether the credit entry meets the default condition that keeps accounts, and after the credit entry meets the condition that keeps accounts, the mark that can keep accounts is generated for the information to be kept accounts of the credit entry;Asynchronous thread is enabled, is scanned with the information to be kept accounts of mark of can keeping accounts in the pending queue, and the processing that keeps accounts, and the information processing that keeps accounts of progress preset kind are carried out according to preset rules to the information to be kept accounts that scan.The present invention improves transaction and performs speed and handling capacity, it is ensured that 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 system of keeping accounts of merchandising.
Background technology
At present, if high emergency situations occurs in the core transaction system of each bank, for example, money transfer transactions amount explodes suddenly; Mutually turn transaction deadlock event caused by (A turns B, and B turns A) between more two accounts of synchronization;Substantial amounts of money transfer transactions are needed Update the data same Account History in storehouse (for example, for electric business platform " for example, Alibaba's electric business platform ", business 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 electric business platform specified intermediate account after preset time, the spending amount of consumer batch is transferred to the silver of trade company In row account), and cause the core transaction system needs to fight for and wait the Account History of the account to lock, need synchronous detained Money completes transaction 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 Plus, throughput of system can decline to a great extent, the trading processing passage meeting blockage phenomenon of bank, have a strong impact on other regular traffics Operation.
The content of the invention
It is a primary object of the present invention to provide a kind of control method and system of keeping accounts of merchandising, it is intended to improve high emergency situations When transaction perform speed and handling capacity.
To achieve the above object, a kind of control method that keeps accounts of merchandising that the present invention is provided, the described method comprises the following steps:
A, transaction keep accounts control system after a money transfer transactions request is received, 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 treat into Account information is added into the pending queue previously generated;
B, check whether the credit entry meets the default condition that keeps accounts, and after the credit entry meets the condition that keeps accounts, The mark that can keep accounts is generated for the information to be kept accounts of the credit entry;
C, asynchronous thread is enabled, scan 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 keeping accounts processing according to preset rules, and the information processing that keeps accounts of progress preset kind.
Preferably, the asynchronous thread, which includes at least one, is used to carry in real time or in the timing scan pending queue The scanning thread of the information to be kept accounts for the mark that can keep accounts is used for the information to be kept accounts scanned according to default rule with least one The processing that keeps accounts then is carried out, and carries out the worker thread of the information processing that keeps accounts of preset kind, this method also includes:
The information content to be kept accounts with the mark that can keep accounts in the pending queue is detected in real time or regularly;If detecting Information content to be kept accounts is more than predetermined threshold value, then increases the scanning thread and/or worker thread of predetermined number, and be transferred to execution institute State step C.
Preferably, the preset rules are:
If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to Same worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
If the worker thread only one of which, the information to be kept accounts of same credit entry is classified as identical and waits to keep 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 each treat into Account information aggregate is ranked up, 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 default class The information processing that keeps accounts of type.
Preferably, the information to be kept accounts of corresponding credit entry is asked to add previously generate pending the money transfer transactions The algorithm of queue is:
Wherein, h is default first initial value, and p is default hash prime number, and n is credit entry x total number of characters, and n is Positive integer more than 1, ascii (xk) for credit entry x+1 character of kth ascii values, k scope is from 0 to n-1;a For the sum of pending queue;The sequence number for the pending queue that f (x) value falls into for credit entry x information to be kept accounts.
Preferably, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry is added in the asynchronous thread The algorithm of worker thread is:
Wherein, h0For default second initial value, p is default hash prime number, and n is credit entry x total number of characters;n For the positive integer more than 1, binary (xk) for credit entry x k-th of character a byte binary value;K scope It is from 1 to n;A is the sum of pending queue, the worker thread that f (x) value falls into for credit entry x information to be kept accounts Sequence number.
In addition, to achieve the above object, the present invention also provides a kind of transaction and kept accounts control system, and the transaction keeps accounts control System includes:
Withhold module, for after a money transfer transactions request is received, corresponding debit account to be asked to the money transfer transactions The information processing of withholing of preset kind is withholdd and carried out, the money transfer transactions are asked to the letter to be kept accounts of corresponding credit entry Breath is added into the pending queue previously generated;
Module is checked, is met for checking whether the credit entry meets the default 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 scanning the information to be kept accounts with the mark that can keep accounts in the pending queue, and to sweeping The information to be kept accounts retouched carries out the processing that keeps accounts according to preset rules, and carries out the information processing that keeps accounts of preset kind.
Preferably, the asynchronous thread, which includes at least one, is used to carry in real time or in the timing scan pending queue The scanning thread of the information to be kept accounts for the mark that can keep accounts is used for the information to be kept accounts scanned according to default rule with least one The processing that keeps accounts then is carried out, and carries out the worker thread of the information processing that keeps accounts of preset kind, the transaction keeps accounts control system also Including:
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 regularly 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 predetermined number Journey.
Preferably, the preset rules are:
If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to Same worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
If the worker thread only one of which, the information to be kept accounts of same credit entry is classified as identical and waits to keep 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 each treat into Account information aggregate is ranked up, 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 default class The information processing that keeps accounts of type.
Preferably, the information to be kept accounts of corresponding credit entry is asked to add previously generate pending the money transfer transactions The algorithm of queue is:
Wherein, h is default first initial value, and p is default hash prime number, and n is credit entry x total number of characters, and n is Positive integer more than 1, ascii (xk) for credit entry x+1 character of kth ascii values, k scope is from 0 to n-1;a For the sum of pending queue;The sequence number for the pending queue that f (x) value falls into for credit entry x information to be kept accounts.
Preferably, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry is added in the asynchronous thread The algorithm of worker thread is:
Wherein, h0For default second initial value, p is default hash prime number, and n is credit entry x total number of characters;n For the positive integer more than 1, binary (xk) for credit entry x k-th of character a byte binary value;K scope It is from 1 to n;A is the sum of pending queue, the worker thread that f (x) value falls into for credit entry x information to be kept accounts Sequence number.
Keeping accounts control method and system proposed by the present invention of merchandising, after money transfer transactions request is received, first to the friendship of transferring accounts Easily ask corresponding debit account to be withholdd and ask the information to be kept accounts of corresponding credit entry to add the money transfer transactions Into the pending queue previously generated, if checking, the credit entry meets the default 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, scan treating with the mark that can keep accounts in the pending queue Keep accounts information, and carries out the processing that keeps accounts according to preset rules to the information to be kept accounts that scans.Due to being first by credit entry Information to be kept accounts is added in pending queue, and using asynchronous thread to met in the pending queue condition that keeps accounts wait keep accounts 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 the Account History of trading account to lock, and improves transaction and performs speed and gulp down The amount of telling, it is ensured that the normal execution of business.
Brief description of the drawings
Fig. 1 keeps accounts the schematic flow sheet of control method first embodiment for present invention transaction;
Fig. 2 keeps accounts the schematic flow sheet of control method second embodiment for present invention transaction;
Fig. 3 keeps accounts the high-level schematic functional block diagram of control system first embodiment for present invention transaction;
Fig. 4 keeps accounts the high-level schematic functional block diagram of control system second embodiment for present invention transaction.
The realization, functional characteristics and advantage of the object of the invention will be described further referring to the drawings in conjunction with the embodiments.
Embodiment
In order that technical problems, technical solutions and advantages to be solved are 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.
Reference picture 1, Fig. 1 keeps accounts the schematic flow sheet of control method first embodiment for present invention transaction.
In the first embodiment, the transaction control method that keeps accounts includes:
Step S10, transaction keeps accounts control system after a money transfer transactions request is received, and correspondence is asked to the money transfer transactions Debit account withholdd and carry out the information processing of withholing of preset kind, the money transfer transactions are asked into corresponding credit entry Information to be kept accounts add into the pending queue previously generated.
In the present embodiment, transaction keep accounts control system receive user send money transfer transactions request, for example, receive user exist Relevant information is inputted in the terminals such as mobile phone, tablet personal 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, flat board electricity Inputting the money transfer transactions sent after relevant information in the terminals such as brain, self-help terminal equipment on preassembled transacting customer end please Ask, or receive user and inputted on the browser in the terminals such as mobile phone, tablet personal computer, self-help terminal equipment after relevant information The money transfer transactions request sent.
Transaction keeps accounts control system after a money transfer transactions request is received, and enabling master transaction thread please to the money transfer transactions Seek corresponding debit account (i.e.:Withhold account) carry out in real time or timing is withholdd, that is, receiving after money transfer transactions are asked at once Ask the account amount of money of corresponding debit account to deduct the money transfer transactions money transfer transactions and ask corresponding transfer amounts, and The information processing of withholing of preset kind is carried out, to complete the operation of withholing of debit account;Wherein, the letter of withholing of the preset kind Breath processing include but is not limited to generation withhold it is detailed, recognize folding processing, push dynamic account and notify etc..Then, do not entered directly Account is operated, but the money transfer transactions are asked into corresponding credit entry (i.e.:Keep accounts account) information to be kept accounts (for example, treat into The amount of money, debit account information, transaction remark information of account etc.) add into the pending queue previously generated.
Step S20, checks whether the credit entry meets the default condition that keeps accounts, and meets the bar 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.
Whether real-time or 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;Or, if 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 of the credit entry 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, and the information processing that keeps accounts of progress preset kind are carried out according to preset rules to the information to be kept accounts that scans.
The transaction control system that keeps accounts enables asynchronous thread, with can in real time or in the pending queue of timing scan generation 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 is the loan that the condition that keeps accounts is met 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 that scans, such as can be to multiple phases The information to be kept accounts of same credit entry carries out parallel processing, and also the information to be kept accounts of multiple different credit entries can be carried out Serial process, is not limited 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 include but is not limited to generation keep accounts it is detailed, recognize Folding processing, the dynamic account notice of push etc., to complete the asynchronous operation that keeps accounts.
The present embodiment first asks corresponding debit account to be withholdd the money transfer transactions after money transfer transactions request is received And ask the information to be kept accounts of corresponding credit entry to add into the pending queue previously generated the money transfer transactions, if inspection Look into the credit entry and meet the default condition that keeps accounts, then generate the mark that can keep accounts for the information to be kept accounts of the credit entry;And open 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.Due to being first to add the information to be kept accounts of credit entry in pending queue, and The processing that keeps accounts is carried out to the information to be kept accounts that the condition that keeps accounts is met in the pending queue using asynchronous thread, kept accounts by asynchronous Mode alleviate keep accounts pressure of the transaction system in high emergency situations, it is to avoid in high emergency situations transaction system fight for and The Account History lock of trading account is waited, transaction is improved and performs speed and handling capacity, it is ensured that 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, also include before above-mentioned steps S30:
Step S40, detects the information content to be kept accounts with the mark that can keep accounts in the pending queue in real time or regularly; 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 predetermined number.
In the present embodiment, the asynchronous thread for being used to keep accounts into line asynchronous includes at least one scanning thread and at least one work Make thread, wherein:The scanning thread is used for treating with the mark that can keep accounts in real time or in the timing scan pending queue Keep accounts information;The worker thread is used to carry out the processing that keeps accounts according to preset rules to the information to be kept accounts scanned, and carries out The information processing that keeps accounts of preset kind.Carried out respectively by least one scanning thread and at least one worker thread with can The scan operation of the information to be kept accounts for the mark that keeps accounts and to the operation that keeps accounts of the information to be kept accounts scanned, the division of labor is clear and definite, 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 regularly detected Quantity;If the information content to be kept accounts of detecting is more than predetermined threshold value, illustrate the information to be kept accounts that currently need to scan and keep accounts compared with It is many, then increase predetermined number scanning thread and/or worker thread, to improve the speed of the asynchronous processing that keeps accounts, it is ensured that it is asynchronous enter The high efficiency of account processing.
Further, in other embodiments, the preset rules are:
If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to Same worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
If the worker thread only one of which, the information to be kept accounts of same credit entry is classified as identical and waits to keep 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 each treat into Account information aggregate is ranked up, 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 default class The information processing that keeps accounts of type.
In the present embodiment, the worker thread in by asynchronous thread keeps accounts to the treating with the mark that can keep accounts scanned Information carry out keep accounts processing when, if the worker thread has multiple, in one or more letters to be kept accounts of same credit entry Breath distributes to same worker thread processing, i.e. one or many by multiple worker threads respectively to multiple different credit entries Individual information to be kept accounts carries out parallel processing.If the worker thread only one of which, by one of same credit entry or many Individual 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 handling process, processing speed is improved, so as to carry The efficiency of the high asynchronous processing that keeps accounts.
Further, in other embodiments, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry adds The algorithm for entering the pending queue previously generated is:
Wherein, h is default first initial value, any integer value is could be arranged to, it can also be provided that 0.P is default Prime number is hashed, 257 are can use.N is credit entry x total number of characters, and n is the positive integer more than 1, ascii (xk) it is credit entry x + 1 character of kth ascii values, k scope is from 0 to n-1.A is the sum of pending queue.
The pending queue that the f (x) calculated by above-mentioned algorithm value falls into for credit entry x information to be kept accounts Sequence number namely code name, such as the f (x) numbers pending queue, so that credit entry x information to be kept accounts is added into corresponding sequence number successively Pending queue in.
Further, in other embodiments, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry adds The algorithm for entering the worker thread in the asynchronous thread is:
Wherein, h0For default second initial value, any integer value is could be arranged to, for example, takes -2128831035.P is Default hash prime number, can use 57885161.N is credit entry x total number of characters;N is the positive integer more than 1, binary (xk) for credit entry x k-th of character a byte binary value;K scope is from 1 to n;A is pending queue Sum.Wherein, the money transfer transactions are asked into the work that the information to be kept accounts of corresponding credit entry is added in the asynchronous thread That makees that the algorithm of thread previously generates with the information to be kept accounts of the corresponding credit entry of money transfer transactions request is added is pending Hash prime number p in the algorithm of queue could be arranged to it is identical, it can also be provided that different;First initial value h and second is initial Value h0It could be arranged to identical, it can also be provided that different, do not limit herein.
The sequence for the worker thread that the f (x) calculated by above-mentioned algorithm value falls into for credit entry x information to be kept accounts Number namely code name, such as the f (x) numbers worker thread, so that credit entry x information to be kept accounts to be added to the work of corresponding sequence number successively Make in thread.
The present invention further provides a kind of control system that keeps accounts of merchandising.
Reference picture 3, Fig. 3 keeps accounts the high-level schematic functional block diagram of control system first embodiment for present invention transaction.
In the first embodiment, the transaction control system that keeps accounts includes:
Module of withholing 01, for after a money transfer transactions request is received, corresponding debit's account to be asked to the money transfer transactions Family is withholdd and carries out the information processing of withholing of preset kind, by the money transfer transactions ask corresponding credit entry wait keep accounts Information is added into the pending queue previously generated.
In the present embodiment, transaction keep accounts control system receive user send money transfer transactions request, for example, receive user exist Relevant information is inputted in the terminals such as mobile phone, tablet personal 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, flat board electricity Inputting the money transfer transactions sent after relevant information in the terminals such as brain, self-help terminal equipment on preassembled transacting customer end please Ask, or receive user and inputted on the browser in the terminals such as mobile phone, tablet personal computer, self-help terminal equipment after relevant information The money transfer transactions request sent.
Transaction keeps accounts control system after a money transfer transactions request is received, and enabling master transaction thread please to the money transfer transactions Seek corresponding debit account (i.e.:Withhold account) carry out in real time or timing is withholdd, that is, receiving after money transfer transactions are asked at once Ask the account amount of money of corresponding debit account to deduct the money transfer transactions money transfer transactions and ask corresponding transfer amounts, and The information processing of withholing of preset kind is carried out, to complete the operation of withholing of debit account;Wherein, the letter of withholing of the preset kind Breath processing include but is not limited to generation withhold it is detailed, recognize folding processing, push dynamic account and notify etc..Then, do not entered directly Account is operated, but the money transfer transactions are asked into corresponding credit entry (i.e.:Keep accounts account) information to be kept accounts (for example, treat into The amount of money, debit account information, transaction remark information of account etc.) add into the pending queue previously generated.
Module 02 is checked, for checking whether the credit entry meets the default condition that keeps accounts, and it is full in the credit entry Foot is kept accounts after condition, and the mark that can keep accounts is generated for the information to be kept accounts of the credit entry.
Whether real-time or 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;Or, if 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 of the credit entry added in pending queue generates the mark that can keep accounts.
The asynchronous module 03 that keeps accounts, for scanning the information to be kept accounts with the mark that can keep accounts in the pending queue, and it is right The information to be kept accounts scanned carries out the processing that keeps accounts according to preset rules, 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 of timing scan generation 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 is the loan that the condition that keeps accounts is met 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 that scans, such as can be to multiple phases The information to be kept accounts of same credit entry carries out parallel processing, and also the information to be kept accounts of multiple different credit entries can be carried out Serial process, is not limited 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 include but is not limited to generation keep accounts it is detailed, recognize Folding processing, the dynamic account notice of push etc., to complete the asynchronous operation that keeps accounts.
The present embodiment first asks corresponding debit account to be withholdd the money transfer transactions after money transfer transactions request is received And ask the information to be kept accounts of corresponding credit entry to add into the pending queue previously generated the money transfer transactions, if inspection Look into the credit entry and meet the default condition that keeps accounts, then generate the mark that can keep accounts for the information to be kept accounts of the credit entry;And open 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.Due to being first to add the information to be kept accounts of credit entry in pending queue, and The processing that keeps accounts is carried out to the information to be kept accounts that the condition that keeps accounts is met in the pending queue using asynchronous thread, kept accounts by asynchronous Mode alleviate keep accounts pressure of the transaction system in high emergency situations, it is to avoid in high emergency situations transaction system fight for and The Account History lock of trading account is waited, transaction is improved and performs speed and handling capacity, it is ensured that 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, in addition to:
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 regularly 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 predetermined number Journey.
In the present embodiment, the asynchronous thread for being used to keep accounts into line asynchronous includes at least one scanning thread and at least one work Make thread, wherein:The scanning thread is used for treating with the mark that can keep accounts in real time or in the timing scan pending queue Keep accounts information;The worker thread is used to carry out the processing that keeps accounts according to preset rules to the information to be kept accounts scanned, and carries out The information processing that keeps accounts of preset kind.Carried out respectively by least one scanning thread and at least one worker thread with can The scan operation of the information to be kept accounts for the mark that keeps accounts and to the operation that keeps accounts of the information to be kept accounts scanned, the division of labor is clear and definite, 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 regularly detected Quantity;If the information content to be kept accounts of detecting is more than predetermined threshold value, illustrate the information to be kept accounts that currently need to scan and keep accounts compared with It is many, then increase predetermined number scanning thread and/or worker thread, to improve the speed of the asynchronous processing that keeps accounts, it is ensured that it is asynchronous enter The high efficiency of account processing.
Further, in other embodiments, the preset rules are:
If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to Same worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
If the worker thread only one of which, the information to be kept accounts of same credit entry is classified as identical and waits to keep 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 each treat into Account information aggregate is ranked up, 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 default class The information processing that keeps accounts of type.
In the present embodiment, the worker thread in by asynchronous thread keeps accounts to the treating with the mark that can keep accounts scanned Information carry out keep accounts processing when, if the worker thread has multiple, in one or more letters to be kept accounts of same credit entry Breath distributes to same worker thread processing, i.e. one or many by multiple worker threads respectively to multiple different credit entries Individual information to be kept accounts carries out parallel processing.If the worker thread only one of which, by one of same credit entry or many Individual 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 handling process, processing speed is improved, so as to carry The efficiency of the high asynchronous processing that keeps accounts.
Further, in other embodiments, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry adds The algorithm for entering the pending queue previously generated is:
Wherein, h is default first initial value, any integer value is could be arranged to, it can also be provided that 0.P is default Prime number is hashed, 257 are can use.N is credit entry x total number of characters, and n is the positive integer more than 1, ascii (xk) it is credit entry x + 1 character of kth ascii values, k scope is from 0 to n-1.A is the sum of pending queue.
The pending queue that the f (x) calculated by above-mentioned algorithm value falls into for credit entry x information to be kept accounts Sequence number namely code name, such as the f (x) numbers pending queue, so that credit entry x information to be kept accounts is added into corresponding sequence number successively Pending queue in.
Further, in other embodiments, the information to be kept accounts for the money transfer transactions being asked into corresponding credit entry adds The algorithm for entering the worker thread in the asynchronous thread is:
Wherein, h0For default second initial value, any integer value is could be arranged to, for example, takes -2128831035.P is Default hash prime number, can use 57885161.N is credit entry x total number of characters;N is the positive integer more than 1, binary (xk) for credit entry x k-th of character a byte binary value;K scope is from 1 to n;A is pending queue Sum.Wherein, the money transfer transactions are asked into the work that the information to be kept accounts of corresponding credit entry is added in the asynchronous thread That makees that the algorithm of thread previously generates with the information to be kept accounts of the corresponding credit entry of money transfer transactions request is added is pending Hash prime number p in the algorithm of queue could be arranged to it is identical, it can also be provided that different;First initial value h and second is initial Value h0It could be arranged to identical, it can also be provided that different, do not limit herein.
The sequence for the worker thread that the f (x) calculated by above-mentioned algorithm value falls into for credit entry x information to be kept accounts Number namely code name, such as the f (x) numbers worker thread, so that credit entry x information to be kept accounts to be added to the work of corresponding sequence number successively Make in thread.
It should be noted that herein, term " comprising ", "comprising" or its any other variant are intended to non-row His property is included, so that process, method, article or device including a series of key elements not only include those key elements, and And also including other key elements being not expressly set out, or also include for this process, method, article or device institute inherently Key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that including this Also there is other identical element in process, method, article or the device of key element.
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 a lot In the case of the former be more preferably embodiment.Understood based on such, technical scheme is substantially in other words to existing The part that technology contributes can be embodied in the form of software product, and the computer software product is stored in a storage In medium (such as ROM/RAM, magnetic disc, CD), including some instructions are to cause a station terminal equipment (can be mobile phone, calculate Machine, server, air conditioner, or network equipment etc.) perform method described in each of the invention embodiment.
Above by reference to the preferred embodiments of the present invention have been illustrated, not thereby limit to the interest field of the present invention.On State that sequence number of the embodiment of the present invention is for illustration only, the quality of embodiment is not represented.Patrolled in addition, though showing in flow charts Order is collected, but in some cases, can be with the step shown or described by being performed different from order herein.
Those skilled in the art do not depart from the scope of the present invention and essence, can have a variety of flexible programs to realize the present invention, Feature for example as one embodiment can be used for another embodiment and obtain another embodiment.All technologies with the present invention Any modifications, equivalent substitutions and improvements made within design, all should be within the interest field of the present invention.

Claims (10)

  1. The control method 1. one kind transaction keeps accounts, it is characterised in that the described method comprises the following steps:
    A, transaction keep accounts control system after a money transfer transactions request is received, and corresponding debit account is asked to the money transfer transactions The information processing of withholing of preset kind is withholdd and carried out, the money transfer transactions are asked to the letter to be kept accounts of corresponding credit entry Breath is added into the pending queue previously generated;
    B, check whether the credit entry meets the default condition that keeps accounts, and after the credit entry meets the condition that keeps accounts, for this The information to be kept accounts of credit entry generates the mark that can keep accounts;
    C, asynchronous thread is enabled, scan the information to be kept accounts with the mark that can keep 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.
  2. The control method 2. transaction as claimed in claim 1 keeps accounts, it is characterised in that the asynchronous thread is used including at least one The scanning thread and at least one of information to be kept accounts with the mark that can keep accounts in the real-time or timing scan pending queue It is individual to be used to carry out at the processing that keeps accounts, and the information that keeps accounts of progress preset kind the information to be kept accounts scanned according to preset rules The worker thread of reason, this method also includes:
    The information content to be kept accounts with the mark that can keep accounts in the pending queue is detected in real time or regularly;If detecting treat into Account information content is more than predetermined threshold value, then increases the scanning thread and/or worker thread of predetermined number, and be transferred to the execution step Rapid C.
  3. The control method 3. transaction as claimed in claim 2 keeps accounts, it is characterised in that the preset rules are:
    If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to same Individual worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
    If the worker thread only one of which, identical information to be kept accounts is classified as by the information to be kept accounts of same credit entry 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, 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.
  4. The control method 4. transaction as claimed in claim 1 or 2 keeps accounts, it is characterised in that the money transfer transactions are asked corresponding The algorithm that the information to be kept accounts of credit entry adds the pending queue previously generated is:
    Wherein, h be default first initial value, p be default hash prime number, n be credit entry x total number of characters, n be more than 1 positive integer, ascii (xk) for credit entry x+1 character of kth ascii values, k scope is from 0 to n-1;A is to treat Handle the sum of queue;The sequence number for the pending queue that f (x) value falls into for credit entry x information to be kept accounts.
  5. The control method 5. transaction as claimed in claim 2 keeps accounts, it is characterised in that the money transfer transactions are asked into corresponding credit side The algorithm for the worker thread that the information to be kept accounts of account is added in the asynchronous thread is:
    Wherein, h0For default second initial value, p is default hash prime number, and n is credit entry x total number of characters;N be more than 1 positive integer, binary (xk) for credit entry x k-th of character a byte binary value;K scope be from 1 to n;A is the sum of pending queue, the sequence number for the worker thread that f (x) value falls into for credit entry x information to be kept accounts.
  6. 6. one kind transaction keeps accounts control system, it is characterised in that the transaction control system that keeps accounts includes:
    Withhold module, for after a money transfer transactions request is received, asking corresponding debit account to carry out the money transfer transactions The information processing of withholing of preset kind is withholdd and carried out, the information to be kept accounts that the money transfer transactions ask corresponding credit entry is added Enter into the pending queue previously generated;
    Module is checked, is kept accounts for checking whether the credit entry meets the default 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, is arrived for scanning the information to be kept accounts with the mark that can keep accounts in the pending queue, and to scanning Information to be kept accounts carry out keeping accounts processing according to preset rules, and the information processing that keeps accounts of progress preset kind.
  7. The control system 7. transaction as claimed in claim 6 keeps accounts, it is characterised in that the asynchronous thread is used including at least one The scanning thread and at least one of information to be kept accounts with the mark that can keep accounts in the real-time or timing scan pending queue It is individual to be used to carry out at the processing that keeps accounts, and the information that keeps accounts of progress preset kind the information to be kept accounts scanned according to preset rules The worker thread of reason, the transaction control system that keeps accounts also 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 regularly 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 predetermined number.
  8. The control system 8. transaction as claimed in claim 7 keeps accounts, it is characterised in that the preset rules are:
    If the worker thread has multiple, in synchronization, the information to be kept accounts of same credit entry is only assigned to same Individual worker thread processing, the information to be kept accounts of different credit entries distributes to different worker thread processing;
    If the worker thread only one of which, identical information to be kept accounts is classified as by the information to be kept accounts of same credit entry 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, 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.
  9. The control system 9. transaction as claimed in claims 6 or 7 keeps accounts, it is characterised in that the money transfer transactions are asked corresponding The algorithm that the information to be kept accounts of credit entry adds the pending queue previously generated is:
    Wherein, h be default first initial value, p be default hash prime number, n be credit entry x total number of characters, n be more than 1 positive integer, ascii (xk) for credit entry x+1 character of kth ascii values, k scope is from 0 to n-1;A is to treat Handle the sum of queue;The sequence number for the pending queue that f (x) value falls into for credit entry x information to be kept accounts.
  10. The control system 10. transaction as claimed in claim 7 keeps accounts, it is characterised in that by the corresponding loan of money transfer transactions request The algorithm for the worker thread that the information to be kept accounts of square account is added in the asynchronous thread is:
    Wherein, h0For default second initial value, p is default hash prime number, and n is credit entry x total number of characters;N be more than 1 positive integer, binary (xk) for credit entry x k-th of character a byte binary value;K scope be from 1 to n;A is the sum of pending queue, the sequence number for the worker thread that f (x) value falls into for credit entry x information to be kept accounts.
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 true CN107015869A (en) 2017-08-04
CN107015869B 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)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256843A (en) * 2018-01-12 2018-07-06 上海瀚银信息技术有限公司 One kind pays out method of commerce and pays out transaction system
CN108615184A (en) * 2018-03-29 2018-10-02 阿里巴巴集团控股有限公司 A kind of method and device of book keeping operation
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
CN109711958A (en) * 2018-08-17 2019-05-03 深圳壹账通智能科技有限公司 It keeps accounts method, apparatus, terminal device and computer readable storage medium to public affairs
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
CN111352753A (en) * 2020-04-26 2020-06-30 中国银行股份有限公司 Accounting processing method and device
CN112561687A (en) * 2020-12-18 2021-03-26 厦门投融汇网络有限公司 Multithreading account fund asynchronous processing method
CN112990900A (en) * 2019-12-02 2021-06-18 贝壳技术有限公司 Transfer method, device, storage medium and equipment
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

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108256843A (en) * 2018-01-12 2018-07-06 上海瀚银信息技术有限公司 One kind pays out method of commerce and pays out transaction system
CN108256843B (en) * 2018-01-12 2022-06-07 上海瀚银信息技术有限公司 Payment-instead transaction method and payment-instead transaction system
WO2019184571A1 (en) * 2018-03-29 2019-10-03 阿里巴巴集团控股有限公司 Bookkeeping method and device
CN108615184A (en) * 2018-03-29 2018-10-02 阿里巴巴集团控股有限公司 A kind of method and device of book keeping operation
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
CN111352753A (en) * 2020-04-26 2020-06-30 中国银行股份有限公司 Accounting processing method and device
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

Also Published As

Publication number Publication date
CN107015869B (en) 2018-08-31

Similar Documents

Publication Publication Date Title
CN107015869A (en) Transaction keeps accounts control method and system
CN107437223A (en) Credit information checking method, device and equipment
CN106548302B (en) Risk identification method and system for internet transaction
CN106557929A (en) Logistics information processing method and processing device
CN108492177A (en) Domestic assets cross-border transaction method, server and storage medium
CN110276369A (en) Feature selection approach, device, equipment and storage medium based on machine learning
US20140012763A1 (en) Money transfer fraud prevention methods and systems
CN106504076A (en) distributed order processing method, device and order processing system
CN107665462A (en) Method and system for automatically cross-platform executing shareholder voting
CN108171561A (en) A kind of full channel order merging treatment method
CN107808285A (en) A kind of method of payment, equipment and computer-readable recording medium
CN112396504A (en) E-commerce order intercepting method and device and electronic equipment
CN107657441A (en) Self-service dealing method, system, server and mobile terminal
CN109670934A (en) Personal identification method, equipment, storage medium and device based on user behavior
US20080040286A1 (en) Method of Anti-Fraud for Credit Card
CN103793820B (en) A kind of put-on method of merchandise news and apparatus and system
CN105247481B (en) The computing system, method and machine readable non-transitory storage medium of selection are exported for webpage
CN113869918A (en) Commodity return processing method and device, electronic equipment and storage medium
CN107194779A (en) Method, device and the computer-readable recording medium being sold under line
CN109636581A (en) Processing method and processing device, storage medium, the computer equipment of loan application information
CN106133779A (en) E-commerce venture's order accepts algorism control method and device
CN106934714A (en) A kind of business data processing method and device
CN111274488B (en) Recommendation method, device, equipment, system, terminal to be executed and storage medium
KR102358156B1 (en) Method for providing customized loan brokerage services
CN107862412A (en) A kind of data processing 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