WO2020015533A1 - Transaction processing method and apparatus, and blockchain system - Google Patents

Transaction processing method and apparatus, and blockchain system Download PDF

Info

Publication number
WO2020015533A1
WO2020015533A1 PCT/CN2019/094557 CN2019094557W WO2020015533A1 WO 2020015533 A1 WO2020015533 A1 WO 2020015533A1 CN 2019094557 W CN2019094557 W CN 2019094557W WO 2020015533 A1 WO2020015533 A1 WO 2020015533A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
sub
partition
account
transaction request
Prior art date
Application number
PCT/CN2019/094557
Other languages
French (fr)
Chinese (zh)
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 深圳市网心科技有限公司
Publication of WO2020015533A1 publication Critical patent/WO2020015533A1/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
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Definitions

  • the present invention relates to the field of blockchain technology, and in particular, to a transaction processing method, device, and blockchain system.
  • a transaction processing method applied to a bookkeeping node in a sub-blockchain partition corresponding to a transferor account includes:
  • a judging unit configured to judge whether the sub-blockchain partition corresponding to the transfer-in account and the sub-blockchain partition corresponding to the transfer-out account are the same;
  • a sending unit is configured to send the transaction request to a sub-blockchain partition corresponding to the transferor account.
  • the accounting node in the sub-blockchain partition corresponding to the transferee account receives the transaction request initiated by the client.
  • the accounting node in the sub-blockchain partition corresponding to the transferee account It can directly receive the transaction request sent by the client.
  • the transaction request initiated by the client can be sent to other than the accounting nodes in the sub-blockchain partition corresponding to the transferee account.
  • the bookkeeping node in the sub-blockchain partition corresponding to the transferor account above receives the transaction request from other nodes.
  • the transaction processing method disclosed in this embodiment implements cross-regional transactions based on the blockchain partition.
  • Each sub-blockchain partition only needs to process transactions related to its corresponding account.
  • Multiple sub-blockchain partitions can process multiple transactions in parallel. Account-related transactions, improving transaction processing efficiency.
  • An embodiment of the present invention provides a storage medium on which a program is stored, and the program implements the foregoing transaction processing method when executed by a processor.

Abstract

Provided are a transaction processing method and apparatus, and a blockchain system. The method comprises: an accounting node in a blockchain sub-partition corresponding to a transferor account receiving a transaction request initiated by a client, and acquiring relevant information of blockchain sub-partitions from a main blockchain partition; determining, according to the relevant information, a blockchain sub-partition corresponding to a transferee account; and if the blockchain sub-partition corresponding to the transferee account is different from the blockchain sub-partition corresponding to the transferor account, after a transferor processes the transaction request, forwarding the transaction request to an accounting node in the blockchain sub-partition corresponding to the transferee account, so that the transferee processes the transaction request. On the basis of blockchain partitions, cross-partition transactions are realized; and each blockchain sub-partition only needs to process transactions related to an account corresponding thereto, and multiple blockchain sub-partitions can process transactions related to multiple accounts in parallel, thereby improving the transaction processing efficiency.

Description

