TWI677220B - Method and blocklattice system with sharding mechanism for generating block in blocklattice - Google Patents
Method and blocklattice system with sharding mechanism for generating block in blocklattice Download PDFInfo
- Publication number
- TWI677220B TWI677220B TW107133149A TW107133149A TWI677220B TW I677220 B TWI677220 B TW I677220B TW 107133149 A TW107133149 A TW 107133149A TW 107133149 A TW107133149 A TW 107133149A TW I677220 B TWI677220 B TW I677220B
- Authority
- TW
- Taiwan
- Prior art keywords
- block
- node
- data
- groups
- network
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements 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/44—Arrangements for executing specific programs
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一種應用分片機制之區塊網之區塊產生方法,其包含以下步驟:一節點基於區塊鏈協定獲取複數筆資料;節點將該等資料分散至複數個群組中,並同時並行地對各群組中之該等資料進行區塊產生程序;以及,節點根據所有群組的運算結果產生新區塊。本發明之區塊網的區塊生成方法可有效率地利用節點的運算能力,並能有效防止分散式阻斷服務攻擊(distributed denial-of-service attack,DDoS)。 A method for generating a block of a block network using a sharding mechanism includes the following steps: a node obtains a plurality of data based on a blockchain agreement; the node distributes the data into a plurality of groups, and simultaneously concurrently The data in each group performs a block generation process; and the node generates a new block according to the operation results of all the groups. The block generation method of the block network of the present invention can efficiently utilize the computing power of nodes and can effectively prevent distributed denial-of-service attack (DDoS).
Description
本發明關於一種應用分片機制之區塊網的區塊產生方法及區塊網系統,並且特別地,關於一種利用分片機制達到更有效地產生區塊網中之區塊的方法及區塊網系統。 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 block using the sharding mechanism to achieve more efficient generation of blocks in the block network. Network system.
近年來,以區塊鏈技術為基礎的各種虛擬貨幣(Crypto Currency)開始在網際網路上大量使用和流行,如比特幣、以太幣、萊特幣、瑞波幣等,且這些虛擬貨幣的日交易額超過千萬美元,並且在不斷增長中。目前已有維基百科、戴爾電腦、新蛋、PayPal等著名公司和機構支持使用比特幣或其他虛擬貨幣作為交易貨幣。虛擬貨幣與一般貨幣不同,並沒有實體,然而,虛擬貨幣及其交易的可信賴度可依靠區塊鏈技術來支持。 In recent years, various virtual currencies (Crypto Currency) 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 transaction value of these virtual currencies Over $ 10 million and 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 join using the same technical standards at any time. 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 proof-of-work (Proof-of-Work) mechanism of decentralized storage solutions, 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, the blockchain system used by the aforementioned Bitcoin also uses a proof-of-work mechanism to determine whether the block can be generated, and the proof-of-work is to solve the difficult hash by the node To achieve this, in order to obtain the right to generate new blocks, each node will spend a lot of computing power on the hash calculation of the proof of work.
區塊鏈發展至今已不僅僅是用在虛擬貨幣的用途,去中心化的技術可應用多種不同的技術領域,而工作量證明也不再是產生區塊的唯一憑藉。在某些區塊鏈架構中,各節點可同時處理資料並產出區塊,在此架構下不需要工作量證明,因此節點的運算能力可由工作量證明的雜湊運算解放出來,而產生區塊的速度也將會對應地提升。然而,如前所述,區塊鏈網路上的節點即為一台電腦主機,而電腦主機依據其規格會有不同的運算能力。當電腦主機的運算能力遠大於進行出塊程序或區塊產生程序所需的運算能力時,對電腦主機的運算能力來說即形成一種浪費。 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.
有鑑於此,本發明之一範疇在於提供一種應用分片機制之區塊網的區塊產生方法,可更有效地利用電腦運算能力以產生區塊。 In view of this, one category of the present invention is to provide a block generation method for a block network using a sharding mechanism, which can more effectively utilize computer computing capabilities to generate blocks.
根據本發明之一具體實施例,區塊網之區塊產生方法可執行於一電腦系統上,其中電腦系統包含多個節點。區塊網之區塊產生方法包含以下步驟:多個節點中之一第一節點基於區塊鏈協定獲取複數筆資料;第一節點將所獲取之複數筆資料分散於複數個群組中,且同時並行地對各群組中之資料進行雜湊運算;以及,根據各群組之運算結果形成區塊。 According to a specific embodiment of the present invention, the block generation method of the block network can be executed on a computer system, where the computer system includes a plurality of nodes. The block network block generation method includes the following steps: one of a plurality of nodes, a first node obtains a plurality of data based on a blockchain agreement; the first node distributes the obtained plurality of data in a plurality of groups, and At the same time, a hash operation is performed on the data in each group in parallel; and a block is formed according to the operation result of each group.
於本具體實施例中,區塊網之區塊產生方法進一步包含以下步驟:第一節點產生區塊後發出對應該區塊之廣播;多個節點中之複數個第二節點分別接收廣播以確認該區塊;以及,當預定數量的第二節點確認該區塊後,該區塊即成為已確認區塊。 In this specific embodiment, the method for generating a block of a block network further includes the following steps: a first node sends out a broadcast corresponding to the block after generating the block; and a plurality of second nodes of the plurality of nodes respectively receive the broadcast to confirm The block; and when a predetermined number of second nodes confirm the block, the block becomes a confirmed block.
本發明之另一範疇在於提供一種應用分片機制之區塊網系統,可更有效地利用電腦運算能力以產生區塊。 Another aspect of the present invention is to provide a block network system using a sharding mechanism, which can more effectively utilize computer computing power to generate blocks.
根據本發明之另一具體實施例,區塊網系統可包含區塊鏈網路及連接區塊鏈網路之第一運算裝置,其中第一運算裝置可包含處理器。第一運算裝置中可儲存區塊產生程序,而處理器可同時執行多個區塊產生程序。當第一運算裝置取得資料後,其處理器可將各資料分散至複數個群組,並同時並行地對各群組中之資料進行區塊產生程序,且根據所有區塊產生程序之運算結果形成區塊。 According to another specific embodiment of the present invention, the block network system may include a block chain network and a first computing device connected to the block chain network, wherein the first computing device may include a processor. The first computing device may store a block generation program, and the processor may execute a plurality of block generation programs simultaneously. After the first computing device obtains the data, its processor can disperse each data into a plurality of groups, and simultaneously perform block generation procedures on the data in each group in parallel, and generate the operation results of the procedures according to all the blocks. Form a block.
於本具體實施例中,區塊網系統進一步包含複數個連接區塊鏈網路的第二運算裝置,其中第二運算裝置可執行與第一運算裝置相同之 程序。第一運算裝置形成區塊後可透過區塊鏈網路發出對應於此區塊之廣播,且第二運算裝置可由區塊鏈網路接收廣播,並依據所接收到的廣播確認此區塊。當一定數量的第二運算裝置確認此區塊後,此區塊即成為已確認區塊。 In this embodiment, the blockchain network system further includes a plurality of second computing devices connected to the blockchain network, wherein the second computing device can perform the same operations as the first computing device. program. After the first computing device forms a block, it can send a broadcast corresponding to this block through the blockchain network, and the second computing device can receive the broadcast from the blockchain network and confirm this block based on the received broadcast. When a certain number of second computing devices confirm the block, the block becomes a confirmed block.
綜上述,本發明之區塊鏈之區塊生成方法與系統可有效地利用節點的運算能力,提高產生區塊的速度以及處理資料的效能。 In summary, the method and system for generating blocks of the blockchain of the present invention can effectively utilize the computing power of the nodes, and improve the speed of generating blocks and the efficiency of processing data.
S10~S14、S30~S34‧‧‧流程步驟 S10 ~ S14, S30 ~ S34‧‧‧Process steps
2‧‧‧區塊網系統 2‧‧‧block network system
20‧‧‧區塊鏈網路 20‧‧‧ Blockchain Network
22‧‧‧第一節點 22‧‧‧ the first node
24‧‧‧第二節點 24‧‧‧Second Node
220‧‧‧處理器 220‧‧‧Processor
2200、2202、2204‧‧‧碎片 2200, 2202, 2204‧‧‧ fragments
B‧‧‧區塊 B‧‧‧ Block
B0、B1、B2‧‧‧子區塊 B0, B1, B2 ‧‧‧ subblocks
C‧‧‧區塊鏈 C‧‧‧ Blockchain
圖1A係繪示根據本發明之一具體實施例之應用分片機制之區塊網之區塊產生方法的步驟流程圖。 FIG. 1A is a flowchart illustrating the steps of a method for generating blocks in 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 method for generating blocks of a block network according to another embodiment of the present invention.
為了讓本發明的優點,精神與特徵可以更容易且明確地了解,後續將以具體實施例並參照所附圖式進行詳述與討論。值得注意的是,這些具體實施例僅為本發明代表性的具體實施例,其中所舉例的特定方法、裝置、條件、材質等並非用以限定本發明或對應的具體實施例。又,圖中各裝置僅係用於表達其相對位置且未按其實際比例繪述,合先敘明。 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 is a flowchart illustrating steps of a method for generating a block of a block network using a sharding mechanism according to a specific embodiment of the present invention. FIG. Functional block diagram of the block network system 2 that executes the method of FIG. 1A. 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. twenty four. 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 of 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 (that is, 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 can obtain one or more pieces of data from the blockchain network 20 based on the blockchain agreement. In practice, the first node 22 can set conditions on its own to search for and obtain qualified data from the blockchain network 20. Please note that the above available data is 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 word "group" is used only to indicate that the 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 The program 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 is a computer host or a device with logic operation capability in this embodiment, and the processor 220 may be a computer host or a central processing unit (CPU) of a device with logic operation capability. In addition, the first node 22 can store a consistent hashing program and a block generating program. The consistent hashing program can distribute the acquired data in various groups, and the block generating program can 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. By this, the processor 220 can learn The number of block generation procedures 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 program with a block corresponding to the group. Process this information.
當前述各群組中之資料運算完後,於步驟S14中,第一節點22之處理器220可將所有群組執行區塊產生程序後的結果寫入一個區塊中而產生新區塊,並可將此新產生的區塊連接於第一節點22中原本儲存之區塊鏈的最後端。 After the data in the foregoing groups is 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 is a schematic diagram illustrating 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 foregoing first node 22 in a plurality of block generating programs at the same time. In this specific embodiment, the first node 22 may It is further divided into three fragments, which are represented by 2200, 2202, and 2204, respectively. 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 Three fragments with arithmetic processing power. As mentioned above, the number of fragments allocated 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 that takes up 30% of the CPU usage, it can be known that this CPU can execute up to 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 not to exceed 70%. If a block generation process requires 30% of the CPU usage, the processor can divide two fragments at the same time. Carry out the block generation process.
於本具體實施例中,第一節點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 sub-blocks B0, B1, and B2, respectively, the three sub-blocks 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, since the first node 22 is The execution of the three block generation program 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 a new block is generated. For example, although the previous block can be generated using three shards at the same time, when the new block is generated, if the first node 22 has 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 of this specific embodiment can be performed after the method of 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 Block Proposer ID, The block hash (block hash), the previous block hash (previous block hash) of the block, the creator signature (signature), block height (block height), and confirmation data (Acks), etc.
接著,於步驟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 use 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 be mutually confirmed, and the blocks of different nodes' blockchains can be further connected to each other to form a block network (Blocklattice) to ensure 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 confirmation data in the broadcast can also be distributed to multiple groups or fragments formed by this node, and each fragment can confirm the broadcast 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 fragmentation mechanism can quickly handle a large number of Broadcast, so that the blockchain network maintains its stability.
於圖3之步驟S34中,當超過預定數量的第二節點24確認了第一節點22所發出之廣播,此廣播所對應的區塊即成為已確認區塊,而儲存於第一節點22中並將此區塊接於最後端之區塊鏈也成為已確認區塊鏈。前述的預定數量係指連接於區塊鏈網路20之節點或運算裝置之總數量的三分之二。值得注意的是,由於一區塊鏈中新生成的區塊資訊包含前一區塊之雜湊值(Previous Block Hash),因此當第一節點22在其儲存之區塊鏈上生成新的區塊,且此新區塊被超過三分之二的其他節點或運算裝置確認時,相當於確認了該區塊所連接之區塊鏈上的所有區塊,藉此,可解決區塊鏈中的拜占庭將軍問題(Byzantine Generals Problem)。 In step S34 of FIG. 3, when the second node 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 previous block hash (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 blocks on the blockchain to which the block is connected, thereby solving the Byzantine in the blockchain Byzantine Generals Problem.
綜上述,本發明之區塊鏈之區塊產生方法及區塊網系統中之節點可根據節點本身的運算能力執行分片機制,進而可同時並行地對多筆資料進行雜湊運算而產生新區塊。藉此,可提升節點運算能力的使用效率、提升新區塊的產生速度、防止DDoS攻擊,以及維持區塊鏈網路的穩定性。 To sum up, the method for generating a block of a blockchain and the nodes in a block network system according to the present invention can perform a sharding mechanism according to the computing capability of the node itself, and then perform a hash operation on multiple data at the same time 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 can be more clearly described, and the scope of the present invention is not limited by the preferred embodiments disclosed above. On the contrary, the intention is to cover various changes and equivalent arrangements within the scope of the patents to be applied for in the present invention. Therefore, the scope of the patent scope of the present invention should be interpreted in the broadest sense according to the above description, so that it covers all possible changes and equal arrangements.
Claims (9)
Applications Claiming Priority (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 |
| WOPCT/CN2018/106090 | 2018-09-18 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| TWI677220B true TWI677220B (en) | 2019-11-11 |
| TW202013941A TW202013941A (en) | 2020-04-01 |
Family
ID=69188850
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| TW107133149A TWI677220B (en) | 2018-09-18 | 2018-09-20 | Method and blocklattice system with sharding mechanism for generating block in blocklattice |
Country Status (2)
| Country | Link |
|---|---|
| TW (1) | TWI677220B (en) |
| WO (1) | WO2020056570A1 (en) |
Families Citing this family (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111680050B (en) * | 2020-05-25 | 2023-09-26 | 杭州趣链科技有限公司 | A fragmentation processing method, equipment and storage medium for alliance chain data |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103475649A (en) * | 2013-08-30 | 2013-12-25 | 中国科学院信息工程研究所 | Concealed anonymous communication method 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 |
| CN106452785A (en) * | 2016-09-29 | 2017-02-22 | 财付通支付科技有限公司 | Block chain network, branch node and block chain network application method |
| CN106899680A (en) * | 2017-03-09 | 2017-06-27 | 上海亿账通区块链科技有限公司 | The burst treating method and apparatus of multi-tiling chain |
Family Cites Families (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106406896B (en) * | 2016-09-27 | 2020-03-17 | 北京天德科技有限公司 | 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 |
| CN107040582B (en) * | 2017-02-17 | 2020-08-14 | 创新先进技术有限公司 | A data processing method and device |
| CN107743064A (en) * | 2017-09-28 | 2018-02-27 | 深圳市易成自动驾驶技术有限公司 | The common recognition method and system of block chain |
-
2018
- 2018-09-18 WO PCT/CN2018/106090 patent/WO2020056570A1/en not_active Ceased
- 2018-09-20 TW TW107133149A patent/TWI677220B/en not_active IP Right Cessation
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103475649A (en) * | 2013-08-30 | 2013-12-25 | 中国科学院信息工程研究所 | Concealed anonymous communication method 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 |
| CN106452785A (en) * | 2016-09-29 | 2017-02-22 | 财付通支付科技有限公司 | Block chain network, branch node and block chain network application method |
| CN106899680A (en) * | 2017-03-09 | 2017-06-27 | 上海亿账通区块链科技有限公司 | The burst treating method and apparatus of multi-tiling chain |
Also Published As
| Publication number | Publication date |
|---|---|
| WO2020056570A1 (en) | 2020-03-26 |
| TW202013941A (en) | 2020-04-01 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP7649594B2 (en) | Maintenance of blockchain blocks in a partitioned blockchain network | |
| TWI714847B (en) | Method, device and electronic equipment for processing consensus request in blockchain consensus network | |
| Pasham | Optimizing Blockchain Scalability: A Distributed Computing Perspective | |
| WO2021103794A1 (en) | Method for realizing highly efficient privacy-preserving transaction in blockchain, and device | |
| CN110110498A (en) | A kind of digital publishing rights based on alliance's chain really weigh method and system | |
| CN113098689A (en) | Trust-establishing cross-chain consensus method, system, storage medium and application | |
| CN107103473A (en) | A kind of intelligent contract implementation method based on block chain | |
| CN108984789A (en) | Method, apparatus, storage medium and the electronic equipment of distribution book keeping operation | |
| WO2017076193A1 (en) | Method and apparatus for processing request from client | |
| WO2019019056A1 (en) | Method for frontal machine to participate in block chain consensus | |
| CN115208665B (en) | Germplasm resource data safe sharing method and system based on blockchain | |
| CN109359206A (en) | Image processing method and system based on Internet of Things campus administration | |
| CN110852648A (en) | A data processing method, device and computer storage medium | |
| CN109101338A (en) | A kind of block chain processing framework and its method based on the extension of multichannel chip | |
| CN115426125A (en) | A block validity verification method for blockchain sharding system | |
| CN107425957A (en) | A kind of cryptographic attack method, apparatus and isomery accelerate platform | |
| CN116582239A (en) | Block chain slicing method, block chain system and cross-slice transaction processing method | |
| CN113326475B (en) | Matrix inversion outsourcing calculation method based on elementary matrix | |
| WO2020082213A1 (en) | Network expandability blockchain implementation method | |
| TWI677220B (en) | Method and blocklattice system with sharding mechanism for generating block in blocklattice | |
| CN114463110A (en) | A blockchain-based credit system and method | |
| CN118277419A (en) | A blockchain-based educational data query optimization method | |
| TWI717071B (en) | Certificate management system and method thereof | |
| CN115021944A (en) | Consensus method and device based on aggregated signature and space-time proof algorithm | |
| TWI698100B (en) | Method for generating and integrating multiple blockchains and blockchain system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| MM4A | Annulment or lapse of patent due to non-payment of fees |