WO2020056570A1 - Sharding mechanism-based block generation method for block network, and block network system - Google Patents

Sharding mechanism-based block generation method for block network, and block network system Download PDF

Info

Publication number
WO2020056570A1
WO2020056570A1 PCT/CN2018/106090 CN2018106090W WO2020056570A1 WO 2020056570 A1 WO2020056570 A1 WO 2020056570A1 CN 2018106090 W CN2018106090 W CN 2018106090W WO 2020056570 A1 WO2020056570 A1 WO 2020056570A1
Authority
WO
WIPO (PCT)
Prior art keywords
block
node
data
groups
nodes
Prior art date
Application number
PCT/CN2018/106090
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 柯宾汉数位金融科技有限公司
Priority to PCT/CN2018/106090 priority Critical patent/WO2020056570A1/en
Priority to TW107133149A priority patent/TWI677220B/en
Publication of WO2020056570A1 publication Critical patent/WO2020056570A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass

Definitions

  • the invention relates to a block generation method and a block network system of a block network using a sharding mechanism, and in particular, to a method and a method for using the sharding mechanism to more effectively generate blocks in a block network and Block network system.
  • Blockchain technology is a technical solution that does not rely on third parties to store, verify, transfer and communicate network data through its own distributed nodes. Therefore, from the perspective of financial accounting, some people regard blockchain technology as a decentralized and open decentralized large-scale network book (public ledger). Teenage can use the same technical standard at any time. Add your own information, extend the blockchain, and continue to meet the data entry needs brought by various needs.
  • the public ledger used by Bitcoin is a set of decentralized storage schemes based on the Proof-of-Work mechanism, which usually has extremely high security and anti-attack characteristics.
  • computing power of up to thousands of TH / s is required, which has exceeded the total computing power of the top 500 supercomputers in the world by a hundred times.
  • each computer can form a node to obtain information or data from the blockchain network, such as transaction data, and then the node can use the data to generate blocks including hash operations.
  • the program or block generates a program to generate a new block, and connects the newly generated block to the end of the blockchain stored by the node.
  • a proof-of-work mechanism is used in the aforementioned blockchain system adopted by Bitcoin to determine whether the block can be generated, and the proof-of-work is solved by nodes.
  • the hash operation is used to achieve it. Therefore, in order to obtain the right to generate new blocks, each node will spend a large amount of computing power on the hash calculation of the workload proof.
  • each node can process data and produce blocks at the same time. Under this architecture, no proof of work is needed, so the node's computing power can be liberated by the hash operation of the proof of work to generate blocks. The speed will also increase accordingly.
  • the node on the blockchain network is a computer host, and the computer host will have different computing capabilities according to its specifications. When the computing power of the computer host is far greater than the computing power required to perform the block generation program or the block generation program, the computing power of the computer host is a waste.
  • an object of the present invention is to provide a block generation method and a block network system of a block network using a sharding mechanism, which can more effectively utilize computer computing capabilities to generate blocks, and can effectively prevent dispersion Distributed Denial-of-service attack (DDoS).
  • DDoS dispersion Distributed Denial-of-service attack
  • the present invention discloses a method for generating blocks of a block network using a sharding mechanism, which is executed on a computer system including a plurality of nodes.
  • the method is characterized in that the method includes the following steps:
  • a first node among the nodes obtains a plurality of data based on a blockchain agreement
  • the first node disperses the data in a plurality of groups, and simultaneously performs a block generation process on the data in the groups in parallel;
  • the first node forms a block according to the results of the block generation procedures performed by the groups.
  • the nodes include a plurality of second nodes, and the method further includes the following steps:
  • the first node generates the block, and sends a broadcast corresponding to the block
  • the second nodes respectively receive the broadcast to confirm the block
  • the block When the block is confirmed by more than a predetermined number of the second nodes, the block becomes a confirmed block.
  • the predetermined number is two-thirds of the total number of these nodes.
  • the second node then distributes the received broadcast in one of a plurality of second groups.
  • the first node is a computer host, and the method further includes:
  • the first node determines the number of the groups according to the computing power of the computer host.
  • the first node distributes the data among the groups through a consistent hash operation.
  • a block network system applying a fragmentation mechanism is also disclosed, which is characterized by:
  • a blockchain network that stores multiple pieces of data
  • a first computing device connected to the blockchain network to obtain the data from the blockchain network.
  • the first computing device has a processor and stores a block generation program, and the processor selectively executes Multiple procedures for generating the block;
  • the processor distributes the data to a plurality of groups, and simultaneously performs the block generation procedure on the data in the groups in parallel, and A block is formed according to the operation result of the block generating program.
  • the first computing device After the first computing device forms the block, the first computing device sends a broadcast corresponding to the block through the blockchain network.
  • the computing devices include the first computing device and a plurality of second computing devices.
  • the second computing devices are connected to the blockchain network and pass through the blockchain network.
  • the broadcast corresponding to the block is received, and the block is confirmed according to the broadcast.
  • the block becomes a confirmed block.
  • the processor determines the number of the groups according to its own computing power.
  • the computing device stores a consistent hash computing program, and the processor executes the consistent hash computing program to disperse the information to the groups.
  • the block generation method and system of the blockchain of the present invention can effectively utilize the computing power of nodes, improve the speed of generating blocks and the efficiency of processing data, and can effectively prevent distributed denial of service attacks. -of-serviceattack (DDoS).
  • DDoS distributed denial of service attacks
  • FIG. 1A is a flowchart illustrating steps of a block generation method of a block network using a fragmentation mechanism according to a specific embodiment of the present invention.
  • FIG. 1B is a functional block diagram of a block network system that can execute the method of FIG. 1A.
  • FIG. 2 is a schematic diagram illustrating a fragmentation mechanism according to another embodiment of the present invention.
  • FIG. 3 is a flowchart illustrating steps of a block generation method of a block network according to another embodiment of the present invention.
  • FIG. 1A shows a flowchart of steps of a method for generating a block of a block network using a fragmentation mechanism according to a specific embodiment of the present invention.
  • FIG. 1B shows a method for executing the method of FIG. 1A.
  • the blockchain network system 2 may include a blockchain network 20 and a plurality of computing devices connected to the blockchain network 20, and the computing devices may be connected to each other through the blockchain network 20.
  • a computing device may also be referred to as a node, which may be a computer host or any device with logic computing capabilities. Each computing device can perform the same computing function, but for the sake of convenience, the central computing device shown in FIG.
  • 1B is defined as the first node 22, and other computing devices are defined as the second node 24. .
  • any computing device or node connected to the blockchain network 20 can be used as the first node 22 to perform the same computing procedure.
  • a computing device or node other than itself can Is defined as second node 24.
  • the block generation method of the block network in this embodiment can be executed by a computer system, and further, it can be performed by the block network system 2 shown in FIG. 1B.
  • the block generation method of the blockchain in this embodiment may include the following steps: Step S10, the first node 22 (ie, the first computing device) obtains a plurality of data based on the blockchain agreement; step S12, the first node 22 will The obtained data is dispersed in a plurality of groups, and a block generation process is performed on the data in each group in parallel at the same time; and in step S14, the first node forms a new area according to the results of the block generation process performed by all the groups. Piece.
  • the blockchain network 20 can store multiple pieces of data, which can include different forms or contents according to different application fields. For example, these data can be financial transaction data, medical medical records, identity verification data, academic data, or human resources. Smart learning materials, etc.
  • the first node 22 may obtain one or more pieces of the plurality of pieces of data from the blockchain network 20 based on the blockchain agreement. In practice, the first node 22 can set conditions by itself to search and obtain qualified data from the blockchain network 20. Please note that the above available data refers to data that has not yet been written in any block. .
  • the first node 22 may distribute the acquired pieces of data into a plurality of groups, and perform a block generation process on the data in the plurality of groups in parallel at the same time.
  • the number of groups can be determined by the first node 22, and the first node 22 can simultaneously execute a block generation program equivalent to the number of groups to perform hash operations on the data in each group in parallel.
  • the group is determined by the number of block generation procedures that the first node 22 can execute simultaneously.
  • the description of the debris is described later.
  • the process of performing step S12 by the first node 22 is detailed below.
  • the first node 22 may include a processor 220.
  • the first node 22 in this embodiment is a computer host or a device with logic operation capabilities, and the processor 220 may be a computer host or a central processing unit (CPU) of a device with logic operation capabilities.
  • the first node 22 may store a consistent hashing program and a block generating program.
  • the consistent hashing program may distribute the acquired data in various groups, and the block generating program may Processing the data in a group, including hashing each data.
  • the consistent hash calculation program and the block generation program can be established in the database or memory of the first node 22.
  • the processor 220 may calculate or learn from the historical data the computing power required by the processor 22 to execute a block generating program, and compare it with the total computing power of the processor 220 to obtain a location for executing a block generating program. Required CPU usage. In this way, the processor 220 can know the number of block generation programs that can be executed simultaneously, that is, the number of groups.
  • the processor 220 may execute a consistent hashing operation program to disperse the data into groups. Then, the processor 220 performs a block generation on each group. program.
  • the block generation program includes a hash calculation program. The data in each group can be hashed to obtain the hash value of these data.
  • the processor 220 may first obtain the required amount of data, and then disperse all the obtained data into each group, and simultaneously execute a corresponding number of block generation procedures to simultaneously process the data in each group.
  • the processor 220 may perform a consistent hash calculation procedure after obtaining a piece of data, and classify the piece of data into one of the groups, and then generate the data in a block corresponding to the group.
  • the program processes this information.
  • the processor 220 of the first node 22 may write the results of the block generation procedures performed by all the groups into a block to generate a new block, and This newly generated block can be connected to the last end of the originally stored blockchain in the first node 22.
  • the method in which the processor 220 of the first node 22 disperses multiple pieces of data and executes multiple block generation programs at the same time to perform parallel operation on all the data that is, a division of the block generation method of the present invention.
  • Shard mechanism In other words, the first node 22 can be further divided into a plurality of fragments, and each fragment executes a block generation program at the same time.
  • FIG. 2 illustrates a schematic diagram of a fragmentation mechanism according to another embodiment of the present invention.
  • the aforementioned first node 22 may generate a block chain C, and the block chain C includes a plurality of blocks B.
  • a block B may be generated by the processor 220 of the first node 22 in a plurality of block generating programs at the same time.
  • the first node 22 may be further divided into three fragments, which are respectively 2200, 2202, and 2204. To represent.
  • the division of the first node 22 into three fragments is not a physical or internal operation function divided into three parts, but rather means that the processor 220 can execute three block generation programs simultaneously, which is equivalent to the first node 22 separately.
  • Three fragments with arithmetic processing power may be determined according to the computing capability of the processor 220. For example, if a CPU or processor executes a block generation program, it takes 30% of the CPU usage. It can be known that this CPU can execute a maximum of 3 block generation programs at the same time, occupying 90% of the CPU usage, so The CPU may determine that the number of groups or fragments is three, that is, the situation where the specific embodiment is divided into three pieces.
  • the number of shards can be determined by the CPU or processor as the maximum number of shards (determined by the maximum computing power), or the number of shards can also be determined based on the upper limit of CPU usage. For example, the user can set the CPU usage of the node's processor to generate blocks to not exceed 70%. If a block generating program requires 30% of the CPU usage, the processor can divide into two fragments. The block generation process is performed at the same time.
  • the first node 22 may execute a block generation procedure on the divided three fragments 2200, 2202, and 2204 to perform hash operations on data in different groups to form a sub-block B0. , B1, and B2, and each sub-block contains the results of multiple pieces of data processed by the block generation program. Then, the first node 22 may generate a block B according to the results of the sub-blocks B0, B1, and B2.
  • the three fragments 2200, 2202, and 2204 of this embodiment can calculate three subblocks B0, B1, and B2, respectively, the three subblocks B0, B1, and B2 are not determined in the blockchain C
  • the block is a collection of results obtained through the calculation of the block generation program.
  • Block B is a new block that is actually connected to the end of the blockchain C.
  • the first node 22 generates only one block B in a time.
  • the first node 22 executes three block generation programs with three fragments at the same time, it can process three times the amount of data at the same time, so the speed of generating block B is faster, and the computing power of the processor or CPU is fully used .
  • the block network system 2 can prevent distributed denial of service attacks (DDoS) to a certain extent.
  • DDoS distributed denial of service attacks
  • a node or a computing device can be further divided into multiple fragments and process data in parallel. Even if a DDoS attack is encountered, the fragmentation mechanism can make the attack more dispersed and avoid system overload, so it can be further prevented DDoS attack.
  • the processor 220 of the first node 22 in FIG. 2 is divided into three fragments 2200, 2202, and 2204 for data processing, the practice is not limited to this. As mentioned earlier, depending on the computing power of the processor, it can also be divided into 2 fragments or more than 3 fragments.
  • the sharding mechanism can also determine the number of shards when generating new blocks. For example, although the previous block can be generated using three shards at the same time, when the new block is generated, Other high-priority procedures are in operation, and the first node 22 can be divided into two fragments or no fragments to generate new blocks.
  • FIG. 3 is a flowchart illustrating steps of a block generation method of a block network according to another embodiment of the present invention.
  • the method in this specific embodiment may be executed after the method in FIG. 1A.
  • the block generation method of the block network of the specific embodiment includes the following steps: Step S30, the first node 22 generates a new block, and sends a broadcast of the corresponding block; Step S32, the second node 24 receives Broadcast, and confirm the block according to the broadcast; and step S34, when the predetermined number of second nodes 24 confirm the block, the block becomes a confirmed block.
  • step S30 after the aforementioned first node 22 generates a new block through the fragmentation mechanism, it can send a broadcast corresponding to the new block to the blockchain network 20.
  • the content of the broadcast contains information about the newly generated block, such as the creator code of the block (Block Proposer ID), the hash value of the block (Block Hash), the hash value of the previous block of the block ( Previous Block), creator signature (Signature), block height (Block height), and confirmation data (Acks).
  • each second node 24 can receive the broadcast from the first node 22 by the blockchain network 20, and confirm the block using the confirmation data in the broadcast.
  • the second node 24 may write the confirmation information in the foregoing broadcast into the new block when it generates a new block.
  • the second node 24 can have the same capabilities as the first node 22, so when the second node 24 generates a new block, it can also use the fragmentation mechanism as the first node 22 to effectively utilize its processing. Computing power.
  • the second node 24 can also send a broadcast corresponding to this block to other nodes on the blockchain network 20 after generating a new block.
  • the second node 24 that generates a new block and sends a broadcast, it is regarded as the first node 22 itself, and other nodes than itself are regarded as the second node 24.
  • each node can maintain its own block chain, and the blocks of different nodes 'blockchains can confirm each other, and the blocks of different nodes' blockchains can be further connected to each other to form a block network (Blocklattice). Guarantee the correctness of the block data.
  • each node since each node can be used as the first node to generate a new block and send a broadcast to other nodes, each node may receive multiple broadcasts from other nodes before generating a new block.
  • the multiple broadcasts and the acknowledgement data in the broadcast can also be distributed to multiple groups or fragments formed by this node, and each fragment can confirm the broadcasts in the corresponding group. Therefore, one node can also acknowledge multiple broadcasts from other nodes in parallel at the same time.
  • step S34 of FIG. 3 when the predetermined number of second nodes 24 confirms the broadcast sent by the first node 22, the block corresponding to the broadcast becomes a confirmed block and is stored in the first node 22.
  • the blockchain that connects this block to the end also becomes a confirmed blockchain.
  • the aforementioned predetermined number refers to two thirds of the total number of nodes or computing devices connected to the blockchain network 20.
  • the method for generating a block of a blockchain and the nodes in a block network system of the present invention can perform a sharding mechanism according to the computing capability of the node itself, and then can perform hash operations on multiple data in parallel to generate new blocks . This can improve the efficiency of node computing power usage, increase the speed of generating new blocks, prevent DDoS attacks, and maintain the stability of the blockchain network.