交易处理方法、装置及区块链系统Transaction processing method, device and blockchain system
本申请要求于2018年07月19日提交中国专利局、申请号为201810798598.1、发明名称为“交易处理方法、装置及区块链系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed on July 19, 2018 with the Chinese Patent Office under the application number 201810798598.1 and the invention name is "Transaction Processing Method, Device and Blockchain System", the entire contents of which are incorporated herein by reference. In this application.
技术领域Technical field
本发明涉及区块链技术领域,具体涉及一种交易处理方法、装置及区块链系统。The present invention relates to the field of blockchain technology, and in particular, to a transaction processing method, device, and blockchain system.
背景技术Background technique
区块链技术是利用块链式数据结构来验证与存储数据、利用分布式节点共识算法来生成和更新数据、利用密码学的方式保证数据传输和访问的安全、利用由自动化脚本代码组成的智能合约来编程和操作数据的一种全新的分布式基础架构与计算范式。区块链技术本身具有很多优势:一方面,由于区块链网络能够通过算法实现自我约束,任何恶意欺骗系统的行为都会遭到网络中其他节点的排斥和抑制,因此,区块链系统无需依赖中央权威机构支撑和信用背书即可实现安全的网络交易。另一方面,由于区块链采取单向哈希算法,同时每个新产生的区块严格按照时间线性顺序推进,时间的不可逆性导致任何试图入侵篡改区块链内数据信息的行为都很容易被追溯,导致被其他节点的排斥,从而可以限制相关不法行为。因此,区块链技术在金融、银行等各大领域得到了日益广泛的应用。Blockchain technology is to use block chain data structure to verify and store data, use distributed node consensus algorithm to generate and update data, use cryptography to ensure the security of data transmission and access, and use intelligence composed of automated script code. A new distributed infrastructure and computing paradigm for contracts to program and manipulate data. Blockchain technology itself has many advantages: On the one hand, because the blockchain network can implement self-restraint through algorithms, any malicious deception of the system will be rejected and suppressed by other nodes in the network, so the blockchain system does not need to rely on The support and credit endorsement of the central authority can realize secure network transactions. On the other hand, because the blockchain adopts a one-way hash algorithm, and each newly generated block advances in strict linear order of time, the irreversibility of time causes any attempt to invade and tamper with the data information in the blockchain. Being traced back leads to exclusion by other nodes, which can limit related wrongdoing. Therefore, blockchain technology has been increasingly widely used in various fields such as finance and banking.
但是,传统的区块链系统,每一笔资产交易均需要通过系统中所有区块链节点的处理,整个区块链系统处理交易的速度受限于单个区块链节点的处理能力,多笔交易无法并发执行,导致交易处理效率低下。However, in traditional blockchain systems, each asset transaction needs to be processed by all blockchain nodes in the system. The processing speed of the entire blockchain system is limited by the processing capacity of a single blockchain node. Transactions cannot be executed concurrently, resulting in inefficient transaction processing.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种交易处理方法及装置。In view of the above problems, the present invention is provided in order to provide a transaction processing method and device that overcome the above problems or at least partially solve the above problems.
一种交易处理方法,应用于转出方账号对应的子区块链分区内的记账节点,所述方法包括:A transaction processing method applied to a bookkeeping node in a sub-blockchain partition corresponding to a transferor account, the method includes:
接收由客户端发起的交易请求;Receiving a transaction request initiated by a client;
从所述交易请求中获取转入方账号;Obtaining the transferee account number from the transaction request;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;Determining the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition;
判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;Judging whether the sub-blockchain partition corresponding to the transferee account and the sub-blockchain partition corresponding to the transferee account are the same;
如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, it is determined that the transfer-in account corresponds to according to the relevant information of each sub-blockchain partition. Accounting nodes within the sub-blockchain partitions;
在所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。After the accounting node in the sub-blockchain partition corresponding to the transferee account processes the transaction request, the transaction request is forwarded to the sub-blockchain partition corresponding to the transferee account. The bookkeeping node processes the transaction request with a bookkeeping node in a sub-blockchain partition corresponding to the transferee account.
可选的,所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理,包括:Optionally, the processing of the transaction request by an accounting node in a sub-blockchain partition corresponding to the transferor account includes:
确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
从所述转出方账号对应的资产中扣除所述资产数额;Deducting the amount of the asset from the asset corresponding to the transferor account;
在从所述转出方账号对应的资产中扣除所述资产数额之后,将跨分区同步信息记录到所述转出方账号对应的子区块链分区内的merkle tree中。After the amount of the assets is deducted from the assets corresponding to the transferor account, cross-sector synchronization information is recorded in a merkle tree in a sub-blockchain partition corresponding to the transferor account.
可选的,所述将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,包括:Optionally, the forwarding the transaction request to an accounting node in a sub-blockchain partition corresponding to the transferee account includes:
将所述交易请求及所述跨分区同步信息转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点根据所述跨分区同步信息确认在所述转出方账号对应的资产中扣除所述资产数额之后,在所述转入方账号对应的资产中增加所述资产数额。Forward the transaction request and the cross-segment synchronization information to an accounting node in a sub-blockchain partition corresponding to the transferee account, and use the After the bookkeeping node confirms that the amount of the asset is deducted from the asset corresponding to the account of the transferring party according to the cross-region synchronization information, the amount of the asset is added to the asset corresponding to the account of the transferring party.
可选的,在将所述交易请求及所述跨分区同步信息转发至所述转入方账号对应的子区块链分区内的记账节点之后,所述方法还包括:Optionally, after the transaction request and the cross-region synchronization information are forwarded to an accounting node in a sub-blockchain partition corresponding to the transferee account, the method further includes:
接收所述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;Receiving transaction completion receipt information sent by an accounting node in a sub-blockchain partition corresponding to the transferee account;
从所述转出方账号对应的子区块链分区内的merkle tree中删除所述跨分区同步信息。Deleting the cross-division synchronization information from a merkle tree within a sub-blockchain partition corresponding to the transferor account.
可选的,所述方法还包括:Optionally, the method further includes:
如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,由所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。If the sub-blockchain partition corresponding to the transferee account is different from the sub-blockchain partition corresponding to the transferee account, the accounting node pair in the subblockchain partition corresponding to the transferee account The transaction request is processed.
一种交易处理方法,应用于客户端,所述方法包括:A transaction processing method applied to a client, the method includes:
生成交易请求;Generating transaction requests;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据所述各个子区块链分区的相关信息确定所述交易请求中的转出方账号对应的子区块链分区;Determining the sub-blockchain partition corresponding to the transferor account in the transaction request according to the relevant information of the respective sub-blockchain partitions;
将所述交易请求发送至所述转出方账号对应的子区块链分区内,以使所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。Sending the transaction request to a sub-blockchain partition corresponding to the transfer-out account number, so that an accounting node in the sub-blockchain partition corresponding to the transfer-out account number processes the transaction request.
一种交易处理装置,应用于转出方账号对应的子区块链分区内的记账节点,所述装置包括:A transaction processing device is applied to an accounting node in a sub-blockchain partition corresponding to a transferor account, and the device includes:
接收单元,用于接收由客户端发起的交易请求;A receiving unit, configured to receive a transaction request initiated by a client;
获取单元,用于从所述交易请求中获取转入方账号;An obtaining unit, configured to obtain a transferee account number from the transaction request;
所述获取单元,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
确定单元,用于根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;A determining unit, configured to determine the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition;
判断单元,用于判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;A judging unit, configured to judge whether the sub-blockchain partition corresponding to the transfer-in account and the sub-blockchain partition corresponding to the transfer-out account are the same;
如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,所述确定单元,还用于根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, the determining unit is further configured to: Determining an accounting node in a sub-blockchain partition corresponding to the transferee account;
发送单元,用于在处理单元对所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。A sending unit, configured to forward the transaction request to the corresponding account of the transferee after the processing unit processes the transaction request from an accounting node in a sub-blockchain partition corresponding to the account of the transferor The accounting node in the sub-blockchain partition of the processing unit processes the transaction request with the accounting node in the sub-blockchain partition corresponding to the transferee account.
一种交易处理装置,应用于客户端,所述装置包括:A transaction processing device applied to a client, the device includes:
生成单元,用于生成交易请求;A generating unit for generating a transaction request;
所述获取单元,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
确定单元,用于根据所述各个子区块链分区的相关信息确定所述交易请求中的转出方账号对应的子区块链分区;A determining unit, configured to determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the relevant information of the respective sub-blockchain partitions;
发送单元,用于将所述交易请求发送至所述转出方账号对应的子区块链分区内。A sending unit is configured to send the transaction request to a sub-blockchain partition corresponding to the transferor account.
一种存储介质,其上存储有程序,该程序被处理器执行时实现如上所述的交易处理方法。A storage medium has a program stored thereon, which when executed by a processor implements the transaction processing method described above.
一种电子设备,所述电子设备包括存储器和处理器,所述存储器用于存储程序,所述处理器用于运行程序,其中,所述程序运行时执行如上所述的交易处理方法。An electronic device includes a memory and a processor, where the memory is used to store a program, and the processor is used to run a program, wherein the program executes the transaction processing method as described above.
一种区块链系统,所述系统包括主区块链分区和至少二个子区块链分区,其中所述至少二个子区块链分区包括第一子区块链分区和第二主区块链分区,A blockchain system comprising a main blockchain partition and at least two sub-blockchain partitions, wherein the at least two sub-blockchain partitions include a first sub-blockchain partition and a second main blockchain Partition,
所述第一子区块链分区内的记账节点用于接收由客户端发起的交易请求;从所述交易请求中获取转入方账号;从主区块链分区中获取各个子区块链分区的相关信息;根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,根据所述 各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;在所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的第二子区块链分区内的记账节点;The accounting node in the first sub-blockchain partition is used to receive a transaction request initiated by a client; obtain a transferee account number from the transaction request; obtain each sub-blockchain from the main blockchain partition Relevant information about the partition; determining the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition; judging the sub-blockchain partition corresponding to the transferee account and the transfer Whether the sub-blockchain partition corresponding to the exporter account is the same; if the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, according to each sub-block The relevant information of the chain partition determines the accounting node in the sub-blockchain partition corresponding to the transferee account; the accounting node in the sub-blockchain partition corresponding to the transferee account performs the transaction request. After processing, forward the transaction request to the accounting node in the second sub-blockchain partition corresponding to the transferee account;
所述第二子区块链分区内的记账节点用于接收所述第一子区块链分区内的记账节点发送的所述交易请求,并对所述交易请求进行处理。The accounting node in the second sub-blockchain partition is configured to receive the transaction request sent by the accounting node in the first sub-blockchain partition, and process the transaction request.
借由上述技术方案,本发明提供的交易处理方法、装置及区块链系统,转出方账号对应的子区块链分区内的记账节点接收由客户端发起的交易请求,从主区块链分区中获取各个子区块链分区的相关信息;根据所述各个子区块链分区的相关信息确定转入方账号对应的子区块链分区;如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;在所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。在区块链分区的基础上实现了跨分区交易,每个子区块链分区只需处理与其对应的账号相关的交易,多个子区块链分区可并行处理多个账号相关的交易,提高了交易处理效率。With the above technical solution, the transaction processing method, device and blockchain system provided by the present invention, the accounting node in the sub-blockchain partition corresponding to the transferor account receives the transaction request initiated by the client, and from the main block Relevant information of each sub-blockchain partition is obtained in the chain partition; the sub-blockchain partition corresponding to the transferee account is determined according to the relevant information of each subblockchain partition; if the sub-zone corresponding to the transferee account is determined The blockchain partition is different from the sub-blockchain partition corresponding to the transferee account, and the accounting node in the sub-blockchain partition corresponding to the transferee account is determined according to the relevant information of each sub-blockchain partition. ; After the accounting node in the sub-blockchain partition corresponding to the transferee account processes the transaction request, forward the transaction request to the sub-blockchain partition corresponding to the transferee account The transaction request is processed by an accounting node in a sub-blockchain partition corresponding to the transferee account. Cross-regional transactions are implemented on the basis of blockchain partitions. Each sub-blockchain partition only needs to process transactions related to its corresponding account. Multiple sub-blockchain partitions can process transactions related to multiple accounts in parallel, improving transactions. Processing efficiency.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to understand the technical means of the present invention more clearly, it can be implemented according to the content of the description, and in order to make the above and other objects, features, and advantages of the present invention more comprehensible In the following, specific embodiments of the present invention are enumerated.
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the detailed description of the preferred embodiments below. The drawings are only for the purpose of illustrating preferred embodiments and are not to be considered as limiting the invention. Moreover, the same reference numerals are used throughout the drawings to refer to the same parts. In the drawings:
图1示出了本发明实施例公开的一种区块链分区示意图;FIG. 1 shows a schematic diagram of blockchain partitioning according to an embodiment of the present invention;
图2示出了本发明实施例公开的一种交易处理方法的流程示意图;FIG. 2 is a schematic flowchart of a transaction processing method disclosed in an embodiment of the present invention; FIG.
图3示出了本发明实施例公开的一种交易处理方法的流程示意图;3 is a schematic flowchart of a transaction processing method disclosed in an embodiment of the present invention;
图4示出了本发明实施例公开的一种交易处理装置的结构示意图;FIG. 4 is a schematic structural diagram of a transaction processing device disclosed by an embodiment of the present invention; FIG.
图5示出了本发明实施例公开的一种交易处理装置的结构示意图。FIG. 5 is a schematic structural diagram of a transaction processing apparatus disclosed by an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Hereinafter, exemplary embodiments of the present disclosure will be described in more detail with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a thorough understanding of the present disclosure, and to fully convey the scope of the present disclosure to those skilled in the art.
本发明提供的交易处理方法,适用于包括一个主区块链分区和至少二个子区块链分区的区块链系统(如图1所示),其中,主区块链分区用于记录所有子区块链分区的相关信息,相关信息包括但不限于,各个子区块链分区的划分信息、各个子区块链分区内的记账节点信息,具体的,各个子区块链分区的划分信息可以包括,各个子区块链分区的序号与各个账号类别的对应关系;各个子区块链分区内的记账节点信息可以包括各个子区块链分区序号与各个子区块链分区内的记账人公钥的对应关系、以及各个子区块链分区序号与各个子区块链分区内的记账节点地址的对应关系。各个子区块链分区中的记账节点可从主区块链分区中获取所有子区块链分区的相关信息。The transaction processing method provided by the present invention is applicable to a blockchain system including one main blockchain partition and at least two sub-blockchain partitions (as shown in FIG. 1), where the main blockchain partition is used to record all sub-blocks. Relevant information about the blockchain partition. The related information includes, but is not limited to, the partition information of each sub-blockchain partition, and the accounting node information in each sub-blockchain partition. Specifically, the partition information of each sub-blockchain partition. It may include the correspondence between the serial number of each sub-blockchain partition and each account type; the accounting node information in each sub-blockchain partition may include the serial number of each sub-blockchain partition and the records in each sub-blockchain partition The correspondence between the accountant's public key and the correspondence between the sub-blockchain partition sequence number and the accounting node address in each sub-blockchain partition. The accounting nodes in each sub-blockchain partition can obtain the relevant information of all sub-blockchain partitions from the main blockchain partition.
在一种实施方式中,上述至少二个子区块链分区包括第一子区块链分区和第二主区块链分区,上述第一子区块链分区内的记账节点用于接收由客户端发起的交易请求;从上述交易请求中获取转入方账号;从主区块链分区中获取各个子区块链分区的相关信息;根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区;判断上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区是否相同;如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,根据上述各个子区块链分区的相关信息确定上述转入方账号对 应的子区块链分区内的记账节点;在上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理之后,将上述交易请求转发至上述转入方账号对应的第二子区块链分区内的记账节点;上述第二子区块链分区内的记账节点用于接收上述第一子区块链分区内的记账节点发送的上述交易请求,并对上述交易请求进行处理。In one embodiment, the at least two sub-blockchain partitions include a first sub-blockchain partition and a second main block-chain partition. The accounting node in the first sub-blockchain partition is used to receive The transaction request initiated by the client; obtain the transferee account number from the above transaction request; obtain the relevant information of each sub-blockchain partition from the main blockchain partition; determine the above-mentioned transfer according to the relevant information of each sub-blockchain partition The sub-blockchain partition corresponding to the transferee account; determine whether the sub-blockchain partition corresponding to the transferee account is the same as the subblockchain partition corresponding to the transferee account; if the subblock corresponding to the transferee account The chain partition is different from the sub-blockchain partition corresponding to the account of the transferee, and the accounting node in the sub-blockchain partition corresponding to the account of the transferee is determined according to the relevant information of each of the sub-blockchain partitions; After the accounting node in the sub-blockchain partition corresponding to the exporter account processes the transaction request, the transaction request is forwarded to the second sub-blockchain branch corresponding to the transfer-in account. Accounting nodes in the zone; accounting nodes in the second sub-blockchain partition are used to receive the transaction requests sent by the accounting nodes in the first sub-blockchain partition, and process the transaction requests.
需要说明的是,第一子区块链分区和第二子区块链分区并非特指某两个子区块链分区,可以是至少二个子区块链分区中的任意两个子区块链分区。It should be noted that the first sub-blockchain partition and the second sub-blockchain partition do not specifically refer to two sub-blockchain partitions, but may be any two sub-blockchain partitions among at least two sub-blockchain partitions.
请参阅附图2,图2为本发明实施例公开的一种交易处理方法的流程示意图,该方法应用于客户端,上述方法包括:Please refer to FIG. 2. FIG. 2 is a schematic flowchart of a transaction processing method disclosed in an embodiment of the present invention. The method is applied to a client. The above method includes:
S100:生成交易请求;S100: Generate a transaction request;
交易请求可以是由客户端生成的,一个交易可包含一个转出方及一个转入方,用于指示转出方需转出一定数额的资产至转入方,即,交易请求中包含该交易的一个转出方账号和一个转入方账号,以及交易资产的数额。The transaction request can be generated by the client. A transaction can include a transferor and a transferor, which are used to instruct the transferor to transfer a certain amount of assets to the transferor. That is, the transaction request contains the transaction. One transferee account and one transferee account, and the amount of assets traded.
举例来说,本实施例中客户端可以是手机、计算机……电子设备,客户端可以安装有相关的应用软件(如钱包APP),以生成相应的交易请求;For example, in this embodiment, the client may be a mobile phone, a computer, ... an electronic device, and the client may be installed with related application software (such as a wallet APP) to generate a corresponding transaction request;
S110:从主区块链分区中获取各个子区块链分区的相关信息;S110: Obtain relevant information of each sub-blockchain partition from the main blockchain partition;
客户端需要从主区块链分区中获取各个子区块链分区的相关信息。The client needs to obtain the relevant information of each sub-blockchain partition from the main blockchain partition.
S120:根据上述各个子区块链分区的相关信息确定上述交易请求中的转出方账号对应的子区块链分区;S120: Determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the related information of each sub-blockchain partition;
客户端在获取各个子区块链分区的相关信息后,根据上述各个子区块链分区的相关信息确定上述转出方账号对应的子区块链分区;在一种实施方式中,客户端先确定上述转出方账号所属的账号类别,然后根据各个子区块链分区的相关信息中的各个子区块链分区的序号与各个账号类别的对应关系确定上述转出方账号所属的账号类别对应的子区块链分区序号,从而确定上述转出方账号对应的子区块链分区。After the client obtains the relevant information of each sub-blockchain partition, the client determines the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition. In one embodiment, the client first Determine the account category to which the transferee account belongs, and then determine the corresponding account category to which the transferee account belongs according to the corresponding relationship between the serial number of each subblockchain partition and the account category in the relevant information of each subblockchain partition. The number of the sub-blockchain partition of.
S130:将上述交易请求发送至上述转出方账号对应的子区块链分区内,以使上述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。S130: Send the transaction request to a sub-blockchain partition corresponding to the transferor account, so that the accounting node in the sub-blockchain partition corresponding to the transferor account processes the transaction request.
在客户端确定上述转出方账号对应的子区块链分区之后,则将交易请求发送至上述转出方账号对应的子区块链分区内,以由上述转出方账号对应的子区块链分区内的记账节点接收上述客户端发送的交易请求并处理。After the client determines the sub-blockchain partition corresponding to the transfer-out account, the transaction request is sent to the sub-blockchain partition corresponding to the transfer-out account, and the sub-block corresponding to the transfer-out account is used. The accounting nodes in the chain partition receive and process the transaction requests sent by the clients.
在本实施例中,客户端可从主区块链分区中获取各个子区块链分区的相关信息,并据此获取交易请求中转出方账号对应的子区块链分区,将交易请求发送至上述转出方账号对应的子区块链分区内,由上述转出方账号对应的子区块链分区内的记账节点对该交易请求进行处理。上述转出方账号对应的子区块链分区内的记账节点对该交易请求进行处理的具体流程将通过以下实施例详细说明。In this embodiment, the client can obtain the relevant information of each sub-blockchain partition from the main blockchain partition, and accordingly obtain the sub-blockchain partition corresponding to the transferor account in the transaction request, and send the transaction request. Up to the sub-blockchain partition corresponding to the transfer-out account, the transaction request is processed by the accounting node in the sub-blockchain partition corresponding to the transfer-out account. The specific process of processing the transaction request by the bookkeeping node in the sub-blockchain partition corresponding to the transferee account will be described in detail through the following embodiments.
请参阅附图3,图3为本发明实施例公开的一种交易处理方法的流程示意图,该方法应用于转出方账号对应的子区块链分区内的记账节点,上述方法包括:Please refer to FIG. 3. FIG. 3 is a schematic flowchart of a transaction processing method disclosed in an embodiment of the present invention. The method is applied to a bookkeeping node in a sub-blockchain partition corresponding to a transferor account. The above method includes:
S200:接收由客户端发起的交易请求;S200: Receive a transaction request initiated by a client;
上述转出方账号对应的子区块链分区内的记账节点接收由客户端发起的交易请求,在一种实施方式中,上述转出方账号对应的子区块链分区内的记账节点可直接接收由客户端发送的交易请求,在另一种实施方式中,客户端发起的交易请求可先发送至除上述转出方账号对应的子区块链分区内的记账节点之外的其他节点,上述转出方账号对应的子区块链分区内的记账节点再从其他节点处接收上述交易请求。The accounting node in the sub-blockchain partition corresponding to the transferee account receives the transaction request initiated by the client. In one embodiment, the accounting node in the sub-blockchain partition corresponding to the transferee account It can directly receive the transaction request sent by the client. In another embodiment, the transaction request initiated by the client can be sent to other than the accounting nodes in the sub-blockchain partition corresponding to the transferee account. For other nodes, the bookkeeping node in the sub-blockchain partition corresponding to the transferor account above receives the transaction request from other nodes.
S210:从上述交易请求中获取转入方账号;S210: Obtain the transferee account number from the above transaction request;
上述转出方账号对应的子区块链分区内的记账节点在接收到客户端发起的交易请求后,需要从上述交易请求中获取转入方账号。After receiving the transaction request initiated by the client, the accounting node in the sub-blockchain partition corresponding to the account of the transferring party needs to obtain the transferring party account from the transaction request.
S220:从主区块链分区中获取各个子区块链分区的相关信息;S220: Obtain relevant information of each sub-blockchain partition from the main blockchain partition;
上述转出方账号对应的子区块链分区内的记账节点在获取转入方账号后,可从主区块链分区中获取各个子区块链分区的相关信息。After the accounting node in the sub-blockchain partition corresponding to the account of the transfer-out party obtains the account of the transfer-in party, it can obtain the relevant information of each sub-blockchain partition from the main blockchain partition.
S230:根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区;S230: Determine the sub-blockchain partition corresponding to the transferee account according to the related information of the sub-blockchain partitions;
上述转出方账号对应的子区块链分区内的记账节点在获取各个子区块链分区的相关信息之后,根据上述各个子区块链分区的相关信息确定上述 转入方账号对应的子区块链分区,在一种实施方式中,上述转出方账号对应的子区块链分区内的记账节点确定上述转入方账号所属的账号类别,然后根据各个子区块链分区的相关信息中的各个子区块链分区的序号与各个账号类别的对应关系确定上述转入方账号所属的账号类别对应的子区块链分区序号,从而确定上述转入方账号对应的子区块链分区。After the accounting node in the sub-blockchain partition corresponding to the transferee account obtains the relevant information of each sub-blockchain partition, it determines the sub-account corresponding to the transferee account according to the relevant information of each sub-blockchain partition. Blockchain partitioning. In one embodiment, the accounting node in the subblockchain partition corresponding to the account of the transferee determines the account type to which the account of the transferee belongs, and then according to the correlation of each subblockchain partition The correspondence between the serial number of each sub-blockchain partition and each account type in the information determines the serial number of the sub-blockchain partition corresponding to the account type to which the transferee account belongs, thereby determining the sub-blockchain corresponding to the transferee account Partition.
S240:判断上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区是否相同,如果不同,则执行S250和S260,如果相同,则执行S270;S240: Determine whether the sub-blockchain partition corresponding to the transferee account and the sub-blockchain partition corresponding to the transferee account are the same. If they are different, execute S250 and S260; if they are the same, execute S270;
在一种实施方式中,如果上述转入方账号对应的子区块链分区的序号与上述转出方账号对应的子区块链分区的序号相同,则判定上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区相同,如果上述转入方账号对应的子区块链分区的序号与上述转出方账号对应的子区块链分区的序号不同,则判定上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同。In one embodiment, if the serial number of the sub-blockchain partition corresponding to the transfer-in account is the same as the serial number of the sub-blockchain partition corresponding to the transfer-in account, the sub-region corresponding to the transfer-in account is determined. The blockchain partition is the same as the sub-blockchain partition corresponding to the transferee account. If the serial number of the sub-blockchain partition corresponding to the transfer-in account is different from the serial number of the sub-blockchain partition corresponding to the transfer-out account, Then it is determined that the sub-blockchain partition corresponding to the transferee account is different from the sub-blockchain partition corresponding to the transferee account.
S250:根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区内的记账节点;S250: Determine the accounting node in the sub-blockchain partition corresponding to the transferee account according to the relevant information of the sub-blockchain partitions;
在一种实施方式中,可根据各个子区块链分区的相关信息中的上述各个子区块链分区序号与各个子区块链分区内的记账节点地址的对应关系确定上述转入方账号对应的子区块链分区内的记账节点。In one embodiment, the transferee account number may be determined according to the correspondence between the serial number of each of the sub-blockchain partitions and the address of the accounting node in each of the sub-blockchain partitions in the relevant information of each sub-blockchain partition The accounting node in the corresponding sub-blockchain partition.
S260:在上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理之后,将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。S260: After the accounting node in the sub-blockchain partition corresponding to the transfer-to account number processes the transaction request, the transaction request is forwarded to the accounting in the sub-blockchain partition corresponding to the transfer-in account number. The node processes the transaction request with an accounting node in a sub-blockchain partition corresponding to the transferee account.
S270:由上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。S270: The accounting node in the sub-blockchain partition corresponding to the account of the transferring party processes the transaction request.
本实施例公开的交易处理方法,在区块链分区的基础上实现了跨分区交易,每个子区块链分区只需处理与其对应的账号相关的交易,多个子区块链分区可并行处理多个账号相关的交易,提高了交易处理效率。The transaction processing method disclosed in this embodiment implements cross-regional transactions based on the blockchain partition. Each sub-blockchain partition only needs to process transactions related to its corresponding account. Multiple sub-blockchain partitions can process multiple transactions in parallel. Account-related transactions, improving transaction processing efficiency.
在交易完成之后,转出方账号对应的区块链分区和转入方账号对应的 区块链分区都还要在分区内进行交易信息的广播,以将交易信息记录在分区内的每个节点上保存的区块链上;而且,不同分区内的每个节点上保存的区块链上只存储与该节点相关的交易信息,而不用存储所有节点的交易信息,从而减少了节点存储的区块链数据的大小。After the transaction is completed, the blockchain partition corresponding to the transferee account and the blockchain partition corresponding to the transferee account must also broadcast the transaction information in the partition to record the transaction information in each node in the partition. The blockchain stored on each node is stored on the blockchain; moreover, the blockchain stored on each node in a different partition stores only the transaction information related to that node, instead of storing the transaction information of all nodes, thereby reducing the area of node storage. The size of the blockchain data.
举例来说,上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理,可包括:For example, the accounting node in the sub-blockchain partition corresponding to the account of the transferring party to process the transaction request may include:
确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
从上述转出方账号对应的资产中扣除上述资产数额;Deduct the amount of the above assets from the assets corresponding to the account of the transferring party;
在从上述转出方账号对应的资产中扣除上述资产数额之后,将跨分区同步信息记录到上述转出方账号对应的子区块链分区内的merkle tree中。After deducting the amount of the asset from the asset corresponding to the transferee account, the cross-sector synchronization information is recorded in the merkle tree in the sub-blockchain partition corresponding to the transferee account.
则,上述将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,包括:将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点根据上述跨分区同步信息确认在上述转出方账号对应的资产中扣除上述资产数额之后,在上述转入方账号对应的资产中增加上述资产数额。Then, the forwarding the transaction request to the accounting node in the sub-blockchain partition corresponding to the transferee account includes: forwarding the transaction request and the cross-segment synchronization information to the subregion corresponding to the transferee account. The accounting nodes in the blockchain partition use the accounting nodes in the sub-blockchain partition corresponding to the transferee account to confirm the deduction of the asset amount from the assets corresponding to the transferor account according to the cross-region synchronization information. , Increase the amount of the above assets in the assets corresponding to the account of the transferee.
则在将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点之后,上述方法还包括:接收上述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;从上述转出方账号对应的子区块链分区内的merkle tree中删除上述跨分区同步信息。After forwarding the transaction request and the cross-segment synchronization information to the accounting node in the sub-blockchain partition corresponding to the transferee account, the method further includes: receiving the sub-blockchain corresponding to the transferee account. The transaction completion receipt information sent by the bookkeeping node in the sub-region; the above cross-division synchronization information is deleted from the merkle tree in the sub-blockchain partition corresponding to the transferee account.
本实施例中,通过跨分区同步信息能够验证转入方账号及转出方账号的交易处理真实性,能够保证交易处理准确性。In this embodiment, the authenticity of the transaction processing of the transfer-in account and the transfer-out account can be verified by synchronizing the information across the partitions, and the accuracy of transaction processing can be guaranteed.
请参阅附图4,图4为本发明实施例公开的一种交易处理装置的具体结构示意图,该装置应用于客户端,上述装置包括:Please refer to FIG. 4, which is a schematic diagram of a specific structure of a transaction processing device disclosed in an embodiment of the present invention. The device is applied to a client. The above device includes:
生成单元10,用于生成交易请求;A generating unit 10, configured to generate a transaction request;
获取单元11,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit 11 is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
确定单元12,用于根据上述各个子区块链分区的相关信息确定上述交易请求中的转出方账号对应的子区块链分区;A determining unit 12 is configured to determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the related information of each of the sub-blockchain partitions;
发送单元13,用于将上述交易请求发送至上述转出方账号对应的子区块链分区内。The sending unit 13 is configured to send the transaction request to a sub-blockchain partition corresponding to the transferee account.
上述交易处理装置包括处理器和存储器,上述生成单元、获取单元、确定单元、和发送单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The transaction processing device includes a processor and a memory. The generating unit, acquiring unit, determining unit, and sending unit are stored in the memory as program units. The processor executes the program units stored in the memory to implement corresponding functions. .
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来提高交易处理效率。The processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory. The kernel can set one or more, and adjust the kernel parameters to improve transaction processing efficiency.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (RAM). Memory includes at least one Memory chip.
本发明实施例提供了一种存储介质,其上存储有程序,该程序被处理器执行时实现上述交易处理方法。An embodiment of the present invention provides a storage medium on which a program is stored, and the program implements the foregoing transaction processing method when executed by a processor.
本发明实施例提供了一种处理器,上述处理器用于运行程序,其中,上述程序运行时执行上述交易处理方法。An embodiment of the present invention provides a processor. The processor is used to run a program, and the program is executed when the program is executed.
本发明实施例提供了一种电子设备,电子设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器执行程序时实现以下步骤:An embodiment of the present invention provides an electronic device. The electronic device includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, the following steps are implemented:
生成交易请求;Generating transaction requests;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据上述各个子区块链分区的相关信息确定上述交易请求中的转出方账号对应的子区块链分区;Determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the related information of the sub-blockchain partitions;
将上述交易请求发送至上述转出方账号对应的子区块链分区内。Send the transaction request to the sub-blockchain partition corresponding to the transferor account.
本文中的电子设备可以是服务器、PC、PAD、手机等。The electronic device in this article may be a server, a PC, a PAD, a mobile phone, or the like.
本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序:This application also provides a computer program product, which when executed on a data processing device, is suitable for executing a program having the following method steps for initialization:
生成交易请求;Generating transaction requests;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据上述各个子区块链分区的相关信息确定上述交易请求中的转出方账号对应的子区块链分区;Determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the related information of the sub-blockchain partitions;
将上述交易请求发送至上述转出方账号对应的子区块链分区内。Send the transaction request to the sub-blockchain partition corresponding to the transferor account.
请参阅附图5,图5为本发明实施例公开的一种交易处理装置的具体结构示意图,该装置应用于转出方账号对应的子区块链分区内的记账节点,上述装置包括:Please refer to FIG. 5. FIG. 5 is a schematic diagram of a specific structure of a transaction processing device disclosed in an embodiment of the present invention. The device is applied to a bookkeeping node in a sub-blockchain partition corresponding to a transferor account. The above device includes:
接收单元20,用于接收由客户端发起的交易请求;A receiving unit 20, configured to receive a transaction request initiated by a client;
获取单元21,用于从上述交易请求中获取转入方账号;An obtaining unit 21, configured to obtain a transferee account number from the above transaction request;
上述获取单元21,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit 21 is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
确定单元22,用于根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区;A determining unit 22, configured to determine the sub-blockchain partition corresponding to the transferee account according to the related information of each sub-blockchain partition;
判断单元23,用于判断上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区是否相同;The judging unit 23 is configured to judge whether the sub-blockchain partition corresponding to the transfer-in account and the sub-blockchain partition corresponding to the transfer-out account are the same;
如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,上述确定单元22,还用于根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, the determining unit 22 is further configured to determine the transfer according to the related information of each of the sub-blockchain partitions. Accounting nodes in the sub-blockchain partition corresponding to the account of the acquirer;
发送单元24,用于在处理单元25对上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理之后,将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。A sending unit 24 is configured to forward the transaction request to the sub-account corresponding to the transfer-in account after the processing unit 25 processes the transaction request to an accounting node in the sub-blockchain partition corresponding to the transfer-to account. The accounting node in the blockchain partition processes the transaction request with the accounting node in the sub-blockchain partition corresponding to the transferee account.
可选的,上述处理单元,具体用于:Optionally, the processing unit is specifically used for:
确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
从上述转出方账号对应的资产中扣除上述资产数额;Deduct the amount of the above assets from the assets corresponding to the account of the transferring party;
在从上述转出方账号对应的资产中扣除上述资产数额之后,将跨分区同步信息记录到上述转出方账号对应的子区块链分区内的merkle tree中。After deducting the amount of the asset from the asset corresponding to the transferee account, the cross-sector synchronization information is recorded in the merkle tree in the sub-blockchain partition corresponding to the transferee account.
可选的,上述发送单元具体用于:Optionally, the sending unit is specifically configured to:
将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内 的记账节点根据上述跨分区同步信息确认在上述转出方账号对应的资产中扣除上述资产数额之后,在上述转入方账号对应的资产中增加上述资产数额。The transaction request and the cross-segment synchronization information are forwarded to the accounting node in the sub-blockchain partition corresponding to the transferee account, and the accounting node in the sub-blockchain partition corresponding to the transferee account is based on The cross-region synchronization information confirms that after deducting the amount of the asset from the asset corresponding to the account of the transferor, the amount of the asset is added to the asset corresponding to the account of the transferee.
可选的,上述接收单元,还用于在将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点之后,接收上述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;Optionally, the receiving unit is further configured to receive the corresponding account of the transferee after forwarding the transaction request and the cross-sector synchronization information to the accounting node in the sub-blockchain partition corresponding to the transferee account. Transaction completion receipt information sent by the bookkeeping node within the sub-blockchain partition;
上述处理单元,还用于从上述转出方账号对应的子区块链分区内的merkle tree中删除上述跨分区同步信息。The processing unit is further configured to delete the cross-division synchronization information from a merkle tree in a sub-blockchain partition corresponding to the transferring account.
可选的,上述处理单元,还用于如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,由上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。Optionally, the processing unit is further configured to: if the sub-blockchain partition corresponding to the transferee account is different from the subblockchain partition corresponding to the transferee account, the subblock corresponding to the transferee account The accounting nodes in the chain partition process the above transaction requests.
上述交易处理装置包括处理器和存储器,上述接收单元、获取单元、确定单元、判断单元、处理单元和发送单元等均作为程序单元存储在存储器中,由处理器执行存储在存储器中的上述程序单元来实现相应的功能。The transaction processing device includes a processor and a memory. The receiving unit, the obtaining unit, the determining unit, the determining unit, the processing unit, and the sending unit are all stored in the memory as a program unit, and the processor executes the program unit stored in the memory. To achieve the corresponding function.
处理器中包含内核,由内核去存储器中调取相应的程序单元。内核可以设置一个或以上,通过调整内核参数来提高交易处理效率。The processor contains a kernel, and the kernel retrieves the corresponding program unit from the memory. The kernel can set one or more, and adjust the kernel parameters to improve transaction processing efficiency.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM),存储器包括至少一个存储芯片。Memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (RAM). Memory includes at least one Memory chip.
本发明实施例提供了一种存储介质,其上存储有程序,该程序被处理器执行时实现上述交易处理方法。An embodiment of the present invention provides a storage medium on which a program is stored, and the program implements the foregoing transaction processing method when executed by a processor.
本发明实施例提供了一种处理器,上述处理器用于运行程序,其中,上述程序运行时执行上述交易处理方法。An embodiment of the present invention provides a processor. The processor is used to run a program, and the program is executed when the program is executed.
本发明实施例提供了一种设备,设备包括处理器、存储器及存储在存储器上并可在处理器上运行的程序,处理器执行程序时实现以下步骤:An embodiment of the present invention provides a device. The device includes a processor, a memory, and a program stored on the memory and can run on the processor. When the processor executes the program, the following steps are implemented:
接收由客户端发起的交易请求;Receiving a transaction request initiated by a client;
从上述交易请求中获取转入方账号;Obtain the transferee account number from the above transaction request;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区;Determine the sub-blockchain partition corresponding to the transferee account according to the related information of each sub-blockchain partition;
判断上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区是否相同;Judging whether the sub-blockchain partition corresponding to the transferee account and the sub-blockchain partition corresponding to the transferee account are the same;
如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-in account, determine the sub-block corresponding to the transfer-in account according to the relevant information of each sub-blockchain partition. Accounting nodes within the chain partition;
在上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理之后,将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。After the accounting node in the sub-blockchain partition corresponding to the transfer-to account number processes the transaction request, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transfer-in account number, The transaction request is processed by an accounting node in a sub-blockchain partition corresponding to the transferee account.
可选的,上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理,包括:Optionally, the accounting node in the sub-blockchain partition corresponding to the account of the transferring party to process the transaction request includes:
确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
从上述转出方账号对应的资产中扣除上述资产数额;Deduct the amount of the above assets from the assets corresponding to the account of the transferring party;
在从上述转出方账号对应的资产中扣除上述资产数额之后,将跨分区同步信息记录到上述转出方账号对应的子区块链分区内的merkle tree中。After deducting the amount of the asset from the asset corresponding to the transferee account, the cross-sector synchronization information is recorded in the merkle tree in the sub-blockchain partition corresponding to the transferee account.
可选的,上述将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,包括:Optionally, the forwarding the transaction request to the accounting node in the sub-blockchain partition corresponding to the transferee account includes:
将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点根据上述跨分区同步信息确认在上述转出方账号对应的资产中扣除上述资产数额之后,在上述转入方账号对应的资产中增加上述资产数额。The transaction request and the cross-segment synchronization information are forwarded to the accounting node in the sub-blockchain partition corresponding to the transferee account, and the accounting node in the sub-blockchain partition corresponding to the transferee account is based on The cross-region synchronization information confirms that after deducting the amount of the asset from the asset corresponding to the account of the transferor, the amount of the asset is added to the asset corresponding to the account of the transferee.
可选的,在将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点之后,上述方法还包括:Optionally, after the transaction request and the cross-region synchronization information are forwarded to the accounting node in the sub-blockchain partition corresponding to the transferee account, the method further includes:
接收上述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;Receive the transaction completion receipt information sent by the accounting node in the sub-blockchain partition corresponding to the transferee account;
从上述转出方账号对应的子区块链分区内的merkle tree中删除上述跨分区同步信息。Delete the cross-division synchronization information from the merkle tree in the sub-blockchain partition corresponding to the transferee account.
可选的,上述方法还包括:Optionally, the above method further includes:
如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,由上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, the accounting node in the sub-blockchain partition corresponding to the transfer-out account requests the transaction request. For processing.
本文中的设备可以是服务器、PC、PAD、手机等。The equipment in this article can be server, PC, PAD, mobile phone, etc.
本申请还提供了一种计算机程序产品,当在数据处理设备上执行时,适于执行初始化有如下方法步骤的程序:This application also provides a computer program product, which when executed on a data processing device, is suitable for executing a program having the following method steps for initialization:
接收由客户端发起的交易请求;Receiving a transaction request initiated by a client;
从上述交易请求中获取转入方账号;Obtain the transferee account number from the above transaction request;
从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区;Determine the sub-blockchain partition corresponding to the transferee account according to the related information of each sub-blockchain partition;
判断上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区是否相同;Judging whether the sub-blockchain partition corresponding to the transferee account and the sub-blockchain partition corresponding to the transferee account are the same;
如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,根据上述各个子区块链分区的相关信息确定上述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-in account, determine the sub-block corresponding to the transfer-in account according to the relevant information of each sub-blockchain partition. Accounting nodes within the chain partition;
在上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理之后,将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。After the accounting node in the sub-blockchain partition corresponding to the transfer-to account number processes the transaction request, the transaction request is forwarded to the accounting node in the sub-blockchain partition corresponding to the transfer-in account number, The transaction request is processed by an accounting node in a sub-blockchain partition corresponding to the transferee account.
可选的,上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理,包括:Optionally, the accounting node in the sub-blockchain partition corresponding to the account of the transferring party to process the transaction request includes:
确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
从上述转出方账号对应的资产中扣除上述资产数额;Deduct the amount of the above assets from the assets corresponding to the account of the transferring party;
在从上述转出方账号对应的资产中扣除上述资产数额之后,将跨分区同步信息记录到上述转出方账号对应的子区块链分区内的merkle tree中。After deducting the amount of the asset from the asset corresponding to the transferee account, the cross-sector synchronization information is recorded in the merkle tree in the sub-blockchain partition corresponding to the transferee account.
可选的,上述将上述交易请求转发至上述转入方账号对应的子区块链分区内的记账节点,包括:Optionally, the forwarding the transaction request to the accounting node in the sub-blockchain partition corresponding to the transferee account includes:
将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点,以由上述转入方账号对应的子区块链分区内的记账节点根据上述跨分区同步信息确认在上述转出方账号对应的资产中扣除上述资产数额之后,在上述转入方账号对应的资产中增加上述资产数额。The transaction request and the cross-segment synchronization information are forwarded to the accounting node in the sub-blockchain partition corresponding to the transferee account, and the accounting node in the sub-blockchain partition corresponding to the transferee account is based on The cross-region synchronization information confirms that after deducting the amount of the asset from the asset corresponding to the account of the transferor, the amount of the asset is added to the asset corresponding to the account of the transferee.
可选的,在将上述交易请求及上述跨分区同步信息转发至上述转入方账号对应的子区块链分区内的记账节点之后,上述方法还包括:Optionally, after the transaction request and the cross-region synchronization information are forwarded to the accounting node in the sub-blockchain partition corresponding to the transferee account, the method further includes:
接收上述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;Receive the transaction completion receipt information sent by the accounting node in the sub-blockchain partition corresponding to the transferee account;
从上述转出方账号对应的子区块链分区内的merkle tree中删除上述跨分区同步信息。Delete the cross-division synchronization information from the merkle tree in the sub-blockchain partition corresponding to the transferee account.
可选的,上述方法还包括:Optionally, the above method further includes:
如果上述转入方账号对应的子区块链分区与上述转出方账号对应的子区块链分区不同,由上述转出方账号对应的子区块链分区内的记账节点对上述交易请求进行处理。If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, the accounting node in the sub-blockchain partition corresponding to the transfer-out account requests the transaction request. For processing.
本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令 产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。This application is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present application. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and combinations of processes and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing device to produce a machine, so that the instructions generated by the processor of the computer or other programmable data processing device are used to generate instructions Means for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to work in a particular manner such that the instructions stored in the computer-readable memory produce a manufactured article including an instruction device, the instructions The device implements the functions specified in one or more flowcharts and / or one or more blocks of the block diagram.
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing device, so that a series of steps can be performed on the computer or other programmable device to produce a computer-implemented process, which can be executed on the computer or other programmable device. The instructions provide steps for implementing the functions specified in one or more flowcharts and / or one or more blocks of the block diagrams.
在一个典型的配置中,计算设备包括一个或多个处理器(CPU)、输入/输出接口、网络接口和内存。In a typical configuration, a computing device includes one or more processors (CPUs), input / output interfaces, network interfaces, and memory.
存储器可能包括计算机可读介质中的非永久性存储器,随机存取存储器(RAM)和/或非易失性内存等形式,如只读存储器(ROM)或闪存(flash RAM)。存储器是计算机可读介质的示例。The memory may include non-persistent memory, random access memory (RAM), and / or non-volatile memory in computer-readable media, such as read-only memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
计算机可读介质包括永久性和非永久性、可移动和非可移动媒体可以由任何方法或技术来实现信息存储。信息可以是计算机可读指令、数据结构、程序的模块或其他数据。计算机的存储介质的例子包括,但不限于相变内存(PRAM)、静态随机存取存储器(SRAM)、动态随机存取存储器(DRAM)、其他类型的随机存取存储器(RAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、快闪记忆体或其他内存技术、只读光盘只读存储器(CD-ROM)、数字多功能光盘(DVD)或其他光学存储、磁盒式磁带,磁带磁磁盘存储或其他磁性存储设备或任何其他非传输介质,可用于存储可以被计算设备访问的信息。按照本文中的界定,计算机可读介质不包括暂存电脑可读媒体(transitory media),如调制的数据信号和载波。Computer-readable media includes both permanent and non-persistent, removable and non-removable media. Information can be stored by any method or technology. Information may be computer-readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), and read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, read-only disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, Magnetic tape cartridges, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media may be used to store information that can be accessed by computing devices. As defined herein, computer-readable media does not include temporary computer-readable media, such as modulated data signals and carrier waves.
还需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、商品或者 设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、商品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、商品或者设备中还存在另外的相同要素。It should also be noted that the terms "including," "including," or any other variation thereof are intended to encompass non-exclusive inclusion, so that a process, method, product, or device that includes a range of elements includes not only those elements, but also Other elements not explicitly listed, or those that are inherent to such a process, method, product, or device. Without more restrictions, the elements defined by the sentence "including a ..." do not exclude the existence of other identical elements in the process, method, product or equipment including the elements.
本领域技术人员应明白,本申请的实施例可提供为方法、系统或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。Those skilled in the art should understand that the embodiments of the present application may be provided as a method, a system, or a computer program product. Therefore, this application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, this application may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
以上仅为本申请的实施例而已,并不用于限制本申请。对于本领域技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本申请的权利要求范围之内。The above are only examples of the present application and are not intended to limit the present application. For those skilled in the art, this application may have various modifications and changes. Any modification, equivalent replacement, and improvement made within the spirit and principle of this application shall be included in the scope of claims of this application.

