The realization principle of "diagram" cross-line clearing system personal understanding

Source: Internet
Author: User

Recently saw a lot of unionpay aspects of the liquidation system design principles, with a great understanding of the Trans-bank clearing system, the purpose of this article is to think from a programmer's perspective on how the architecture of a cross-border clearing system is implemented and what ideas we have in the process. Because there are too many professional terms involved in finance, including borrowing, payment, position, allocation and so on, this will not be involved here, but instead it is explained by the understandable concept.

The following is a brief introduction to the implementation principles and characteristics of the two types of trans-bank clearing systems. A trans-liquidation system is one of our most familiar UnionPay, as well as an increasingly popular third-party payment system, which is typically fast money.

First, take a very common example of life to illustrate the whole process of cross-border liquidation, which does not involve other concepts such as transaction fees.

Cross-line withdrawal process

John is the cardholder of ICBC, he needs to take cash, but can not find ICBC ATM machine, found that there is a bank of the ATM machine, he can only go to CCB withdrawals, the whole process is the process of liquidation, we take this scenario as an example, analysis of business processes, the specific interaction process see the following picture.

ICBC cardholder John in the Construction Bank ATM machine Withdrawals 100,ATM request, because it is ICBC card, CCB does not recognize, can only request ICBC to deal with, ICBC identify cardholder account and debit 100, then notify CCB, CCB will notify ATM spit money.

Here the whole system is going to solve two problems:

1 how CCB communicates with ICBC

2 How to liquidate between CCB and ICBC, as shown above, ICBC owes CCB 100.

The analysis of the whole system is based on the above two problems, the following is the first solution is communication problem

Two modes of cross-line communication

We first assume that ICBC provides the interface, only the construction bank to send the agreed format of the message can be in ICBC communications, this is equivalent to the CCB directly through the interface with ICBC communication. If this is the way, can only solve the CCB and ICBC one-way communications, if ICBC and CCB communication, then ICBC to send the construction Bank designated communication message format. But think about it, if the bank is going to do more, here are three communications between banks.

When there are three banks, there are 3*2=6 in the communication link, as banks become more and more, this point-to-point communication becomes more and more complex, every new bank, he will do before the bank has to do a lot of repetitive work, this cost is very high, not economic, then must appear a network, It was able to access all the banks, and the new banks needed access to the network, and they could communicate with all the other banks.

First of all, this network is a communication network, there are two ways to connect all the banks

1 This communication network defines the standard interface, all banks must implement this communication network definition API, the new bank if want to access this communication network, must implement the communication interface agreement. Public interface mode for short

2 This network initiative to connect all the bank's interface, all the bank's interface information into the inside, like an adapter, the new bank if you want to access this communication network, the communication network must actively contact the bank, according to the interface of the Bank protocol to achieve communication, referred to as adapter mode.

The following illustration shows the difference between the two modes:

For both models, the main game lies in who is strong and who is weak. It is obvious that a third-party payment company belongs to the adapter mode and needs a bank to access it, and as for UnionPay, it is the first model, which is the most advantageous for UnionPay, which needs a stable system.

Cross-bank liquidation margin model

Solve the communication problem, the following is to see how to solve the problem of liquidation of funds. A simple solution would be for ICBC to open a margin account in CCB that would use the account to reimburse CCB for the entire trans-bank deal.

From the above picture, this kind of scheme is feasible indeed. ICBC only need to put in full margin in the construction Bank, you can meet the cost of crossing the line. But there are really a lot of problems in this,

1 If banks are getting more and more, every bank will have to save money in other banks, it's not economical

2 How much money do you need to put in the margin? If there has never been a trans-bank deal, ICBC will lose

3 What if the margin is not enough? A transaction failure or a receivable?

For the first question, assuming that banks are growing, it will lead ICBC to open margin accounts in every other bank (see chart), a very economic solution.