Abstract

A sharding mechanism-based block generation method for a block network, and a block network system. The method comprises the following steps: a first node acquiring a plurality of entries of data based on a blockchain protocol (S10); the node distributing the data to a plurality of groups, and performing, in parallel, a block generation process with respect to the data in the respective groups; and the first node generating a new block according to operation results of all groups (S14). The block generation method for a block network and the block network system enable effective utilization of operation capability of a node, and enable effective prevention of denial-of-service attacks.

Description

应用分片机制的区块网的区块产生方法及区块网系统Block generation method of block network and block network system using sharding mechanism 技术领域Technical field
本发明关于一种应用分片机制的区块网的区块产生方法及区块网系统,并且特别地,关于一种利用分片机制达到更有效地产生区块网中的区块的方法及区块网系统。The invention relates to a block generation method and a block network system of a block network using a sharding mechanism, and in particular, to a method and a method for using the sharding mechanism to more effectively generate blocks in a block network and Block network system.
背景技术Background technique
近年来,以区块链技术为基础的各种虚拟货币(Crypto Currency)开始在网际网路上大量使用和流行,如比特币、以太币、莱特币、瑞波币等,且这些虚拟货币的日交易额超过千万美元,并且在不断增长中。目前已有维基百科、戴尔电脑、新蛋、PayPal等著名公司和机构支持使用比特币或其他虚拟货币作为交易货币。虚拟货币与一般货币不同,并没有实体,然而,虚拟货币及其交易的可信赖度可依靠区块链技术来支持。In recent years, various virtual currencies (CryptoCurrency) based on blockchain technology have begun to be widely used and popular on the Internet, such as Bitcoin, Ethereum, Litecoin, Ripple, etc., and the daily transactions of these virtual currencies The amount is more than 10 million US dollars, and is constantly growing. Currently, Wikipedia, Dell Computer, Newegg, PayPal and other famous companies and institutions support the use of Bitcoin or other virtual currencies as transaction currencies. Virtual currency is different from general currency and has no entity. However, the reliability of virtual currency and its transactions can be supported by blockchain technology.
区块链技术是一种不依赖第三方、通过自身分散式节点进行网路数据的存储、验证、传递和交流的一种技术方案。因此,有人从金融会计的角度,把区块链技术看成是一种分散式开放性去中心化的大型网路记账薄(公开帐本),任何人任何时间都可以采用相同的技术标准加入自己的信息,延伸区块链,持续满足各种需求带来的数据录入需要。Blockchain technology is a technical solution that does not rely on third parties to store, verify, transfer and communicate network data through its own distributed nodes. Therefore, from the perspective of financial accounting, some people regard blockchain technology as a decentralized and open decentralized large-scale network book (public ledger). Anyone can use the same technical standard at any time. Add your own information, extend the blockchain, and continue to meet the data entry needs brought by various needs.
例如,比特币使用的公开帐本是一套基于工作量证明(Proof-of-Work)机制的分散式存储方案,通常具有极高的安全性和抗攻击特性。要对比特币区块链的安全性形成有效攻击,需要高达数千TH/s以上的计算能力,这已经超过了当前全球前500强超级电脑的计算能力总和的百倍。For example, the public ledger used by Bitcoin is a set of decentralized storage schemes based on the Proof-of-Work mechanism, which usually has extremely high security and anti-attack characteristics. To effectively attack the security of the Bitcoin blockchain, computing power of up to thousands of TH / s is required, which has exceeded the total computing power of the top 500 supercomputers in the world by a hundred times.
在区块链的技术中,每台电脑都可以形成一个节点以从区块链网路上获取信息或资料,例如获得交易资料等,接着节点可将这些资料进行包含杂凑(Hash)运算等出块程序或区块产生程序以产生新区块,并将新产生的区块连接于该节点所储存的区块链的最后端。除了信息或资料本身的杂凑运算之外,在前述比特币所采用的区块链系统中还采用了工作量证明机制来决定区块是否能产生,而工作量证明系以节点解开难解的杂凑运算来达成,因此,为了能获得新区块的产生权利,每个节点将会耗费大量的运算能力在工作量证明的杂凑运算上。In blockchain technology, each computer can form a node to obtain information or data from the blockchain network, such as transaction data, and then the node can use the data to generate blocks including hash operations. The program or block generates a program to generate a new block, and connects the newly generated block to the end of the blockchain stored by the node. In addition to the hash operation of the information or data itself, a proof-of-work mechanism is used in the aforementioned blockchain system adopted by Bitcoin to determine whether the block can be generated, and the proof-of-work is solved by nodes. The hash operation is used to achieve it. Therefore, in order to obtain the right to generate new blocks, each node will spend a large amount of computing power on the hash calculation of the workload proof.
区块链发展至今已不仅仅是用在虚拟货币的用途,去中心化的技术可应用多 种不同的技术领域,而工作量证明也不再是产生区块的唯一凭借。在某些区块链架构中,各节点可同时处理资料并产出区块,在此架构下不需要工作量证明,因此节点的运算能力可由工作量证明的杂凑运算解放出来,而产生区块的速度也将会对应地提升。然而,如前所述,区块链网路上的节点即为一台电脑主机,而电脑主机依据其规格会有不同的运算能力。当电脑主机的运算能力远大于进行出块程序或区块产生程序所需的运算能力时,对电脑主机的运算能力来说即形成一种浪费。The development of blockchain has not only been used for the purpose of virtual currency, decentralized technology can be applied to many different technical fields, and proof of work is no longer the sole means of generating blocks. In some blockchain architectures, each node can process data and produce blocks at the same time. Under this architecture, no proof of work is needed, so the node's computing power can be liberated by the hash operation of the proof of work to generate blocks. The speed will also increase accordingly. However, as mentioned earlier, the node on the blockchain network is a computer host, and the computer host will have different computing capabilities according to its specifications. When the computing power of the computer host is far greater than the computing power required to perform the block generation program or the block generation program, the computing power of the computer host is a waste.
因此,有必要研发一种新式的区块产生方法或系统,以解决上述问题。Therefore, it is necessary to develop a new block generation method or system to solve the above problems.
发明内容Summary of the Invention
有鉴于此,本发明的的目的在于提供一种应用分片机制的区块网的区块产生方法及区块网系统,可更有效地利用电脑运算能力以产生区块,并能有效防止分散式阻断服务攻击(distributed denial-of-service attack,DDoS)。In view of this, an object of the present invention is to provide a block generation method and a block network system of a block network using a sharding mechanism, which can more effectively utilize computer computing capabilities to generate blocks, and can effectively prevent dispersion Distributed Denial-of-service attack (DDoS).
为实现上述目的,本发明公开了一种应用分片机制的区块网的区块产生方法,执行于一电脑系统,该电脑系统包含复数个节点,其特征在于该方法包含以下步骤:In order to achieve the above object, the present invention discloses a method for generating blocks of a block network using a sharding mechanism, which is executed on a computer system including a plurality of nodes. The method is characterized in that the method includes the following steps:
该等节点中的一第一节点基于一区块链协定获取复数笔资料;A first node among the nodes obtains a plurality of data based on a blockchain agreement;
该第一节点将该等资料分散于复数个群组中,并同时并行地对该等群组中的该等资料进行一区块产生程序;以及The first node disperses the data in a plurality of groups, and simultaneously performs a block generation process on the data in the groups in parallel; and
该第一节点根据该等群组进行该等区块产生程序的结果形成一区块。The first node forms a block according to the results of the block generation procedures performed by the groups.
其中,该等节点包含复数个第二节点,该方法该进一步包含以下步骤:The nodes include a plurality of second nodes, and the method further includes the following steps:
该第一节点产生该区块,并且发出对应该区块的一广播;The first node generates the block, and sends a broadcast corresponding to the block;
该等第二节点分别接收该广播以确认该区块;以及The second nodes respectively receive the broadcast to confirm the block; and
当该区块被超过一预定数量的该等第二节点确认后,该区块成为一已确认区块。When the block is confirmed by more than a predetermined number of the second nodes, the block becomes a confirmed block.
其中,该预定数量为该等节点总数的三分之二。Among them, the predetermined number is two-thirds of the total number of these nodes.
其中,进一步包含以下步骤:Which further includes the following steps:
该第二节点接将所接收到的该广播分散于复数个第二群组的其中之一第二群组之中。The second node then distributes the received broadcast in one of a plurality of second groups.
其中,该第一节点为一电脑主机,该方法进一步包含:The first node is a computer host, and the method further includes:
该第一节点根据该电脑主机的运算能力决定该等群组的数量。The first node determines the number of the groups according to the computing power of the computer host.
其中,进一步包含以下步骤:Which further includes the following steps:
该第一节点藉由一致性杂凑运算将该等资料分散于该等群组中。The first node distributes the data among the groups through a consistent hash operation.
还公开了一种应用分片机制的区块网系统,其特征在于包含:A block network system applying a fragmentation mechanism is also disclosed, which is characterized by:
一区块链网路,储存有复数笔资料;以及A blockchain network that stores multiple pieces of data; and
一第一运算装置,连接该区块链网路以自该区块链网路取得该等资料,该第一运算装置具有一处理器并储存有一区块产生程序,该处理器选择性地执行多个该区块产生程序;A first computing device connected to the blockchain network to obtain the data from the blockchain network. The first computing device has a processor and stores a block generation program, and the processor selectively executes Multiple procedures for generating the block;
其中,当该第一运算装置取得该等资料后,该处理器将该等资料分散至复数个群组,并且同时并行地对该等群组中的该等资料进行该区块产生程序,且根据该等区块产生程序的运算结果形成一区块。Wherein, after the first computing device obtains the data, the processor distributes the data to a plurality of groups, and simultaneously performs the block generation procedure on the data in the groups in parallel, and A block is formed according to the operation result of the block generating program.
其中,当该第一运算装置形成该区块后,该第一运算装置透过该区块链网路发出对应该区块的一广播。Wherein, after the first computing device forms the block, the first computing device sends a broadcast corresponding to the block through the blockchain network.
其中,进一步包含复数个运算装置,该等运算装置包含该第一运算装置及复数个第二运算装置,该等第二运算装置连接于该区块链网路并透过该区块链网路接收对应该区块的该广播,且依据该广播确认该区块,其中当一预定数量的该等第二运算装置确认该区块,该区块即成为一已确认区块。Wherein, it further includes a plurality of computing devices. The computing devices include the first computing device and a plurality of second computing devices. The second computing devices are connected to the blockchain network and pass through the blockchain network. The broadcast corresponding to the block is received, and the block is confirmed according to the broadcast. When a predetermined number of the second computing devices confirm the block, the block becomes a confirmed block.
其中,该处理器根据自身的运算能力决定该等群组的数量。The processor determines the number of the groups according to its own computing power.
其中,该运算装置中储存有一致性杂凑运算程序,该处理器执行该一致性杂凑运算程序以将该等资讯分散至该等群组。The computing device stores a consistent hash computing program, and the processor executes the consistent hash computing program to disperse the information to the groups.
综上述,本发明的区块链的区块生成方法与系统可有效地利用节点的运算能力,提高产生区块的速度以及处理资料的效能,并能有效防止分散式阻断服务攻击(distributed denial-of-service attack,DDoS)。In summary, the block generation method and system of the blockchain of the present invention can effectively utilize the computing power of nodes, improve the speed of generating blocks and the efficiency of processing data, and can effectively prevent distributed denial of service attacks. -of-serviceattack (DDoS).
附图说明BRIEF DESCRIPTION OF THE DRAWINGS
图1A:绘示根据本发明的一具体实施例的应用分片机制的区块网的区块产生方法的步骤流程图。FIG. 1A is a flowchart illustrating steps of a block generation method of a block network using a fragmentation mechanism according to a specific embodiment of the present invention.
图1B:绘示可执行图1A的方法的区块网系统的功能方块图。FIG. 1B is a functional block diagram of a block network system that can execute the method of FIG. 1A.
图2:绘示根据本发明的另一具体实施例的分片机制的示意图。FIG. 2 is a schematic diagram illustrating a fragmentation mechanism according to another embodiment of the present invention.
图3:绘示根据本发明的另一具体实施例的区块网的区块产生方法的步骤流程图。FIG. 3 is a flowchart illustrating steps of a block generation method of a block network according to another embodiment of the present invention.
具体实施方式detailed description
为了让本发明的优点,精神与特征可以更容易且明确地了解,后续将以具体实施例并参照所附图式进行详述与讨论。值得注意的是,这些具体实施例仅为本发明代表性的具体实施例,其中所举例的特定方法、装置、条件、材质等并非用以限定本发明或对应的具体实施例。又,图中各装置仅系用于表达其相对位置且未按其实际比例绘述,合先叙明。In order to make the advantages, spirits and features of the present invention easier and clearer, it will be detailed and discussed in the following with specific embodiments and with reference to the accompanying drawings. It is worth noting that these specific embodiments are only representative specific embodiments of the present invention, and the specific methods, devices, conditions, materials, etc. exemplified therein are not intended to limit the present invention or corresponding specific embodiments. In addition, each device in the figure is only used to express its relative position and is not depicted in its actual proportion, which will be described together.
请参考图1A及图1B,图1A绘示根据本发明的一具体实施例的应用分片机制的区块网的区块产生方法的步骤流程图,图1B绘示可执行图1A的方法的区块网系统2的功能方块图。如图1B所示,区块网系统2可包含区块链网路20以及多个连接于区块链网路20的运算装置,而运算装置可透过区块链网路20互相联系。运算装置亦可称为节点,其可为电脑主机或任何具有逻辑运算能力的装置。各运算装置可执行同样的运算功能,但于此为了方便说明起见,将图1B中所绘示的位于中央的运算装置定义为第一节点22,而其他的运算装置则定义为第二节点24。于实务中,连接于区块链网路20上的任意运算装置或节点均可作为第一节点22以进行相同的运算程序,而对于各节点而言,除了自身之外的运算装置或节点可被定义为第二节点24。Please refer to FIG. 1A and FIG. 1B. FIG. 1A shows a flowchart of steps of a method for generating a block of a block network using a fragmentation mechanism according to a specific embodiment of the present invention. FIG. 1B shows a method for executing the method of FIG. 1A. Functional block diagram of the block network system 2. As shown in FIG. 1B, the blockchain network system 2 may include a blockchain network 20 and a plurality of computing devices connected to the blockchain network 20, and the computing devices may be connected to each other through the blockchain network 20. A computing device may also be referred to as a node, which may be a computer host or any device with logic computing capabilities. Each computing device can perform the same computing function, but for the sake of convenience, the central computing device shown in FIG. 1B is defined as the first node 22, and other computing devices are defined as the second node 24. . In practice, any computing device or node connected to the blockchain network 20 can be used as the first node 22 to perform the same computing procedure. For each node, a computing device or node other than itself can Is defined as second node 24.
如图1A所示,本具体实施例的区块网的区块产生方法可透过电脑系统来执行,更进一步的说,可透过如图1B所示的区块网系统2来执行。本具体实施例的区块链的区块产生方法可包含以下步骤:步骤S10,第一节点22(即第一运算装置)基于区块链协定获取复数笔资料;步骤S12,第一节点22将所获取的资料分散于复数个群组中,并同时并行地对各群组中的资料进行区块产生程序;以及,步骤S14,第一节点根据所有群组进行区块产生程序的结果形成新区块。As shown in FIG. 1A, the block generation method of the block network in this embodiment can be executed by a computer system, and further, it can be performed by the block network system 2 shown in FIG. 1B. The block generation method of the blockchain in this embodiment may include the following steps: Step S10, the first node 22 (ie, the first computing device) obtains a plurality of data based on the blockchain agreement; step S12, the first node 22 will The obtained data is dispersed in a plurality of groups, and a block generation process is performed on the data in each group in parallel at the same time; and in step S14, the first node forms a new area according to the results of the block generation process performed by all the groups. Piece.
区块链网路20中可储存多笔资料,这些资料可根据不同的应用领域而包含不同的形式或内容,例如,这些资料可为金融交易资料、医疗病历、身分验证资料、学历资料或人工智慧学习资料等。于步骤S10中,第一节点22基于区块链协定而可从区块链网路20中获取前述复数笔资料的其中的一笔或多笔资料。于实务中,第一节点22可自行设定条件,以自区块链网路20中搜索并获得符合条件的资料,请注意,上述可获取的资料系指尚未写入任何区块中的资料。The blockchain network 20 can store multiple pieces of data, which can include different forms or contents according to different application fields. For example, these data can be financial transaction data, medical medical records, identity verification data, academic data, or human resources. Smart learning materials, etc. In step S10, the first node 22 may obtain one or more pieces of the plurality of pieces of data from the blockchain network 20 based on the blockchain agreement. In practice, the first node 22 can set conditions by itself to search and obtain qualified data from the blockchain network 20. Please note that the above available data refers to data that has not yet been written in any block. .
于步骤S12中,第一节点22可将所获取的多笔资料分散至多个群组中,并且同时并行地对多个群组中的资料进行区块产生程序。群组数量可由第一节点22自行决定,并且第一节点22可同时执行与群组数量相当的区块产生程序来平行地对各群组内的资料进行杂凑运算。请注意,于本具体实施例中,并非是先形成群组再由群组的数量执行同等的区块产生程序,而是以第一节点22所能同时执行的区块产生程序数量来决定群组数量,其中,群组一词仅用来说明资料将会被归至其中一个第一节点22中的一碎片或区块产生程序来进行处理,亦即,一个碎片或一个区块产生程序即代表一个群组。关于碎片的说明如后述。以下详述第一节点22执行步骤S12的过程。In step S12, the first node 22 may distribute the acquired pieces of data into a plurality of groups, and perform a block generation process on the data in the plurality of groups in parallel at the same time. The number of groups can be determined by the first node 22, and the first node 22 can simultaneously execute a block generation program equivalent to the number of groups to perform hash operations on the data in each group in parallel. Please note that in this specific embodiment, instead of forming a group first and then executing the equivalent block generation procedure by the number of groups, the group is determined by the number of block generation procedures that the first node 22 can execute simultaneously. The number of groups, where the term group is used only to indicate that data will be processed by a fragment or block generation program in one of the first nodes 22, that is, a fragment or block generation program is Represents a group. The description of the debris is described later. The process of performing step S12 by the first node 22 is detailed below.
如图1B所示,第一节点22中可包含处理器220。第一节点22于本具体实施例中为电脑主机或具有逻辑运算能力的装置,而处理器220则可为电脑主机或具逻辑运算能力的装置的中央运算单元(CPU)。此外,第一节点22中可储存一致性杂 凑运算程序(Consistent Hashing)以及区块产生程序,其中一致性杂凑运算程序可将所获取的资料分散于各群组中,而区块产生程序则可对一个群组中的资料进行处理,包含对各资料进行杂凑运算等。于实务中,一致性杂凑运算程序及区块产生程序可建立于第一节点22的资料库或记忆体内。As shown in FIG. 1B, the first node 22 may include a processor 220. The first node 22 in this embodiment is a computer host or a device with logic operation capabilities, and the processor 220 may be a computer host or a central processing unit (CPU) of a device with logic operation capabilities. In addition, the first node 22 may store a consistent hashing program and a block generating program. The consistent hashing program may distribute the acquired data in various groups, and the block generating program may Processing the data in a group, including hashing each data. In practice, the consistent hash calculation program and the block generation program can be established in the database or memory of the first node 22.
处理器220可计算或由历史资料得知处理器22自身执行一个区块产生程序所需的运算能力,并将其与处理器220的总运算能力进行比对而得到执行一个区块产生程序所需的CPU使用率。藉此,处理器220可得知自身可同时执行区块产生程序的数量,亦即群组的数量。The processor 220 may calculate or learn from the historical data the computing power required by the processor 22 to execute a block generating program, and compare it with the total computing power of the processor 220 to obtain a location for executing a block generating program. Required CPU usage. In this way, the processor 220 can know the number of block generation programs that can be executed simultaneously, that is, the number of groups.
当第一节点22自区块链网路20获取资料后,处理器220可执行一致性杂凑运算程序而将资料分散至各群组,接着,处理器220对每一群组执行一个区块产生程序。区块产生程序中包含杂凑运算程序,可将各群组内的资料进行杂凑运算而得到这些资料的杂凑值。于实务中,处理器220可先获取所需的资料数量后,将所获得的全部资料分散至各群组中,同时执行相对应数量的区块产生程序以同时处理各群组中的资料。或者,于另一具体实施例中,处理器220也可于获得一笔资料后即进行一致性杂凑运算程序将该笔资料归类于其中一个群组,接着以对应此群组的区块产生程序对此笔资料进行处理。After the first node 22 obtains data from the blockchain network 20, the processor 220 may execute a consistent hashing operation program to disperse the data into groups. Then, the processor 220 performs a block generation on each group. program. The block generation program includes a hash calculation program. The data in each group can be hashed to obtain the hash value of these data. In practice, the processor 220 may first obtain the required amount of data, and then disperse all the obtained data into each group, and simultaneously execute a corresponding number of block generation procedures to simultaneously process the data in each group. Alternatively, in another specific embodiment, the processor 220 may perform a consistent hash calculation procedure after obtaining a piece of data, and classify the piece of data into one of the groups, and then generate the data in a block corresponding to the group. The program processes this information.
当前述各群组中的资料运算完后,于步骤S14中,第一节点22的处理器220可将所有群组执行区块产生程序后的结果写入一个区块中而产生新区块,并可将此新产生的区块连接于第一节点22中原本储存的区块链的最后端。After the data in the foregoing groups are calculated, in step S14, the processor 220 of the first node 22 may write the results of the block generation procedures performed by all the groups into a block to generate a new block, and This newly generated block can be connected to the last end of the originally stored blockchain in the first node 22.
于本具体实施例中,第一节点22的处理器220将多笔资料分散并同时执行多个区块产生程序来对所有资料进行平行运算的方法,即为本发明的区块产生方法的分片(Shard)机制。换言之,第一节点22可再分成数个碎片,每个碎片同时执行一个区块产生程序。In this specific embodiment, the method in which the processor 220 of the first node 22 disperses multiple pieces of data and executes multiple block generation programs at the same time to perform parallel operation on all the data, that is, a division of the block generation method of the present invention. Shard mechanism. In other words, the first node 22 can be further divided into a plurality of fragments, and each fragment executes a block generation program at the same time.
请一并参照图1B及图2,图2绘示根据本发明的另一具体实施例的分片机制的示意图。如图2所示,前述第一节点22可产生一条区块链C,此区块链C中包含多个区块B。一个区块B可由前述第一节点22的处理器220同时以复数个区块产生程序产生,于本具体实施例中,第一节点22可再分为三个碎片,分别以2200、2202及2204来表示。请注意,前述第一节点22分成三个碎片并非物理上或内部运算机能分成三个部分,而是指处理器220可同时执行三个区块产生程序,对于第一节点22来说相当于分别具有运算处理能力的三个碎片。如前所述,第一节点22所分出的碎片数量可根据依据其处理器220的运算能力而定。举例来说,若一CPU或处理器执行一个区块产生程序需占用30%的CPU使用率,可得知此CPU最大可同时执行3个区块产生程序,占用90%的CPU使用率,因此,CPU可决定群组或碎片的数量为3,即为本具体实施例分成三片的状况。实务中,CPU或处理器可自行决定分片 的数量为最大可分片数量(以最大运算力来决定),或者,分片的数量也可根据占用的CPU使用率上限来决定。举例来说,使用者可设定节点的处理器用来产生区块的CPU使用率不超过70%,若一个区块产生程序需占30%的CPU使用率,则处理器可分出二个碎片同时进行区块产生程序。Please refer to FIG. 1B and FIG. 2 together. FIG. 2 illustrates a schematic diagram of a fragmentation mechanism according to another embodiment of the present invention. As shown in FIG. 2, the aforementioned first node 22 may generate a block chain C, and the block chain C includes a plurality of blocks B. A block B may be generated by the processor 220 of the first node 22 in a plurality of block generating programs at the same time. In this specific embodiment, the first node 22 may be further divided into three fragments, which are respectively 2200, 2202, and 2204. To represent. Please note that the division of the first node 22 into three fragments is not a physical or internal operation function divided into three parts, but rather means that the processor 220 can execute three block generation programs simultaneously, which is equivalent to the first node 22 separately. Three fragments with arithmetic processing power. As mentioned above, the number of fragments sharded by the first node 22 may be determined according to the computing capability of the processor 220. For example, if a CPU or processor executes a block generation program, it takes 30% of the CPU usage. It can be known that this CPU can execute a maximum of 3 block generation programs at the same time, occupying 90% of the CPU usage, so The CPU may determine that the number of groups or fragments is three, that is, the situation where the specific embodiment is divided into three pieces. In practice, the number of shards can be determined by the CPU or processor as the maximum number of shards (determined by the maximum computing power), or the number of shards can also be determined based on the upper limit of CPU usage. For example, the user can set the CPU usage of the node's processor to generate blocks to not exceed 70%. If a block generating program requires 30% of the CPU usage, the processor can divide into two fragments. The block generation process is performed at the same time.
于本具体实施例中,第一节点22可藉由分出的三个碎片2200、2202及2204分别执行一个区块产生程序分别对不同群组内的资料进行杂凑运算,以形成子区块B0、B1及B2,各个子区块中分别包含多笔资料经过区块产生程序处理所产生的结果。接着,第一节点22可根据子区块B0、B1及B2的结果产生区块B。请注意,虽然本具体实施例的三个碎片2200、2202及2204可分别运算出三个子区块B0、B1及B2,然而此三个子区块B0、B1及B2并非区块链C中已确定的区块,而是资料经过区块产生程序运算所得到的结果的集合,区块B才是实际接于区块链C最后端的新区块。换言之,由区块链网路20中的其他节点或其他运算装置(第二节点24)看来,第一节点22于一时间内仅产生了一个区块B。然而,由于第一节点22同时以三个碎片执行三个区块产生程序,可同时处理三倍的资料量,因此产生区块B的速度更快,且充分地运用处理器或CPU的运算能力。In this specific embodiment, the first node 22 may execute a block generation procedure on the divided three fragments 2200, 2202, and 2204 to perform hash operations on data in different groups to form a sub-block B0. , B1, and B2, and each sub-block contains the results of multiple pieces of data processed by the block generation program. Then, the first node 22 may generate a block B according to the results of the sub-blocks B0, B1, and B2. Please note that although the three fragments 2200, 2202, and 2204 of this embodiment can calculate three subblocks B0, B1, and B2, respectively, the three subblocks B0, B1, and B2 are not determined in the blockchain C The block is a collection of results obtained through the calculation of the block generation program. Block B is a new block that is actually connected to the end of the blockchain C. In other words, from the perspective of other nodes or other computing devices (the second node 24) in the blockchain network 20, the first node 22 generates only one block B in a time. However, because the first node 22 executes three block generation programs with three fragments at the same time, it can process three times the amount of data at the same time, so the speed of generating block B is faster, and the computing power of the processor or CPU is fully used .
另一方面,区块网系统2基于其去中心化的特征,一定程度上可防止分散式阻断服务攻击(DDoS)。于前述的具体实施例中,节点或运算装置能更进一步地分成多个碎片且并行地处理资料,即便遭受DDoS攻击,分片机制可使攻击更分散而避免系统过载,故可更进一步地防止DDoS攻击。On the other hand, based on its decentralized characteristics, the block network system 2 can prevent distributed denial of service attacks (DDoS) to a certain extent. In the foregoing specific embodiment, a node or a computing device can be further divided into multiple fragments and process data in parallel. Even if a DDoS attack is encountered, the fragmentation mechanism can make the attack more dispersed and avoid system overload, so it can be further prevented DDoS attack.
虽然图2中的第一节点22的处理器220分成3个碎片2200、2202及2204来进行资料处理,但实务中并不限于此。如前所述,视处理器的运算能力,也可分成2个碎片或超过3个以上的碎片。此外,分片机制也可于产生新区块时决定分片数量,举例来说,虽然前一区块可利用三个碎片同时运算而产生,但于新区块产生时,若第一节点22同时有其他高优先程序正在运作,第一节点22可分成二个碎片或不分片来产生新区块。Although the processor 220 of the first node 22 in FIG. 2 is divided into three fragments 2200, 2202, and 2204 for data processing, the practice is not limited to this. As mentioned earlier, depending on the computing power of the processor, it can also be divided into 2 fragments or more than 3 fragments. In addition, the sharding mechanism can also determine the number of shards when generating new blocks. For example, although the previous block can be generated using three shards at the same time, when the new block is generated, Other high-priority procedures are in operation, and the first node 22 can be divided into two fragments or no fragments to generate new blocks.
请一并参照图1B以及图3,图3绘示根据本发明的另一具体实施例的区块网的区块产生方法的步骤流程图。本具体实施例的方法可接续于图1A的方法后执行。如图3所示,本具体实施例的区块网的区块产生方法包含以下步骤:步骤S30,第一节点22产生新区块,并发出对应区块的广播;步骤S32,第二节点24接收广播,并根据广播确认此区块;以及步骤S34,当超过预定数量的第二节点24确认此区块,此区块即成为已确认区块。Please refer to FIG. 1B and FIG. 3 together. FIG. 3 is a flowchart illustrating steps of a block generation method of a block network according to another embodiment of the present invention. The method in this specific embodiment may be executed after the method in FIG. 1A. As shown in FIG. 3, the block generation method of the block network of the specific embodiment includes the following steps: Step S30, the first node 22 generates a new block, and sends a broadcast of the corresponding block; Step S32, the second node 24 receives Broadcast, and confirm the block according to the broadcast; and step S34, when the predetermined number of second nodes 24 confirm the block, the block becomes a confirmed block.
于步骤S30中,前述的第一节点22经过了分片机制产生新区块后,可发出对应于此新区块的广播至区块链网路20。广播的内容包含了此新产生区块的相关资讯,例如区块的创建者代码(Block Proposer ID)、该区块的杂凑值(Block Hash)、 该区块的前一区块的杂凑值(Previous Block Hash)、创建者签名(Signature)、区块高度(Block Height)、以及确认资料(Acks)等。In step S30, after the aforementioned first node 22 generates a new block through the fragmentation mechanism, it can send a broadcast corresponding to the new block to the blockchain network 20. The content of the broadcast contains information about the newly generated block, such as the creator code of the block (Block Proposer ID), the hash value of the block (Block Hash), the hash value of the previous block of the block ( Previous Block), creator signature (Signature), block height (Block height), and confirmation data (Acks).
接着,于步骤S32中,各第二节点24可由区块链网路20接收前述第一节点22所发出的广播,并利用广播内的确认资料确认此区块。当确认无误后,第二节点24可于其产生新区块时将前述广播中的确认资讯写入新区块中。请注意,如前所述,第二节点24可具有与第一节点22相同的能力,故于第二节点24产生新区块时,也可如同第一节点22采用分片机制而有效利用其处理器的运算能力。此外,第二节点24于产生新区块后同样可发出对应此区块的广播给区块链网路20上的其他节点。换言之,对于产生新区块并发出广播的第二节点24而言,其本身被视为第一节点22,而除了自身之外的其他节点则被视为第二节点24。藉此,各节点可保有自身的区块链,且透过不同节点的区块链的区块互相确认,可进一步将不同节点的区块链的区块互相连接形成区块网(Blocklattice)而保证区块资料的正确性。Next, in step S32, each second node 24 can receive the broadcast from the first node 22 by the blockchain network 20, and confirm the block using the confirmation data in the broadcast. When the confirmation is correct, the second node 24 may write the confirmation information in the foregoing broadcast into the new block when it generates a new block. Please note that as mentioned above, the second node 24 can have the same capabilities as the first node 22, so when the second node 24 generates a new block, it can also use the fragmentation mechanism as the first node 22 to effectively utilize its processing. Computing power. In addition, the second node 24 can also send a broadcast corresponding to this block to other nodes on the blockchain network 20 after generating a new block. In other words, for the second node 24 that generates a new block and sends a broadcast, it is regarded as the first node 22 itself, and other nodes than itself are regarded as the second node 24. In this way, each node can maintain its own block chain, and the blocks of different nodes 'blockchains can confirm each other, and the blocks of different nodes' blockchains can be further connected to each other to form a block network (Blocklattice). Guarantee the correctness of the block data.
另一方面,由于每个节点都可做为第一节点而产生新区块并发出广播给其他节点,因此每个节点于产生新区块前可能会接收到多个来自其他节点的广播。当一节点接收到多个广播时,同样也可将多个广播与广播内的确认资料分散给此节点所形成的多个群组或碎片,且各碎片可分别确认对应群组中的广播。因此,一个节点也可同时并行地确认来自其他节点的多个广播。于实务中,当区块网系统内的节点数量快速扩张时,大量新区块的产生也会带来大量的广播,而节点的分片机制能快速处理大量的广播,使区块链网路维持其稳定性。On the other hand, since each node can be used as the first node to generate a new block and send a broadcast to other nodes, each node may receive multiple broadcasts from other nodes before generating a new block. When a node receives multiple broadcasts, the multiple broadcasts and the acknowledgement data in the broadcast can also be distributed to multiple groups or fragments formed by this node, and each fragment can confirm the broadcasts in the corresponding group. Therefore, one node can also acknowledge multiple broadcasts from other nodes in parallel at the same time. In practice, when the number of nodes in the block network system is rapidly expanding, the generation of a large number of new blocks will also bring a large number of broadcasts, and the node's sharding mechanism can quickly handle a large number of broadcasts to maintain the blockchain network. Its stability.
于图3的步骤S34中,当超过预定数量的第二节点24确认了第一节点22所发出的广播,此广播所对应的区块即成为已确认区块,而储存于第一节点22中并将此区块接于最后端的区块链也成为已确认区块链。前述的预定数量系指连接于区块链网路20的节点或运算装置的总数量的三分之二。值得注意的是,由于一区块链中新生成的区块资讯包含前一区块的杂凑值(Previous Block Hash),因此当第一节点22在其储存的区块链上生成新的区块,且此新区块被超过三分之二的其他节点或运算装置确认时,相当于确认了该区块所连接的区块链上的所有区块,藉此,可解决区块链中的拜占庭将军问题(Byzantine Generals Problem)。In step S34 of FIG. 3, when the predetermined number of second nodes 24 confirms the broadcast sent by the first node 22, the block corresponding to the broadcast becomes a confirmed block and is stored in the first node 22. The blockchain that connects this block to the end also becomes a confirmed blockchain. The aforementioned predetermined number refers to two thirds of the total number of nodes or computing devices connected to the blockchain network 20. It is worth noting that because the newly generated block information in a blockchain contains the hash value of the previous block (Previous Block Hash), when the first node 22 generates a new block on its stored blockchain When this new block is confirmed by more than two-thirds of other nodes or computing devices, it is equivalent to confirming all the blocks on the blockchain to which the block is connected, thereby solving the Byzantine in the blockchain General issues (Byzantine Generals Problem).
综上述,本发明的区块链的区块产生方法及区块网系统中的节点可根据节点本身的运算能力执行分片机制,进而可同时并行地对多笔资料进行杂凑运算而产生新区块。藉此,可提升节点运算能力的使用效率、提升新区块的产生速度、防止DDoS攻击,以及维持区块链网路的稳定性。To sum up, the method for generating a block of a blockchain and the nodes in a block network system of the present invention can perform a sharding mechanism according to the computing capability of the node itself, and then can perform hash operations on multiple data in parallel to generate new blocks . This can improve the efficiency of node computing power usage, increase the speed of generating new blocks, prevent DDoS attacks, and maintain the stability of the blockchain network.
藉由以上较佳具体实施例的详述,希望能更加清楚描述本发明的特征与精神,而并非以上述所揭露的较佳具体实施例来对本发明的范畴加以限制。相反地, 其目的是希望能涵盖各种改变及具相等性的安排于本发明所欲申请的专利范围的范畴内。因此,本发明所申请的专利范围的范畴应根据上述的说明作最宽广的解释,以致使其涵盖所有可能的改变以及具相等性的安排。With the above detailed description of the preferred embodiments, it is hoped that the features and spirit of the present invention may be more clearly described, rather than limiting the scope of the present invention with the preferred embodiments disclosed above. On the contrary, the intention is to cover various changes and equivalent arrangements within the scope of the patent scope of the present invention. Therefore, the scope of the patent scope of the present invention should be explained in the broadest sense according to the above description, so that it covers all possible changes and equal arrangements.