Claims (11)

  1. 一种交易处理方法,其特征在于,应用于转出方账号对应的子区块链分区内的记账节点,所述方法包括:A transaction processing method, which is characterized in that it is applied to an accounting node in a sub-blockchain partition corresponding to a transferor account, and the method includes:
    接收由客户端发起的交易请求;Receiving a transaction request initiated by a client;
    从所述交易请求中获取转入方账号;Obtaining the transferee account number from the transaction request;
    从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
    根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;Determining the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition;
    判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;Judging whether the sub-blockchain partition corresponding to the transferee account and the sub-blockchain partition corresponding to the transferee account are the same;
    如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, it is determined that the transfer-in account corresponds to according to the relevant information of each sub-blockchain partition. Accounting nodes within the sub-blockchain partitions;
    在所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。After the accounting node in the sub-blockchain partition corresponding to the transferee account processes the transaction request, the transaction request is forwarded to the sub-blockchain partition corresponding to the transferee account. The bookkeeping node processes the transaction request with a bookkeeping node in a sub-blockchain partition corresponding to the transferee account.
  2. 根据权利要求1所述的方法,其特征在于,所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理,包括:The method according to claim 1, wherein the processing of the transaction request by an accounting node in a sub-blockchain partition corresponding to the transferor account includes:
    确定交易请求对应的资产数额;Determine the amount of assets corresponding to the transaction request;
    从所述转出方账号对应的资产中扣除所述资产数额;Deducting the amount of the asset from the asset corresponding to the transferor account;
    在从所述转出方账号对应的资产中扣除所述资产数额之后,将跨分区同步信息记录到所述转出方账号对应的子区块链分区内的merkle tree中。After the amount of the assets is deducted from the assets corresponding to the transferor account, cross-sector synchronization information is recorded in a merkle tree in a sub-blockchain partition corresponding to the transferor account.
  3. 根据权利要求2所述的方法,其特征在于,所述将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,包括:The method according to claim 2, wherein the forwarding the transaction request to a bookkeeping node within a sub-blockchain partition corresponding to the transferee account comprises:
    将所述交易请求及所述跨分区同步信息转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点根据所述跨分区同步信息确认在所述转出方账号对应的资产中 扣除所述资产数额之后,在所述转入方账号对应的资产中增加所述资产数额。Forward the transaction request and the cross-segment synchronization information to an accounting node in a sub-blockchain partition corresponding to the transferee account, and use the After the bookkeeping node confirms that the amount of the asset is deducted from the asset corresponding to the account of the transferring party according to the cross-region synchronization information, the amount of the asset is added to the asset corresponding to the account of the transferring party.
  4. 根据权利要求3所述的方法,其特征在于,在将所述交易请求及所述跨分区同步信息转发至所述转入方账号对应的子区块链分区内的记账节点之后,所述方法还包括:The method according to claim 3, wherein after forwarding the transaction request and the cross-sector synchronization information to a billing node in a sub-blockchain partition corresponding to the transferee account, the method The method also includes:
    接收所述转入方账号对应的子区块链分区内的记账节点发送的交易完成回执信息;Receiving transaction completion receipt information sent by an accounting node in a sub-blockchain partition corresponding to the transferee account;
    从所述转出方账号对应的子区块链分区内的merkle tree中删除所述跨分区同步信息。Deleting the cross-division synchronization information from a merkle tree within a sub-blockchain partition corresponding to the transferor account.
  5. 根据权利要求1至4中任意一项所述的方法,其特征在于,所述方法还包括:The method according to any one of claims 1 to 4, wherein the method further comprises:
    如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区相同,由所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。If the subblockchain partition corresponding to the transferee account is the same as the subblockchain partition corresponding to the transferee account, the accounting node pair in the subblockchain partition corresponding to the transferee account The transaction request is processed.
  6. 一种交易处理方法,其特征在于,应用于客户端,所述方法包括:A transaction processing method, which is applied to a client, and the method includes:
    生成交易请求;Generating transaction requests;
    从主区块链分区中获取各个子区块链分区的相关信息;Obtain the relevant information of each sub-blockchain partition from the main blockchain partition;
    根据所述各个子区块链分区的相关信息确定所述交易请求中的转出方账号对应的子区块链分区;Determining the sub-blockchain partition corresponding to the transferor account in the transaction request according to the relevant information of the respective sub-blockchain partitions;
    将所述交易请求发送至所述转出方账号对应的子区块链分区内,以使所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。Sending the transaction request to a sub-blockchain partition corresponding to the transfer-out account number, so that an accounting node in the sub-blockchain partition corresponding to the transfer-out account number processes the transaction request.
  7. 一种交易处理装置,其特征在于,应用于转出方账号对应的子区块链分区内的记账节点,所述装置包括:A transaction processing device, which is characterized in that it is applied to an accounting node in a sub-blockchain partition corresponding to a transferor account, and the device includes:
    接收单元,用于接收由客户端发起的交易请求;A receiving unit, configured to receive a transaction request initiated by a client;
    获取单元,用于从所述交易请求中获取转入方账号;An obtaining unit, configured to obtain a transferee account number from the transaction request;
    所述获取单元,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
    确定单元,用于根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;A determining unit, configured to determine the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition;
    判断单元,用于判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;A judging unit, configured to judge whether the sub-blockchain partition corresponding to the transfer-in account and the sub-blockchain partition corresponding to the transfer-out account are the same;
    如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,所述确定单元,还用于根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;If the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, the determining unit is further configured to: Determining an accounting node in a sub-blockchain partition corresponding to the transferee account;
    发送单元,用于在处理单元对所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的子区块链分区内的记账节点,以由所述转入方账号对应的子区块链分区内的记账节点对所述交易请求进行处理。A sending unit, configured to forward the transaction request to the corresponding account of the transferee after the processing unit processes the transaction request from an accounting node in a sub-blockchain partition corresponding to the account of the transferor The accounting node in the sub-blockchain partition of the processing unit processes the transaction request with the accounting node in the sub-blockchain partition corresponding to the transferee account.
  8. 一种交易处理装置,其特征在于,应用于客户端,所述装置包括:A transaction processing device is characterized in that it is applied to a client, and the device includes:
    生成单元,用于生成交易请求;A generating unit for generating a transaction request;
    所述获取单元,还用于从主区块链分区中获取各个子区块链分区的相关信息;The obtaining unit is further configured to obtain relevant information of each sub-blockchain partition from the main blockchain partition;
    确定单元,用于根据所述各个子区块链分区的相关信息确定所述交易请求中的转出方账号对应的子区块链分区;A determining unit, configured to determine the sub-blockchain partition corresponding to the transferor account in the transaction request according to the relevant information of the respective sub-blockchain partitions;
    发送单元,用于将所述交易请求发送至所述转出方账号对应的子区块链分区内。A sending unit is configured to send the transaction request to a sub-blockchain partition corresponding to the transferor account.
  9. 一种存储介质,其上存储有程序,该程序被处理器执行时实现如权利要求1至5中任一项和/或权利要求6所述的交易处理方法。A storage medium stores a program thereon, and when the program is executed by a processor, the transaction processing method according to any one of claims 1 to 5 and / or claim 6 is implemented.
  10. 一种电子设备,所述电子设备包括存储器和处理器,所述存储器用于存储程序,所述处理器用于运行程序,其中,所述程序运行时执行如权利要求1至5中任一项和/或权利要求6所述的交易处理方法。An electronic device includes a memory and a processor, the memory is used to store a program, and the processor is used to run a program, wherein when the program is run, any one of claims 1 to 5 and The transaction processing method according to claim 6.
  11. 一种区块链系统,所述系统包括主区块链分区和至少二个子区块链分区,其中所述至少二个子区块链分区包括第一子区块链分区和第二主区块链分区,A blockchain system comprising a main blockchain partition and at least two sub-blockchain partitions, wherein the at least two sub-blockchain partitions include a first sub-blockchain partition and a second main blockchain Partition,
    所述第一子区块链分区内的记账节点用于接收由客户端发起的交易请求;从所述交易请求中获取转入方账号;从主区块链分区中获取各个子区 块链分区的相关信息;根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区;判断所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区是否相同;如果所述转入方账号对应的子区块链分区与所述转出方账号对应的子区块链分区不同,根据所述各个子区块链分区的相关信息确定所述转入方账号对应的子区块链分区内的记账节点;在所述转出方账号对应的子区块链分区内的记账节点对所述交易请求进行处理之后,将所述交易请求转发至所述转入方账号对应的第二子区块链分区内的记账节点;The accounting node in the first sub-blockchain partition is used to receive a transaction request initiated by a client; obtain a transferee account number from the transaction request; obtain each sub-blockchain from the main blockchain partition Relevant information about the partition; determining the sub-blockchain partition corresponding to the transferee account according to the relevant information of each sub-blockchain partition; judging the sub-blockchain partition corresponding to the transferee account and the transfer Whether the sub-blockchain partition corresponding to the exporter account is the same; if the sub-blockchain partition corresponding to the transfer-in account is different from the sub-blockchain partition corresponding to the transfer-out account, according to each sub-block The relevant information of the chain partition determines the accounting node in the sub-blockchain partition corresponding to the transferee account; the accounting node in the sub-blockchain partition corresponding to the transferee account performs the transaction request. After processing, forward the transaction request to the accounting node in the second sub-blockchain partition corresponding to the transferee account;
    所述第二子区块链分区内的记账节点用于接收所述第一子区块链分区内的记账节点发送的所述交易请求,并对所述交易请求进行处理。The accounting node in the second sub-blockchain partition is configured to receive the transaction request sent by the accounting node in the first sub-blockchain partition, and process the transaction request.
