Invention content
Based on the above issues, an embodiment of the present invention provides a kind of method of commerce and device based on block chain.
In a first aspect, an embodiment of the present invention provides a kind of method of commerce based on block chain.Including:
The first transaction request is received in the first environment that the first currency is currency, first transaction request includes
First quantity, first transaction request are used to ask using the first currency and the second-cash of first quantity to be circulation goods
Commodity in the second environment of coin are traded;
First currency of first quantity is stored in by the first block chain in the first fund pool, first fund pool
In the first environment;
Determine the second number in corresponding second fund pool of the first currency of the first quantity in first fund pool
The second-cash of amount, second fund pool is in the second environment;
In the second environment, second of the second quantity described in second fund pool is used by the second block chain
Currency is traded with the commodity.
In one is optionally realized, the second quantity described in second fund pool is really being used by the second block chain
The second-cash and the commodity be traded before further include:
Determine whether the quantity of the second-cash in second fund pool is sufficient;
When the quantity abundance of the second-cash in second fund pool, continues to execute and determine in first fund pool
In corresponding second fund pool of the first currency of first quantity the step of the second-cash of the second quantity.
In another is optionally realized, further include:
When the lazy weight of the second-cash in second fund pool, first transaction request is locked.
In another is optionally realized, the first currency of the first quantity in determination first fund pool corresponds to
Second fund pool in the second-cash of the second quantity include:
According to the exchange rate of the first currency and the second-cash, determine that the first currency of the first quantity in the first fund pool is corresponding
The second-cash of second quantity in second fund pool.
In another is optionally realized, further include:
The second transaction request is received in the second environment, second transaction request includes third quantity, and described
Two transaction requests are for asking to be traded with the commodity in the first environment using the second-cash of the third quantity;
The second-cash of the third quantity is stored in by the second block chain in second fund pool;
Determine the 4th number in corresponding first fund pool of the second-cash of the third quantity in second fund pool
First currency of amount;
In the first environment, first of the 4th quantity described in first fund pool is used by the first block chain
Currency is traded with the commodity.
Second aspect, an embodiment of the present invention provides a kind of transaction systems based on block chain.Including:
First receiving unit, for receiving the first transaction request, institute in the first environment that the first currency is currency
It includes the first quantity to state the first transaction request, and first transaction request is used to ask the first currency using first quantity
It is traded for the commodity in the second environment of currency with the second-cash;
First deposit unit, for the first currency of first quantity to be stored in the first fund pool by the first block chain
In, first fund pool is located in the first environment;
First determination unit, for determining the first currency of the first quantity in first fund pool corresponding described
The second-cash of second quantity in two fund pools, second fund pool is in the second environment;
First transaction unit, in the second environment, being used in second fund pool by the second block chain
The second-cash of second quantity is traded with the commodity.
In another is optionally realized, further include:
Whether the second determination unit, the quantity for determining the second-cash in second fund pool are sufficient;
When the quantity abundance of the second-cash in second fund pool, continues to execute and determine in first fund pool
In corresponding second fund pool of the first currency of first quantity the step of the second-cash of the second quantity.
In another is optionally realized, further include:
Lock cell, when the lazy weight of the second-cash in second fund pool, for locking first transaction
Request.
In another is optionally realized, first determination unit is specifically used for:
According to the exchange rate of the first currency and the second-cash, determine that the first currency of the first quantity in the first fund pool is corresponding
The second-cash of second quantity in second fund pool.
In another is optionally realized, further include:
Second receiving unit, receives the second transaction request in the second environment, and second transaction request includes the
Three quantity, second transaction request are used to ask the second-cash using the third quantity and the quotient in the first environment
Product are traded;
Second deposit unit, for the second-cash of the third quantity to be stored in second money by the second block chain
Jin Chizhong;
Third determination unit, for determining the second-cash of the third quantity in second fund pool corresponding described
First currency of the 4th quantity in one fund pool;
Second transaction unit, in the first environment, being used in first fund pool by the first block chain
First currency of the 4th quantity is traded with the commodity.
The third aspect, this specification embodiment provide a kind of computer equipment, including memory, processor and are stored in
On memory and the computer program that can run on a processor, which is characterized in that the processor executes real when described program
The method and step of existing aforementioned first aspect.
Fourth aspect provides a kind of computer readable storage medium, and meter is stored on the computer readable storage medium
Calculation machine program, the computer program realize the method described in above-mentioned first aspect when being executed by processor.
5th aspect provides a kind of computer program product including instruction, when described instruction is run on computers
When so that computer executes the method described in above-mentioned first aspect.
Through the embodiment of the present invention, between the mechanism for two countries that currency cannot directly circulate, exist respectively
Fund pool is set in other side mechanism, is traded by fund pool combination block chain so that International Transaction becomes more succinct, user
Experience higher.
Specific implementation mode
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention
In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is
A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art
The every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
An embodiment of the present invention provides a kind of method of commerce and device based on block chain.This method is suitable for shown in Fig. 1
Application scenarios, as shown in Figure 1, including:One or more clients 101, for example, laptop, desktop computer and shifting
Dynamic terminal etc.;One or more block chain nodes 102.
Client 101 is mainly used for interacting with user, for example, user can be logged in by client, inquiry
Record in block chain can also record the information in block chain;Client 101 is additionally operable to carry out with block chain node 102
Interaction, the block chain node 102 are stored with block chain, and client 101 can obtain block chain from block chain node 102,
Newly-generated block chain can be sent to block chain node 102;Wherein client 101 can there are many clients by function
End, for example, inquiring client terminal, bank client, packing client, are packaged client for being packaged new block chain etc..
For Foreign Transactions, it usually needs the currency of other side country is first bought, then in the currency branch using other side country
Corresponding payment for goods is paid, if directly paid using local currency, in other side country since there may be can not arrive account for Regulation Policy
Or need to illustrate that cause can keep accounts to bank, if it is desired to making to use in other side country, other side still needs oneself after keeping accounts
Carrying out currency conversion, it is clear that process is very cumbersome, especially in the case where not knowing about other side's national monetary policy, and it is big absolutely
Majority state is all conditional to the amount of changing money, is operated inconvenient, and existing mode can not be coped with
The Foreign Transactions market to become increasingly prosperous, Foreign Transactions are also required to develop to more easily direction.
Based on this, an embodiment of the present invention provides a kind of method of commerce and device based on block chain.By combining block
Chain realizes Foreign Transactions, and realization is capacitive to exchange automatically, and operation is more convenient.
For ease of the understanding to the embodiment of the present invention, it is further explained with specific embodiment below in conjunction with attached drawing
Bright, embodiment does not constitute the restriction to the embodiment of the present invention.
Fig. 2 is a kind of flow chart of the method for commerce based on block chain provided in an embodiment of the present invention.This method can lead to
It crosses in scene shown in FIG. 1, terminal, mine machine or block chain node are realized.As shown in Fig. 2, this method specifically includes:
S210 receives transaction request in the first environment that the first currency is currency, and the transaction request includes the
One quantity, the transaction request are used to ask the first currency using first quantity and the second-cash for the of currency
Commodity in two environment are traded.
Wherein, currency can refer to the currency of the every countries such as dollar, Euro, yen and RMB.First currency and
Two currency can refer to arbitrary two kinds of currency.For example, the first currency is RMB, the second-cash is yen.
Environment can refer to one independent region of money-system or money-system, which can refer to bank, centre
The money transaction system of row or Unionpay.Correspondingly, the first environment that the first currency is currency refers to circulating in internal system
For the first currency, for example, the money transaction system of China Construction Bank, the currency of internal circulation is RMB.First environment with
Second environment is and money transaction system corresponding with the first currency and the second-cash or isolated area respectively.
For example, when the first currency is RMB, first environment can be the money transaction system of China Construction Bank, the
When two currency are yen, second environment can be the money transaction system of someiyoshine bank.In the currency of China Construction Bank
When transaction system receives the first transaction request, that is, user pays the commodity bought in Japan by Construction Bank
When, the first transaction request can be submitted to Construction Bank's money transaction system, which may include producing bank's account
Family is transferred to bank account and the first quantity, which, which is used to indicate, will produce the first quantity of bank account
RMB is transferred accounts to being transferred to bank account.Certainly, can also include the others such as the type of the transaction in first transaction request
Information.
It is traded using the first currency and the commodity in second environment of the first quantity, can refer to that will produce bank's account
First Money transfer of first quantity at family, which is given, is transferred to bank account for buying the commodity in second environment.For example, user
It, can be by the Bank Account Number in China Construction Bank into someiyoshine bank when people's coin buys the commodity in Japanese national
Bank Account Number is transferred accounts the payment for goods of the commodity.
First currency of first quantity is stored in by the first block chain in the first fund pool, described first by S220
Fund pool is located in the first environment.
Fund pool can refer to one or more accounts.Such as one or more of China Construction Bank bank account.
May include the fund pool of other multiple environment in first environment, the owner of fund can be in the fund pool
It corresponds to the country or bank of environment.For example, first environment is China Construction Bank, when second environment is someiyoshine bank,
The ownership of the first fund pool in China Construction Bank can be someiyoshine bank.
Wherein, the currency in the embodiment of the present invention can refer to the digital cash issued based on block chain.It, can be with when transferring accounts
The account (can also be the reception address of currency) and transaction amount of offer both parties are simultaneously recorded in block chain.
Currency in the embodiment of the present invention can also refer to the currency issued under normal mode, when transferring accounts, directly pass through silver
Row account is transferred accounts, and the transfer information is recorded in block chain, which may include producing Bank Account Number, is turned
Enter bank account and transfer amounts etc..
S230 is determined in corresponding second fund pool of the first currency of the first quantity in first fund pool
The second-cash of two quantity, second fund pool is in the second environment.
Moneytary operations is carried out between two varying environments, can fund pool be arranged in other side's environment respectively in both sides.To this
Fund pool is transferred accounts, you can thinks that the fund is flowed into the environment of the fund pool pair.From other accounts of the fund pool into environment
It transfers accounts at family, you can think that the fund is flowed into from the corresponding environment of the fund pool in this environment.
For example, in conjunction with the example of above-mentioned first environment and second environment.China Construction Bank can be in someiyoshine bank
Second fund pool is set, the first fund pool is arranged in China Construction Bank in someiyoshine bank, then, in user from China Reconstructs
When the account of bank is transferred accounts to the account of someiyoshine bank, actual flow is to first pass through the account of China Construction Bank
Family is transferred accounts the first currency of the first quantity to the first fund pool, and the first currency for being equivalent to first quantity is flowed into someiyoshine
Bank's (actual funds still in China Construction Bank, but right belongs to someiyoshine bank), then passes through Japanese cherry again
Spend the second-cash of the second fund pool in bank to someiyoshine bank transfer and the first money equivalent value of the first quantity.
In this process, the first currency of the first quantity is needed to determine the second-cash of the second quantity, first quantity
First currency and the second-cash of the second quantity such as are at the values, can specifically be converted according to the current exchange rate, that is, according to
The exchange rate of first currency and the second-cash determines corresponding second fund of the first currency of the first quantity in the first fund pool
The second-cash of second quantity in pond.
S240 uses the second quantity described in second fund pool in the second environment by the second block chain
The second-cash be traded with the commodity.
Wherein, first environment and second environment can be traded using different block chains, the first block chain and
Two block chains can be associated.When the first currency is issued based on the first block chain, the second-cash is sent out based on the second-cash
When row, the trade fair transferred accounts to the first fund pool in the first block chain is sent to the second block chain and synchronizes processing, phase
It is same to carry out that the transaction request transferred accounts to the second fund pool in the second block chain answered can also be sent to the first block chain
Step processing.
First environment and second environment can also be traded using the same block chain.For common form (non-block
Chain form) distribution currency, first environment and second environment can will be recorded in block in the relevant transfer information of fund pool
In chain.
In addition, can also receive transaction request in second environment, the embodiment of the present invention can also include the following steps at this time:
Step A:The second transaction request is received in second environment, which includes third quantity, this second
Transaction request is for asking to be traded with the commodity in the first environment using the second-cash of the third quantity;
Step B:The second-cash of the third quantity is stored in by the second block chain in second fund pool;
Step C:It determines in corresponding first fund pool of the second-cash of the third quantity in second fund pool
First currency of the 4th quantity;
Step D:In the first environment, the 4th quantity described in first fund pool is used by the first block chain
The first currency be traded with the commodity.
Through the above steps, currency may be implemented freely to be circulated in different environment, trading efficiency is improved.
In embodiments of the present invention, be not in process of exchange really fund is exchanged, but based on across
State's business is continuously increased, and on the basis of certain cash flow, bank or other mechanisms are withheld in process of exchange
With pay out.Withholding the fund come may be used to pay out other transaction, just realize the circulation of fund in this way, eliminate
The process that user exchanges.
In addition, account is withheld or pays out since fund pool is equivalent in process of exchange, if the fund withheld is less than generation
The fund paid, then, during paying out, it is possible that the case where insufficient funds.At this point, before S240 or S220
Before, further include:
Determine whether the quantity of the second-cash in second fund pool is sufficient;
When the quantity abundance of the second-cash in second fund pool, S240 or S220-S240 is continued to execute.
When the lazy weight of the second-cash in the second fund pool, the first transaction request is locked.
When locking the first transaction, it can wait for when having enough currency in the second fund pool, be further continued for executing above-mentioned step
Suddenly.
When waiting for, timer can be started, for example, waiting for one day time, the time more than one day, which may also be, does not fill
Foot, then cancel the transaction.
It can not also wait for and directly Cancel Transaction.
In order to increase the success rate of transaction, reduces the locked situation of transaction to the greatest extent, can unite to both sides' trade difference
Meter, can the replenishment of funds in fund pool in time according to statistical result.The supplement process can be the fund that bank possesses it
Fund in pond is exchanged, and is injected into the fund pool of other side.
Furthermore it is also possible to which the historical statistics of trade difference is predicted according to trend, fund is adjusted according to prediction result in advance
Pond.
Some starting funds can also be paid for first in fund pool, to play cushioning effect, reduce the locked possibility of transaction.
It should be noted that currencies, environment, bank may include a variety of, herein merely to aspect in description
It is illustrated with two kinds, does not constitute and limit.
Through the embodiment of the present invention, between the mechanism for two countries that currency cannot directly circulate, exist respectively
Fund pool is set in other side mechanism, is traded by fund pool combination block chain so that International Transaction becomes more succinct, user
Experience higher.In addition, in fund pool insufficient funds, the safety of transaction can be ensure that with locked transaction, passes through configuration scheduling
Means can reduce the locked situation of transaction, further increase the circulation of fund.
Fig. 3 is a kind of structural schematic diagram of the transaction system based on block chain provided in an embodiment of the present invention.The device has
Body includes:
First receiving unit 301, for receiving the first transaction request in the first environment that the first currency is currency,
First transaction request includes the first quantity, and first transaction request is used to ask the first goods using first quantity
Coin is traded with the second-cash for the commodity in the second environment of currency;
First deposit unit 302, for the first currency of first quantity to be passed through the first money of the first block chain deposit
Jin Chizhong, first fund pool are located in the first environment;
First determination unit 303, for determining the corresponding institute of the first currency of the first quantity in first fund pool
The second-cash of the second quantity in the second fund pool is stated, second fund pool is in the second environment;
First transaction unit 304, in the second environment, second fund pool to be used by the second block chain
Described in the second-cash of the second quantity be traded with the commodity.
Optionally, further include:
Whether the second determination unit, the quantity for determining the second-cash in second fund pool are sufficient;
When the quantity abundance of the second-cash in second fund pool, continues to execute and determine in first fund pool
In corresponding second fund pool of the first currency of first quantity the step of the second-cash of the second quantity.
Optionally, further include:
Lock cell, when the lazy weight of the second-cash in second fund pool, for locking first transaction
Request.
Optionally, first determination unit is specifically used for:
According to the exchange rate of the first currency and the second-cash, determine that the first currency of the first quantity in the first fund pool is corresponding
The second-cash of second quantity in second fund pool.
Optionally, further include:
Second receiving unit, receives the second transaction request in the second environment, and second transaction request includes the
Three quantity, second transaction request are used to ask the second-cash using the third quantity and the quotient in the first environment
Product are traded;
Second deposit unit, for the second-cash of the third quantity to be stored in second money by the second block chain
Jin Chizhong;
Third determination unit, for determining the second-cash of the third quantity in second fund pool corresponding described
First currency of the 4th quantity in one fund pool;
Second transaction unit, in the first environment, being used in first fund pool by the first block chain
First currency of the 4th quantity is traded with the commodity..
Fig. 4 shows a kind of computer equipment structural schematic diagram that this specification embodiment is provided, the computer equipment
May include:Processor 410, memory 420, input/output interface 430, communication interface 440 and bus 450.Wherein processor
44, memory 420, input/output interface 430 and communication interface 440 by bus 450 realize between inside equipment
Communication connection.
General CPU (Central Processing Unit, central processing unit), microprocessor may be used in processor 410
Device, application specific integrated circuit (Application Specific Integrated Circuit, ASIC) or one or
The modes such as multiple integrated circuits are realized, for executing relative program, to realize technical solution that this specification embodiment is provided.
ROM (Read Only Memory, read-only memory), RAM (Random Access may be used in memory 420
Memory, random access memory), static storage device, the forms such as dynamic memory realize.Memory 420 can store
Operating system and other applications are realizing technical solution that this specification embodiment is provided by software or firmware
When, relevant program code is stored in memory 420, and is executed by processor 410 to call.
Input/output interface 430 is for connecting input/output module, to realize information input and output.Input and output/
Module can be used as component Configuration (not shown) in a device, can also be external in equipment to provide corresponding function.Wherein
Input equipment may include keyboard, mouse, touch screen, microphone, various kinds of sensors etc., output equipment may include display,
Loud speaker, vibrator, indicator light etc..
Communication interface 440 is used for connection communication module (not shown), to realize the communication of this equipment and other equipment
Interaction.Wherein communication module can be realized by wired mode (such as USB, cable etc.) and be communicated, can also be wirelessly
(such as mobile network, WIFI, bluetooth etc.) realizes communication.
Bus 450 includes an access, in various components (such as processor 410, memory 420, the input/output of equipment
Interface 430 and communication interface 440) between transmit information.
It should be noted that although above equipment illustrates only processor 410, memory 420, input/output interface
430, communication interface 440 and bus 450, but in specific implementation process, which can also include realizing normal operation
Necessary other assemblies.In addition, it will be appreciated by those skilled in the art that, can also only include to realize in above equipment
Component necessary to this specification example scheme, without including all components shown in figure.
Professional should further appreciate that, described in conjunction with the examples disclosed in the embodiments of the present disclosure
Unit and algorithm steps, can be realized with electronic hardware, computer software, or a combination of the two, hard in order to clearly demonstrate
The interchangeability of part and software generally describes each exemplary composition and step according to function in the above description.
These functions are implemented in hardware or software actually, depend on the specific application and design constraint of technical solution.
Professional technician can use different methods to achieve the described function each specific application, but this realization
It should not be considered as beyond the scope of the present invention.
The step of method described in conjunction with the examples disclosed in this document or algorithm, can use hardware, processor to execute
The combination of software module or the two is implemented.Software module can be placed in random access memory (RAM), memory, read-only memory
(ROM), electrically programmable ROM, electrically erasable ROM, register, hard disk, moveable magnetic disc, CD-ROM or technical field
In any other form of storage medium well known to interior.
Above-described specific implementation mode has carried out further the purpose of the present invention, technical solution and advantageous effect
It is described in detail, it should be understood that the foregoing is merely the specific implementation mode of the present invention, is not intended to limit the present invention
Protection domain, all any modification, equivalent substitution, improvement and etc. within the scope of the present invention, done should be included in this hair
Within bright protection domain.