Method for constructing blockchain network and computer software program for implementing method

By building a virtual network in the blockchain network and implementing node management processes, the problems of frequent disconnection of nodes and processing resource depletion are solved, and the stability of the blockchain network and the sustainability of agreements are achieved.

CN119452598APending Publication Date: 2025-02-14COUNTUP KK
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202380049959.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2022-07-04
Filing Date
2023-05-29
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

Existing blockchain networks are difficult to maintain stability when nodes are frequently disconnected or processing resources are exhausted, resulting in network performance degradation and difficulty in reaching agreements.

Method used

By implementing node management processes on the computer, building a virtual network, recording signed nodes and punishing nodes that do not participate in the signature, ensuring that nodes in the network participate in block signatures sequentially and stably.

Benefits of technology

It has been realized that when the nodes stop working for a long time, the blockchain network can continue to implement agreements, improving the stability and reliability of the network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119452598A_ABST
    Figure CN119452598A_ABST
Patent Text Reader

Abstract

Provided is a method capable of continuously executing efficient agreement achievement (consensus) even when a predetermined node is stopped. Provided is a method having a punishment step in which a computer monitors whether or not a predetermined node among the nodes constituting the virtual network is able to perform a block signature, and deletes nodes that do not participate in the block signature continuously for a number of times of a certain threshold from the nodes constituting the virtual network.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for constructing a blockchain network. Background Art

[0002] The blockchain network is a self-regulating decentralized system that uses multiple computers and smartphones as nodes to improve the security and reliability of the entire network. It can also be called a system that does not allow data to be tampered with or incorrect.

[0003] Here, in order to maintain the blockchain network soundly, it is preferred that the nodes joining the network are always connected to the network and operate properly, but it can be said that it is difficult to achieve this state under the current circumstances.

[0004] For example, small portable terminals such as smartphones can usually connect to WiFi and mobile networks, while network lines used by computers hosted by data centers often have significantly poor connection stability and communication performance. Therefore, it is conceivable that terminals will frequently disconnect from the network or reconnect again.

[0005] In addition, regarding this type of small portable terminal, it is also conceivable that when executing applications that significantly consume the processing power and memory of the processor, such as playing games or viewing animations, the resources allocated to the blockchain application are exhausted and the operation is hindered.

[0006] In this situation, it is conceivable that there will be defects in continuing to maintain non-functioning nodes as members of the blockchain network, and methods will need to be installed in the future to minimize such defects. Summary of the invention

[0007] The present invention is proposed in view of the above-mentioned situation, and its purpose is to provide a system and method that can properly manage the nodes that constitute the blockchain, and can continue to execute the agreement (consensus) without stopping the blockchain even if several nodes stop functioning for a long time.

[0008] In order to solve the above-mentioned problems, according to the main viewpoints of the present invention, the following invention is provided.

[0009] A method for constructing a blockchain network, characterized in that:

[0010] The node management process includes a computer storing information about nodes related to the agreement for adding data received via the P2P network to the blockchain, and determining nodes that need to be signed based on a consensus algorithm.

[0011] The node management process is a process in which a computer manages all nodes that have reached a participation agreement and constructs a virtual network consisting of the nodes connected in a ring shape.

[0012] The process is as follows:

[0013] a signing node recording step, in which a computer records which node among the nodes constituting the virtual network can sign a block; and

[0014] The penalty step determines, based on the records in the signing node recording step, a node that has not participated in the block signing for a certain threshold number of times in a row, and deletes it from the nodes constituting the virtual network.

[0015] The method according to (1) is characterized in that the penalty step comprises the following steps:

[0016] a node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network can sign, and if it cannot sign, increments a count value indicating that it cannot sign; and

[0017] In the node deletion step, the computer determines at a specified timing whether the count value indicating the unsigned number of each node constituting the virtual network exceeds a specified threshold, and if it is determined that there is a node that exceeds the threshold, the node is deleted from the nodes constituting the virtual network.

[0018] The method according to (1) above, characterized in that:

[0019] The predetermined timing is the timing for generating a block.