Claims (11)

  1. 一种应用分片机制的区块网的区块产生方法,执行于一电脑系统,该电脑系统包含复数个节点,其特征在于该方法包含以下步骤:A block generation method of a block network using a sharding mechanism is executed on a computer system, the computer system includes a plurality of nodes, and is characterized in that the method includes the following steps:
    该等节点中的一第一节点基于一区块链协定获取复数笔资料;A first node among the nodes obtains a plurality of data based on a blockchain agreement;
    该第一节点将该等资料分散于复数个群组中,并同时并行地对该等群组中的该等资料进行一区块产生程序;以及The first node disperses the data in a plurality of groups, and simultaneously performs a block generation process on the data in the groups in parallel; and
    该第一节点根据该等群组进行该等区块产生程序的结果形成一区块。The first node forms a block according to the results of the block generation procedures performed by the groups.
  2. 如权利要求1所述的方法,其特征在于,该等节点包含复数个第二节点,该方法该进一步包含以下步骤:The method of claim 1, wherein the nodes comprise a plurality of second nodes, and the method further comprises the following steps:
    该第一节点产生该区块,并且发出对应该区块的一广播;The first node generates the block, and sends a broadcast corresponding to the block;
    该等第二节点分别接收该广播以确认该区块;以及The second nodes respectively receive the broadcast to confirm the block; and
    当该区块被超过一预定数量的该等第二节点确认后,该区块成为一已确认区块。When the block is confirmed by more than a predetermined number of the second nodes, the block becomes a confirmed block.
  3. 如权利要求2所述的方法,其特征在于,该预定数量为该等节点总数的三分之二。The method of claim 2, wherein the predetermined number is two thirds of the total number of the nodes.
  4. 如权利要求2所述的方法,其特征在于进一步包含以下步骤:The method according to claim 2, further comprising the following steps:
    该第二节点接将所接收到的该广播分散于复数个第二群组的其中之一第二群组之中。The second node then distributes the received broadcast in one of a plurality of second groups.
  5. 如权利要求1所述的方法,其特征在于,该第一节点为一电脑主机,该方法进一步包含:The method according to claim 1, wherein the first node is a computer host, and the method further comprises:
    该第一节点根据该电脑主机的运算能力决定该等群组的数量。The first node determines the number of the groups according to the computing power of the computer host.
  6. 如权利要求1所述的方法,其特征在于进一步包含以下步骤:The method according to claim 1, further comprising the following steps:
    该第一节点藉由一致性杂凑运算将该等资料分散于该等群组中。The first node distributes the data among the groups through a consistent hash operation.
  7. 一种应用分片机制的区块网系统,其特征在于包含:A block network system using a fragmentation mechanism is characterized by including:
    一区块链网路,储存有复数笔资料;以及A blockchain network that stores multiple pieces of data; and
    一第一运算装置,连接该区块链网路以自该区块链网路取得该等资料,该第一运算装置具有一处理器并储存有一区块产生程序,该处理器选择性地执行多个该区块产生程序;A first computing device connected to the blockchain network to obtain the data from the blockchain network. The first computing device has a processor and stores a block generation program, and the processor selectively executes Multiple procedures for generating the block;
    其中,当该第一运算装置取得该等资料后,该处理器将该等资料分散至复数个群组,并且同时并行地对该等群组中的该等资料进行该区块产生程序,且根据该等区块产生程序的运算结果形成一区块。Wherein, after the first computing device obtains the data, the processor distributes the data to a plurality of groups, and simultaneously performs the block generation procedure on the data in the groups in parallel, and A block is formed according to the operation result of the block generating program.
  8. 如权利要求7所述的系统,其特征在于当该第一运算装置形成该区块后,该第一运算装置透过该区块链网路发出对应该区块的一广播。The system of claim 7, wherein after the first computing device forms the block, the first computing device sends a broadcast corresponding to the block through the blockchain network.
  9. 如权利要求8所述的系统,其特征在于进一步包含复数个运算装置,该等 运算装置包含该第一运算装置及复数个第二运算装置,该等第二运算装置连接于该区块链网路并透过该区块链网路接收对应该区块的该广播,且依据该广播确认该区块,其中当一预定数量的该等第二运算装置确认该区块,该区块即成为一已确认区块。The system according to claim 8, further comprising a plurality of computing devices, the computing devices including the first computing device and a plurality of second computing devices, the second computing devices being connected to the blockchain network Lu Bing receives the broadcast corresponding to the block through the blockchain network, and confirms the block according to the broadcast. When a predetermined number of the second computing devices confirm the block, the block becomes A confirmed block.
  10. 如权利要求7所述的系统,其特征在于,该处理器根据自身的运算能力决定该等群组的数量。The system of claim 7, wherein the processor determines the number of the groups according to its own computing power.
  11. 如权利要求7所述的系统,其特征在于,该运算装置中储存有一致性杂凑运算程序,该处理器执行该一致性杂凑运算程序以将该等资讯分散至该等群组。The system according to claim 7, wherein the computing device stores a consistent hashing operation program, and the processor executes the consistent hashing operation program to disperse the information to the groups.
