CN106780034B - Unilateral account scale control method and system - Google Patents

Unilateral account scale control method and system Download PDF

Info

Publication number
CN106780034B
CN106780034B CN201611220166.XA CN201611220166A CN106780034B CN 106780034 B CN106780034 B CN 106780034B CN 201611220166 A CN201611220166 A CN 201611220166A CN 106780034 B CN106780034 B CN 106780034B
Authority
CN
China
Prior art keywords
transaction
valve
account
new
lock
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
CN201611220166.XA
Other languages
Chinese (zh)
Other versions
CN106780034A (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.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN201611220166.XA priority Critical patent/CN106780034B/en
Publication of CN106780034A publication Critical patent/CN106780034A/en
Application granted granted Critical
Publication of CN106780034B publication Critical patent/CN106780034B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange
    • 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
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0609Buyer or seller confidence or verification

Landscapes

  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Engineering & Computer Science (AREA)
  • Marketing (AREA)
  • Economics (AREA)
  • Development Economics (AREA)
  • Strategic Management (AREA)
  • Physics & Mathematics (AREA)
  • General Business, Economics & Management (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Technology Law (AREA)
  • Financial Or Insurance-Related Operations Such As Payment And Settlement (AREA)

Abstract

The invention provides a method and a system for controlling the scale of a single-side account, wherein when financial transactions are abnormal, transaction abnormal information is acquired; judging whether the transaction abnormal type is a unilateral account or not according to the transaction abnormal information; when the transaction abnormal type is judged to be the unilateral account, transaction statistical data are obtained; judging whether a transaction valve is opened or not according to the transaction statistical data; and when the judgment result is yes, opening a transaction valve to limit the transaction concurrency number. The method and the system for controlling the scale of the single-side account can effectively avoid the large-scale occurrence of the single-side account, prevent the fault spreading, ensure the consistency of the accounting transaction, and further improve the stability and the reliability of the system.

Description

Unilateral account scale control method and system
Technical Field
The invention relates to the field of data information processing, in particular to a method and a system for controlling the scale of a single-side account.
Background
With the rapid development of the financial industry, the demand of financial transactions across systems and banks is increased, but the single-side account condition of financial transactions is also increased. From the accounting perspective, if only borrowing or only lending but not corresponding party, a single-side account is formed; from the technical point of view, a specific application or application component can be used as a server to respond to a front-end request and can also be used as a client to call other related applications or application components, and at the moment, if network timeout or transaction abnormity occurs, and no simultaneous accounting is generated between the interdependent applications or application components, a single-side account can be formed.
At present, the single-side account condition of a financial system is usually processed in an asynchronous correction mode, namely after the single-side account occurs in the financial transaction, the financial transaction is corrected in the correction mode, the single-side account is eliminated, and the consistency of the financial transaction is ensured. However, when a large-scale single-side account appears, a system can send out a huge amount of positive-going requests, so that the processing of normal transactions is influenced, and faults are spread; moreover, when large-scale single-side accounts appear, once orthogonal conflict is easily encountered under the conditions of cross-day tangent points or abnormal conflict service and the like, conflict transactions can not be normally carried out, so that a large number of single-side accounts can not be resolved, and at the moment, a large amount of manual intervention and subsequent manual account adjustment are needed to solve the problem, and therefore the system efficiency and the customer experience are seriously influenced.
Therefore, a technical scheme capable of effectively avoiding large-scale occurrence of unilateral accounts, preventing fault propagation, ensuring the consistency of financial transactions and further improving the stability and reliability of the system is urgently needed at present.
Disclosure of Invention
In view of this, the present invention provides a method and a system for controlling the scale of a single-sided account, so as to solve the problem of how to effectively avoid the large scale of the single-sided account.
In order to achieve the purpose, the invention provides the following technical scheme:
a method for controlling the size of a single account comprises the following steps:
when the financial transaction is abnormal, acquiring transaction abnormal information;
judging whether the transaction abnormal type is a unilateral account or not according to the transaction abnormal information;
when the transaction abnormal type is judged to be the unilateral account, transaction statistical data are obtained;
judging whether a transaction valve is opened or not according to the transaction statistical data;
and when the judgment result is yes, opening a transaction valve to limit the transaction concurrency number.
Preferably, the determining whether the transaction exception type is a single-sided account according to the transaction exception information includes:
extracting a transaction exception code from the transaction exception information;
and determining a corresponding transaction exception type according to the transaction exception code so as to judge whether the transaction exception type is a unilateral account.
Preferably, the determining whether to open the transaction valve according to the transaction statistical data includes:
executing a preset control rule according to the transaction statistical data to judge whether a transaction valve is opened or not;
the preset control rule comprises a chain structure consisting of a plurality of check rules.
Preferably, the transaction statistics include: the number of continuous occurrences of the single-side account, the total number of occurrences of the single-side account, the transaction failure number in unit time and the transaction failure rate in unit time;
the plurality of verification rules include:
the first check rule is used for judging whether the continuous occurrence frequency of the single-side account is greater than or equal to a first preset threshold value or not;
the second check rule is used for judging whether the total occurrence frequency of the single-side account is greater than or equal to a second preset threshold value or not;
a third check rule, which judges whether the transaction failure times in unit time is greater than or equal to a third preset threshold value;
a fourth check rule, which is used for judging whether the transaction failure rate in unit time is greater than or equal to a fourth preset threshold value;
executing a preset control rule according to the transaction statistical data to judge whether to open a transaction valve comprises the following steps:
executing a first check rule to obtain a first check result;
when the first check result is yes, executing a second check rule to obtain a second check result;
when the second check result is yes, executing a third check rule to obtain a third check result;
when the third verification result is yes, executing a fourth verification rule to obtain a fourth verification result;
and when the fourth verification result is yes, obtaining a judgment result of yes.
Preferably, the opening of the transaction valve to limit the number of transaction concurrences includes:
initializing a preset number of lock resources, each lock resource being used only to provide a transaction approval for one financial transaction;
when a new accounting transaction enters, judging whether an idle lock resource exists, if so, allocating an idle lock resource for the new accounting transaction; if not, refusing to allocate lock resources for the new financial transaction;
judging whether the new financial transaction is distributed with a lock resource, if so, allowing the new financial transaction to be executed; if not, the new accounting transaction is refused to be executed.
Preferably, the method further comprises: when the execution of the new accounting transaction allocated with the lock resource is finished, releasing the lock resource allocated to the new accounting transaction.
Preferably, the method further comprises: when the execution of the new financial transaction distributed with the lock resource is finished, judging whether the new financial transaction is successfully executed;
adjusting a total number of lock resources to twice a current number when the new accounting transaction is successfully executed;
and returning the acquired transaction statistical data when the new financial transaction fails to be executed, and judging whether to open a transaction valve according to the transaction statistical data.
Preferably, the method further comprises: and when the total number of the lock resources is greater than or equal to the upper limit of the transaction concurrency number set by the system, closing the transaction valve to remove the limit of the transaction valve on the transaction concurrency number.
A single-sided ledger scale control system, comprising:
the abnormal information acquisition module is used for acquiring abnormal transaction information when the financial transaction is abnormal;
the abnormal type judging module is used for judging whether the transaction abnormal type is a unilateral account or not according to the transaction abnormal information;
the statistical data acquisition module is used for acquiring transaction statistical data when the transaction abnormal type is judged to be the unilateral account;
the transaction valve judging module is used for judging whether to open a transaction valve according to the transaction statistical data;
and the transaction valve control module is used for opening the transaction valve to limit the transaction concurrency number when the judgment result is yes.
Preferably, the transaction valve control module comprises:
the lock resource initialization submodule is used for initializing a preset number of lock resources, and each lock resource is only used for providing transaction permission for one financial transaction;
the lock resource allocation submodule is used for judging whether idle lock resources exist or not when a new financial transaction enters, and if so, allocating an idle lock resource for the new financial transaction; if not, refusing to allocate lock resources for the new financial transaction;
a transaction execution permission submodule, configured to determine whether the new financial transaction has been allocated with a lock resource, and if so, allow execution of the new financial transaction; if not, the new accounting transaction is refused to be executed.
According to the technical scheme, when the unilateral account occurs in the financial transaction, the transaction statistical data are obtained, whether a transaction valve is opened or not is judged according to the transaction statistical data, and when the judgment result is yes, the transaction valve is opened to limit the transaction concurrency number, so that the unilateral account is prevented from occurring in a large scale, the fault spreading is prevented, the financial transaction consistency is ensured, and the stability and the reliability of the system are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a flowchart of a method for controlling a size of a single-sided account according to an embodiment of the present disclosure;
fig. 2 is a flowchart of a method for determining a single-side account according to an embodiment of the present application;
fig. 3 is another flowchart of a method for controlling a size of a single-sided account according to an embodiment of the present application;
fig. 4 is another flowchart of a method for controlling the size of a single-sided account according to an embodiment of the present application;
fig. 5 is a flowchart of another method for controlling the size of a single-sided account according to an embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of a single-side account scale control system according to an embodiment of the present application;
fig. 7 is another schematic structural diagram of a single-sided account size control system according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Transaction consistency is very important in a financial accounting system, traditional in-transaction consistency methods (such as correction, retransmission, account checking, reconciliation and the like) compensate and process the existing accounting consistency problem, and often have serious fund risk when the transaction real-time requirement is high or the transaction is abnormal, and then a large amount of work of communication explanation, account recourse and the like needs to be made, and serious social influence can be caused.
The single-side account scale control scheme provided by the invention is a technical scheme for fundamentally avoiding large-scale single-side accounts, avoids large-scale inconsistency under abnormal transaction conditions, simultaneously, the control and recovery processes are all automated, manual intervention is not needed, the response efficiency is greatly improved, and more inconsistent financial affairs and better-minded work after the transaction are avoided.
Referring to fig. 1, fig. 1 is a flowchart of a method for controlling a single-side account size according to an embodiment of the present disclosure.
As shown in fig. 1, the method includes:
s101: when the financial transaction is abnormal, acquiring transaction abnormal information;
in the financial online transaction process, when an abnormal financial transaction occurs, corresponding transaction abnormal information is usually generated.
In this embodiment, the transaction exception information includes information that can indicate the type of the transaction exception, and by acquiring the transaction exception information, the information that can indicate the type of the transaction exception can be acquired.
S102: judging whether the transaction abnormal type is a unilateral account or not according to the transaction abnormal information;
in the accounting transaction process, if both transaction parties do not account at the same time, a single-side account is formed. Taking a credit card repayment transaction process as an example, when a core component of a debit card called out for the first time by a credit card front-end component is overtime, asynchronous correction is initiated locally, the transaction is failed to be juxtaposed, a log is updated to the error state, and the debit card component called out at the moment can normally complete a debit application; or when the debit card core component is successfully called for the first time by the credit card front component, but timeout occurs or the status code is returned abnormally when the foreign-calling credit card core system carries out repayment operation next time, the local transaction is also failed, and when the debit card core component is successfully called for the previous time, the debit card core component can carry out normal account keeping; alternatively, when all outbound calls are successful and the local update log is abnormal, a local billing failure may result.
In this embodiment, when the single-sided account exception occurs in the accounting transaction, corresponding transaction exception information is generated, where the transaction exception information includes information that can indicate that the transaction exception type is the single-sided account. Therefore, whether the transaction abnormal type is a unilateral account can be judged according to the acquired transaction abnormal information.
S103: when the transaction abnormal type is judged to be the unilateral account, transaction statistical data are obtained;
the transaction statistical data mainly comprises unit time class (runtimecellstat) data and continuous transaction class (RuntimeStat) data.
The transaction statistical data is updated in real time, and after each financial transaction is finished, the transaction statistical data is updated in real time according to the transaction result, so that the transaction statistical data acquired at any time are all latest.
The statistics and calculation of the unit time class data can be realized in a time sliding window mode. For example, the unit time is set to 1 minute, the time window size is 2, the current time is 2016-06-0809:00, 2016-06-0808: 59 is a window with completed statistics, 2016-06-0809:00 is a window with ongoing statistics, when the time reaches 2016-06-0809:01, the data of 2016-06-0808: 59 is eliminated, 2016-06-0809:00 is a window with completed statistics, and the data of 2016-06-0809:00 is available. By means of the time sliding window, various transaction data of the financial transaction in unit time can be calculated conveniently, and the transaction completion condition can be monitored in real time.
In an example, the transaction statistics of the time unit class data include one or more of a number of transaction failures per time unit (tsfailed), a number of transaction successes per time unit (tsSuccess), a total time of request successes per time unit (rtsuccess total), and a rate of transaction failures per time unit. The unit time transaction failure rate can be obtained by dividing the unit time transaction failure times by the sum of the unit time transaction failure times and the unit time transaction success times.
The statistics and calculation of the continuous transaction class data can be realized in a continuous transaction window mode. The continuous transaction window refers to a monitoring window for the completion condition of the n transactions which occur recently. For example, the average response time of the transaction, the success rate of the service, the success rate of the technology, and the like of the latest 100 pens (n is 100) are counted and calculated. The continuous transaction window can avoid statistical difference caused by transaction frequency difference during time sliding window statistics.
In an example, the transaction statistics of the continuous transaction class data include one or more of a number of continuous failures of the accounting transaction (consfaiilnum), a number of continuous occurrences of the one-sided account (consfaiilsingsinglunum), and a total number of occurrences of the one-sided account (faiilsingtotaltlunm).
In another example, when the transaction exception type is determined to be a single account, in addition to obtaining the latest transaction statistical data, a cross transaction request is initiated for the account transaction to ensure consistency of the account transaction. Wherein, the orthogonal flushing can be executed in a synchronous or asynchronous mode.
S104: judging whether a transaction valve is opened or not according to the transaction statistical data;
the transaction statistical data can reflect the occurrence of unilateral account and other transaction execution conditions. According to the transaction statistical data, whether the scale of the unilateral account needs to be controlled or not can be judged. When the scale of the unilateral account needs to be controlled, the transaction valve needs to be opened, so that the scale of the unilateral account is prevented from being enlarged.
In one example, the reliability of the determination result can be improved by implementing the determination logic by a strict control rule. Therefore, step S104 may include: and executing a preset control rule according to the transaction statistical data to judge whether a transaction valve is opened or not. The preset control rule includes a chain structure (rule chain) composed of a plurality of check rules. Different control rules can be set for different accounting transaction types so as to achieve better control effect.
S105: when the judgment result is yes, a transaction valve is opened to limit the transaction concurrence number;
the transaction valve is the core of the single-side account scale control system, and directly determines whether to carry out concurrency limit (flow control) on the accounting transaction.
And when the judgment result is yes, the transaction valve is indicated to be opened, so that the transaction valve is opened at the moment to limit the transaction concurrency number. After the transaction concurrency is limited, only a small amount of accounting transactions are allowed to be executed at the same time, even only one accounting transaction is allowed to be executed at the same time, so that the scale of the single-side account is controlled within a certain range, and the fault spreading is avoided.
According to the unilateral account scale control method provided by the embodiment, when unilateral accounts occur in the financial transaction, transaction statistical data are obtained, whether a transaction valve is opened or not is judged according to the transaction statistical data, and when the judgment result is yes, the transaction valve is opened to limit the transaction concurrency number, so that the unilateral accounts are prevented from being generated in a large scale, the fault spreading is prevented, the financial transaction consistency is ensured, and the system stability and reliability are improved.
In practical application, the transaction abnormal type is various, and the single-side account is only one of the transaction abnormal type, so that the invention also provides a single-side account judging method in order to accurately judge whether the transaction abnormal type is the single-side account.
Referring to fig. 2, fig. 2 is a flowchart of a method for determining a single-side account according to an embodiment of the present disclosure.
The method for judging the single-side account provided by the embodiment can realize the step of judging whether the transaction abnormal type is the single-side account or not according to the transaction abnormal information.
As shown in fig. 2, the method includes:
s201: extracting a transaction exception code from the transaction exception information;
in this embodiment, the transaction exception information includes a transaction exception code, and the transaction exception code corresponds to the transaction exception type one to one. Therefore, according to the transaction exception code extracted from the transaction exception information, the transaction exception type corresponding to the transaction exception code can be determined.
S202: and determining a corresponding transaction exception type according to the transaction exception code so as to judge whether the transaction exception type is a unilateral account.
And when the extracted transaction exception code corresponds to the single-side account, judging that the transaction exception type is the single-side account.
The unilateral account determination method provided by this embodiment can accurately determine the transaction exception type according to the transaction exception information by using the enemy relationship between the transaction exception code and the transaction exception type, and further can accurately determine whether the transaction exception occurring in the current financial transaction is a unilateral account.
In practical application, the transaction statistical data can reflect the occurrence situation of the unilateral account and other transaction execution situations, and when judging whether the transaction valve needs to be opened according to the transaction statistical data, the judgment can be carried out by executing a strict control rule so as to improve the reliability of the judgment result.
Referring to fig. 3, fig. 3 is another flowchart of a method for controlling a size of a single-sided account according to an embodiment of the present disclosure.
S301-S303 are similar to S101-S103 described above and will not be described further herein.
In this embodiment, the transaction statistical data includes the continuous occurrence number of the single-sided account, the total occurrence number of the single-sided account, the transaction failure number per unit time, and the transaction failure rate per unit time.
After the transaction statistical data are obtained, a preset control rule can be executed according to the transaction statistical data to judge whether a transaction valve is opened or not. The preset control rule is a rule chain formed by a first check rule, a second check rule, a third check rule and a fourth check rule in a chain structure.
The chain structure refers to that a previous check rule is linked with a next check rule, when the execution of the previous check rule is finished, whether the next check rule is executed or not is judged according to the check result of the previous check rule, and if yes, the next check rule is executed; if not, the latter check rule is not executed.
S304: executing a first check rule to obtain a first check result;
wherein, the first check rule is: and judging whether the continuous occurrence frequency of the single-side account is greater than or equal to a first preset threshold value.
S305: when the first check result is yes, executing a second check rule to obtain a second check result;
wherein the second check rule is: and judging whether the total occurrence frequency of the single-side account is greater than or equal to a second preset threshold value.
S306: when the second check result is yes, executing a third check rule to obtain a third check result;
wherein the third check rule is: and judging whether the transaction failure times per unit time are greater than or equal to a third preset threshold value.
S307: when the third verification result is yes, executing a fourth verification rule to obtain a fourth verification result;
wherein, the fourth check rule is: and judging whether the transaction failure rate per unit time is greater than or equal to a fourth preset threshold value.
S308: when the fourth verification result is yes, the judgment result is yes;
the first preset threshold value, the second preset threshold value, the third preset threshold value and the fourth preset threshold value may be determined suitable values thereof through a large-scale test.
The steps S304-S308 can implement the aforementioned step of executing the preset control rule according to the transaction statistical data to determine whether to open the transaction valve.
In an example, when any one of the first check result, the second check result, the third check result and the fourth check result is negative, the judgment result is negative.
S309: and when the judgment result is yes, opening a transaction valve to limit the transaction concurrency number.
Step S309 is similar to step S105, and will not be described herein again.
According to the unilateral account scale control method provided by the embodiment, when whether the transaction valve is opened or not is judged according to transaction statistical data, the judgment result is obtained by executing a strict control rule, the accuracy of the judgment result can be improved, and the opening reasonability of the transaction valve is ensured, so that the unilateral account is accurately avoided from occurring on a large scale, the fault spreading is prevented, the accounting transaction consistency is ensured, and the system stability and reliability are improved.
In practical application, when the transaction concurrency number is limited by the transaction valve, the limitation can be realized by directly reducing the parameter value of the transaction concurrency number, and the limitation can also be realized by providing a certain number of transaction permissions for the financial transaction.
Referring to fig. 4, fig. 4 is another flowchart of a method for controlling a single-sided account size according to an embodiment of the present disclosure.
S401-S404 are similar to S101-S104 described above and will not be described in detail herein.
S405: when the judgment result is yes, initializing a preset number of lock resources;
lock resources are used to provide transaction approval for an accounting transaction, and one lock resource is used to provide transaction approval for only one accounting transaction.
When the transaction valve is opened, a preset number of lock resources are initialized. The preset number may be 1 or other values, but the preset number must be smaller than the upper limit value of the transaction concurrency number set by the system, otherwise, the preset number cannot play a role in limiting the transaction concurrency number.
S406: when a new account transaction enters, judging whether an idle lock resource exists, if so, entering S407; if not, entering S408;
s407: allocating an idle lock resource for the new accounting transaction;
in one example, a permission field may be reserved in the new accounting transaction information, and when a lock resource is allocated for the new accounting transaction information, the permission field value in the new accounting transaction information is set to "1".
S408: refuse to allocate lock resources for the new accounting transaction;
in this example, when the allocation of the lock resource for the new accounting transaction is rejected, the permission field value in the new accounting transaction information is set to "0".
The allocation of an idle lock resource for the new accounting transaction, or the refusal of allocating a lock resource for the new accounting transaction, may also be implemented in other ways, and is not limited to the above examples.
In another example, the preset number of lock resources is set to 1. When a new accounting transaction enters, whether an idle lock resource exists is judged, and if yes, an idle lock resource is distributed for the new accounting transaction. When the number of the lock resources is reduced by 1 after the lock resources are allocated to the new accounting transaction, the number of the idle lock resources is 0, and when a new accounting transaction enters and no idle lock resources exist, the allocation of the lock resources to the new accounting transaction is refused.
S409: judging whether the new accounting transaction is allocated with lock resources, if so, entering S410; if not, the step S411 is entered;
in an example, determining whether a new accounting transaction has been allocated a lock resource may be accomplished by determining an approval field value in the new accounting transaction information. For example, when the permission field value in the new accounting transaction information is "1", it indicates that the new accounting transaction has been allocated a lock resource; when the permission field value in the new accounting transaction information is "0", it indicates that the new accounting transaction is not allocated with the lock resource.
S410: allowing the new accounting transaction to be performed;
for a new accounting transaction that has been allocated a lock resource, it is allowed to be executed.
In an example, when execution of a new accounting transaction having a lock resource allocated thereto ends, the lock resource allocated for the new accounting transaction is released. After the lock resource is released, the number of lock resources is increased by 1.
S411: denying execution of the new accounting transaction.
For new accounting transactions that are not assigned lock resources, a rejection is performed.
For example, when the number of the lock resources is N, only N new accounting transactions are allowed to be executed concurrently, and N is smaller than the upper limit value N of the transaction concurrency number set by the system, so that the concurrency number of the new accounting transactions is limited, and the expansion of the scale of the unilateral account and the large-scale occurrence of other transaction abnormalities are avoided.
According to the unilateral account scale control method provided by the embodiment, when the transaction valve is opened to limit the transaction concurrency number, transaction permission is provided for the financial transaction through the preset number of lock resources, so that the concurrency number of new financial transaction is limited, the unilateral account scale is controlled in a smaller range, the fault spreading is prevented, and the stability and the reliability of the system are improved.
In practical applications, if the closing of the transaction valve causes the concurrent number of the accounting transactions to suddenly increase, the system may shake while processing the transactions, so that a single account appears again, and the transaction amount blowout may also occur, causing the system to crash. Therefore, the present invention also provides the following examples.
Referring to fig. 5, fig. 5 is a flowchart illustrating a method for controlling a single-sided account size according to an embodiment of the present disclosure.
S501-S511 are similar to S401-S411 and will not be described in detail.
For closing of the transaction valve, the present embodiment provides a slow start strategy to achieve a gradual closing of the transaction valve.
S512: when the execution of the new financial transaction distributed with the lock resource is finished, judging whether the new financial transaction is successfully executed;
the new accounting transaction assigned with the lock resource is also called a tentative transaction, and when the tentative transaction is completed, the transaction statistical data is updated in real time according to the transaction result.
S513: adjusting a total number of lock resources to twice a current number when the new accounting transaction is successfully executed;
for example, the preset number of the lock resources is set to be "1", when the transaction valve is opened, the current number of the lock resources is "1" (which is equal to the preset number at this time), when a new accounting transaction enters, the idle lock resources are allocated to the new accounting transaction, when the execution of the new accounting transaction allocated with the lock resources is finished and the execution is successful, the total number of the lock resources is adjusted to be "2" (which is equal to twice of the current number of "1"), at this time, 2 new accounting transactions are allowed to be concurrently processed, that is, the current number of the lock resources is adjusted to be "2". When the next new accounting transaction that is finished is also successfully executed, the total number of lock resources is adjusted to "4" (equal to twice the current number "2"), and then 4 new accounting transactions are allowed to be processed concurrently. By analogy, if the new account transaction executed subsequently is executed successfully, the total number of the lock resources is increased by an exponential multiple of 2, and finally reaches or exceeds the upper limit value of the transaction concurrency number set by the system.
S514: and returning the acquired transaction statistical data when the new financial transaction fails to be executed, and judging whether to open a transaction valve according to the transaction statistical data.
When the new financial transaction fails to be executed, transaction statistical data are updated in real time according to transaction results, and whether a transaction valve is opened or not is judged again according to the transaction statistical data after the transaction statistical data are obtained.
For example, the preset number of lock resources is "1". When the total number of the lock resources is adjusted to be 8, if the new financial transaction fails to be executed at the moment, whether a transaction valve is opened or not is judged again according to transaction statistical data, and if the judgment result is yes, the lock resources are initialized to be 1 in the preset number.
According to the description of the embodiment, it can be seen that the number of the lock resources is directly initialized to the preset number when the transaction valve is opened, and the lock resources are gradually closed by the index times of 2 when the transaction valve is closed, so that the situations of transaction jitter or transaction amount blowout and the like possibly caused when the transaction valve is closed are avoided, the reoccurrence of a unilateral account is avoided, and the stability and the reliability of the system are further ensured.
S515: and when the total number of the lock resources is greater than or equal to the upper limit of the transaction concurrency number set by the system, closing the transaction valve to remove the limit of the transaction valve on the transaction concurrency number.
When the new financial transaction is continuously executed successfully, the total number of the lock resources is continuously increased, and when the total number of the lock resources is greater than or equal to the upper limit of the transaction concurrency number set by the system, the limit of the transaction valve on the transaction concurrency number does not exist, so that the transaction valve is closed to remove the limit of the transaction valve on the transaction concurrency number.
For example, the upper limit of the transaction concurrency number set by the system is 100, and if the total number of the lock resources is 101, the number of new accounting transactions which are allowed to be processed concurrently by the system is still 100, which is limited by the system itself, so that the lock resources lose the limiting function. Therefore, the transaction valve is closed, the lock resource is not provided any more, and when a new account transaction enters, whether the lock resource is distributed to the new account transaction or not is not judged any more, so that the limit of the transaction valve on the transaction concurrence number is relieved.
According to the unilateral account scale control method provided by the embodiment, the number of the lock resources is gradually adjusted according to the new financial transaction execution result so as to control the transaction valve to be gradually closed or directly opened, thereby avoiding the situations of transaction jitter or transaction volume blowout and the like possibly caused when the transaction valve is closed, avoiding the reoccurrence of the unilateral account, and further ensuring the stability and reliability of the system.
The embodiment of the invention also provides a single-side account scale control system corresponding to the single-side account scale control method.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a single-side account scale control system according to an embodiment of the present application.
The single-sided account size control system of this embodiment is configured to implement the single-sided account size control method of the foregoing embodiment, as shown in fig. 6, and the system includes:
the abnormal information acquisition module U101 is used for acquiring abnormal transaction information when the financial transaction is abnormal;
in the financial online transaction process, when an abnormal financial transaction occurs, corresponding transaction abnormal information is usually generated. The financial online transaction system generally comprises a transaction processing stack, and the transaction processing stack generally comprises a transaction trace processor, an access security processor, an access control processor, a flow control processor and the like in sequence.
In an example, a single-account size control system may be arranged at the forefront of the transaction processing stack to acquire transaction exception information.
In another example, the exception information obtaining module U101 in the unilateral ledger scale control system may be arranged at the forefront of the transaction processing stack to obtain transaction exception information.
The abnormal type judging module U102 is used for judging whether the transaction abnormal type is a unilateral account or not according to the transaction abnormal information;
when the unilateral account exception occurs in the accounting transaction, corresponding transaction exception information is generated, and the transaction exception information comprises information capable of indicating that the transaction exception type is the unilateral account. Therefore, the abnormal type determining module U102 can determine whether the transaction abnormal type is a single-sided account according to the acquired transaction abnormal information.
The statistical data acquisition module U103 is used for acquiring transaction statistical data when the transaction abnormal type is judged to be the unilateral account;
the transaction statistical data is updated in real time, and after each financial transaction is finished, the transaction statistical data is updated in real time according to the transaction result, so that the transaction statistical data acquired by the statistical data acquisition module U103 is the latest.
The transaction statistical data mainly comprises unit time class (runtimecellstat) data and continuous transaction class (RuntimeStat) data.
The transaction statistics of the unit time class data include one or more of transaction failure times per unit time (tsfailed), transaction success times per unit time (tsSuccess), total request success time per unit time (rtsuccess total), and transaction failure rate per unit time.
The transaction statistical data of the continuous transaction type data comprises one or more of the continuous failure times (consFailNum) of the financial transaction, the continuous occurrence times (consFailSingleNum) of the single-side account and the total occurrence times (failSingleTotalNum) of the single-side account
The transaction valve judgment module U104 is used for judging whether to open a transaction valve according to the transaction statistical data;
the transaction statistical data can reflect the occurrence of unilateral account and other transaction execution conditions. The transaction valve judgment module U104 can judge whether the scale of the unilateral account needs to be controlled according to the transaction statistical data. When the scale of the unilateral account needs to be controlled, the transaction valve needs to be opened, so that the scale of the unilateral account is prevented from being enlarged.
In an example, the transaction valve determination module U104 is further specifically configured to: and executing a preset control rule according to the transaction statistical data to judge whether a transaction valve is opened or not. The preset control rule includes a chain structure (rule chain) composed of a plurality of check rules. Different control rules can be set for different accounting transaction types so as to achieve better control effect.
And the transaction valve control module U105 is used for opening the transaction valve to limit the transaction concurrency number when the judgment result is yes.
The transaction valve is the core of the single-side account scale control system, and directly determines whether to carry out concurrency limit (flow control) on the accounting transaction.
When the determination result is yes, it indicates that the transaction valve needs to be opened, so the transaction valve control module U105 opens the transaction valve at this time to limit the transaction concurrency number. After the transaction concurrency is limited, only a small amount of accounting transactions are allowed to be executed at the same time, even only one accounting transaction is allowed to be executed at the same time, so that the scale of the single-side account is controlled within a certain range, and the fault spreading is avoided.
The unilateral account scale control system that this embodiment provided, when unilateral account takes place in the account transaction, acquire transaction statistical data, judge whether open the transaction valve according to transaction statistical data, when the judged result is, open the transaction valve to restrict the transaction concurrency number, thereby avoid unilateral account to take place on a large scale, prevent that the trouble from spreading, guarantee account transaction uniformity, and then improve system stability and reliability.
In practical application, when the transaction concurrency number is limited by the transaction valve, the limitation can be realized by directly reducing the parameter value of the transaction concurrency number, and the limitation can also be realized by providing a certain number of transaction permissions for the financial transaction.
Referring to fig. 7, fig. 7 is a schematic view of another structure of a single-side account scale control system according to an embodiment of the present application.
In the single-sided account scale control system of the present embodiment, the transaction valve control module U105 includes:
the lock resource initialization submodule U201 is used for initializing a preset number of lock resources when the judgment result is yes;
lock resources are used to provide transaction approval for an accounting transaction, and one lock resource is used to provide transaction approval for only one accounting transaction.
When the transaction valve is opened, the lock resource initialization submodule U201 initializes a preset number of lock resources. The preset number may be 1 or other values, but the preset number must be smaller than the upper limit value of the transaction concurrency number set by the system, otherwise, the preset number cannot play a role in limiting the transaction concurrency number.
The lock resource allocation submodule U202 is used for judging whether idle lock resources exist when a new financial transaction enters, and if so, allocating an idle lock resource for the new financial transaction; if not, refusing to allocate lock resources for the new financial transaction;
in one example, the lock resource allocation submodule U202 includes:
the lock resource judgment submodule is used for judging whether idle lock resources exist or not when a new account transaction enters;
the lock resource allocation submodule is used for allocating an idle lock resource for the new financial transaction when the judgment result obtained by the lock resource judgment submodule is yes; and when the judgment result obtained by the lock resource judgment submodule is negative, refusing to allocate the lock resource for the new financial transaction.
The transaction execution permission submodule U203 is used for judging whether the new financial transaction is allocated with lock resources or not, and if so, the new financial transaction is allowed to be executed; if not, the new accounting transaction is refused to be executed.
In one example, the transaction execution approval submodule U203 includes:
an admission judgment sub-module for judging whether the new financial transaction has been allocated with lock resources;
the permission execution sub-module is used for allowing the new financial transaction to be executed when the judgment result obtained by the permission judgment sub-module is yes; and when the judgment result obtained by the permission judgment submodule is negative, refusing to execute the new financial transaction.
The unilateral account scale control system that this embodiment provided opens the transaction valve to when limiting the concurrent number of transaction, lock resource through the default number provides the transaction permission for the account transaction, thereby limits the concurrent number of new account transaction, with unilateral account scale control in less scope, prevent that the trouble from spreading, improve the stability and the reliability of system.
According to the unilateral account scale control method and system provided by the invention, when unilateral accounts occur in the financial transaction, transaction statistical data are obtained, whether a transaction valve is opened or not is judged according to the transaction statistical data, and when the judgment result is yes, the transaction valve is opened to limit the transaction concurrency number, so that the unilateral accounts are prevented from occurring in a large scale, the fault spreading is prevented, the financial transaction consistency is ensured, and the system stability and reliability are further improved.
And when the transaction valve is judged to be opened or not according to the transaction statistical data, the judgment result is obtained by executing a strict control rule, so that the accuracy of the judgment result can be improved, and the opening reasonability of the transaction valve is ensured.
Furthermore, when the transaction valve is opened to limit the transaction concurrency number, transaction permission is provided for the financial transaction through the preset number of lock resources, so that the concurrency number of the new financial transaction is limited, and the scale of the single-side account is controlled in a smaller range. According to the new financial transaction execution result, the number of the lock resources is gradually adjusted to control the transaction valve to be gradually closed or directly opened, so that the conditions of transaction jitter or transaction amount blowout and the like possibly caused when the transaction valve is closed are avoided, the reoccurrence of the unilateral account is avoided, and the stability and the reliability of the system are further ensured.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Through the above description of the embodiments, those skilled in the art will clearly understand that the present application can be implemented by software plus a necessary hardware platform, and certainly can be implemented by hardware, but in many cases, the former is a better embodiment. With this understanding in mind, the technical solutions of the present application may be embodied in whole or in part in the form of a software product, which may be stored in a storage medium such as a ROM/RAM, a magnetic disk, an optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the methods described in the embodiments or some parts of the embodiments of the present application.
The embodiments in the present description are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments are referred to each other. The device disclosed by the embodiment corresponds to the method disclosed by the embodiment, so that the description is simple, and the relevant points can be referred to the method part for description.
The principle and the implementation of the present application are explained herein by applying specific examples, and the above description of the embodiments is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, the specific embodiments and the application range may be changed. In view of the above, the description should not be taken as limiting the application.

Claims (8)

1. A method for controlling the size of a single account is characterized by comprising the following steps:
when the financial transaction is abnormal, acquiring transaction abnormal information;
judging whether the transaction abnormal type is a unilateral account or not based on the asynchronous positive information according to the transaction abnormal information;
when the transaction abnormal type is judged to be the unilateral account, transaction statistical data are obtained;
according to the transaction statistical data, two detection dimensions of unit time class data and continuous transaction class data are introduced, and whether a transaction valve is opened or not is comprehensively judged;
a slow start strategy is adopted for closing the valve, so that the valve is gradually closed, shaking caused by transaction when the valve is closed is prevented, and unilateral account control is triggered again;
when the judgment result is yes, the transaction valve is opened to limit the transaction concurrency number, wherein the method comprises the following steps: initializing a preset number of lock resources, wherein each lock resource is only used for providing transaction permission for one financial transaction and is used as a tentative transaction for opening a valve; when a new accounting transaction enters, judging whether an idle lock resource exists, if so, allocating an idle lock resource for the new accounting transaction; if not, refusing to allocate lock resources for the new financial transaction; judging whether the new financial transaction is distributed with a lock resource, if so, allowing the new financial transaction to be executed; if not, the new accounting transaction is refused to be executed.
2. The method of claim 1, wherein the determining whether the transaction exception type is a single-sided account according to the transaction exception information comprises:
extracting a transaction exception code from the transaction exception information;
and determining a corresponding transaction exception type according to the transaction exception code so as to judge whether the transaction exception type is a unilateral account.
3. The method of claim 1, wherein said determining whether to open a transaction valve based on said transaction statistics comprises:
executing a preset control rule according to the transaction statistical data to judge whether a transaction valve is opened or not;
the preset control rule comprises a chain structure consisting of a plurality of check rules.
4. The method of claim 3, wherein the transaction statistics comprise: the number of continuous occurrences of the single-side account, the total number of occurrences of the single-side account, the transaction failure number in unit time and the transaction failure rate in unit time;
the plurality of verification rules include:
the first check rule is used for judging whether the continuous occurrence frequency of the single-side account is greater than or equal to a first preset threshold value or not;
the second check rule is used for judging whether the total occurrence frequency of the single-side account is greater than or equal to a second preset threshold value or not;
a third check rule, which judges whether the transaction failure times in unit time is greater than or equal to a third preset threshold value;
a fourth check rule, which is used for judging whether the transaction failure rate in unit time is greater than or equal to a fourth preset threshold value;
executing a preset control rule according to the transaction statistical data to judge whether to open a transaction valve comprises the following steps:
executing a first check rule to obtain a first check result;
when the first check result is yes, executing a second check rule to obtain a second check result;
when the second check result is yes, executing a third check rule to obtain a third check result;
when the third verification result is yes, executing a fourth verification rule to obtain a fourth verification result;
and when the fourth verification result is yes, obtaining a judgment result of yes.
5. The method of claim 1, further comprising: when the execution of the new accounting transaction allocated with the lock resource is finished, releasing the lock resource allocated to the new accounting transaction.
6. The method of claim 1, further comprising: when the execution of the new financial transaction distributed with the lock resource is finished, judging whether the new financial transaction is successfully executed;
adjusting a total number of lock resources to twice a current number when the new accounting transaction is successfully executed;
and returning the acquired transaction statistical data when the new financial transaction fails to be executed, and judging whether to open a transaction valve according to the transaction statistical data.
7. The method of any one of claims 5-6, further comprising: and when the total number of the lock resources is greater than or equal to the upper limit of the transaction concurrency number set by the system, closing the transaction valve to remove the limit of the transaction valve on the transaction concurrency number.
8. A single-sided ledger scale control system, comprising:
the abnormal information acquisition module is used for acquiring abnormal transaction information when the financial transaction is abnormal;
the abnormal type judging module is used for judging whether the transaction abnormal type is a unilateral account or not based on the abnormal correction information according to the transaction abnormal information;
the statistical data acquisition module is used for acquiring transaction statistical data when the transaction abnormal type is judged to be the unilateral account;
the transaction valve judgment module is used for introducing two detection dimensions of unit time class data and continuous transaction class data according to the transaction statistical data and comprehensively judging whether to open a transaction valve; a slow start strategy is adopted for closing the valve, so that the valve is gradually closed, shaking caused by transaction when the valve is closed is prevented, and unilateral account control is triggered again;
the transaction valve control module is used for opening a transaction valve to limit the transaction concurrence number when the judgment result is yes;
the transaction valve control module comprises:
the lock resource initialization submodule is used for initializing a preset number of lock resources, and each lock resource is only used for providing transaction permission for one financial transaction and is used as a tentative transaction for opening a valve;
the lock resource allocation submodule is used for judging whether idle lock resources exist or not when a new financial transaction enters, and if so, allocating an idle lock resource for the new financial transaction; if not, refusing to allocate lock resources for the new financial transaction;
a transaction execution permission submodule, configured to determine whether the new financial transaction has been allocated with a lock resource, and if so, allow execution of the new financial transaction; if not, the new accounting transaction is refused to be executed.
CN201611220166.XA 2016-12-26 2016-12-26 Unilateral account scale control method and system Active CN106780034B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611220166.XA CN106780034B (en) 2016-12-26 2016-12-26 Unilateral account scale control method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611220166.XA CN106780034B (en) 2016-12-26 2016-12-26 Unilateral account scale control method and system

Publications (2)

Publication Number Publication Date
CN106780034A CN106780034A (en) 2017-05-31
CN106780034B true CN106780034B (en) 2020-08-28

Family

ID=58926452

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611220166.XA Active CN106780034B (en) 2016-12-26 2016-12-26 Unilateral account scale control method and system

Country Status (1)

Country Link
CN (1) CN106780034B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241189B (en) * 2018-09-10 2021-11-19 创新先进技术有限公司 Data storage method, device and equipment
CN111211973B (en) * 2020-01-15 2022-06-21 百望股份有限公司 Information processing method and device in invoice field and storage medium
CN111461864A (en) * 2020-03-31 2020-07-28 中国银行股份有限公司 Transaction processing method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000563A (en) * 2006-12-30 2007-07-18 中国建设银行股份有限公司 Adaptive congestion control method and device
CN103839182A (en) * 2012-11-23 2014-06-04 中国银联股份有限公司 Method and system for monitoring transaction data processing of online transaction system in real time
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
CN105227384A (en) * 2015-11-10 2016-01-06 中国建设银行股份有限公司 Method of commerce between online transaction processing system and transaction system
CN105844521A (en) * 2016-03-22 2016-08-10 中国银行股份有限公司 Transaction concurrence quantity control method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101989213B (en) * 2009-08-07 2016-06-29 阿里巴巴集团控股有限公司 Account concurrent processing method and account concurrent processing system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101000563A (en) * 2006-12-30 2007-07-18 中国建设银行股份有限公司 Adaptive congestion control method and device
CN103839182A (en) * 2012-11-23 2014-06-04 中国银联股份有限公司 Method and system for monitoring transaction data processing of online transaction system in real time
CN104090823A (en) * 2014-06-09 2014-10-08 中国建设银行股份有限公司 Flow control method and device for computer system
CN105227384A (en) * 2015-11-10 2016-01-06 中国建设银行股份有限公司 Method of commerce between online transaction processing system and transaction system
CN105844521A (en) * 2016-03-22 2016-08-10 中国银行股份有限公司 Transaction concurrence quantity control method and device

Also Published As

Publication number Publication date
CN106780034A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
TWI699720B (en) Risk control method and device for business operation
US20210350383A1 (en) Transaction exchange platform with watchdog microservice
US9774726B1 (en) Detecting and preventing fraud and abuse in real time
US11488171B2 (en) Risk management and control method and device
CN106780034B (en) Unilateral account scale control method and system
US9633355B2 (en) Knowledge based verification of the identity of a user
CN108449327A (en) A kind of account method for cleaning, device, terminal device and storage medium
CN107958551B (en) Business-extensible bank full-channel remote centralized authorization system
CN105719033B (en) Method and device for identifying object risk
CN109344583B (en) Threshold determination and body verification method and device, electronic equipment and storage medium
CN105930226B (en) A kind of data processing method and device
WO2020042503A1 (en) Verification method and apparatus for risk management system, and device and storage medium
CN109272404B (en) Service authorization method and device
US20230153825A1 (en) Transaction exchange platform with a validation microservice for validating transactions before being processed
US20230153826A1 (en) Detecting and preventing duplicate transactions on a transaction exchange platform
CN104363112B (en) A kind of parameter management method and device
CN111581055A (en) Business system control method and device, electronic equipment and readable storage medium
CN107180040A (en) The management method and device of a kind of business datum
US20230230097A1 (en) Consensus key locking with fast local storage for idempotent transactions
US20230237498A1 (en) Removing duplicate transactions from a transaction exchange platform
CN110197374A (en) Transaction intercepts control method and device
CN109918176B (en) Account checking method and device, storage medium and electronic equipment
CN110782143B (en) Data processing method and device
CN113177052A (en) Method and device for processing service data consistency of distributed system
Razaque et al. Enhanced risk minimization framework for cloud computing environment

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