[0020] The method according to (1) above, characterized in that:

[0021] The signing node recording step is a step of incrementing the count value of the block signing counter of the node that generated the block each time a block is generated, and recording which node can sign the block based on the value of the block signing counter.

[0022] The method according to (4) above is characterized in that:

[0023] The unsignable node recording step further includes a step of adjusting the unsignable count value by subtracting the signature count value from the unsignable count value at the predetermined node during the confirmation.

[0024] The method according to (1) above, characterized in that:

[0025] The node management process is a process in which a computer defines / differentiates nodes that have joined the agreement into Voter nodes that perform actions in a more stable environment and other Signer nodes, and manages them, and connects the above nodes to each other to build a ring-shaped virtual network.

[0026] The penalty step is a step of determining whether a node is a Voter node, and if the node is a Voter node, not deleting the node from the nodes constituting the virtual network.

[0027] (7) A computer software program for constructing a blockchain network, characterized in that:

[0028] The computer is caused to execute a node management process of storing information of nodes related to the agreement for adding data received via the P2P network to the blockchain, and determining nodes that need to be signed based on a consensus algorithm,

[0029] The node management process is a process in which a computer manages all nodes that have reached a participation agreement and constructs a virtual network consisting of the nodes connected in a ring shape.

[0030] Perform the following steps:

[0031] a signing node recording step, in which a computer records which node among the nodes constituting the virtual network can sign a block; and

[0032] The penalty step determines, based on the records in the signing node recording step, a node that has not participated in the block signing for a certain threshold number of times in a row, and deletes it from the nodes constituting the virtual network.

[0033] Based on the computer software program described in (7), it is characterized in that

[0034] The penalty process has the following steps:

[0035] a node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network can sign, and if it cannot sign, increments a count value indicating that it cannot sign; and

[0036] In the node deletion step, the computer determines at a specified timing whether the count value indicating the unsigned number of each node constituting the virtual network exceeds a specified threshold, and if it is determined that there is a node that exceeds the threshold, the node is deleted from the nodes constituting the virtual network.

[0037] The computer software program according to (7) above is characterized in that the predetermined timing is a timing for generating a block.

[0038] Based on the computer software program described in (7), it is characterized in that

[0039] The signing node recording step is a step of incrementing the count value of the block signing counter of the node that generated the block each time a block is generated, and recording which node can sign the block based on the value of the block signing counter.

[0040] Based on the computer software program described in (10), it is characterized in that

[0041] The unsignable node recording step further includes a step of adjusting the unsignable count value by subtracting the signature count value from the unsignable count value at the predetermined node during the confirmation.

[0042] Based on the computer software program described in (7), it is characterized in that

[0043] The node management process is a process in which a computer defines / differentiates nodes that have joined the agreement into Voter nodes that perform actions in a more stable environment and other Signer nodes, and manages them, and connects the above nodes to each other to build a ring-shaped virtual network.

[0044] The penalty step is a step of determining whether a node is a Voter node, and if the node is a Voter node, not deleting the node from the nodes constituting the virtual network.

[0045] In addition, features of the present invention other than those described above are disclosed in the description of the embodiments of the present invention described below and in the drawings thereof. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] Figure 1 It is a system schematic configuration diagram showing one embodiment of the present invention.

[0047] Figure 2 This is a schematic diagram showing the Sealer Ring.

[0048] Figure 3 This is a schematic diagram showing the state where several sealers are stopped.

[0049] Figure 4 This is a flowchart that also shows the processing logic of block signature confirmation.

[0050] Figure 5 This is a flowchart showing the processing logic when the penalty process is executed. DETAILED DESCRIPTION

[0051] Hereinafter, one embodiment of the present invention will be described with reference to the drawings.

[0052] (One embodiment)

[0053] Figure 1 The structure of a blockchain execution server component (computer software program) 1 according to one embodiment of the present invention is shown.

[0054] The execution server component 1 is a service program for building a blockchain network, which can execute actions on a server such as Linux (registered trademark), or can be embedded in an application and execute actions on a portable terminal. In this case, the component 1 is stored on a storage medium installed on each device, and is appropriately called and executed by the CPU of the device (not shown) on a memory (not shown) to perform actions as each structure of the present invention.

