WO2020019891A1 - 基于区块链的金融交易执行方法及装置、电子设备 - Google Patents

基于区块链的金融交易执行方法及装置、电子设备 Download PDF

Info

Publication number
WO2020019891A1
WO2020019891A1 PCT/CN2019/091042 CN2019091042W WO2020019891A1 WO 2020019891 A1 WO2020019891 A1 WO 2020019891A1 CN 2019091042 W CN2019091042 W CN 2019091042W WO 2020019891 A1 WO2020019891 A1 WO 2020019891A1
Authority
WO
WIPO (PCT)
Prior art keywords
transaction
centers
trading
order
ledger
Prior art date
Application number
PCT/CN2019/091042
Other languages
English (en)
French (fr)
Inventor
马凌
何昌华
张辉
胡丹青
金戈
Original Assignee
阿里巴巴集团控股有限公司
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 阿里巴巴集团控股有限公司 filed Critical 阿里巴巴集团控股有限公司
Priority to EP19841859.2A priority Critical patent/EP3792858A4/en
Priority to SG11202011053VA priority patent/SG11202011053VA/en
Publication of WO2020019891A1 publication Critical patent/WO2020019891A1/zh
Priority to US17/086,194 priority patent/US20210049695A1/en

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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • G06Q20/102Bill distribution or payments
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/04Payment circuits
    • G06Q20/06Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme
    • G06Q20/065Private payment circuits, e.g. involving electronic currency used among participants of a common payment scheme using e-cash
    • 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
    • G06Q20/00Payment architectures, schemes or protocols
    • G06Q20/08Payment architectures
    • G06Q20/10Payment architectures specially adapted for electronic funds transfer [EFT] systems; specially adapted for home banking systems
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3236Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions
    • H04L9/3239Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials using cryptographic hash functions involving non-keyed hash functions, e.g. modification detection codes [MDCs], MD5, SHA or RIPEMD
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/32Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials
    • H04L9/3297Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols including means for verifying the identity or authority of a user of the system or for message authentication, e.g. authorization, entity authentication, data integrity or data verification, non-repudiation, key authentication or verification of credentials involving time stamps, e.g. generation of time stamps
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/56Financial cryptography, e.g. electronic payment or e-cash