PCT/CN2019/094557 2018-07-19 2019-07-03 Transaction processing method and apparatus, and blockchain system WO2020015533A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810798598.1 2018-07-19
CN201810798598.1A CN108985742B (en) 2018-07-19 2018-07-19 Transaction processing method and device and block chain system

Publications (1)

Publication Number Publication Date
WO2020015533A1 true WO2020015533A1 (en) 2020-01-23

Family

ID=64550427

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/094557 WO2020015533A1 (en) 2018-07-19 2019-07-03 Transaction processing method and apparatus, and blockchain system

Country Status (2)

Country Link
CN (1) CN108985742B (en)
WO (1) WO2020015533A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113935836A (en) * 2021-10-19 2022-01-14 平安科技(深圳)有限公司 Cross-border payment method, system, equipment and medium based on Fabric alliance chain

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985742B (en) * 2018-07-19 2022-04-05 深圳市迅雷网络技术有限公司 Transaction processing method and device and block chain system
CN110245522B (en) * 2019-01-16 2022-07-12 腾讯科技(深圳)有限公司 Data processing method, terminal and medium in block chain fund settlement system
CN109934592A (en) * 2019-03-22 2019-06-25 深圳市网心科技有限公司 A kind of across the chain communication means of block chain, system, electronic equipment and storage medium
CN109961366A (en) * 2019-03-25 2019-07-02 中国农业银行股份有限公司 A kind of method of commerce and system based on subregion common recognition
CN110322348A (en) * 2019-06-03 2019-10-11 阿里巴巴集团控股有限公司 Reconciliation system, method, apparatus and electronic equipment based on block chain
US11188910B2 (en) 2019-06-03 2021-11-30 Advanced New Technologies Co., Ltd. Blockchain-based reconciliation system, method, and apparatus and electronic device
CN110287205A (en) * 2019-06-21 2019-09-27 中国银联股份有限公司 A kind of across the fragment transaction data processing method of block chain and device
CN111144866B (en) * 2019-12-25 2021-04-30 腾讯科技(深圳)有限公司 Data transfer method, device, node equipment and storage medium
CN112488717A (en) * 2020-12-30 2021-03-12 国网河南省电力公司南阳供电公司 Power management method based on block chain

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107147735A (en) * 2017-05-12 2017-09-08 北京博晨技术有限公司 A kind of distributed account book system based on hierarchy
CN107239940A (en) * 2017-05-11 2017-10-10 北京博晨技术有限公司 Network trading method and device based on block catenary system
CN107464112A (en) * 2017-07-20 2017-12-12 捷德(中国)信息科技有限公司 Exchange management method and system based on block chain
US20180198626A1 (en) * 2015-02-27 2018-07-12 Guardtime Ip Holdings Limited Blockchain-supported, fail-safe synchronization in a data authentication infrastructure
CN108985742A (en) * 2018-07-19 2018-12-11 深圳市网心科技有限公司 Transaction processing method, device and block catenary system

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170116693A1 (en) * 2015-10-27 2017-04-27 Verimatrix, Inc. Systems and Methods for Decentralizing Commerce and Rights Management for Digital Assets Using a Blockchain Rights Ledger
CN105719185B (en) * 2016-01-22 2019-02-15 杭州复杂美科技有限公司 The data comparison and common recognition method of block chain
CN107819582A (en) * 2016-09-14 2018-03-20 陈新 Intelligent block chain interacted system
KR101841565B1 (en) * 2017-04-27 2018-03-26 주식회사 코인플러그 Method for issuing, using, refunding, settling and revocating electric voucher in use of merkle tree structure on the basis of unspent transaction output, and server using the same
CN107392608B (en) * 2017-07-11 2020-07-07 北京博晨技术有限公司 Block chain system-based digital asset transaction method and block chain system
CN107528886B (en) * 2017-07-25 2020-07-31 中国科学院计算技术研究所 Block chain full-network splitting method and system
CN107909369A (en) * 2017-10-13 2018-04-13 布比(北京)网络技术有限公司 Based on the common recognition method, apparatus merchandised across chain and storage medium
CN107862216B (en) * 2017-10-13 2021-04-06 布比(北京)网络技术有限公司 Privacy protection method, device and storage medium for anonymous cross-link transaction
CN108009811B (en) * 2017-11-30 2021-06-04 中国人民解放军国防科技大学 Inter-cloud computing environment value exchange-oriented cross-chain communication method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180198626A1 (en) * 2015-02-27 2018-07-12 Guardtime Ip Holdings Limited Blockchain-supported, fail-safe synchronization in a data authentication infrastructure
CN107239940A (en) * 2017-05-11 2017-10-10 北京博晨技术有限公司 Network trading method and device based on block catenary system
CN107147735A (en) * 2017-05-12 2017-09-08 北京博晨技术有限公司 A kind of distributed account book system based on hierarchy
CN107464112A (en) * 2017-07-20 2017-12-12 捷德(中国)信息科技有限公司 Exchange management method and system based on block chain
CN108985742A (en) * 2018-07-19 2018-12-11 深圳市网心科技有限公司 Transaction processing method, device and block catenary system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113935836A (en) * 2021-10-19 2022-01-14 平安科技(深圳)有限公司 Cross-border payment method, system, equipment and medium based on Fabric alliance chain
CN113935836B (en) * 2021-10-19 2024-03-22 平安科技(深圳)有限公司 Cross-border payment method, system, equipment and medium based on Fabric alliance chain