[0055] like Figure 1 As shown, the execution server component 1 has a smart contract execution unit 2, a consensus algorithm execution unit 3, a blockchain data storage function unit 4, a data synchronization function unit 5, and a P2P network construction function unit 6. Here, the smart contract execution unit 2 also provides an interface for the blockchain. The consensus algorithm execution unit 3 also provides a node management function unit 7.

[0056] The above-mentioned structural elements 2 to 7 can access the shared data 9 that stores the smart contract 10, the consensus algorithm 11, the blockchain data 12, and the node information 13.

[0057] Next, the detailed structure and function of each of the above-mentioned components will be described in detail through their operations.

[0058] (Functions of smart contract execution department, blockchain data storage department, data synchronization department, and P2P network construction department)

[0059] The smart contract execution unit 2 is a virtual machine that executes a specific method (update method) of the smart contract 10 stored in the shared data 9 based on external calls and data transmission to the blockchain network and returns the result.

[0060] The P2P network construction function unit 6 realizes the function of constructing a new node as a member of the P2P network of the blockchain and connecting the blockchain execution servers to each other. That is, in order to call and execute the method of the smart contract 10, a node for accessing the blockchain network is required. In order to make a certain node newly join the blockchain network, one of the existing nodes needs to be set as a member of the P2P network of the blockchain.

[0061] The data synchronization function unit 5 synchronizes the latest blockchain data 12 at each node. During the synchronization, data 11 is obtained from other nodes connected via P2P, and after the correctness is verified, it is saved as shared data 9. The blockchain data storage function unit 4 retains the shared data (blockchain data 12) of the above-mentioned blockchain in the storage area of ​​the server or portable terminal.

[0062] Regarding the call of the update method of the above-mentioned smart contract 10, a transaction is formed and sent from each node to the blockchain network. The transaction is transmitted to all nodes constituting the blockchain network. At this time, each node is temporarily queued as a transaction waiting to be stored in the block. It takes a certain amount of time until the transaction is stored in the block, so the update method is in principle an asynchronous process.

[0063] The execution of the update method of the smart contract 10 is equivalent to storing the call transaction of the method in the new block. The execution timing of the update method is when the block creation node creates a new block, and when other nodes other than the block creation node receive the new block and verify its correctness.

[0064] Smart contracts 10 are executed in the same manner on all nodes on the blockchain network, with the same results achieved along with the processed state updates.

[0065] Regarding the call and execution of the reference method of smart contract 10, the node's own verified smart contract code and internal state are used to immediately return the result. As mentioned above, smart contract 10 can be executed in the above manner because all nodes on the blockchain network share data 9.

[0066] In addition, the shared objects include blocks and transactions, as well as the code and internal state of smart contracts. As a result, any node can reproduce the execution of smart contracts based on the transactions stored in the blocks, and can independently verify the correctness of the internal state updates accompanying the execution. Based on this structure, the tamper-resistant characteristics of the blockchain are realized as an execution platform for smart contracts.

[0067] (Consensus Algorithm Execution Department)

[0068] Next, the consensus algorithm execution unit 3 of this embodiment is described.

[0069] The consensus algorithm 11 of this embodiment is based on Proof of Authority (PoA). This PoA is a consensus algorithm based on the consideration that only trusted nodes can sign blocks, and is a consensus algorithm in which nodes called Sealers form a ring-shaped virtual network and sign blocks in sequence at specified intervals.

[0070] In this embodiment, in order to join the network adopting this algorithm, it is necessary to obtain trust through approval (Aurhority) such as eKYC, and in this sense, it is centralized, but malicious participants can be excluded at a realistic level.

[0071] Below, an example is used to illustrate the case where a consensus algorithm 11 having such a concept is installed in the consensus algorithm execution unit 3 and the node management function unit of this embodiment.