Definitions

  • One or more embodiments of the present specification relate to the field of blockchain technology, and in particular, to a method and an apparatus for executing a financial transaction based on a blockchain, and an electronic device.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices participate in "accounting" and jointly maintain a complete distributed database. Because blockchain technology has the characteristics of decentralization, openness and transparency, each computing device can participate in database records, and data can be quickly synchronized between computing devices, making blockchain technology widely used in many fields. Apply
  • This specification proposes a blockchain-based financial transaction execution method that is applied to a distributed exchange built on the blockchain.
  • the distributed exchange includes several distributed transaction centers.
  • the method includes:
  • each trading center in the distributed exchange performs clock calibration synchronization in advance.
  • the method before receiving a transaction order submitted by a user client connected to a local transaction center, the method includes:
  • the transaction order sent to each of the other transaction centers in the blockchain includes the propagation delay of the transaction order; wherein the propagation delay indicates that the user client sends the transaction order to the connected Transmission time of the trading center.
  • the propagation time is a time interval between the time when the market information is pushed and the time when the transaction order is received.
  • the receiving a transaction order submitted by a user client connected to a local transaction center includes:
  • the receiving a transaction order sent by the other transaction centers and submitted by a user client connected to the other transaction centers includes:
  • the sending the generated transaction entrusted ledger to other transaction centers in the blockchain includes:
  • Receiving the transaction entrusted account generated by the other transaction centers and generated by the other transaction centers by performing transaction matching processing on the received transaction orders includes:
  • the first preset duration is greater than the first preset duration.
  • the transaction order includes a buy order and a sell order
  • the step of performing transaction matching processing on the received transaction orders to generate a transaction entrusted ledger includes:
  • the transaction commission ledger is created based on the generated transaction order.
  • the initiating consensus processing on the transaction entrusted ledger generated by each trading center includes:
  • Optional also includes:
  • the execution result of the transaction order in the consensus transaction commission ledger is returned to the corresponding user client.
  • the distributed exchange includes several trading centers distributed in different regions.
  • This specification also proposes a blockchain-based financial transaction execution device that is applied to a distributed exchange built on the blockchain.
  • the distributed exchange includes several distributed transaction centers.
  • the device includes:
  • a receiving module that receives a transaction order submitted by a user client connected to a local transaction center;
  • a sending module that sends the received transaction order to each other transaction center in the blockchain; and receives a user client connected to the other transaction centers that is sent by the other transaction centers Submitted transaction orders;
  • the matching module performs transaction matching processing on the received transaction orders to generate a transaction entrusted ledger
  • the sending module further: sends the generated transaction entrusted ledger to other trading centers in the blockchain; the receiving module further: receives the sending from the other trading centers, and the other trading centers pair The transaction entrustment ledger generated by the transaction matching processing of the received transaction order; wherein the transaction entrusted ledger includes the transaction order generated based on the transaction order matching;
  • the execution module initiates consensus processing on the transaction commission ledger generated by each trading center, and executes the transaction orders in the transaction commission ledger passed by consensus.
  • each trading center in the distributed exchange performs clock calibration synchronization in advance.
  • the sending module further:
  • the receiving module Before the receiving module receives the transaction order submitted by the user client connected to the local transaction center, push the transaction market information to the user client connected to the local transaction center, and record the pushing time of the transaction market information.
  • the transaction order sent to each of the other transaction centers in the blockchain includes the propagation delay of the transaction order; wherein the propagation delay indicates that the user client sends the transaction order to the connected Transmission time of the trading center.
  • the propagation time is a time interval between the time when the market information is pushed and the time when the transaction order is received.
  • the receiving module further:
  • the receiving module further:
  • the sending module further:
  • the receiving module further:
  • the first preset duration is greater than the first preset duration.
  • the transaction order includes a buy order and a sell order
  • the matching module :
  • the transaction commission ledger is created based on the generated transaction order.
  • the execution module :
  • the sending module further:
  • the execution result of the transaction order in the consensus transaction commission ledger is returned to the corresponding user client.
  • the distributed exchange includes several trading centers distributed in different regions.
  • This specification also proposes an electronic device that is applied to a distributed exchange built on the blockchain; the distributed exchange includes several distributed transaction centers, including:
  • Memory for storing machine-executable instructions
  • the processor by reading and executing the machine-executable instructions stored in the memory corresponding to the control logic executed by the blockchain-based financial transaction, the processor is caused to:
  • each transaction center can synchronize the transaction orders submitted by local user clients with each other, and each transaction center can use the blockchain consensus mechanism to generate transactions generated by each transaction center based on the received transaction orders.
  • the transaction entrusted ledger has reached a consensus, so each trading center in the above-mentioned distributed exchanges will be equivalent in terms of processing capacity for transaction orders.
  • Different user clients can get equivalent peers by accessing local trading centers.
  • Trading opportunities; therefore, based on blockchain technology, several distributed trading centers in different regions are set up as distributed exchanges, which is fundamentally realized.
  • the scarce resources of the trading center are distributed and distributed to popularize scarce resources. , To ensure that users can get fair and effective trading opportunities.
  • FIG. 1 is a flowchart of a blockchain-based financial transaction execution method according to an exemplary embodiment.
  • FIG. 2 is an architecture diagram of a distributed exchange provided by an exemplary embodiment.
  • FIG. 3 is a schematic structural diagram of an electronic device according to an exemplary embodiment.
  • FIG. 4 is a block diagram of a blockchain-based financial transaction execution device according to an exemplary embodiment.
  • the purpose is to propose a blockchain-based technology to build several distributed trading centers into distributed exchanges to decentralize the scarce processing resources of the trading center and popularize scarce resources, so as to protect users.
  • trading centers distributed in different regions can be set up as distributed exchanges based on blockchain technology, so that the scarce processing resources of the trading center can be distributed in different regions, so that users in different regions can be distributed.
  • each trading center in the distributed exchange can receive the transaction orders submitted by the local user client and synchronize the received trading orders to other trading centers, and then the received trading orders can be processed. Transaction matching processing, generating transaction entrusted ledger.
  • each trading center can also synchronize the transaction entrusted ledger generated locally to other trading centers. And each transaction center can reach a consensus on the transaction entrusted ledger generated by each transaction center based on the consensus mechanism of the blockchain, and then execute the transaction orders in the transaction entrusted ledger passed by consensus to complete the transaction order submitted by the user.
  • each transaction center can synchronize the transaction orders submitted by local user clients with each other, and each transaction center can use the blockchain consensus mechanism to generate transactions generated by each transaction center based on the received transaction orders.
  • the transaction entrusted ledger has reached a consensus, so each trading center in the above-mentioned distributed exchanges will be equivalent in terms of processing capacity for transaction orders.
  • Different user clients can get equivalent peers by accessing local trading centers.
  • Trading opportunities; therefore, based on blockchain technology, several distributed trading centers in different regions are set up as distributed exchanges, which is fundamentally realized.
  • the scarce resources of the trading center are distributed and distributed to popularize scarce resources. , To ensure that users can get fair and effective trading opportunities.
  • FIG. 1 is a block chain-based financial transaction execution method provided by an embodiment of this specification, which is applied to any transaction center in a distributed exchange built on the block chain;
  • the distributed exchange includes several distributed trading centers, performing the following steps:
  • Step 102 Receive a transaction order submitted by a user client connected to a local transaction center;
  • Step 104 Send the received transaction order to each other transaction center in the blockchain; and, receive a user client connected to the other transaction centers sent by the other transaction centers. Submitted transaction orders;
  • Step 106 Perform transaction matching processing on the received transaction orders to generate a transaction entrusted ledger, and send the generated transaction entrusted ledger to each other transaction center in the blockchain; and, receive the other transaction centers sent by the other transaction centers.
  • the transaction entrustment ledger generated by the other transaction centers performing transaction matching processing on the received transaction orders; wherein the transaction entrusted ledger includes the transaction orders generated based on the transaction order matching;
  • Step 108 Initiate consensus processing on the transaction entrusted ledger generated by each trading center, and execute the transaction order in the transaction entrusted ledger passed by consensus.
  • the blockchain described in this specification may specifically include a private chain, a public chain, and an alliance chain, which are not particularly limited in this specification.
  • the above-mentioned blockchain may specifically be an alliance chain composed of server devices of several transaction centers as member devices. Users can access peer-to-peer trading opportunities through the user client's access to the server equipment of any of the trading centers in the above-mentioned alliance chain.
  • the transaction order described in this specification refers to a financial transaction order submitted by a user through a user client connected to a trading center; for example, a stock transaction order, a foreign exchange transaction order, and so on.
  • the operator of the blockchain can build several distributed transaction centers into a distributed exchange based on the blockchain technology.
  • the distributed exchange specifically refers to a new type of exchange in the form of a distributed structure composed of a number of trading centers distributed in different physical regions and having equal processing power for trading orders.
  • trading centers distributed in different regions can be set up as distributed exchanges based on blockchain technology, so that the scarce processing resources of the trading center can be distributed in different regions, so that Users in different regions can get fair and effective trading opportunities.
  • a trading center in a country or city where the trading population is denser globally, and then build each trading center into a distributed transaction based on blockchain technology.
  • the above blockchain is used as the alliance chain, and based on the alliance chain, the transaction centers distributed in different regions are set up as distributed exchanges as an example.
  • the operator of the alliance chain can build a network of alliance chains in advance, and server-side equipment (such as servers, server clusters, or transaction platforms based on server clusters) distributed in transaction centers in different regions can Join the alliance chain network as a member of the alliance chain.
  • each trading center can jointly maintain the exact same transaction market data to ensure that the initial data of each trading center is synchronized.
  • the clocks of server-side equipment located in different trading centers may not be synchronized; in this case, you can perform clock calibration and synchronization for each trading center to ensure that Clock synchronization can be achieved between server devices located in different trading centers; for example, in practical applications, clock calibration synchronization can be performed for each trading center to synchronize time between any two server devices in each trading center
  • the accuracy is controlled within a tolerable error range; for example, in the field of financial transactions, the synchronization time accuracy between any two server devices in each trading center can be controlled within 1 millisecond.
  • FIG. 2 is an architecture diagram of a distributed exchange based on the alliance chain shown in the present specification.
  • the trading centers 1-3 can access several user clients, and users can submit transaction orders to the server device of the connected trading center through the user client to complete a financial transaction.
  • each trading center can also synchronize the generated transaction entrusted ledger with each other to collect the entire network of transaction entrusted ledger generated by other transaction centers; then, the blockchain consensus mechanism can be used to The transaction entrusted ledger generated by the trading center reaches a consensus and executes the transaction orders in the agreed transaction entrusted ledger, so that user clients distributed in different regions can access equivalent trading opportunities by accessing the local transaction center.
  • each transaction center receives transaction orders submitted by the transaction client connected to the local transaction center, receives transaction orders sent by other transaction centers, and sends generated transaction commission books to other transaction centers. , And when receiving the generated transaction commission ledger sent synchronously by each other trading center, the corresponding processing timeout period can be set.
  • each transaction center when each transaction center receives a transaction order submitted by a transaction client connected to a local transaction center, it may receive a user client connected to the local transaction center and The information pushing time T0 is used as the transaction order submitted within the first preset time of the starting time. And when each trading center receives the transaction orders sent synchronously by other trading centers, it can determine the sending time of sending the received trading order to other trading centers, and then receive the other trading centers from the above sending time as the starting time. Orders sent within the second preset duration of.
  • each transaction center when each transaction center sends the generated transaction commission ledger to each other transaction center synchronously, it can determine the start time of the transaction matching processing on the received transaction order, which will be from the above. Within the first preset time period when the start time is the start time, the generated transaction commission ledger is sent to other trading centers. Correspondingly, when each trading center receives the generated transaction commission ledger sent by other trading centers, It is possible to determine the sending time of sending the generated transaction entrusted ledger to other trading centers, and to receive the transaction entrusted ledger sent by other trading centers within a second preset time period from the aforementioned sending time as the starting time.
  • the second preset duration shown above may be longer than the first preset duration. That is, in actual applications, the processing timeout period when each trading center sends a transaction order or a transaction entrusted ledger synchronously to each other transaction may be shorter than the time when each trading center receives the transaction order or transaction sent by other trading centers simultaneously. The processing timeout when the ledger was commissioned.
  • the first preset duration is 10 milliseconds and the second preset duration is 100 milliseconds.
  • first preset duration is 10 milliseconds and the above-mentioned second preset duration is 100 milliseconds as an example, which is merely exemplary. Obviously, in practical applications, those skilled in the art can customize the duration of the first preset duration and the duration of the second preset duration in combination with actual requirements.
  • the trading center 1-3 can simultaneously push the trading market information to the user clients connected to each trading center, so that the user can view the latest trading market information through the user client as a transaction reference. .
  • the above-mentioned transaction market information may specifically include information related to the transaction of financial products, which can be used as a user's transaction reference;
  • the above-mentioned transaction market information may specifically include information such as a price change of a stock.
  • each trading center when each trading center synchronously pushes the transaction market information to the user client, it can use a periodic push method
  • the sending cycle of transaction market information can use a microsecond time period (that is, the sending cycle can be small enough), so that each trading center can provide users accessing each trading center in a near real-time manner.
  • the client synchronously pushes the transaction market information.
  • transaction centers 1-3 send transaction information to user clients connected to each transaction center synchronously.
  • the user client closest to each transaction center will also receive priority information.
  • the latest trading market information Each user can view the above transaction market information through the user client as a transaction reference to understand the latest transaction market, and submit the initiated transaction order to the transaction center accessed by the transaction client through the transaction client.
  • each trading center after each trading center synchronizes the transaction market information to the user client connected to the local trading center at time T0, it can start timing at the same time, starting from time T0 as 10ms. Within, receive transaction orders submitted by user clients connected to the local trading center.
  • each trading center synchronously pushes the transaction market information to the user client connected to the local trading center at time T0, waits for 10ms, and receives the transaction order submitted by the user client connected to the local trading center within these 10ms.
  • the matching transaction processing can be performed in the next consensus cycle.
  • each transaction center After each transaction center receives the transaction order submitted by the accessed user client, it can first calculate the propagation delay of the received transaction order.
  • the propagation delay is specifically used to indicate that the user client is sending the transaction order. Transmission time to the connected transaction center.
  • the time delay between the time T0 (that is, the time when the above-mentioned transaction market information is pushed) and the time when the transaction order is received may be used to indicate the propagation delay of the transaction order.
  • each transaction center pushes the transaction market information to each user client that is accessed, and can record the current local time stamp as the time to push the above transaction market information; and each transaction center is receiving
  • the local timestamp of the received transaction order can also be recorded as the receiving time of the transaction order; then, each trading center can subtract the recorded receiving time of the transaction order from the recorded
  • the transaction time of the above-mentioned transaction market information is used to obtain the propagation time of the transaction order sent from the user client to the transaction center.
  • the propagation delay of a transaction order reaching each transaction center is an important parameter for performing transaction matching processing, so each transaction center will receive the
  • the propagation delay of each transaction order calculated can also be sent to other transaction centers together.
  • the transaction orders sent synchronously by each transaction center to other transaction centers can also carry the propagation delay of each transaction order.
  • each trading center will After receiving the transaction orders submitted by the user client connected to the local transaction center, the transaction orders are sent to other transaction centers simultaneously, and then a separate message is constructed, and then the propagation delay of each transaction order is transmitted to the other transaction centers. .
  • each trading center uses the time T0 as the starting time, after waiting for 10ms, it can immediately send the received order information to the other trading centers in the alliance chain.
  • a broadcast transmission method may be used to broadcast the received transaction order submitted by a user client connected to a local transaction center to other transaction centers in the above-mentioned alliance chain; for example, Taking the trading center 1 as an example, the trading center 1 may broadcast the received transaction order submitted by the user client connected to the trading center 1 to the trading center 2 and the trading center 3.
  • any one of the trading centers 1-3 in addition to sending the received transaction order submitted by the user client connected to the local trading center to other trading centers, it can also Receive transaction orders sent by other trading centers and submitted by user clients connected to other trading centers.
  • each trading center after each trading center sends the received trading orders to other trading centers simultaneously, it can start timing at the same time from T0 + 10ms (that is, the received trading orders are sent to other
  • the sending time of each trading center is a transaction order sent by other trading centers within 100ms as the starting time.
  • each trading center waits for 100ms after sending the received trading order to other trading centers simultaneously, and receives the trading order submitted by other trading centers within this 100ms.
  • each trading center sends the received trading orders to other trading centers simultaneously and waits for 100ms, at this time, regardless of whether each trading center has received all the trading orders sent by all trading centers, it can be based on immediately The transaction orders collected throughout the network began to be processed for transaction matching.
  • the transaction matching process started on the transaction orders collected across the entire network, that is, the process of matching the buy orders and sell orders in the collected transaction orders to generate a final transaction order.
  • the transaction centers when they perform transaction matching processing on the transaction orders collected across the entire network, they can receive the received sell orders; and, the purchase price is greater than or equal to the sell orders And the buy order with the shortest propagation time is subjected to transaction matching processing to generate a transaction order, and then based on the generated transaction order, a transaction commission ledger is further generated. In other words, only the orders recorded in the transaction order book can be concluded after matching.
  • each trading center can find a buy order whose purchase price is greater than or equal to the sell price of the above sell order for each sell order collected; if a buy price greater than or equal to is found
  • the buy order at the sell price of the above sell order.
  • the price of the buy order and the sell order is adapted.
  • a transaction order can be generated based on the sell order and the buy order. If it is matched, for a sell order, there are multiple buy orders with exactly the same price for the buy order. At this time, the above propagation delays of the multiple buy orders can be further compared. Based on the sell order Realize the smallest one or more buy orders with the above propagation to generate a transaction order,
  • each trading center when each trading center waits for 100ms and starts the transaction matching process, it may start timing at the same time from T0 + 10ms + 100ms (that is, the transaction matching process Start time) Within 10ms of the start time, the locally generated transaction entrusted ledger is sent to other trading centers simultaneously.
  • each trading center starts from T0 + 10ms + 100ms, waits for 10ms, and sends the transaction entrusted ledger generated within these 10ms to other trading centers simultaneously.
  • any one of the transaction centers 1-3 in addition to sending the locally generated transaction entrustment ledger to other transaction centers simultaneously, it can also receive the transaction entrusted ledger sent by other transaction centers.
  • each trading center after each trading center sends the locally generated transaction commission ledger to other trading centers, it can start timing at the same time, at the time from T0 + 10ms + 100ms + 10ms (that is, the locally generated The sending time when the transaction entrusted ledger is sent to other trading centers) Within 100ms as the starting time, the transaction entrusted ledger sent by other trading centers is received synchronously.
  • consensus algorithms such as pbft, raft, etc., which are widely used in the alliance chain, can also be adopted, or the operators of the alliance chain can customize the corresponding consensus algorithms based on actual business scenarios and requirements.
  • the consensus algorithm used by the above alliance chain is a series of Byzantine Fault Tolerance algorithms.
  • each transaction center when each transaction center agrees on the transaction entrusted ledger collected by the entire network, it can use The locally generated transaction commission ledger is compared with the received transaction commission ledger sent by other trading centers to determine the number of identical transaction commission ledgers in the transaction commission ledger generated by each trading centre; then, the same can be further calculated The ratio of the number of transaction entrusted ledgers to the total number of trading centers in the above-mentioned distributed exchanges, and determine whether the above ratio reaches the Byzantine fault tolerance threshold; if so, the same transactions in the transaction entrusted books generated by each trading center can be The entrusted ledger is determined as the transaction entrusted ledger passed by consensus.
  • the common Byzantine fault tolerance threshold of the Byzantine fault tolerance series of algorithms is 2/3.
  • each trading center is calculating the same number of transaction entrusted ledgers and the total number of trading centers in the above-mentioned distributed exchanges. After the ratio, it can be determined whether the above ratio reaches 2/3; if so, the consensus is reached at this time, the same transaction commission account in the transaction commission book generated by each trading center can be determined as the transaction commission book passed by consensus; for example, if Among the transaction commission books generated by the trading centers 1-3, the transaction commission books generated by the trading center 1 and the trading center 2 are exactly the same. At this time, the ratio of the number of the same transaction commission books to the total number of the trading center reaches 2/3. It is considered that the consensus is reached, and the transaction entrusted ledger generated by transaction center 1 and transaction center 2 is the transaction entrusted ledger passed by consensus.
  • the trading center 1-3 when the trading center 1-3 completes the consensus process shown above, it can execute the transaction orders included in the transaction commission book passed by consensus, and then return the execution results of the transaction orders in the transaction commission book passed by consensus. To the corresponding user client.
  • each transaction center can synchronize the transaction orders submitted by local user clients with each other, and each transaction center can use the blockchain's consensus mechanism to generate transaction matching processing for each transaction center based on the received transaction order.
  • the transaction entrusted ledger has reached a consensus, so the trading centers in the above-mentioned distributed exchanges will be equivalent in terms of processing transaction orders.
  • User clients distributed in different regions can access the local trading center by accessing the local trading center. Get peer-to-peer trading opportunities; therefore, based on blockchain technology, several distributed trading centers in different regions are set up as distributed exchanges, which is fundamentally realized.
  • the scarce resource of the trading center is distributed in different Regions, popularize scarce resources, and ensure that users in different regions can get fair and effective trading opportunities;
  • this specification also provides an embodiment of a blockchain-based financial transaction execution device.
  • the device can be applied to a distributed exchange built based on a blockchain; the distributed exchange includes a number of distributed transaction centers.
  • the embodiments of the blockchain-based financial transaction execution device of this specification can be applied to electronic devices.
  • the device embodiments may be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory through the processor of the electronic device in which it is located. In terms of hardware, as shown in FIG.
  • the electronic device in which the device is located in the embodiment may generally include other hardware according to the actual function of the electronic device, and details are not described herein again.
  • Fig. 4 is a block diagram of a blockchain-based financial transaction execution device according to an exemplary embodiment of the present specification.
  • the blockchain-based financial transaction execution device 40 may be applied to the electronic device shown in FIG. 2 and includes a receiving module 401, a sending module 402, a matching module 403, and an execution module 404.
  • the receiving module 401 receives a transaction order submitted by a user client connected to a local transaction center;
  • the sending module 402 sends the received transaction order to each other transaction center in the blockchain; and receives a user client sent by the other transaction centers and connected to the other transaction centers by customers Transaction order submitted by the client;
  • the matching module 403 performs transaction matching processing on the received transaction orders to generate a transaction entrusted account
  • the sending module 402 further: sends the generated transaction entrusted ledger to other trading centers in the blockchain; the receiving module 401 further: receives the sending from the other trading centers, and the other transactions The transaction commission ledger generated by the center by performing transaction matching processing on the received transaction orders; wherein the transaction commission ledger includes the transaction orders generated based on the transaction order matching;
  • the execution module 404 initiates consensus processing on the transaction entrusted ledger generated by each trading center, and executes the transaction order in the transaction entrusted ledger passed by consensus.
  • each trading center in the distributed exchange performs clock calibration synchronization in advance.
  • the sending module 402 further:
  • the receiving module Before the receiving module receives the transaction order submitted by the user client connected to the local transaction center, push the transaction market information to the user client connected to the local transaction center, and record the pushing time of the transaction market information.
  • the transaction order sent to other trading centers in the blockchain includes the propagation delay of the transaction order; wherein the propagation delay represents that the user client sends the transaction order to Transmission time of connected transaction centers.
  • the propagation time is a time interval between the time when the market information is pushed and the time when the transaction order is received.
  • the receiving module 401 further:
  • the receiving module 401 further:
  • the sending module 402 further:
  • the receiving module 401 further:
  • the first preset duration is greater than the first preset duration.
  • the transaction order includes a buy order and a sell order
  • the matching module 403 is a first matching module 403:
  • the transaction commission ledger is created based on the generated transaction order.
  • the execution module 404 the execution module 404:
  • the sending module 402 further:
  • the execution result of the transaction order in the consensus transaction commission ledger is returned to the corresponding user client.
  • the distributed exchange includes several trading centers distributed in different regions.
  • the relevant part may refer to the description of the method embodiment.
  • the device embodiments described above are only schematic, and the modules described as separate components may or may not be physically separated, and the components displayed as modules may or may not be physical modules, which may be located in One place, or can be distributed to multiple network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the solution in this specification. Those of ordinary skill in the art can understand and implement without creative efforts.
  • the system, device, module, or module described in the foregoing embodiments may be specifically implemented by a computer chip or entity, or may be implemented by a product having a certain function.
  • a typical implementation device is a computer, and the specific form of the computer may be a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email sending and receiving device, and a game control Desk, tablet computer, wearable device, or a combination of any of these devices.
  • this specification also provides an embodiment of an electronic device.
  • the electronic device can be applied to a distributed exchange built based on a blockchain; the distributed exchange includes several distributedly deployed trading centers; the electronic device includes: a processor and a memory for storing machine-executable instructions ; Among them, the processor and the memory are usually connected to each other through an internal bus. In other possible implementations, the device may further include an external interface to enable communication with other devices or components.
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the transaction order includes a buy order and a sell order
  • the processor By reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a blockchain-based financial transaction, the processor is caused to:
  • the transaction commission ledger is created based on the generated transaction order.
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the processor by reading and executing machine-executable instructions stored in the memory corresponding to control logic for execution of a financial transaction based on a blockchain, the processor is caused to:
  • the execution result of the transaction order in the consensus transaction commission ledger is returned to the corresponding user client.

Abstract

一种基于区块链的金融交易执行方法,应用于基于区块链搭建的分布式交易所;该分布式交易所包括若干分布式部署的交易中心,包括:接收连接至本地交易中心的用户客户端提交的交易订单;将接收到的交易订单发送至所述区块链中的其它各交易中心;接收其它各交易中心发送的,由连接至其它各交易中心的用户客户端提交的交易订单;对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至其它各交易中心;接收其它各交易中心发送的,由其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。

Description

基于区块链的金融交易执行方法及装置、电子设备 技术领域
本说明书一个或多个实施例涉及区块链技术领域,尤其涉及一种基于区块链的金融交易执行方法及装置、电子设备。
背景技术
区块链技术,也被称之为分布式账本技术,是一种由若干台计算设备共同参与“记账”,共同维护一份完整的分布式数据库的新兴技术。由于区块链技术具有去中心化、公开透明、每台计算设备可以参与数据库记录、并且各计算设备之间可以快速的进行数据同步的特性,使得区块链技术已在众多的领域中广泛的进行应用
发明内容
本说明书提出一种基于区块链的金融交易执行方法,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,所述方法包括:
接收连接至本地交易中心的用户客户端提交的交易订单;
将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
可选的,所述分布式交易所中的各交易中心预先进行了时钟校准同步。
可选的,所述接收连接至本地交易中心的用户客户端提交的交易订单之前,包括:
向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时刻。
可选的,发送至所述区块链中的其它各交易中心的交易订单中,包含所述交易订单的传播时延;其中,所述传播时延表征用户客户端将交易订单发送至连接的交易中心的传播时长。
可选的,所述传播时长为所述行情信息的推送时刻,与所述交易订单的接收时刻之间的时长间隔。
可选的,所述接收连接至本地交易中心的用户客户端提交的交易订单,包括:
接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
所述接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单,包括:
确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
可选的,所述将生成的交易委托账本发送至所述区块链中的其它各交易中心,包括:
确定对接收到的交易订单进行交易撮合处理的开始时刻;
将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本,包括:
确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
可选的,所述第一预设时长大于所述第一预设时长。
可选的,所述交易订单包括买入订单和卖出订单;
所述对接收到的交易订单进行交易撮合处理生成交易委托账本,包括:
对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
基于生成的成交订单创建所述交易委托账本。
可选的,所述发起对各交易中心生成的交易委托账本进行共识处理,包括:
将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
可选的,还包括:
将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
可选的,所述分布式交易所包括若干分布在不同地域的交易中心。
本说明书还提出一种基于区块链的金融交易执行装置,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,所述装置包括:
接收模块,接收连接至本地交易中心的用户客户端提交的交易订单;
发送模块,将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
撮合模块,对接收到的交易订单进行交易撮合处理生成交易委托账本;
所述发送模块进一步:将生成的交易委托账本发送至所述区块链中的其它各交易中心;所述接收模块进一步:接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
执行模块,发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
可选的,所述分布式交易所中的各交易中心预先进行了时钟校准同步。
可选的,所述发送模块进一步:
在所述接收模块接收连接至本地交易中心的用户客户端提交的交易订单之前,向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时 刻。
可选的,发送至所述区块链中的其它各交易中心的交易订单中,包含所述交易订单的传播时延;其中,所述传播时延表征用户客户端将交易订单发送至连接的交易中心的传播时长。
可选的,所述传播时长为所述行情信息的推送时刻,与所述交易订单的接收时刻之间的时长间隔。
可选的,所述接收模块进一步:
接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
所述接收模块进一步:
确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
可选的,所述发送模块进一步:
确定对接收到的交易订单进行交易撮合处理的开始时刻;
将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
所述接收模块进一步:
确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
可选的,所述第一预设时长大于所述第一预设时长。
可选的,所述交易订单包括买入订单和卖出订单;
所述撮合模块:
对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
基于生成的成交订单创建所述交易委托账本。
可选的,所述执行模块:
将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
可选的,所述发送模块进一步:
将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
可选的,所述分布式交易所包括若干分布在不同地域的交易中心。
本说明书还提出一种电子设备,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,包括:
处理器;
用于存储机器可执行指令的存储器;
其中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收连接至本地交易中心的用户客户端提交的交易订单;
将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
通过以上技术方案,由于各交易中心可以互相同步本地用户客户端提交的交易订单,并且各交易中心可以通过区块链的共识机制,对各交易中心基于接收到的交易订单进行 交易撮合处理生成的交易委托账本达成共识,因此上述分布式交易所中的各交易中心在对交易订单的处理能力上将是对等的,不同的用户客户端通过接入本地的交易中心,均能够得到对等的交易机会;从而,基于区块链技术,将若干分布式在不同地域的交易中心搭建成为分布式交易所,从根本上实现了,对交易中心这一稀缺资源进行分布式部署,使稀缺资源大众化,能够保障用户能够得到公平有效的交易机会。
附图说明
图1是一示例性实施例提供的一种基于区块链的金融交易执行方法的流程图。
图2是一示例性实施例提供的一种分布式交易所的架构图。
图3是一示例性实施例提供的一种电子设备的结构示意图。
图4是一示例性实施例提供的一种基于区块链的金融交易执行装置的框图。
具体实施方式
本说明书中,旨在提出一种基于区块链技术,将若干分布式部署的交易中心搭建成为分布式交易所,以对交易中心稀缺的处理资源进行分散,使稀缺资源大众化,从而可以保障用户能够得到公平有效的交易机会的技术方案。
在实现时,可以基于区块链技术,将若干分布式部署的交易中心搭建成为一个分布式交易所;
例如,在实现时,可以基于区块链技术将分布在不同地域的若干个交易中心搭建成为分布式交易所,从而可以将交易中心稀缺的处理资源分布在不同的地域,使处于不同地域的用户能够得到公平有效的交易机会
对于分布式交易所中的各交易中心而言,可以接收连接至本地的用户客户端提交的交易订单,并将接收到的交易订单同步到其它各交易中心,然后可以对接收到的交易订单进行交易撮合处理,生成交易委托账本。
进一步的,各交易中心还可以将在本地生成的交易委托账本,也同步到其它各交易中心。而各交易中心可以基于通过区块链的共识机制,对各交易中心生成的交易委托账本达成共识,然后执行共识通过的交易委托账本中的成交订单,完成对用户提交的交易订单的撮合成交。
通过以上技术方案,由于各交易中心可以互相同步本地用户客户端提交的交易订单,并且各交易中心可以通过区块链的共识机制,对各交易中心基于接收到的交易订单进行交易撮合处理生成的交易委托账本达成共识,因此上述分布式交易所中的各交易中心在对交易订单的处理能力上将是对等的,不同的用户客户端通过接入本地的交易中心,均能够得到对等的交易机会;从而,基于区块链技术,将若干分布式在不同地域的交易中心搭建成为分布式交易所,从根本上实现了,对交易中心这一稀缺资源进行分布式部署,使稀缺资源大众化,能够保障用户能够得到公平有效的交易机会。
下面通过具体实施例并结合具体的应用场景对本说明书进行描述。
请参考图1,图1是本说明书一实施例提供的一种基于区块链的金融交易执行方法,应用于基于区块链搭建的分布式交易所中的任一交易中心;其中,所述分布式交易所包括若干分布式部署的交易中心,执行以下步骤:
步骤102,接收连接至本地交易中心的用户客户端提交的交易订单;
步骤104,将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
步骤106,对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
步骤108,发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
在本说明书所描述的区块链,具体可以包括私有链、公有链以及联盟链等,在本说明书中不进行特别限定。
例如,在一个场景中,上述区块链具体可以是由若干交易中心的服务端设备作为成员设备组成的一个联盟链。用户可以通过用户客户端接入到上述联盟链中任意一个交易中心的服务端设备,来得到对等的交易机会。
在本说明书中所描述的交易订单,是指用户通过连接至交易中心的用户客户端提交的金融交易订单;例如,股票交易订单、外汇交易订单,等等。
在本说明书中,区块链的运营方可以基于区块链技术,将若干分布式部署的交易中心搭建成为一个分布式交易所。其中,分布式交易所,具体是指由若干分布在不同的物理地域,并且在对交易订单的处理能力对等的交易中心组成的,在架构上呈现一种分布式状态的新型交易所形态。
在示出的一种实施方式中,可以基于区块链技术将分布在不同地域的若干个交易中心搭建成为分布式交易所,从而可以将交易中心稀缺的处理资源分布在不同的地域,使处于不同地域的用户能够得到公平有效的交易机会。例如,在实际应用中,针对某一种具体的金融产品,可以在全球范围内交易人群较为密集的国家或者城市部署交易中心,然后基于区块链技术将各个交易中心搭建成为一个分布式的交易所。
以下以上述区块链为联盟链,基于联盟链将分布在不同地域的交易中心搭建成分布式交易所为例进行说明。在实现时,联盟链的运营方可以预先搭建一个联盟链网络,而分布在不同的地域的交易中心的服务端设备(比如可以是服务器、服务器集群、或者基于服务器集群搭建的交易平台),可以作为联盟链中的联盟成员加入到联盟链网络。
其中,交易中心的服务端设备,作为联盟成员加入至联盟链网络的具体实施过程,在本说明书中不再进行详述,本领域技术人员在将本说明书记载的技术方案付诸实现时,可以参考相关技术中的记载。
在本说明书中,为了确保组成上述分布式交易所的各交易中心,在对交易订单的处理能力上对等:
一方面,需要确保各交易中心的初始数据完全相同;例如,各交易中心可以共同维护完全相同的交易行情数据,以确保各交易中心的初始数据同步。
另一方面,由于各交易中心分布在不同的地域,因此位于不同的交易中心的服务端设备的时钟可能并不同步;在这种情况下,可以预先对各交易中心进行时钟校准同步,来确保位于不同的交易中心的服务端设备之间,可以达成时钟同步;例如,在实际应用中,可以对各交易中心进行时钟校准同步,将各交易中心的任意两台服务端设备之间的同步时间精度,控制在一个能够容忍的误差范围之内;比如,在金融交易领域,可以将各交易中心的任意两台服务端设备之间的同步时间精度控制在1毫秒之内。
请参见图2,图2为本说明书示出的一种基于联盟链搭建的分布式交易所的架构图。
以下将结合图2,以由交易中心1-3等三个位于不同地域的交易中心构成的分布 式交易所为例进行说明。
在本说明书中,交易中心1-3均可以接入若干用户客户端,用户可以通过用户客户端向接入的交易中心的服务端设备,提交交易订单,来完成一笔金融交易。
而对于交易中心1-3而言,可以互相同步本地的用户客户端提交的交易订单,来全网络收集接入各交易中心的用户客户端提交的交易订单,对收集到的交易订单进行交易撮合处理生成交易委托账本;进一步的,各交易中心还可以互相同步生成的交易委托账本,来全网络收集由其它各交易中心生成的交易委托账本;然后,可以通过区块链的共识机制,对各交易中心生成的交易委托账本达成共识,并执行达成共识的交易委托账本中的成交订单,使得分布在不同地域的用户客户端通过接入本地的交易中心,均能够得到对等的交易机会。
其中,需要说明的是,各交易中心在接收由连接至本地交易中心的交易客户端提交的交易订单、接收其它各交易中心同步发送的交易订单、向其它各交易中心同步发送生成的交易委托账本、以及接收由其它各交易中心同步发送的生成的交易委托账本时,均可以设置相应的处理超时时长。
例如,在示出的一种实施方式中,各交易中心在接收由连接至本地交易中心的交易客户端提交的交易订单时,可以接收连接至本地交易中心的用户客户端,在从上述交易行情信息的推送时刻T0作为起始时刻的第一预设时长之内提交的交易订单。而各交易中心在接收其它各交易中心同步发送的交易订单时,可以确定将接收到的交易订单发送至其它各交易中心的发送时刻,然后接收其它各交易中心在从上述发送时刻作为起始时刻的第二预设时长之内发送的交易订单。
进一步的,在示出的一种实施方式中,各交易中心在向其它各交易中心同步发送生成的交易委托账本时,可以确定对接收到的交易订单进行交易撮合处理的开始时刻,将从上述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至其它各交易中心;相应的,各交易中心在接收由其它各交易中心同步发送的生成的交易委托账本时,可以确定将生成的交易委托账本发送至其它各交易中心的发送时刻,并接收其它各交易中心在从上述发送时刻作为起始时刻的第二预设时长之内发送的交易委托账本。
其中,以上示出的第二预设时长,可以大于上述第一预设时长。也即,在实际应用中,各交易中心在向其它各交易中同步发送交易订单或者交易委托账本时的处理超 时时长,可以小于各交易中心在接收由其它各交易中心同步发送的交易订单或者交易委托账本时的处理超时时长。
通过这种方式,可以为各交易中心在全网络收集由其它各交易中心同步发送的交易订单或者交易委托账本时,预留出充足的收集时间。
在以下实施例中,将以上述第一预设时长为10毫秒,上述第二预设时长为100毫秒为例进行说明。
需要强调的是,以上述第一预设时长为10毫秒,上述第二预设时长为100毫秒为例,仅为示例性的。显然,在实际应用中,本领域技术人员可以结合实际的需求,对上述第一预设时长和上述第二预设时长的时长长度进行自定义设置。
请参见图2,在本说明书中,交易中心1-3可以同步的向接入各交易中心的用户客户端推送交易行情信息,使得用户可以通过用户客户端查看到最新的交易行情信息作为交易参考。
其中,上述交易行情信息具体可以包括与金融产品的交易相关,能够作为用户的交易参考的信息;
例如,在实际应用中,以股票交易为例,上述交易行情信息,具体可以包括诸如股票的价格变动等信息。
需要说明的是,各交易中心在向用户客户端同步推送交易行情信息时,可以采用周期性推送的方式;
例如,在实际应用中,交易行情信息的发送周期可以采用微秒级的时间周期(即发送周期可以足够小),从而使得各交易中心可以以近乎实时的方式,向接入各交易中心的用户客户端同步推送交易行情信息。
请继续参见图2,假设交易中心1-3在T0时刻,同步的向接入各交易中心的用户客户端发送了交易行情信息,此时距离各交易中心最近的用户客户端也会优先接收到最新的交易行情信息。各用户可以通过用户客户端查看上述交易行情信息作为交易参考,来了解最新的交易行情,并通过交易客户端将发起的交易订单提交至该交易客户端接入的交易中心。
在示出的一种实施方式中,各交易中心在T0时刻向连接至本地交易中心的用户客户端同步推送了交易行情信息后,可以同时开始计时,在从T0时刻作为起始时刻的 10ms之内,接收由连接至本地交易中心的用户客户端提交的交易订单。
也即,各交易中心在T0时刻向连接至本地交易中心的用户客户端同步推送了交易行情信息后,等待10ms,接收由连接至本地交易中心的用户客户端在这10ms内提交的交易订单。而对于各交易中心在从T0时刻作为起始时刻的10ms之外,继续接收到的交易订单,则可以在下一个共识周期进行撮合交易处理。
其中,各交易中心在接收到接入的用户客户端提交的交易订单后,首先可以统计接收到的交易订单的传播延时;上述传播延时,具体用于表征用户客户端在将交易订单发送至接入的交易中心的传播时长。
在示出的一种实施方式中,具体可以用上述T0时刻(即上述交易行情信息的推送时刻),与交易订单的接收时刻之间的时长间隔,来表示该交易订单的传播延时。
在这种情况下,各交易中心在T0时刻向接入的各用户客户端推送交易行情信息的同时,可以记录当前的本地时间戳作为上述交易行情信息的推送时刻;以及,各交易中心在收到用户客户端提交的交易订单时,还可以记录接收到该交易订单的本地时间戳作为该交易订单的接收时刻;然后,各交易中心可以将记录的该交易订单的接收时刻,减去记录的上述交易行情信息的推送时刻,来得到该交易订单,从用户客户端发送至交易中心的传播时长。
当然,在实际应用中,除了以上描述的,利用上述T0时刻,与交易订单的接收时刻之间的时长间隔,来表示该交易订单的传播延时以外,也可以仅利用交易订单的接收时刻来表示该交易订单的传播延时,在本说明书中不再进行特别限定。
在示出的另一种实施方式中,由于在金融交易的场景下,交易订单达到各交易中心的传播时延,是进行交易撮合处理的一个重要的参数,因此各交易中心在将接收到的,由连接至本地交易中心的用户客户端提交的交易订单同步发送至其它各交易中心时,也可以将统计出的各交易订单的传播时延,也一并发送给其它各交易中心。
在这种情况下,各交易中心向其它各交易中心同步发送的交易订单中,除了可以携带交易订单的原始信息以外,还可以携带各交易订单的传播时延。
当然,在实际应用中,各交易订单的传播时延,也可以不与交易订单同步一并发送,而是采用单独发送的方式,在本说明书中不进行特别限定;例如,各交易中心在将接收到的,由连接至本地交易中心的用户客户端提交的交易订单同步发送至其它各交易中心之后,再通过构建单独的消息,再将各交易订单的传播时延同步发送给其它各交 易中心。
请继续参见图2,当各交易中心以T0时刻作为起始时刻,等待10ms之后,可以立即将已经接收到的订单信息,同步发送给上述联盟链中的其它各交易中心。
例如,在一种实现方式中,可以采用广播发送的方式,将接收到的由连接至本地交易中心的用户客户端提交的交易订单,广播发送至上述联盟链中的其它各交易中心;比如,以交易中心1为例,交易中心1可以将接收到的由连接至交易中心1的用户客户端提交的交易订单,广播发送至交易中心2和交易中心3。
相应的,对于交易中心1-3中的任一交易中心来说,除了需要将接收到的由连接至本地交易中心的用户客户端提交的交易订单,同步发送至其它各交易中心以外,也可以接收其它各交易中心发送的,由连接至其它各交易中心的用户客户端提交的交易订单。
在示出的一种实施方式中,各交易中心在将接收到的交易订单同步发送至其它各交易中心后,可以同时开始计时,在从T0+10ms时刻(即将接收到的交易订单发送至其它各交易中心的发送时刻)作为起始时刻的100ms之内,由其它各交易中心发送的交易订单。
也即,各交易中心在将接收到的交易订单同步发送至其它各交易中心后,等待100ms,接收由其它各交易中心在这100ms内提交的交易订单。
在本说明书中,各交易中心在将接收到的交易订单同步发送至其它各交易中心,并且等待100ms之后,此时无论各交易中心是否接收到了所有交易中心同步发送的交易订单,都可以立即基于全网收集到的交易订单开始进行交易撮合处理。
其中,对全网收集到的交易订单开始进行交易撮合处理,即为对收集到的交易订单中的买入订单和卖出订单进行撮合,生成最终可以成交的成交订单的过程。
在示出的一种实施方式中,各交易中心在对全网收集到的交易订单进行交易撮合处理时,可以对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时长最小的买入订单进行交易撮合处理,生成成交订单,然后基于生成的成交订单,来进一步生成交易委托账本。也即,交易委托账本中记录的仅为经过撮合可以成交的订单。
在实现时,各交易中心,可以针对收集到的每一笔卖出订单,分别查找买入价格大于或者等于上述卖出订单的卖出价格的买入订单;如果查找到了买入价格大于或者 等于上述卖出订单的卖出价格的买入订单,此时买入订单和卖出订单的价格适配,可以基于该卖出订单和该买入订单生成成交订单。如果经过撮合,对于一笔卖出订单,存在价格适配的多笔买入价格完全相同的买入订单,此时可以进一步比较该多笔买入订单的上述传播时延,基于该卖出订单和上述传播实现最小的一笔或者多笔买入订单生成成交订单,
请继续参见图2,在示出的一种实施方式中,各交易中心在等待100ms之后,开始进行交易撮合处理时,可以同时开始计时,在从T0+10ms+100ms时刻(即交易撮合处理的开始时刻)作为起始时刻的10ms之内,本地生成的交易委托账本同步发送至其它各交易中心。
也即,各交易中心从T0+10ms+100ms时刻开始,再等待10ms,将在这10ms之内生成的交易委托账本同步发送至其它各交易中心。
相应的,对于交易中心1-3中的任一交易中心来说,除了需要将本地生成的交易委托账本,同步发送至其它各交易中心以外,也可以接收其它各交易中心发送的交易委托账本。
在示出的一种实施方式中,各交易中心在将本地生成的交易委托账本同步发送至其它各交易中心后,可以同时开始计时,在从T0+10ms+100ms+10ms时刻(即将本地生成的交易委托账本发送至其它各交易中心的发送时刻)作为起始时刻的100ms之内,接收由其它各交易中心同步发送的交易委托账本。
在本说明书中,当各交易中心全网收集到上述联盟链中的各交易中心生成的交易委托账本后,可以基于上述联盟链支持的共识算法,对收集到的交易委托账本进行共识处理。
其中,需要说明的是,在本说明中,上述联盟链采用的共识算法,在本说明书中不再进行特别限定;
例如,在实现时,可以采用诸如pbft、raft等在联盟链应用较为广泛的共识算法,也可以由联盟链的运营方基于实际的业务场景和需求,来定制相应的共识算法。
在示出的一种实施方式中,以上述联盟链采用的共识算法为拜占庭容错(Byzantine Fault Tolerance)系列算法为例,各交易中心在对全网收集到的交易委托账本进行共识时,可以将本地生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,来确定各交易中心生成的交易委托账本中相同的交易委托账 本的数量;然后,可以进一步计算相同的交易委托账本的数量,与上述分布式交易所中的交易中心的总数量的比值,并确定上述比值是否达到拜占庭容错阈值;如果是,可以将由各交易中心生成的交易委托账本中相同的交易委托账本,确定为共识通过的交易委托账本。
其中,上述拜占庭容错阈值的具体取值,在实际应用中,可以由联盟链的运营方基于实际的需求进行自定义设置;
例如,拜占庭容错系列算法通用的拜占庭容错阈值为2/3,在这种情况下,各交易中心在计算出相同的交易委托账本的数量,与上述分布式交易所中的交易中心的总数量的比值后,可以确定上述比值是否达到2/3;如果是,此时共识达成,可以将由各交易中心生成的交易委托账本中相同的交易委托账本,确定为共识通过的交易委托账本;比如,如果交易中心1-3分别生成的交易委托账本中,交易中心1和交易中心2生成的交易委托账本完全相同,此时相同的交易委托账本的数量与交易中心总数量的比值达到2/3,可以认为共识达成,交易中心1和交易中心2生成的交易委托账本为共识通过的交易委托账本。
在本说明书中,当交易中心1-3完成以上示出的共识过程,可以执行共识通过的交易委托账本中收录的成交订单,然后将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
通过以上技术方案,由于各交易中心可以互相同步本地的用户客户端提交的交易订单,并且各交易中心可以通过区块链的共识机制,对各交易中心基于接收到的交易订单进行交易撮合处理生成的交易委托账本达成共识,因此上述分布式交易所中的各交易中心在对交易订单的处理能力上将是对等的,分布在不同地域的用户客户端通过接入本地的交易中心,均能够得到对等的交易机会;从而,基于区块链技术,将若干分布式在不同地域的交易中心搭建成为分布式交易所,从根本上实现了,将交易中心这一稀缺资源,分布在不同的地域,使稀缺资源大众化,能够保障处于不同地域的用户能够得到公平有效的交易机会;
例如,传统的交易所均采用中心化的架构,由于交易规则规定,在对由用户提交的买入订单和卖出订单进行撮合成交的过程中,先到达交易所的交易订单会优先处理,也即在物理地域上距离交易所更近的用户,可能会得到优先成交的机会;然而,这种看起来公平的规则,会导致距离交易所较近的位置为稀缺资源,只有少数资金雄厚的机构或者个人才能够得到这种位置。而基于本方案,如果基于区块链技术,将若干分布式在 不同地域的交易中心搭建成为分布式交易所,由于分布在不同地域的用户客户端通过接入本地的交易中心,均能够得到对等的交易机会,因此相当于将交易中心这一稀缺资源大众化,使得不同地域的用户能够得到公平有效的交易机会。
与上述方法实施例相对应,本说明书还提供了一种基于区块链的金融交易执行装置的实施例。所述装置可以应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心。本说明书的基于区块链的金融交易执行装置的实施例可以应用在电子设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在电子设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图3所示,为本说明书的基于区块链的金融交易执行装置所在电子设备的一种硬件结构图,除了图3所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的电子设备通常根据该电子设备的实际功能,还可以包括其他硬件,对此不再赘述。
图4是本说明书一示例性实施例示出的一种基于区块链的金融交易执行装置的框图。
请参考图4,所述基于区块链的金融交易执行装置40可以应用在前述图2所示的电子设备中,包括有:接收模块401、发送模块402、撮合模块403和执行模块404。
接收模块401,接收连接至本地交易中心的用户客户端提交的交易订单;
发送模块402,将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
撮合模块403,对接收到的交易订单进行交易撮合处理生成交易委托账本;
所述发送模块402进一步:将生成的交易委托账本发送至所述区块链中的其它各交易中心;所述接收模块401进一步:接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
执行模块404,发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
在本实施例中,所述分布式交易所中的各交易中心预先进行了时钟校准同步。
在本实施例中,所述发送模块402进一步:
在所述接收模块接收连接至本地交易中心的用户客户端提交的交易订单之前,向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时刻。
在本实施例中,发送至所述区块链中的其它各交易中心的交易订单中,包含所述交易订单的传播时延;其中,所述传播时延表征用户客户端将交易订单发送至连接的交易中心的传播时长。
在本实施例中,所述传播时长为所述行情信息的推送时刻,与所述交易订单的接收时刻之间的时长间隔。
在本实施例中,所述接收模块401进一步:
接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
所述接收模块401进一步:
确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
在本实施例中,所述发送模块402进一步:
确定对接收到的交易订单进行交易撮合处理的开始时刻;
将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
所述接收模块401进一步:
确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
在本实施例中,所述第一预设时长大于所述第一预设时长。
在本实施例中,所述交易订单包括买入订单和卖出订单;
所述撮合模块403:
对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
基于生成的成交订单创建所述交易委托账本。
在本实施例中,所述执行模块404:
将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
在本实施例中,所述发送模块402进一步:
将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
在本实施例中,所述分布式交易所包括若干分布在不同地域的交易中心。
上述装置中各个模块的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本说明书方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
上述实施例阐明的系统、装置、模块或模块,具体可以由计算机芯片或实体实现,或者由具有某种功能的产品来实现。一种典型的实现设备为计算机,计算机的具体形式可以是个人计算机、膝上型计算机、蜂窝电话、相机电话、智能电话、个人数字助理、媒体播放器、导航设备、电子邮件收发设备、游戏控制台、平板计算机、可穿戴设备或者这些设备中的任意几种设备的组合。
与上述方法实施例相对应,本说明书还提供了一种电子设备的实施例。所述电 子设备可以应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心;该电子设备包括:处理器以及用于存储机器可执行指令的存储器;其中,处理器和存储器通常通过内部总线相互连接。在其他可能的实现方式中,所述设备还可能包括外部接口,以能够与其他设备或者部件进行通信。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收连接至本地交易中心的用户客户端提交的交易订单;
将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收连接至本地交易中心的用户客户端提交的交易订单之前,向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时刻。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内 发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
确定对接收到的交易订单进行交易撮合处理的开始时刻;
将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
在本实施例中,所述交易订单包括买入订单和卖出订单;
通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
基于生成的成交订单创建所述交易委托账本。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
在本实施例中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本说明书的其它实施方案。本说明书旨在涵盖本说明书的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本说明书的一般性原理并包括本说明书未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本说明书的真正范围和精神由下面的权利要求指出。
应当理解的是,本说明书并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本说明书的范围仅由所附的权利要求来限制。
以上所述仅为本说明书的较佳实施例而已,并不用以限制本说明书,凡在本说明书的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本说明书保护的范围之内。

Claims (25)

  1. 一种基于区块链的金融交易执行方法,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,所述方法包括:
    接收连接至本地交易中心的用户客户端提交的交易订单;
    将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
    对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
    发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
  2. 根据权利要求1所述的方法,所述分布式交易所中的各交易中心预先进行了时钟校准同步。
  3. 根据权利要求1所述的方法,所述接收连接至本地交易中心的用户客户端提交的交易订单之前,包括:
    向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时刻。
  4. 根据权利要求3所述的方法,发送至所述区块链中的其它各交易中心的交易订单中,包含所述交易订单的传播时延;其中,所述传播时延表征用户客户端将交易订单发送至连接的交易中心的传播时长。
  5. 根据权利要求4所述的方法,所述传播时长为所述行情信息的推送时刻,与所述交易订单的接收时刻之间的时长间隔。
  6. 根据权利要求3所述的方法,所述接收连接至本地交易中心的用户客户端提交的交易订单,包括:
    接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
    所述接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单,包括:
    确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
    接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发 送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
  7. 根据权利要求6所述的方法,所述将生成的交易委托账本发送至所述区块链中的其它各交易中心,包括:
    确定对接收到的交易订单进行交易撮合处理的开始时刻;
    将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
    接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本,包括:
    确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
    接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
  8. 根据权利要求6或7所述的方法,所述第一预设时长大于所述第一预设时长。
  9. 根据权利要求3所述的方法,所述交易订单包括买入订单和卖出订单;
    所述对接收到的交易订单进行交易撮合处理生成交易委托账本,包括:
    对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
    基于生成的成交订单创建所述交易委托账本。
  10. 根据权利要求1所述的方法,所述发起对各交易中心生成的交易委托账本进行共识处理,包括:
    将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
    计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
    确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
  11. 根据权利要求1所述的方法,还包括:
    将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
  12. 根据权利要求1所述的方法,所述分布式交易所包括若干分布在不同地域的交易中心。
  13. 一种基于区块链的金融交易执行装置,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,所述装置包括:
    接收模块,接收连接至本地交易中心的用户客户端提交的交易订单;
    发送模块,将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
    撮合模块,对接收到的交易订单进行交易撮合处理生成交易委托账本;
    所述发送模块进一步:将生成的交易委托账本发送至所述区块链中的其它各交易中心;所述接收模块进一步:接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
    执行模块,发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
  14. 根据权利要求13所述的装置,所述分布式交易所中的各交易中心预先进行了时钟校准同步。
  15. 根据权利要求13所述的装置,所述发送模块进一步:
    在所述接收模块接收连接至本地交易中心的用户客户端提交的交易订单之前,向连接至本地交易中心的用户客户端推送交易行情信息,并记录所述交易行情信息的推送时刻。
  16. 根据权利要求15所述的装置,发送至所述区块链中的其它各交易中心的交易订单中,包含所述交易订单的传播时延;其中,所述传播时延表征用户客户端将交易订单发送至连接的交易中心的传播时长。
  17. 根据权利要求16所述的装置,所述传播时长为所述行情信息的推送时刻,与所述交易订单的接收时刻之间的时长间隔。
  18. 根据权利要求15所述的装置,所述接收模块进一步:
    接收连接至本地交易中心的用户客户端,在从所述推送时刻作为起始时刻的第一预设时长之内提交的交易订单;
    所述接收模块进一步:
    确定将接收到的交易订单发送至区块链中的其它各交易中心的发送时刻;
    接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单。
  19. 根据权利要求18所述的装置,所述发送模块进一步:
    确定对接收到的交易订单进行交易撮合处理的开始时刻;
    将从所述开始时刻作为起始时刻的第一预设时长之内,生成的交易委托账本发送至所述区块链中的其它各交易中心;
    所述接收模块进一步:
    确定将生成的交易委托账本发送至所述区块链中的其它各交易中心的发送时刻;
    接收所述其它各交易中心在从所述发送时刻作为起始时刻的第二预设时长之内发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本。
  20. 根据权利要求18或19所述的装置,所述第一预设时长大于所述第一预设时长。
  21. 根据权利要求13所述的装置,所述交易订单包括买入订单和卖出订单;
    所述撮合模块:
    对接收到的卖出订单;以及,买入价格大于或者等于所述卖出订单,并且所述传播时延最小的买入订单进行交易撮合处理,生成成交订单;
    基于生成的成交订单创建所述交易委托账本。
  22. 根据权利要求13所述的装置,所述执行模块:
    将生成的交易委托账本与接收到的由其它各交易中心发送的交易委托账本分别进行比对,以确定各交易中心生成的交易委托账本中的相同数量;
    计算所述相同数量与所述分布式交易所中的交易中心总数量的比值;
    确定所述比值是否达到预设阈值;如果是,将所述各交易中心生成的交易委托账本中相同的交易委托账本确定为共识通过的交易委托账本。
  23. 根据权利要求13所述的装置,所述发送模块进一步:
    将共识通过的交易委托账本中的成交订单的执行结果,返回给对应的用户客户端。
  24. 根据权利要求13所述的装置,所述分布式交易所包括若干分布在不同地域的交易中心。
  25. 一种电子设备,应用于基于区块链搭建的分布式交易所;所述分布式交易所包括若干分布式部署的交易中心,包括:
    处理器;
    用于存储机器可执行指令的存储器;
    其中,通过读取并执行所述存储器存储的与基于区块链的金融交易执行的控制逻辑对应的机器可执行指令,所述处理器被促使:
    接收连接至本地交易中心的用户客户端提交的交易订单;
    将接收到的所述交易订单发送至所述区块链中的其它各交易中心;以及,接收所述 其它各交易中心发送的,由连接至所述其它各交易中心的用户客户端提交的交易订单;
    对接收到的交易订单进行交易撮合处理生成交易委托账本,并将生成的交易委托账本发送至所述区块链中的其它各交易中心;以及,接收所述其它各交易中心发送的,由所述其它各交易中心对接收到的交易订单进行交易撮合处理生成的交易委托账本;其中,所述交易委托账本包括基于交易订单撮合生成的成交订单;
    发起对各交易中心生成的交易委托账本进行共识处理,并执行共识通过的交易委托账本中的成交订单。
PCT/CN2019/091042 2018-07-23 2019-06-13 基于区块链的金融交易执行方法及装置、电子设备 WO2020019891A1 (zh)

Priority Applications (3)

Application Number Priority Date Filing Date Title
EP19841859.2A EP3792858A4 (en) 2018-07-23 2019-06-13 PROCESS AND APPARATUS FOR EXECUTING FINANCIAL NEGOTIATION BASED ON A CHAIN OF BLOCKS, AND ELECTRONIC DEVICE
SG11202011053VA SG11202011053VA (en) 2018-07-23 2019-06-13 Blockchain-based financial trading executing method and apparatus, and electronic device
US17/086,194 US20210049695A1 (en) 2018-07-23 2020-10-30 Blockchain-based financial trading executing method and apparatus, and electronic device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810813386.6 2018-07-23
CN201810813386.6A CN109087082B (zh) 2018-07-23 2018-07-23 基于区块链的金融交易执行方法及装置、电子设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US17/086,194 Continuation US20210049695A1 (en) 2018-07-23 2020-10-30 Blockchain-based financial trading executing method and apparatus, and electronic device

Publications (1)

Publication Number Publication Date
WO2020019891A1 true WO2020019891A1 (zh) 2020-01-30

Family

ID=64838117

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/091042 WO2020019891A1 (zh) 2018-07-23 2019-06-13 基于区块链的金融交易执行方法及装置、电子设备

Country Status (6)

Country Link
US (1) US20210049695A1 (zh)
EP (1) EP3792858A4 (zh)
CN (1) CN109087082B (zh)
SG (1) SG11202011053VA (zh)
TW (1) TWI754819B (zh)
WO (1) WO2020019891A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112184438A (zh) * 2020-09-27 2021-01-05 北京金山云网络技术有限公司 一种区块链交易监控方法、装置及区块链节点

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109087082B (zh) * 2018-07-23 2020-06-23 阿里巴巴集团控股有限公司 基于区块链的金融交易执行方法及装置、电子设备
CN110097365A (zh) * 2019-04-29 2019-08-06 迅鳐成都科技有限公司 一种基于海量区块审计技术的交易监管系统及机制
CN110246006A (zh) * 2019-05-26 2019-09-17 必成汇(成都)科技有限公司 分布式环境动态分配撮合任务量的方法
CN112766575A (zh) * 2021-01-21 2021-05-07 中信银行股份有限公司 一种基于复杂订单的智能路由方法及系统
CN113110983B (zh) * 2021-04-01 2023-04-11 深圳华锐分布式技术股份有限公司 交易系统时延的处理方法、装置、计算机设备和存储介质
WO2023023168A1 (en) * 2021-08-17 2023-02-23 Tobkin Joshua Satellite and miniature atomic clocks for near perfect time for distributed blockchain non-interactive synchronization
US20240029157A1 (en) * 2022-07-21 2024-01-25 Ava Labs, Inc. Secure and trustworthy crossing network for transferring assets outside of exchange

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038638A (zh) * 2017-02-24 2017-08-11 杭州象链网络技术有限公司 一种基于联盟链的股权登记交易系统构建方法
US20180204213A1 (en) * 2017-01-17 2018-07-19 HashLynx Inc. System for facilitating secure electronic communications between entities and processing resource transfers
CN109087082A (zh) * 2018-07-23 2018-12-25 阿里巴巴集团控股有限公司 基于区块链的金融交易执行方法及装置、电子设备

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101098270A (zh) * 2006-06-30 2008-01-02 西门子通信技术(北京)有限公司 一种分布式对等网络系统
CN104008504A (zh) * 2014-06-12 2014-08-27 天津大学 基于Multi-Agent的股票市场分布式仿真方法
CN107615317A (zh) * 2015-03-31 2018-01-19 纳斯达克公司 区块链交易记录的系统和方法
EP3281163B1 (en) * 2015-04-05 2023-12-13 Digital Asset (Switzerland) GmbH Digital asset intermediary electronic settlement platform
KR101628009B1 (ko) * 2015-04-20 2016-06-13 주식회사 코인플러그 당사자간 블록체인을 갖는 디지털 가상화폐의 거래시스템
US20170011460A1 (en) * 2015-07-09 2017-01-12 Ouisa, LLC Systems and methods for trading, clearing and settling securities transactions using blockchain technology
CN113159948A (zh) * 2016-01-24 2021-07-23 杭州复杂美科技有限公司 区块链撮合交易所
US11037211B2 (en) * 2016-08-04 2021-06-15 Clarovia Holdings, Llc Systems and methods for using smart contracts to control the trade, supply, manufacture, and distribution of commodities
TWM543413U (zh) * 2016-12-05 2017-06-11 Taiwan United Financial Technology Co Ltd 利用區塊鏈技術進行交易的網路借貸平台
CN106530088B (zh) * 2016-12-19 2023-11-17 杜伯仁 基于区块链安全节点对证券产品进行交易的方法
KR101751025B1 (ko) * 2017-01-03 2017-06-26 주식회사 온더 블록체인 기반의 스마트 증권업무 처리 시스템
CN107330788B (zh) * 2017-06-15 2021-01-26 沈陶磊 一种区块链数字资产交易撮合方法、系统、装置及介质
CN107248076A (zh) * 2017-06-24 2017-10-13 北京天德科技有限公司 一种双链式跨链交易的区块链互联网模型的核心算法
US11386493B2 (en) * 2018-07-13 2022-07-12 Toffee Merger Sub Ii, Llc System and method for cryptocurrency trading

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180204213A1 (en) * 2017-01-17 2018-07-19 HashLynx Inc. System for facilitating secure electronic communications between entities and processing resource transfers
CN107038638A (zh) * 2017-02-24 2017-08-11 杭州象链网络技术有限公司 一种基于联盟链的股权登记交易系统构建方法
CN109087082A (zh) * 2018-07-23 2018-12-25 阿里巴巴集团控股有限公司 基于区块链的金融交易执行方法及装置、电子设备

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP3792858A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112184438A (zh) * 2020-09-27 2021-01-05 北京金山云网络技术有限公司 一种区块链交易监控方法、装置及区块链节点

Also Published As

Publication number Publication date
TWI754819B (zh) 2022-02-11
CN109087082B (zh) 2020-06-23
US20210049695A1 (en) 2021-02-18
EP3792858A1 (en) 2021-03-17
SG11202011053VA (en) 2020-12-30
CN109087082A (zh) 2018-12-25
EP3792858A4 (en) 2021-06-30
TW202008254A (zh) 2020-02-16

Similar Documents

Publication Publication Date Title
WO2020019891A1 (zh) 基于区块链的金融交易执行方法及装置、电子设备
TWI690184B (zh) 跨區塊鏈的認證方法及裝置、電子設備
WO2020207090A1 (zh) 基于区块链的数据处理系统、方法、计算设备及存储介质
TWI679874B (zh) 跨區塊鏈的認證方法及裝置、電子設備
CN108717630B (zh) 一种出块方法及其实现系统
US11126659B2 (en) System and method for providing a graph protocol for forming a decentralized and distributed graph database
US20190012662A1 (en) Systems, methods, and devices for reducing and/or eliminating data leakage in electronic ledger technologies for trustless order matching
CN109003078A (zh) 基于区块链的智能合约调用方法及装置、电子设备
TWI727467B (zh) 聯盟鏈的可信度驗證方法、系統、裝置及設備
CN109146679A (zh) 基于区块链的智能合约调用方法及装置、电子设备
CN112424810A (zh) 实现区块链分布式分类账的基于分布式协调引擎的兑汇的方法、设备和系统
CN108898390A (zh) 基于区块链的智能合约调用方法及装置、电子设备
CN110115001A (zh) 促进实用拜占庭容错区块链共识和节点同步
CN110009338B (zh) 基于区块链的记账方法及装置、电子设备
CN109522362A (zh) 基于区块链数据的非完全数据同步方法、系统及设备
TW201822033A (zh) 資源處理方法及裝置
EP3905178A1 (en) Blockchain-based resource allocation method and apparatus, and electronic device
WO2020220764A1 (zh) 基于区块链的数据压缩、查询方法及装置和电子设备
TWI717660B (zh) 資金流動報表生成方法及裝置和電子設備
WO2020108289A1 (zh) 一种数据库系统、节点和方法
WO2020134606A1 (zh) 基于区块链的发票冲红方法及装置和电子设备
WO2022262510A1 (zh) 跨区块链交易同步的方法和装置
KR20210146274A (ko) 암호화폐의 합산 거래 시스템 및 방법
CN110278246B (zh) 一种针对联盟链的存证业务转移方法、装置及设备
CN110544143B (zh) 一种拼团信用项目的合约建立方法及装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19841859

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: 2019841859

Country of ref document: EP

Effective date: 20201105

NENP Non-entry into the national phase

Ref country code: DE