Also Published As

Publication number Publication date
CN108985742A (en) 2018-12-11
CN108985742B (en) 2022-04-05

Similar Documents

Publication Publication Date Title
WO2020015533A1 (en) Transaction processing method and apparatus, and blockchain system
US10698885B2 (en) Method and device for writing service data in block chain system
TWI727292B (en) Block chain transaction method and device, and electronic equipment
CN110520882B (en) Parallel execution of transactions in a blockchain network
US11398914B2 (en) Blockchain-based data authorization method and apparatus
TWI712976B (en) Asset management system, method and device, electronic equipment
TWI786282B (en) Block chain transaction method and device, electronic equipment
JP6975101B2 (en) Methods, devices and non-temporary computer-readable storage media for transaction execution and validation in the blockchain (transaction execution and validation in the blockchain)
US11726968B2 (en) Methods, apparatuses, and devices for transferring data assets based on blockchain
JP6498767B2 (en) System for efficient processing of transaction requests related to database accounts
WO2020029629A1 (en) Transaction method and system based on centralized settlement and block chain storage
TW201822033A (en) Resource processing method and apparatus
TWI730690B (en) Method and device for simultaneously executing transactions in block chain, computer readable storage medium and computing equipment
US11228446B2 (en) Blockchain-based reconciliation method and apparatus and electronic device
WO2020216077A1 (en) Blockchain event deduplication method and apparatus, and computer device and storage medium
EP3961453A1 (en) Method and apparatus for invoking smart contract, electronic device, and storage medium
US20190286841A1 (en) Detecting alterations of journal data structures
WO2016169420A1 (en) Method, device and system for querying service request execution state
CN108710658B (en) Data record storage method and device
CN111383008B (en) Block chain transfer method and device based on account model
CN113592495A (en) Block chain-based evidence storing method, device and system
CN111444201A (en) Block chain-based security trading process optimization method, equipment and medium
US20230318808A1 (en) Custodial digital wallet management systems
US11677728B2 (en) Secure authorization and transmission of data between trustless actors
JP2018507488A (en) Data transmission method and transmission system

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: 19837116

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 14/05/2021)

122 Ep: pct application non-entry in european phase

Ref document number: 19837116

Country of ref document: EP

Kind code of ref document: A1