[0072] The consensus algorithm execution unit 3 executes the agreement for adding the data received via the P2P network to the blockchain. Therefore, the information 13 of all nodes related to the agreement is retained. In addition, the node management function unit 7 provided in the consensus algorithm execution unit 3 manages and determines the nodes that should be signed based on the consensus algorithm 11.

[0073] Next, the operations of the consensus algorithm execution unit 3 and the node management function unit 7 are explained.

[0074] (Signatories and Voters)

[0075] The node management function unit 7 divides the nodes participating in the agreement into Singers (signatories) and Voters (voters) for management. Singers are nodes that are assumed to perform actions on portable terminals, and Voters are nodes that can be adequately endowed with network, power, and other computing resources, hosted in a data center, and perform actions on a server computer.

[0076]

Table 1

[0077]

[0078] The node management function is built for Voters and Singers Figure 2 Such a ring-shaped virtual network is constructed to sign the blocks containing transaction processing in order so that the network can execute actions. Here, Voter and Singer are called Sealer (a node that can sign "Sealing" a block and add it to the blockchain: a signatory). In this figure, blocks are signed and added to the blockchain in order, such as S1→V1→S2→V2.

[0079] (Sealer Ring Node Management)

[0080] This healthy state is called a Sealer Ring. According to this Sealer Ring, it is assumed that all Singers are cut off from the blockchain network due to a failure of the entire network. In this case, Figure 3 That way only Voters are built on a stable infrastructure and can therefore continue to execute the network ( Figure 3 ).

[0081] However, if a part of the Signer nodes continue to be disconnected from the network, it is conceivable that defects will occur in order to continue to maintain the node as a member of the blockchain network.

[0082] Therefore, the node management function unit 7 of this embodiment is configured to be able to detect and release this state.

[0083] That is, the node management function unit 7 has: a signature node recording unit 16, which records which node among the nodes constituting the virtual network can sign the block; and a penalty processing execution unit 17, which determines, based on the signature record, a node that has not participated in the block signing for N consecutive times with a certain threshold, and deletes it from the network.

[0084] Next, the above structure will be described.

[0085] (Signature Node Record Section)

[0086] In this embodiment, the node management function unit 7 manages all nodes related to the signature of the block as lists (lists 1 and 2) (indicated by 14 and 15 in the figure). List 1 is an associative arrangement, and the key is the address of the node. In addition, the list 1 is a collection of node objects, and the node object stores the attributes of the node as variables.

[0087] (List 1)

[0088] NodeList[]={N1,N2,N3,N4,,,}.

[0089] In addition, the list 2 manages the arranged address list storing the addresses of the nodes. The key of the list 2 is a numerical value from 0 to the number of all nodes - 1.

[0090] (List 2)

[0091] NodeAddrList[]={N1_addr,N2_addr,N3_addr,,,}.

[0092] In this embodiment, the signing of the blocks is performed in the order of the agreed list, but if the list is processed in order and the last element is reached, the processing is repeated again from the beginning of the list, such as Figure 2 The process is continuously performed in a loop as shown, thereby generating blocks in sequence.

[0093] Here, the signing node recording unit of this embodiment receives a new block from the network, and records which node can sign the block when adding the block to the blockchain.

[0094] That is, the signing node recording unit 16 executes the timing when receiving a new block. Figure 4 Processing shown.

[0095] That is, first, the node signs the block and determines whether it is valid (steps S1-2, 1-2). In the case of a valid signature, the node's block signature count value signedCount (block generation count value) is incremented (step S1-3). The singnedCount value is updated and stored as a variable of the above-mentioned node object.

[0096] NodeList[addr].signed_counter ++

[0097] If the signature is invalid, no processing is performed and the signature confirmation processing (step S1-4) is terminated.

[0098] (Punishment Execution Department)

[0099] In addition, the penalty execution unit 16 ( Figure 1 ) has an unsignable node recording unit 18 and a node deletion processing unit 19. The unsignable node recording unit 19 has the following function, namely, when adding a new node, it is confirmed whether a specified node in the nodes of the list 1 can be signed. If it cannot be signed, the count value indicating unsigned is incremented. In addition, the node deletion processing unit has the following function, namely, at the same timing, it is determined whether the count value indicating unsigned exceeds a specified threshold value. If it is determined that there is a node that exceeds the threshold value, the node is deleted from the nodes constituting the virtual network.