PCT/CN2018/106090 2018-09-18 2018-09-18 Sharding mechanism-based block generation method for block network, and block network system WO2020056570A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2018/106090 WO2020056570A1 (en) 2018-09-18 2018-09-18 Sharding mechanism-based block generation method for block network, and block network system
TW107133149A TWI677220B (en) 2018-09-18 2018-09-20 Method and blocklattice system with sharding mechanism for generating block in blocklattice

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2018/106090 WO2020056570A1 (en) 2018-09-18 2018-09-18 Sharding mechanism-based block generation method for block network, and block network system

Publications (1)

Publication Number Publication Date
WO2020056570A1 true WO2020056570A1 (en) 2020-03-26

Family

ID=69188850

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/106090 WO2020056570A1 (en) 2018-09-18 2018-09-18 Sharding mechanism-based block generation method for block network, and block network system

Country Status (2)

Country Link
TW (1) TWI677220B (en)
WO (1) WO2020056570A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680050A (en) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 Fragmentation processing method, device and storage medium for alliance link data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106406896A (en) * 2016-09-27 2017-02-15 北京天德科技有限公司 Block chain block-building method based on parallel PipeLine technology
CN107743064A (en) * 2017-09-28 2018-02-27 深圳市易成自动驾驶技术有限公司 The common recognition method and system of block chain
CN108427601A (en) * 2017-02-13 2018-08-21 北京航空航天大学 A kind of cluster transaction processing method of privately owned chain node
WO2018149345A1 (en) * 2017-02-17 2018-08-23 阿里巴巴集团控股有限公司 Data processing method and device

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103475649B (en) * 2013-08-30 2016-03-16 中国科学院信息工程研究所 A kind of hidden anonymous communication method realized based on peer-to-peer network
WO2016022864A2 (en) * 2014-08-06 2016-02-11 Blockchain Technologies Corporation System and method for securely receiving and counting votes in an election
CN106452785B (en) * 2016-09-29 2019-05-17 财付通支付科技有限公司 Block chain network, branch node and block chain network application method
CN106899680B (en) * 2017-03-09 2019-07-30 深圳壹账通智能科技有限公司 The fragment treating method and apparatus of multi-tiling chain

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106406896A (en) * 2016-09-27 2017-02-15 北京天德科技有限公司 Block chain block-building method based on parallel PipeLine technology
CN108427601A (en) * 2017-02-13 2018-08-21 北京航空航天大学 A kind of cluster transaction processing method of privately owned chain node
WO2018149345A1 (en) * 2017-02-17 2018-08-23 阿里巴巴集团控股有限公司 Data processing method and device
CN107743064A (en) * 2017-09-28 2018-02-27 深圳市易成自动驾驶技术有限公司 The common recognition method and system of block chain

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111680050A (en) * 2020-05-25 2020-09-18 杭州趣链科技有限公司 Fragmentation processing method, device and storage medium for alliance link data
CN111680050B (en) * 2020-05-25 2023-09-26 杭州趣链科技有限公司 Fragment processing method, device and storage medium for alliance chain data