It is not feasible to make a deposit in other banks, as was the case with previous communications, and it is not possible to manage all bank margin accounts separately and put them together in a unified way to facilitate liquidation among banks. We call this system a margin system for the time being.

Margin system

Margin is to facilitate the clearing between the various banks, need to be managed by a separate system, to resolve the issue of margin deposit between the bank. Each bank only needs to deposit some money in the margin system. There are also two modes of margin system. Let's look at the first model that's better understood:

In this mode, the bank first put a part of the money in the margin system, while the bank set up a virtual account, record how much money is stored, mainly convenient reconciliation, in case the margin system money is wrong how to do. You can imagine that the bank is very stingy, why would like to deposit money into the margin system, this part of the money do not good, the bank can do so only the country, this system is the central bank's reserve payment management system. Every new bank has to keep a dollar here.

Another option is to think backwards, and since there is no such thing as a central bank to support, it is possible to set up an account in each commercial bank, with which the Bank is responsible for liquidation. For each new bank, a margin account is opened in that bank.

These two ways are fundamentally different, one is the bank to transfer part of the funds to the margin, the bank set up a virtual account and deposit the real money map. One is the margin system, which transfers funds from one bank to another, builds a virtual account within itself and maps the real capital account in the bank. This indirect bank has a follow-up reconciliation mechanism, which is not described here first.

All Third-party payment companies are the second way to liquidate, and only national clearing companies (such as UnionPay) are the first way, a resource and power inequality, but understandable.

Clearing system

The margin system solves the problem of deposit deposits, and then solves the problem of how to settle the settlement. If the margin transfer is real-time, it is necessary to face the above mentioned problems, the margin is not enough, the Cross-border transaction is a success or failure. This is a business problem, there are many kinds of solutions, we do not say. Technically speaking, if every transaction to the margin real-time account, then the margin system load is too large, how to guarantee the transaction, and so on some of the issues. So one of the easiest options is to settle it once a day.

Each day by a system to record these trans-line transaction information, summed up, unified bookkeeping. So one day you just need to call a margin system. Then the entire liquidation process is the following process:

1 system T Day takes place CCB and ICBC cross-line transaction 100

2 Clearing System T+1 Day summary of T-day between ICBC and CCB transactions between the detailed data, and send the data issued to CCB and ICBC to confirm

3 ICBC, respectively, the details of the confirmation of the account, notify the clearing system to confirm the transaction details correct, clearing system began liquidation, call margin payment system transfer.

4 after the completion of the liquidation, ICBC and CCB respectively obtain the real amount of the margin system and its own system internal mapping account for balance reconciliation.

The main thing the Clearing house does is to count who owes who and how much, and to trigger the operation of the margin system.

Reconciliation process

The reconciliation includes two parts, one is the reconciliation of the transaction details and the margin balance.

The first thing to think about is: who initiated the reconciliation? This is the essence of understanding reconciliation.

We give an example of life, we invest money in a person, who is responsible for the day-to-day operation of the company. You will definitely take the initiative to get to know the company's accounts, because that's your money. The same is true of the originator of the bill, for the liquidation process of UnionPay, the originator of the reconciliation is commercial bank, because you put the money in the margin system, this is your money, you need to care about this, UnionPay does not care about this.

For another kind of margin system, put the money in each bank, then the originator of the reconciliation is the margin system defender. The current universal Third-party payment companies are the model, so he wants to find each bank to the results of the reconciliation, to confirm that their funds are safe and correct.

The above is a simple prototype of a trans-bank clearing system, starting with a simple example to illustrate a liquidation process. At present, the liquidation process of the third party payment company of UnionPay is roughly the same, but the implementation details are far more complicated than this. But the essential model of a basic clearing system is largely unchanged. Of course, this is only for the settlement of the same currency, different currencies or virtual currency liquidation will involve exchange rate problems, these are very complex, have the opportunity to study, follow-up in the sharing.

PS: Many of the above nouns are their own casual writing, there are many professional nouns are not mentioned here, interested in the can own to understand.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.