[0100] That is, when a new block is added to the blockchain, the penalty execution unit first determines an index value in order to check the block generation status of the node indicated by the predetermined index (step S2-1).

[0101] Here, the index value is the position of the node that is the object to be confirmed in the process, counted from the beginning of the nodes sorted in the order of addresses in List 1, and is obtained in the following manner.

[0102] Index (IDX) = the number of the currently signed block / the remainder of the number of all nodes.

[0103] Next, it is determined whether the signedCount of the node indicated by the above index value is greater than or equal to 0 (steps S2-2, 2-3). If it is not greater than or equal to 0, it is determined that the signing is unsuccessful, so that the strikeCount value cannot be signed and increments (step S2-4). The strikeCount value is also updated and stored as a variable of the above node object.

[0104] addr = NodeAddrList[IDX]

[0105] NodeList[addr].strike_counter ++ .

[0106] Next, determine whether the node is a node other than a Voter and whether the strikeCount value exceeds the specified threshold N (steps S2-5, S2-6). If exceeded, stop the function of the node and delete the node from the node list 1 (step S2-7).

[0107] addr = NodeAddrList[IDX]

[0108] NodeList.delete(addr).

[0109] Here, the above count value exists in each node and is checked every time a new block is added to the blockchain. The check refers to determining whether it exceeds the specified threshold N (threshold).

[0110] addr = NodeAddrList[IDX]

[0111] NodeList[addr].strike_counter>=threshold(N).

[0112] On the other hand, when the signedCount of the node at the index position in the above step S2-3 is greater than or equal to 0, determine whether the strikeCount value of the node is greater than the signedCout value (steps S2-8, 2-9). If it is greater than the signedCout value, the value obtained by subtracting the signedCout value from the strikeCount value is updated to the strikeCount value (step S2-10). If it is less than the signedCout value, the strikeCount value is initialized and restored to 0 (step S2-11).

[0113] addr = NodeAddrList[IDX]

[0114] NodeList[addr].strike_counter-=NodeList[addr].signed_counter If(NodeList[addr].strike_counter<0)then NodeList[addr].strike_counter=0

[0115] NodeList[addr].signed_counter=0.

[0116] According to the above processing, for nodes that have not participated in block signing for a certain threshold N times in a row, they will be deleted from the list of agreements reached. The deleted nodes do not participate in the agreement, and the corresponding processing load will be excluded from the entire blockchain network.

[0117] Here, the threshold value N is greater than or equal to 1, but need not be an integer. In addition, as a method for determining the threshold value, for example, if a specific node is offline for a certain number of days, it is cut off from the network as a penalty, as described below.

[0118] That is, for example, in a virtual network with a block generation timer of 5 minutes and 2000 nodes, if the network is offline for 30 days, the penalty becomes (30*86400) / 300 / 2000=4.32, so if the network cannot sign approximately 4 times, it can be considered offline. In this case, the threshold can be set to 4 to 4.3, etc.

[0119] In addition, the method for determining the index value is not limited to the above-mentioned one embodiment, and in short, any algorithm can be used as long as it can sequentially check the status of the nodes constituting each network. For example, in the above-mentioned one embodiment, the block number is used to determine the index value, but it can also be a method that only sequentially checks the status of the nodes on the list.

[0120] In addition, the present invention is not limited to the above-mentioned one embodiment, and various modifications can be made within the scope of the present invention.

[0121] Description of the label

[0122] 1…Blockchain Execution Server Components

[0123] 3…Consensus Algorithm Execution Department

[0124] 4…Blockchain data storage function

[0125] 5…Data synchronization function

[0126] 6…Network Construction Function Department

[0127] 7…Node management function

[0128] 9…Share data

[0129] 10…Smart Contracts

[0130] 11…Consensus Algorithm

[0131] 12…Blockchain Data

[0132] 13…Node information

[0133] 16…Signature Node Recording Section