Also Published As

Publication number Publication date
TWI677220B (en) 2019-11-11
TW202013941A (en) 2020-04-01

Similar Documents

Publication Publication Date Title
TWI714847B (en) Method, device and electronic equipment for processing consensus request in blockchain consensus network
US10944570B2 (en) Method and server for providing notary service for file and verifying file recorded by notary service
CN110945550B (en) Processing and storing blockchain data in a trusted execution environment
US20170316497A1 (en) Method for creating, registering, revoking authentication information and server using the same
US20190182029A1 (en) Method of generating block chain and apparatus and method for generating blocks
US20180365448A1 (en) Method and server for providing notary service for file and verifying file recorded by notary service
WO2017076193A1 (en) Method and apparatus for processing request from client
WO2020173287A1 (en) Systems and methods for determining network shards in blockchain network
US20210256016A1 (en) Blockchain system and method
TW202023224A (en) Event-driven blockchain workflow processing
US9064124B1 (en) Distributed caching system
TWI614713B (en) Smart contract version control system and method thereof based on blockchain
CN109359206A (en) Image processing method and system based on Internet of Things campus administration
WO2020142906A1 (en) Structured directed acyclic graph-based transaction allocation method and apparatus
WO2021109718A1 (en) Verification method and apparatus based on block chain system
CN114556864A (en) Method and device for safety symbiotic excavation
WO2020056570A1 (en) Sharding mechanism-based block generation method for block network, and block network system
WO2021057273A1 (en) Method and apparatus for realizing efficient contract calling on fpga
TWI717071B (en) Certificate management system and method thereof
CN107085681B (en) Robust computing device identification framework
Jose et al. Enhancing Security in Resource Sharing Using Key Holding Mechanism
CN112258170A (en) PKI-based parallel signature system and method
Graves High performance password cracking by implementing rainbow tables on nVidia graphics cards (IseCrack)
WO2021082404A1 (en) Information monitoring method, system, device, and storage medium
WO2024007856A1 (en) Data processing method and apparatus, device, medium, and product

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

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 18934383

Country of ref document: EP

Kind code of ref document: A1