[0134] 17…Penalty Execution Processing Department

Claims

1. A method for constructing a blockchain network, characterized in that: The node management process includes a computer storing information about nodes related to the agreement for adding data received via the P2P network to the blockchain, and determining nodes that need to be signed based on a consensus algorithm. The node management process is a process in which a computer manages all nodes that have reached a participation agreement and constructs a virtual network consisting of the nodes connected in a ring shape. The process is as follows: a signing node recording step, in which a computer records which node among the nodes constituting the virtual network can sign a block; and The penalty process determines the nodes that have not participated in the block signing for a certain threshold number of times in a row based on the records in the signing node recording process, and deletes them from the nodes constituting the virtual network.

2. The method according to claim 1, characterized in that The penalty process has the following steps: a node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network can sign, and if the node cannot sign, increments a count value indicating that the node cannot sign; as well as In the node deletion step, the computer determines at a specified timing whether the count value indicating the unsigned number of each node constituting the virtual network exceeds a specified threshold, and if it is determined that there is a node that exceeds the threshold, the node is deleted from the nodes constituting the virtual network.

3. The method according to claim 1, characterized in that The predetermined timing is the timing for generating a block.

4. The method according to claim 1, characterized in that The signing node recording step is a step of incrementing the count value of the block signing counter of the node that generated the block each time a block is generated, and recording which node can sign the block based on the value of the block signing counter.

5. The method according to claim 4, characterized in that The unsignable node recording step further includes a step of adjusting the unsignable count value by subtracting the signature count value from the unsignable count value at the predetermined node during the confirmation.

6. The method according to claim 1, characterized in that The node management process is a process in which a computer defines / differentiates nodes that have joined the agreement into Voter nodes that perform actions in a more stable environment and other Signer nodes, and manages them, and connects the above nodes to each other to build a ring-shaped virtual network. The penalty step is a step of determining whether a node is a Voter node, and if the node is a Voter node, not deleting the node from the nodes constituting the virtual network.

7. A computer software program, which is a computer software program for constructing a blockchain network, characterized in that: The computer is caused to execute a node management process of storing information of nodes related to the agreement for adding data received via the P2P network to the blockchain, and determining nodes that need to be signed based on a consensus algorithm, The node management process is a process in which a computer manages all nodes that have reached a participation agreement and constructs a virtual network consisting of the nodes connected in a ring shape. Perform the following steps: a signing node recording step, in which a computer records which node among the nodes constituting the virtual network can sign a block; and The penalty process determines the nodes that have not participated in the block signing for a certain threshold number of times in a row based on the records in the signing node recording process, and deletes them from the nodes constituting the virtual network.

8. The computer software program according to claim 7, characterized in that The penalty process has the following steps: a node recording step in which the computer checks at a predetermined timing whether a predetermined node among the nodes constituting the virtual network can sign, and if the node cannot sign, increments a count value indicating that the node cannot sign; as well as In the node deletion step, the computer determines at a specified timing whether the count value indicating the unsigned number of each node constituting the virtual network exceeds a specified threshold, and if it is determined that there is a node that exceeds the threshold, the node is deleted from the nodes constituting the virtual network.

9. The computer software program according to claim 7, characterized in that: The predetermined timing is the timing for generating a block.

10. The computer software program according to claim 7, characterized in that The signing node recording process is a process of incrementing the count value of the block signing counter of the node that generated the block each time a block is generated, and recording which node can sign the block based on the value of the block signing counter.

11. The computer software program according to claim 10, characterized in that The unsignable node recording step further includes a step of adjusting the unsignable count value by subtracting the signature count value from the unsignable count value at the predetermined node during the confirmation.

12. The computer software program according to claim 7, characterized in that The node management process is a process in which a computer defines / differentiates nodes that have joined the agreement into Voter nodes that perform actions in a more stable environment and other Signer nodes, and manages them, and connects the above nodes to each other to build a ring-shaped virtual network. The penalty step is a step of determining whether a node is a Voter node, and if the node is a Voter node, not deleting the node from the nodes constituting the virtual network.