A Fault-Tolerant Assistance Storage Mechanism for Blockchain Network Node Groups Based on Internet of Things Devices

By using a node group composed of IoT devices in the blockchain network, dynamically adjusting the strategy of storage blocks, the problems of scalability and high cost of blockchain storage are solved, and efficient and reliable blockchain data storage and assistance are achieved.

CN116016540BActive Publication Date: 2025-06-10CHANGSHA UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211614423.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-15
Publication Date
2025-06-10
Estimated Expiration
2042-12-15

AI Technical Summary

Technical Problem

Blockchain technology has challenges in storage scalability, especially when decentralized nodes need to store complete copies. As the amount of data increases, the storage pressure and cost of nodes increase, resulting in a decrease in users willing to maintain and join the blockchain, affecting the security of the system.

Method used

The blockchain network node group based on IoT devices is adopted to provide fault-tolerant assistance storage mechanism. By mapping IoT devices as nodes, the blocks stored by nodes are dynamically adjusted, and the elimination rate and storage cost limits are set according to the importance of the block and storage cost, and the strategy of node storage blocks is optimized to maximize the probability of assisting the block and minimize storage costs.

Benefits of technology

It effectively reduces node storage costs, improves the storage scalability of blockchain, ensures the stable operation of node groups in the event of failure, and avoids the risk that the blockchain system cannot provide data due to node failure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116016540B_ABST
    Figure CN116016540B_ABST
Patent Text Reader

Abstract

The present invention discloses a fault-tolerant assistance storage mechanism for a blockchain network node group based on Internet of Things devices. By forming a node group from Internet of Things devices, compared with prior art, a dynamic blockchain is considered in the present invention. According to characteristics such as low capacity and low computing resources of Internet of Things devices or nodes, in order to save resources, nodes can eliminate their unimportant original blocks. Under the condition of restricting the storage cost of each block, by formulating a node selection strategy, the total assistance probability of each block is optimized to ensure that when nodes in the group fail and go offline, normal nodes can still assist any block of the entire blockchain copy. The present invention improves the stability and fault tolerance of the node group in running the blockchain copy, and enhances the practicality and scalability of blockchain technology.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of blockchain, in particular to a fault-tolerant assistance storage mechanism for a blockchain network node group based on Internet of Things devices. Background Art

[0002] With the development of Internet technology, encrypted digital currencies have gradually emerged in our lives. Bitcoin, a well-known digital currency, uses blockchain technology as its core supporting technology. In a blockchain network, peer-to-peer communication is adopted, where each node is both a server and a client. When a node initiates a new transaction, other nodes need to unanimously verify the validity and correctness of the transaction. The transactions that reach a consensus will be packaged into a block, and the block accounting right is obtained by solving the node computing power, so that the block is added to the chain. Once the block is added to the chain, the data in it cannot be tampered with. Therefore, blockchain technology has the characteristics of decentralization, data immutability, data persistence, traceability, etc. It is precisely because of these characteristics that blockchain technology has high application value in the fields of financial economy, logistics supply chain, Internet of Things, medical care, insurance, etc.

[0003] Although blockchain technology has great potential in the future Internet, there are still many challenges, among which storage scalability is a major challenge. Due to the decentralized concept of blockchain technology, nodes need to store complete copies to ensure the correctness of data. However, with the continuous generation of new blocks, the total data volume of the blockchain is continuously increasing. As of December 9, 2022, the total data volume of Bitcoin, which is dominated by blockchain technology, has reached 441.91 GB, and the total number of blocks has reached 766,286. For the huge and growing data volume, it has increased the threshold for nodes to join the blockchain, and fewer and fewer users are willing to maintain and join it, which will lead to the gradual transformation of decentralization into centralization, further affecting the security of the blockchain system.

[0004] In the current research status of storage scalability, storing data in a blockchain in a third-party database is a solution. For example, the InterPlanetary File System (IPFS), which is widely used currently, is a peer-to-peer distributed file system that connects computing devices with the same file system. In this model, the blockchain only needs to store the IPFS hash value, which is generated by storing the original blockchain data through the IPFS file system. Therefore, the blockchain can obtain the corresponding data by only storing the IPFS hash value. Although this method can reduce the storage pressure on the blockchain, the important data of the blockchain is stored in the third-party database, and the state of the third-party database will directly affect the blockchain system, which poses certain risks. Among the current solutions that do not rely on third-party databases, the sharding technology is one of the ways to relieve the storage pressure on nodes. Sharding groups nodes to process different transactions or maintain different segments of the blockchain copy. Therefore, the sharding technology can improve the response performance and scalability of the blockchain. However, the communication between each partition will become more complex. In addition, it will reduce the total computing power of the blockchain, resulting in a decline in the security performance of the blockchain. Besides sharding, the consensus unit is also a solution. The consensus unit refers to a group of nodes jointly storing at least one copy of the blockchain. In the consensus unit, the block is the smallest data unit, and nodes preferentially retain the blocks they care about. For blocks that they do not store themselves, they can temporarily obtain them by accessing other nodes. The consensus unit reduces the storage pressure on a single node by integrating node resources. It does not require a third-party database to share the storage pressure and does not have partitions itself, so there will be no more complex communication process. Therefore, the consensus unit can be applied to more scenarios. However, the nodes in the consensus unit come from the same community or have a cooperative relationship, and each node is not completely trustworthy. Therefore, the state of the nodes will directly affect the normal operation of the entire consensus unit.

[0005] In today's era of interconnected everything, smart home devices, industrial sensors, smart cars, smart cameras and other devices all belong to Internet of Things (IoT) devices. These devices are interconnected to achieve information sharing and exchange. However, the data generated by these IoT devices needs to be uploaded to a third party for processing, or this data has been stolen when they share and exchange information. The decentralized, immutable, and traceable characteristics of blockchain technology can empower the data security of IoT devices. In real-world scenarios, the number of IoT devices is vast, and the hardware level of a single device is often insufficient to support running a complete blockchain copy. To improve the storage scalability of the blockchain, using the concept of a consensus unit to integrate the storage resources of these devices with small storage capacities to collaboratively store the blockchain copy is an option. Therefore, we adopt the concept of a consensus unit to form a node group with those devices that need to use blockchain technology but have insufficient storage capacity. However, different from the consensus unit, the nodes or devices in the node group do not come from the same community or have a cooperative relationship. In the consensus unit, it pays more attention to the communication cost of accessing blocks between nodes. However, in actual application scenarios, in addition to the communication cost of accessing blocks, factors such as hardware, power, and maintenance also need to be considered when nodes store blocks, which cannot be ignored. In addition, special situations such as disconnection and failure may also occur to the IoT devices or nodes that collaborate together, and they will be unable to provide block assistance to other nodes for some time. Therefore, we need to formulate a strategy for how to select nodes for each block to ensure and improve the block assistance of nodes to other nodes in the group as much as possible while controlling storage costs, considering node failures, and coping with the growing data volume. Summary of the Invention

[0006] Through investigation of the prior art, in order to solve the shortcomings of the prior art and enable blockchain technology to be better applied in IoT devices, the present invention provides a fault-tolerant assisted storage mechanism based on the node group of the blockchain network of IoT devices. In the present invention, the IoT devices are mapped to nodes. As the blocks increase dynamically, the nodes store more and more blocks, and the cost of storing blocks themselves will also become higher and higher. Therefore, the nodes appropriately eliminate the original blocks according to their own dependence on the blocks. We call the probability of the node eliminating the original blocks the elimination rate. When the node itself does not fail and no block elimination occurs (block survival state), the node can provide block query for other nodes. Further analysis shows that the probability that the node can still provide block query for other nodes under the probability of elimination of other nodes is called the block assistance probability. The purpose of the present invention is to select a node set to store each block under cost constraints when a node fails in the group (a node failure represents a scenario) when nodes are organized into a node group to run a blockchain copy, so as to maximize the total assistance probability of each block in all scenarios, and to avoid as much as possible the situation where the node group cannot provide its stored blocks to other nodes in the group due to node failure, thereby ensuring the effective operation of the node group.

[0007] To achieve the above purpose, a blockchain network node group fault-tolerant assisted storage mechanism based on IoT devices includes:

[0008] Use a certain number of IoT devices as nodes to build a node group, and all nodes work together to run the same blockchain copy.

[0009] The cost of storing blocks on a node is calculated based on the storage resources, CPU computing resources, and communication resources occupied by the block.

[0010] The importance of blocks to the node group is quantified through the total number of times the system accesses blocks. A storage cost limit is set for each block to prevent blocks from being stored by a large number of nodes and wasting node storage resources. For more frequent blocks, the block cost limit can be increased.

[0011] Considering that data is constantly increasing, new blocks will also be packaged and generated, so the number of blocks in the node group is dynamically increasing. Therefore, the node needs to eliminate the original blocks that are not important to itself, and quantify the elimination rate through the node's demand for blocks, so as to further calculate the probability of assistance brought by the node storage block based on the elimination rate.

[0012] Construct a mathematical model based on the above content, assuming that the complete blockchain copy B consisting of m blocks = {b 1 ,b 2 ,…,b m}, a set of nodes in the cluster V = {v 1 ,v2 ,…,v n}, x(b i , v j ) represents a decision variable, and block b i selects node v j for storage, that is, the decision variable x(b i , v j ) = 1; for block b i stored by node v j , the storage cost is c(b i , v j ), and the total storage cost of block b i in the group does not exceed its cost limit θ(b i ). v k represents a failed node and thus cannot provide queries for blocks. For node v u , if v u needs to store a new block and the probability of eliminating block b i is d(b i , v u ), then v u needs to obtain b i from other nodes, for example, obtain b j from node v i , where the probability that node v j can provide b i (the survival rate of block b i in node v j ) is 1 - d(b i , v j ). In this way, the probability that v u obtains b j provided by v i is (1 - d(b i , v j )) * d(b i , v u ). Since v u can be any node other than v k and v j , when v k fails, the probability that v j can assist other nodes and provide b i is expressed as: Assume that when the assisting node v j becomes the failed node v k , that is, v j = v k , then v j can assist other nodes and provide b iThe average probability is 0. The node selection problem is to select nodes to store blocks, but the same node cannot store the same block multiple times. Indicates that when node v k fails, the selected node can provide block b to other nodes i The sum of the assistance probabilities (i.e., the total block assistance probability), Indicates finding a v k such that when it fails, the sum of the block assistance probabilities provided by the selected nodes is the smallest; thus, it can be known that when v k fails, the impact on the block assistance probability within the group is the greatest. Therefore, we need to find an allocation method to maximize the total block assistance probability under the failure of v k That is, the optimization goal is to maximize the total block assistance probability under the failure of v while satisfying that the total cost of block storage by nodes does not exceed the storage cost limit θ(b i ). That is, under the condition that the total cost of block storage by nodes does not exceed the storage cost limit θ(b k ), find the failure node v with the worst total block assistance probability, and select an allocation method to maximize the total block assistance probability under this failure node:

[0013]

[0014] Constraint: Constraint (3) indicates that the total cost generated by block b i selecting different nodes for storage does not exceed the storage cost limit of the node group for block b i . Constraint (4) indicates that block b i is allocated to the same node at most once.

[0015]

[0016]

[0017] Finally, according to the objective function and constraints obtained from the mathematical model, nodes are arranged for each block to be stored.

[0018] In the prior art, neither the consensus unit nor the formation of the node group carefully considered the impact of the state of a single node on the entire node group. Because in actual Internet of Things devices, it often happens that devices go offline due to power outages or other factors. An offline node will not be able to provide block assistance, which may prevent other nodes in the node group from obtaining the blocks they need. In addition, the blockchain grows dynamically, which will lead to continuous growth of the data volume and occupy more node resources. How to balance the resources occupied by blocks in the node group has not been well solved in the past technical solutions. In the present invention, according to an embodiment of a fault-tolerant assistance storage mechanism for a blockchain network node group based on Internet of Things devices, there are the following advantages over the prior art:

[0019] The present invention provides a fault-tolerant assistance storage mechanism for a blockchain network node group based on Internet of Things devices. By restricting the cost of each block in the node group, nodes for storing blocks are reasonably selected to avoid resource waste and save the cost overhead brought by node storage. Considering that new blocks are continuously added to the blockchain, resulting in excessive redundant blocks stored by nodes, according to the characteristics of low capacity and low computing resources of Internet of Things devices or nodes, nodes are allowed to eliminate unimportant original blocks of their own. The elimination rate is quantified by the demand of nodes for blocks, and further the assist probability brought by node storage of blocks is calculated according to the elimination rate, thereby improving the scalability of the application of blockchain technology. In an actually formed node group, nodes will inevitably fail or go offline. The present invention considers the total assist probability in the scenario where the node group fails, and through the objective function and constraint conditions, a suitable node set is selected for storing blocks to optimize the total assist probability of each block. So that when a node fails and goes offline, the normal nodes in the node group can still assist any block of the entire blockchain copy, providing a high guarantee for the normal operation of the entire node group and improving the stability of the node group.

[0020] Embodiments of the present invention will become apparent from the following description or be learned through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] The following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings without creative efforts.

[0022] Figure 1 It is a schematic diagram of a block collaboration case provided for nodes in an embodiment of the present invention;

[0023] Figure 2 It is a schematic diagram of the process of a node selection scheme based on block assist probability gain in an embodiment of the present invention;

[0024] Figure 3 It is a schematic diagram of the process of a node selection scheme based on storage cost in an embodiment of the present invention;

[0025] Figure 4 It is a schematic diagram of the process of a node selection scheme based on faulty nodes in an embodiment of the present invention;

[0026] Figure 5 It is a schematic diagram of the process of a node dynamic addition scheme in an embodiment of the present invention;

[0027] Figure 6 It is a schematic diagram of the process of a node dynamic deletion scheme in an embodiment of the present invention; DETAILED DESCRIPTION OF THE EMBODIMENTS

[0028] The technical solution of the present invention will be fully described below in conjunction with the accompanying drawings and embodiments. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments.

[0029] In the present invention, in order to improve the scalability and practicability of blockchain technology, Internet of Things devices or nodes will jointly maintain at least one copy of the blockchain in the form of a node group. However, in real life, Internet of Things devices are not always online. Considering special situations such as node failures and offline in the node group, it may lead to the inability of the entire node group to perform block collaboration; in addition, the storage resources occupied by blocks in the group nodes are also non-negligible factors. Therefore, the present invention proposes a fault-tolerant assistance storage mechanism for blockchain network node groups based on Internet of Things devices, and the specific steps are as follows:

[0030] Step 1: Use Internet of Things devices as nodes to build a node group, and all nodes cooperate to run the same copy of the blockchain.

[0031] Step 2: Calculate the cost of a node storing a block according to the storage resources, CPU computing resources, and communication resources occupied by the block.

[0032] Step 3: Quantify the importance of a block to the node group through the total number of accesses to the block by the system, and set a storage cost limit for each block to prevent the block from being stored by a large number of nodes together, wasting node storage resources.

[0033] Step 4: Considering that data is constantly increasing and new blocks will also be generated and packaged, the number of blocks in the node group is dynamically increasing. Therefore, nodes need to eliminate the original blocks that are not important to themselves, quantify the elimination rate through the node's demand for blocks, and further calculate the assist probability brought by the node storing the block according to the elimination rate.

[0034] Step 5: Build a mathematical model, give the optimization objective and constraints, analyze the node selection problem in the mathematical model, and reduce the known NP-hard problem - the maximum-minimum knapsack problem to the node selection problem, thereby proving that the node selection problem is NP-hard.

[0035] Step 6: By proving that the node selection problem belongs to the NP-hard problem, three heuristic schemes are designed to implement the selection of nodes in the group for each block.

[0036] Step 7: Considering that the nodes in the node group are dynamic in the actual scenario, two node dynamic addition and deletion schemes for the corresponding objective function are designed on the premise of constraints.

[0037] The following will first explain the above steps 1 to 5 in detail:

[0038] After analyzing the characteristics of nodes and blocks, the block set of the complete blockchain is defined as B = {b 1 , b 2 , …, b}, and the block set B consists of m blocks to form a complete blockchain data copy. A complete blockchain copy is stored in different nodes in the group with blocks as the smallest unit. Therefore, a single node can query the blocks it lacks from other nodes in the group. In blockchain technology, blocks are dynamically added. When data is packed into new blocks, the node group will receive the new blocks through the blockchain network. Therefore, the number of blocks stored by nodes in the group is constantly increasing. As the number of blocks stored by nodes increases, the cost of storing blocks will also become higher and higher. Therefore, nodes appropriately eliminate the original blocks according to their dependence on the blocks. We call the probability of nodes eliminating the original blocks the elimination rate. In addition, we need to consider the node failure scenario, which means that nodes may experience hardware failures, network delays, and other factors in the future, resulting in node failures and offline. Because the storage status of a single node will affect the operation of the entire node group.

[0039] For the above situation, when selecting nodes for blocks, we need to consider that even when nodes fail or nodes eliminate blocks in the future, the reliability and stability of the node group can still be guaranteed. Therefore, we need to appropriately redundant the blocks and store the same block in different nodes in the group. Since there are differences in physical hardware costs between nodes, the costs of storing the same block by different nodes will be different. The more the same block is stored by different nodes, the higher the storage cost. To control the storage cost of blocks, a set O = {θ(b 1 ), θ(b 2 ), …, θ(b m )} of the upper limit of block storage cost is given. Based on the above ideas, we give the definition of nodes.

[0040] Definition 1: Given a set of nodes V = {v 1 , v 2 , …, v n} for constructing a node group, where n represents the total number of nodes, and v j is the j-th node; d(b i , b j ) represents the elimination rate of block b i in node b j when a new block is added in the future, where d(b i , v j ) ∈ [0, 1]; c(b i , v j ) represents the cost of node v j storing block b i .

[0041] If block bi At node v j the elimination rate is d(b i , v j ), conversely the survival rate of block b i at node v j is 1 - d(b i , v j ). When node v j stores block b i , in the case of its own non - failure and no block elimination (block survival state), node v j can provide block queries for other nodes. Under the assumption of the probability of other nodes being eliminated, the probability that node v j can provide block queries for other nodes is what we call the block assistance probability. The more nodes store block b i , the greater the block assistance probability, and block b i is more reliable in the node group. In addition, we need to consider scenarios such as node hardware failures or network failures. Use node v k to represent that the node fails and goes offline, where v k ∈V. Assume that only one node fails each time. For example, the current node group has four nodes v 1 , v 2 , v 3 , v 4 . Assume that when a new block joins a node, the probability that v 1 eliminates b 5 is 33%, the probability that v 2 eliminates b 5 is 37%, the probability that v 3 eliminates b 5 is 23%, and the probability that v 4 eliminates b 5 is 27%. At this time, v 2 stores block b 5 , and the survival probability of b 5 in v 2 is 63%. Assume that when node v 3 fails, v 2 has a 63% probability of survival and can provide block b 1 queries for v 4 and v 5 . See the specific Figure 1 example below; The following gives the specific definition of the block assistance probability.

[0042] Definition 2: When node v k fails, it means that node v k goes offline and thus cannot provide block queries. For node v uFor example, if v u needs to store a new block and evict block b i with probability d(b i , v u ), then v u needs to obtain b from other nodes i , for example, obtain b from node v j , where node v i can provide b j with probability (the survival rate of block b i in node v i ) of 1 - d(b j , v i ). Thus, the probability that v j obtains b provided by v u is (1 - d(b j , v i )) * d(b i , v j ). Since v i can be any node other than v u and v u , when v k fails, the average probability that v j can assist other nodes and provide b k is as follows: Assume that when the assisting node v j becomes the failed node v i , i.e., v j = v k , then the average probability that v j can assist other nodes and provide b k is 0. Therefore, we define the probability of block assistance of node v j to other nodes when node v i fails as:

[0043]

[0044] When selecting a node for block storage, we need to consider the assistance probability of the selected block node when different nodes fail. Since there are differences in storage costs for blocks in different nodes, and in a node group, each block has its own upper limit of storage cost θ(b j ). Through the set of nodes selected by block b k , in node v i ) i , the set of nodes selected by block b kWhen a failure occurs, the sum of the block assistance probabilities of each node in the node set is the total block assistance probability. Therefore, under the condition of satisfying the storage cost upper limit of each block, we select an allocation method to maximize the smallest total block assistance probability when different nodes fail. The node selection problem is specifically defined as follows.

[0045] Definition 3 (Node Selection Problem): Given a complete blockchain copy B = {b 1 , b 2 , …, b m} consisting of m blocks, a set of in-group node sets V = {v 1 , v 2 , …, v n}, x(b i , v j ) represents the decision variable. Block b i selects node v j for storage, that is, the decision variable x(b i , v j ) = 1; the storage cost of block b i by node v j is c(b i , v j ), and the total storage cost of block b i in the group does not exceed its cost limit θ(b i ). The node selection problem is to select nodes for blocks to store, but the same node cannot store the same block multiple times. represents the sum of the probabilities (i.e., the total block assistance probability) that the selected nodes can provide assistance to other nodes for block b k when node v i fails, represents finding a v k such that when it fails, the total block assistance probability provided by the selected nodes is the smallest; therefore, it can be known that when v k fails, the impact on the block assistance probability in the group is the greatest. So we need to find an allocation method to maximize the smallest total block assistance probability under the failure of v k . That is, the optimization goal is to find the failure node v i with the worst total block assistance probability and select an allocation method to maximize the total block assistance probability under this failure node under the condition that the total cost of block storage by nodes does not exceed the storage cost upper limit θ(b k ):

[0046]

[0047] Constraint: Constraint (3) represents block b iThe total cost of storing at different nodes does not exceed the storage cost limit of the node group for block b i Constraint (4) means that block b i is assigned to the same node at most once.

[0048]

[0049]

[0050] After constructing the mathematical model, we expand the detailed process of step 6:

[0051] Before presenting the specific solution, we first need to analyze the complexity of the node selection problem. We prove that the node selection problem is NP-hard by reducing the Max–min knapsack problem (MMKP) to the node selection problem. The following is the proof process:

[0052] Theorem 1: The node selection problem is NP-hard.

[0053] Proof: The Max–min knapsack problem is known to be NP-hard. The following is a specific example: Given a set of items j = {1, 2,..., n}, w j is the weight of each item, and a set of scenarios S is given, representing the profit of item j under scenario s. Select a subset of items with a total weight not exceeding c to maximize the profit in the worst scenario. The specific formula is as follows:

[0054]

[0055] Constraints:

[0056]

[0057] x j ∈ {0, 1} j = {1, 2,..., n} (7)

[0058] We map the instance of the Max–min knapsack problem to an instance of the node selection problem. Assume that there is only one block b in the blockchain set * at this time, the node set V corresponds to a set of items j, the cost of storing the block at the node is c(b * , v j ) corresponding to the weight w of the item j , for the unique block b * the storage cost limit θ(b * ) in the group corresponds to the weight threshold c, the node failure set F corresponds to the set of scenarios S, and the block assistance probability t(b i, v j , f k ) The profit of project j under the corresponding scenario s Through the above mapping relationship, a special case of the node selection problem has the same solution as the max-min knapsack problem. Therefore, the reduced case of the node selection problem is NP-hard, thus proving that the node selection problem is also NP-hard.

[0059] The selection of nodes by the block needs to consider the block assistance probability of the node under different faulty nodes. Therefore, we need to select an allocation scheme to meet the objective function and constraints. Specifically, when the total cost of storing block b i does not exceed the storage cost limit θ(b i ), find the faulty node with the worst total block assistance probability, and maximize the total block assistance probability under the failure of this node. Since the node selection problem has been proven to be NP-hard above, we designed three heuristic schemes to perform the allocation.

[0060] Block selection node scheme 1: The specific steps and cases of the node selection scheme based on the block assistance probability gain are as follows:

[0061] According to the above optimization objective, for each block, we consider the block assistance probability of each node under different faulty nodes. Therefore, for each node selected by the block, it is necessary to calculate the total block assistance probability after adding this node under different faulty nodes. Suppose node v k fails, and block b i selects node v j . The total assistance probability after that is S(b i , v j , v k ), where S(b i , v j , v min ) represents the minimum total block assistance probability (minimum value) in S(b i , v j , v k ), corresponding to the failure of node v min ; the total assistance probability when block b i does not select node v j is G(b i , v k ), and G(b i , v min′ ) represents the minimum total block assistance probability (minimum value) in G(b i , v k ), corresponding to the failure of v min′ ; therefore, the gain of the minimum total block assistance probability after adding node v j is:

[0062] ΔG(b i ,v j )=S(b i ,v j ,v min )-G(b i ,v min′ ) (8)

[0063] Therefore, our optimization goal is to satisfy block b i Storage cost constraint θ(b i ), for block b i Find the node v j , so that the block has the minimum total assistance probability gain ΔG(b i ,v j )maximize.

[0064] According to the above ideas, the specific steps of the node selection algorithm based on block assistance probability gain are as follows: First, initialize block b i The node selection set A(b i ) and in v k When a failure occurs, block b i Join node v j The total assist probability S(b i ,v j ,v k )(row 1); calculate in v k When a failure occurs, block b i For node v j The block assistance probability t(b i ,v j ,v k )(Lines 2-5); Initialize block b i No node v is selected j The total assistance probability of the current block G(b i ,v k ), join node v j The minimum total assistance probability gain of the next block ΔG(b i ,v j ), in v min′ The minimum total probability of assistance of a block during a failure G(b i ,v min′ ), determine whether there is still a node variable q that satisfies the block, and traverse the node set V′ (line 6); when V′ is empty, end the loop (line 7); traverse each node in V′ (line 8); if r(b i ,v j ) does not exceed the limit θ(b i )(Line 9), then calculate the joining node v jAfter that, for the total block assistance probability S(b i ,v j ,v k )(line 10) under all faulty nodes, find the minimum value S(b i ,v j ,v k ) in S(b i ,v j ,v min )(line 11); calculate the minimum total block assistance probability gain ΔG(b j ,v i ,v j ) after adding node v i ,v j ), mark that there is a minimum total block assistance probability gain in V′, and set q to 1 (line 12); judge that if q = 0, it means there is no gain, and end the loop (line 13); if there is a gain, find the node v max with the maximum gain in ΔG(b max ,v i ,v k )(line 15); update the total block assistance probability G(b i ,v k ) of the blocks added with v min′ when each node fails (line 16); find the total block assistance probability G(b i ,v min′ ) of the blocks under the minimum failure scenario v i ) in G(b i )(line 17); update the calculation parameters q, A(b

[0065]

[0066]

[0067] Time complexity analysis: Lines 2 to 5 need to calculate the block assistance probability of each block to nodes under different failure scenarios O(mn 3 ), the time complexity of traversing the node set V′ in line 7 is O(n), the time complexity of considering the minimum total block assistance probability gain after adding each node in the node set V′ in line 8 is O(n), line 10 means calculating the total block assistance probability gain of each node failure after adding v j , the time complexity is O(n), in line 11, find the minimum value S(b i ,v j ,v k ) in S(b i ,v j ,v min)O(n), update node v at line 16 max The total assistance probability G(b) of each scenario after addition i , v k )O(n), find G(b) according to different faulty nodes at line 17 i , v k ) the minimum total assistance probability G(b) in i , v min′ )O(n), so the overall time complexity of the algorithm is O(mn 3 ).

[0068] Specific example of the node selection algorithm based on the block assistance probability gain: Given the node set V = {v 1 , v 2 , v 3 , v 4 , v 5}, assume the elimination rates of the nodes in the node set V storing the block b 1 are {40%, 30%, 60%, 35%, 50%}, and the costs of storing the block b 1 are {5, 4, 2, 3, 4} respectively, and the storage cost limit θ(b 1 ) = 11 in the group. According to the above data, first calculate the assistance probability of the node storing the block b 1 when different nodes fail. The calculated data results are shown in Table 1. 1

[0069] When selecting a node for the first time, the minimum total assistance probability S(b 1 , v 1 , v min ) = 0 for all nodes, and the gain ΔG(b 1 , v j ) = 0 for any node. So we select the node v 1 to store the block b 1 , update the total assistance probability G(b 1 , v k ) when different nodes fail. The smallest one is G(b 1 , v 1 ) = 0, update the remaining storage cost limit θ(b 1 ) = 6 and the selection result set A(b 1 ) = {v 1}, as shown in the step1 process of Figure 2 .

[0070] The second time we consider the gain ΔG(b 1 , v min ) brought by other nodes to the current minimum total assistance probability G(b​1 , v j ), whose gains are ΔG(b 1 , v 2 ) = 29%, ΔG(b 1 , v 3 ) = 15.3%, ΔG(b 1 , v 4 ) = 28%, ΔG(b 1 , v 5 ) = 20.8%. Select the node v with the largest gain 2 , and v 2 satisfies the remaining storage cost capacity limit. Update the selected result set A(b 1 ) = {v 1 , v 2}}, and update the total block assistance probability G(b 2 ) when different nodes fail after adding v 1 , v k ). The smallest among them is G(b 1 , v 2 ) = 29%. Update the remaining storage cost limit θ(b 1 ) = 2, as in Figure 2 's step2 process.

[0071] For the third time, we get that the node v with the largest gain of the minimum total assistance probability is 4 , ΔG(b 1 , v 4 ) = 32.5%. However, the storage costs of node v 4 and node v 5 exceed the remaining storage cost limit of block b 1 . Therefore, only node v 3 can be added to A(b 1 ), A(b 1 ) = {v 1 , v 2 , v 3}. Update G(b 1 , v k ). The smallest among them is G(b 1 , v 2 ) = 45.7%. Update the remaining storage cost limit θ(b 1 ) = 0, as in Figure 2 's step3 process. Therefore, when there is only one block b 1 , the minimum total assistance probability G of all blocks is G = G(b 1 , v 2 ) = 45.7%, and the block selection node set is A(b 1 ) = {v 1 , v2 , v 3}。

[0072] Table 1. Assistance probability of node storing block b when the node fails (rounded to 1 decimal place) 1

[0073] t <![CDATA[v 1 malfunction]]> <![CDATA[v 2 malfunction]]> <![CDATA[v 3 malfunction]]> <![CDATA[v 4 malfunction]]> <![CDATA[v 5 Fault]]> <![CDATA[b 1 →v 1 > 0 29% 23% 28% 25% <![CDATA[b 1 →v 2 > 34% 0 29% 35% 31.5% <![CDATA[b 1 →v 3 > 15.3% 16.7% 0 16% 14% <![CDATA[b 1 →v 4 > 30.3% 32.5% 26% 0 28.2% <![CDATA[b 1 →v 5 > 20.8% 22.5% 17.5% 21.7% 0

[0074] Block selection node solution two: The specific steps and cases of the node selection solution based on the block assistance probability gain are as follows:

[0075] In solution one, we considered the total block assistance probability after selecting a node for the block and found the node that maximizes the minimum total block assistance probability gain ΔG(b i , v j ), but did not consider the cost of the node storing the block. Because a node with a high block selection assistance probability may also have a high cost of storing this block. Due to the storage cost limit θ(b i ) in the node group, we need to consider the problem from the perspective of unit cost. To optimize the deficiencies of algorithm 1, we define the assistance probability of the block under unit cost, that is, when the node v k fails, the unit cost assistance probability of block b i selecting node v j is:

[0076]

[0077] Therefore, the idea of the node selection algorithm based on storage cost is that each time a block selects a node, it gives priority to the failure scenario f min = 1 where the total block assistance probability is the lowest when v min fails; so under the condition of satisfying the storage cost limit θ(b i ) of block b i , select the node v min with the highest unit cost assistance probability u(b i , v j , v k ) in the v max failure scenario, thereby increasing the minimum total assistance probability of all blocks.

[0078] According to the above idea, the specific steps of the node selection algorithm based on storage cost are as follows: First, initialize the node selection set A(b i ) of block b i and the total assistance probability G(b k ) of block b i when v i , v k ​)(Line 1), initialize the faulty node v with the minimum total assistance probability of the block min , calculate the assistance probability t(b k of storing the block b at node v j under the fault of node v i ,v i ,v j ,v k ) and the unit cost assistance probability u(b i ,v j ,f k )(Lines 3 - 7), initialize the node set V′ (Line 8), end the loop when the node set V′ is empty (Line 9), and in each loop, select the node v with the maximum u(b min when the fault occurs at v i ,v j ,f min )(Line 10). If the storage cost r(b max at node v max ) does not exceed the limit θ(b i )(Line 11), update the total assistance probability G(b max of each fault scenario after adding v i )(Line 12), find the faulty node v with the minimum total assistance probability of the updated block max , update the block storage cost θ(b i ,v k )(Line 13), select the node v for the block b min (Line 14), remove v i from the node set V′ (Line 15), select the minimum total assistance probability G(b i in the total assistance probability G(b max ,v max )(Line 16), and calculate the minimum total assistance probability G of all blocks (Line 17). i ,v k ) with the minimum total assistance probability G(b i ,v min )(Line 16). Calculate the minimum total assistance probability G of all blocks (Line 17).

[0079]

[0080] Time complexity analysis: Lines 2 to 7 require O(mn k ) to calculate the assistance probability of storing the block b at node v j under the fault of node v i . The time overhead required to traverse the node set V′ in Line 9 is O(n). Line 10 takes time to find the block assistance probability u(b 3 ) when the fault occurs at v min ,v i ,v j ,v min)The largest node v max O(n). Line 11 calculates the total assistance probability of each node when adding node v max O(n). In line 13, the faulty node v with the worst total assistance probability of the block is selected min O(n). Line 16 queries the minimum G(b i ,v k ). In the case of n faulty nodes, the time complexity is O(n). Therefore, the total time complexity of the algorithm is O(mn 3 ).

[0081] Specific example of the node selection algorithm based on storage cost: We continue to use the simulation data in Algorithm 1. First, calculate the assistance probability of each node when a different node fails for storing block b 1 (Table 1). Calculate the unit cost assistance probability through the cost of each node storing block b 1 . The specific data is shown in Table 2. First, it is defaulted that the total assistance probability of the block is the smallest when v 1 fails; when v 1 fails, the node with the largest unit cost assistance probability is node v 4 , specifically u(b 1 ,v 4 ,v 1 ) = 10.10%. The cost of v 4 storing block b 1 is r(b 1 ,v 3 ) = 3, which satisfies θ(b 1 ). Update the selected result set A(b 1 ) = {v 4} and the total assistance probability G(b 1 ,v k ) of different nodes when they fail. The smallest of them is G(b 1 ,v 4 ) = 0. We set v 4 as v min , indicating that the total assistance probability of the block is the smallest in the case of the current v 4 failing. Update the remaining storage cost limit θ(b 1 ) = 8.

[0082] As can be seen from the previous paragraph, v min is node v 4 . Therefore, when v 4 fails, among the remaining nodes V - A(b 1 ), the node with the largest unit cost assistance probability is node v 2 , specifically u(b 1 ,v 2 ,v4 ) = 8.75%, and c(b 1 , v 2 ) satisfies θ(b 1 ), update A(b 1 ) = {v 4 , v 2}, and G(b 1 , v k ), where the smallest is G(b 1 , v 2 ) = 32.5%. We set v 2 to v min , and update the remaining storage cost limit θ(b 1 ) = 4. For the third time, we consider the total assistance probability when v 2 fails. For node v 1 , node v 3 , and node v 5 , among which the node with the largest unit - cost assistance probability is node v 3 , specifically u(b 1 , v 3 , v 2 ) = 8.35%, and c(b 1 , v 3 ) just satisfies θ(b 1 ). Update A(b 1 ) = {v 4 , v 2 , v 3}, and G(b 1 , v k ). The smallest in G(b 1 , v k ) is G(b 1 , v 2 ) = 49.2%. Set v 2 to v min , and update the remaining storage cost limit θ(b 1 ) = 2. At this time, the storage costs of node v 1 and node v 5 both exceed θ(b 1 ), and the node selection ends. The minimum total assistance probability of block b 1 is G = G(b 1 , v 2 ) = 49.2%, and the result set is A(b 1 ) = {v 4 , v 2 , v 3}. The specific steps are as Figure 3 shown.

[0083] Table 2. Nodes storing block b when nodes fail1 Unit cost assistance probability (rounded to 2 decimal places)

[0084] u <![CDATA[v 1 Fault]]> <![CDATA[v 2 fault]]> <![CDATA[v 3 malfunction]]> <![CDATA[v 4 malfunction]]> <![CDATA[v 5 fault]]> <![CDATA[b 1 →v 1 > 0 5.80% 4.60% 5.60% 5.00% <![CDATA[b 1 →v 2 > 8.50% 0 7.25% 8.75% 7.88% <![CDATA[b 1 →v 3 > 7.65% 8.35% 0 8.00% 7.00% <![CDATA[b 1 →v 4 > 10.10% 10.80% 8.67% 0 9.40% <![CDATA[b 1 →v 5 > 5.20% 5.62% 4.38% 5.43% 0

[0085] Block selection node solution three: Specific steps and cases of the node selection solution based on the block assistance probability gain. As follows:

[0086] For solution one and solution two, each time the block selects a node, it needs to consider the block assistance probability under different faulty nodes. After each time the block selects a node, the total block assistance probability G(b i ,v k ) needs to be recalculated. To reduce the computational overhead, we take the average of the block assistance probabilities of the alternative nodes under different node failures, so that there is only one average block assistance probability for the alternative nodes. Under the storage cost limit θ(b i ), the block only needs to consider the node with the minimum average assistance probability. We define the average assistance probability of block b i as z(b i ,v j ). The following gives the specific calculation process of z(b i ,v j ).

[0087] Where t(b i ,v j ,v k ) represents the assistance probability that node v k stores block b j when node v i fails; next, take the mean of t(b i ,v j ,v k ) under all node failures:

[0088]

[0089] Expand t(b i ,v j ,v k ):

[0090]

[0091] By simplification, we can see that:

[0092]

[0093] To obtain the optimal result, we use the idea of algorithm 2 and consider the average block assistance probability under unit cost as:

[0094]

[0095] According to the optimization objective, under the condition of satisfying the storage cost limit θ(b i ) of block b, the node with the largest average assistance probability of the block under unit cost is preferentially selected for the block. i ) The maximum node.

[0096] According to the above idea, the specific steps of the node selection algorithm based on the faulty node are as follows: First, initialize the node selection set A(b i ) of block b and the total assistance probability G(b i ,v k ) of block b when v i fails (line 1). Calculate the average assistance probability of node v i ,v k storing block b j under unit cost (line 2-4). Sort the nodes in descending order according to i to obtain the ordered node set V′ (line 5). Traverse the node set V′ (line 6). When the cost of the current node v (line 2-4) storing block b j does not exceed the limit θ(b i ) (line 7), block b i selects node v i , updates the block resource quantity limit θ(b j ) (line 8). Through the node selection set A(b i ), calculate the total assistance probability G(b i ) of the selected nodes of block b i in the faulty node v k (line 9). Find the minimum total assistance probability G(b i ,v k ) in the total assistance probability G(b i ,v k ) of the block (line 10). Calculate the minimum total assistance probability G of all blocks (line 11). i ,v min )

[0097]

[0098] Time complexity analysis: The time complexity of traversing all blocks in line 2 is O(m). Lines 3 to 4 need to calculate the average assistance probability of each node for the block under unit cost. Therefore, the time complexity is O(n 2 ). Line 5 sorts the nodes according to Sorted in descending order of size, its time complexity is O(n log n). The time complexity of traversing the ordered node set V′ in line 6 is O(n). In line 9, for each failed node, calculate the sum of the block assistance probabilities of the selected node set A(b i ) in the current failed node is O(n 2 ). Therefore, the total time complexity of the algorithm is O(mn 2 ).

[0099] Specific example of the node selection algorithm based on failed nodes: We continue to use the data of Algorithm 1 for the data we simulate. In Algorithm 3, first we calculate the average assistance probability of the unit cost block stored in different nodes for block b 1 are respectively By sorting the average assistance probability of the unit cost block in descending order, we get the ordered node set V′ = {v 4 , v 2 , v 3 , v 1 , v 5}. Select nodes in order from the ordered node set V′. The sum of the costs of storing block b 1 in the selected node set A(b i ) needs to be less than the storage cost limit of block b i in the group. So the nodes that meet the above conditions are r(b 1 , v 4 ) + r(b 1 , v 2 ) + r(b 1 , v 3 ) = 9 < 11. Therefore, A(b 1 ) = {v 4 , v 2 , v 3}. Through the node set A(b 1 ), calculate the total block assistance probabilities when each node fails, which are G(b 1 , v 1 ) = 79.6%, G(b 1 , v 2 ) = 49.2%, G(b 1 , v 3 ) = 55.0%, G(b 1 , v 4 ) = 51.0%, G(b 1 , v 5 ) = 73.7%; find the minimum value among them is G(b 1 , v 2 ) = 49.2%.

[0100] Through the above calculations, we know that block b 1 The final selection result is A(b 1 ) = {v 4 , v 2 , v 3}, and when they fail at node v 2 , the total assistance probability for block b 1 is G(b 1 , v 2 ) = 49.2%. In this example, we only consider one block, so G = G(b 1 , v 2 ) = 49.2%. The node selection process based on the failed node is shown in Figure 4 .

[0101] In the above algorithm, we give three specific methods for the block to select nodes. The block set B we use is a complete blockchain copy composed of m blocks, and these m blocks represent the total number of current blocks. However, in the technology of the blockchain, the number of blocks increases dynamically, and the newly added data will be packaged into new blocks and broadcast in the blockchain network every once in a while. Therefore, when the node group receives the new block b new , given the cost limit θ(b new ) of the new block, the new block b new is stored in different nodes through any one of the above three algorithms.

[0102] Next, step 7 will be expanded for detailed description: an execution case of the dynamic nodes inside the node group is given.

[0103] In our problem definition, the node group is a set constructed by n nodes. These nodes can cooperate with each other to reduce their own storage of blocks, thereby reducing the storage cost. In the above scheme, the number of nodes is fixed. Considering the actual situation, the nodes in the group exist dynamically. When the node group is running normally, if a new node v new joins the group, we need to allocate blocks to the new node v new to improve the minimum total assistance probability of the block (i.e., the optimization goal).

[0104] Dynamic node solution one: The specific steps and cases of the node dynamic addition solution are as follows:

[0105] Different blocks have different storage costs for the new node. Let the cost of the new node v new storing the block b i be c(b i , v new ), and A(b i ) represents the block b i when the new node has not joined.The selected node set, θ(b i ) represents block b i The current remaining cost.

[0106] The addition of new nodes does not increase the block b i Storage cost limit, so we check the new node v new Storage block b i The cost of c(b i ,v new ) exceeds the remaining cost θ(b i ). If not, the new node v new Storage block b i Will directly increase the minimum total assist probability gain;

[0107] If the cost limit θ(b i ), we need to consider v new Replace the stored block b i The node v j , that is, node v j No longer storing block b i , by the new node v new To store. Therefore, when c(b i ,v new )≤θ(b i )+c(b i ,v j ) under the condition that E(b i ,v min ) indicates v new Replace v j Block b i The minimum assistance probability after i ,v min ) represents the minimum assistance probability before replacing the block, ΔG j =E(b i ,v min )-G(b i ,v min ) indicates v new Replace v j Block b i After the gain, if ΔG j If it is greater than 0, it means v new Replace v j Block b in i Will increase the current minimum assistance probability. According to the optimization goal, we need to find ΔG j >0 corresponds to the node v with the maximum gain ex , v new Replace v ex Block b i .

[0108] According to the above idea, the specific steps of the node dynamic addition algorithm are as follows: First, initialize the gain set ΔG j , replace node v ex , maximum gain G max , update the node set V (line 1); update node v new The block assistance probability t(b i ,v j ,v k )(Line 2), check whether each block can add the new node v new (Line 3), if the new node v new Storage block b i The cost of c(b i ,v new ) does not exceed the remaining cost limit θ(b i ), directly block b i Add new node v new (Lines 4-5), otherwise, block replacement is performed, and the current block b is first calculated i Assign node set A(b i ) The total block assistance probability G(b) under the current different node failures i ,v k ), v k Indicates the faulty node, find G(b i ,v k ) in the minimum total assistance probability G(b i ,v min )(Lines 6-8), traverse A(b i ) (line 9), and replace v with the node v(line 10) while satisfying the block storage cost constraint. j Block b i Back node v k The total block assistance probability E(b i ,v k ), find the minimum total assistance probability E(b i ,v min ), calculate the gain ΔG after replacement j (Lines 11-15), find the gain ΔG j The maximum gain G greater than 0 max and the corresponding node v ex (Line 16), if there is a node v ex , delete the node set A(b i ) in the node v ex , v new Join node set A(b i )(Line 17).

[0109]

[0110] Time complexity analysis: The time complexity of updating the block assistance probabilities of all nodes in line 2 is O(m(n + 1) 2 ), the time complexity of examining whether each block can add the new node v new in line 3 is O(m), the time complexity of calculating the total block assistance probability G(b i , v k ) in line 7 is O((n + 1) 2 ), the time complexity of finding the minimum total block assistance probability G(b i , v k ) in G(b i , v min ) in line 8 is O(n + 1), the time complexity of traversing the node set A(b i ) in line 9 is O(n), the time complexity of recomputing the total block assistance probabilities when different nodes fail after the new node v new replaces the block b j in node v i in line 12 is O(n + 1), the time complexity of finding the minimum total block assistance probability E(b i , v k ) in E(b i , v min ) in line 13 is O(n + 1), so the total time complexity is O(m(n + 1) 2 ).

[0111] Example of the node dynamic addition algorithm: We continue to use the simulation data and the allocation result A(b 1 ) = {v 1 , v 2 , v 3} of Algorithm 1, and θ(b 1 ) = 0. To simplify the complexity of the example, we still consider the specific allocation of only one block b 1 . Suppose the cost of storing the block b new in the new node v 1 is c(b 1 , v new ) = 4. Due to the addition of the new node, we need to update the block assistance probabilities of all nodes. The specific data is shown in Table 3. From A(b 1 ) = {v 1 , v 2 , v 3}, it can be calculated that the minimum total block assistance probability under different node failures is 45%, corresponding to the failure of the node v 2 . For the node v 1, where c(b 1 , v 1 ) = 5, so c(b 1 , v 1 ) + θ(b 1 ) > c(b 1 , v new ), so v new can replace the block b 1 in v 1 . Through the calculation of lines 11 - 15, E(b 1 , v 2 ) = 45%, and we know that ΔG 1 = 0, which does not meet the replacement condition. Regarding the node v 2 , where c(b 1 , v 2 ) = 4, so c(b 1 , v 2 ) + θ(b 1 ) > c(b 1 , v new ), so v new can replace the block b 2 in v 1 . Through the calculation of lines 11 - 15, E(b 1 , v 2 ) = 42% is the minimum, and we know that ΔG 2 = -2%, which does not meet the replacement condition. Regarding the node v 3 , c(b 1 , v 3 ) = 2, which does not meet the cost constraint condition. So the block b 1 cannot be stored in the new node v new .

[0112] Table 3. Assistance probability of block b 1 after the addition of a new node (without retaining decimals)

[0113] t <![CDATA[v 1 malfunction]]> <![CDATA[v 2 fault]]> <![CDATA[v 3 malfunction]]> <![CDATA[v 4 Fault]]> <![CDATA[v 5 malfunction]]> <![CDATA[v new Fault <!-- 14 -->]]> <![CDATA[b 1 →v 1 > 0 28% 23% 27% 25% 26% <![CDATA[b 1 →v 2 > 32% 0 29% 33% 31% 32% <![CDATA[b 1 →v 3 > 16% 17% 0 16% 15% 16% <![CDATA[b 1 →v 4 > 29% 31% 26% 0 28% 29% <![CDATA[b 1 →v 5 > 21% 22% 18% 21% 0 21% <![CDATA[b 1 →v new > 26% 28% 23% 27% 25% 0

[0114] Dynamic node scheme two: The specific steps and cases of the node dynamic deletion scheme are as follows:

[0115] The above introduced the block allocation scheme when a new node joins the group. Since there are nodes joining, there will also be nodes leaving. Although we have considered the situation of node failures, node failures or offline are not permanent departures from the group. For the situation where a node actively leaves or the node group forces a node to leave, we call this situation node dynamic deletion.

[0116] Assume that the node v del is deleted from the node group, and its block set Q(v del)All the blocks in it will also be deleted. We are not worried about the loss of blocks, but only that it will reduce the node v del The stored block b i The total assistance probability of the blocks in the node group. Since the node v del has been deleted, the total storage cost of the blocks stored by the node v del will decrease. In order to minimize the reduction of the total assistance probability of the block b i under the condition that θ(b i ) + c(b i , v del ) ≥ c(b i , v j ) and the node v j does not store the block b i , we can allocate the block b i to the node v j . If there are multiple nodes that meet the above conditions, according to the optimization goal, we use the core idea of Algorithm 2 to select the node with a higher unit-cost assistance probability u(b i , v i , v j , v k ) as much as possible for the block b

[0117] First, update the node set V (line 1), traverse the block set of the node v del , update the unit-cost assistance probability after deleting the node v del , update the remaining storage cost θ(b i ) of the block b i , and the set of nodes A(b i ) selected by the block b i (lines 3 - 4), update the total assistance probability G(b i ) of the block b i allocated to the set of nodes A(b i , v k ) under different current node failures, find the failure node v i , v k corresponding to the minimum total assistance probability in G(b min ) (lines 5 - 6), initialize the set of nodes V′ of the unallocated block b i (line 7), and end the loop when V′ is empty (line 8). Each time the loop finds the node v min with the highest unit-cost assistance probability u(b i , b j , v min ) when v max fails, v maxBelonging to the node set V′ (line 9), for the node v i that satisfies c(b max , v i ) ≤ θ(b max ) (line 10), after updating and adding v max , for different node failures, the total assistance probability G(b i , v k ) of the block, re - find the failed node v min with the minimum total assistance probability, add v max to A(b i ), update the storage cost limit θ(b i ) (lines 11 - 13), and delete v max from the node set V′ (line 14).

[0118]

[0119]

[0120] Time complexity analysis: The time complexity of traversing the block set of node v del in line 2 is O(m). The time complexity of updating the unit - cost assistance probability in line 3 is O((n - 1) 2 ). The time complexity of updating the total assistance probability G(b i , v k ) in line 5 is O((n - 1) 2 ). The time complexity of finding the failed node v i corresponding to the minimum total assistance probability in G(b k ) in line 6 is O(n - 1). The time complexity of traversing the node set V′ in line 8 is O(n - 1). The time complexity of finding the node v min with the maximum u(b min , v i , v j , v min ) when v max fails in line 9 is O(n - 1). The time complexity of adding node v max and updating the total assistance probability of each failed node in line 11 is O(n - 1). The time complexity of finding the minimum total assistance probability after the update in line 11 in line 12 is O(n - 1). Therefore, the total complexity of the algorithm is O(m(n - 1) 2 ).

[0121] Example of the node dynamic deletion algorithm: For the data and result set of the node dynamic deletion algorithm, we use the simulation data of Algorithm 1 and the allocation result set A(b 1 ) = {v 4 , v 2 , v3}, θ(b 1 ) = 2. Similarly, only considering the specific solution of block b 1 , the node to be deleted in this example is v 2 . After the node v 2 is deleted, update the unit cost assistance probability u(b 1 , v 1 , v j , v k ) of the block b 2 . The specific calculation data is shown in Table 4. Since the storage cost of node v 1 , v 2 ) = 4, the remaining storage cost θ(b 1 ) after update increases to 6, and the allocation result set A(b 1 ) = {v 4 , v 3}. Through the calculation of the result set A(b 1 ), we know that the current minimum total assistance probability of the block is 18.0%, corresponding to the total assistance probability of the block when node v 4 fails, which is a 31.2% decrease compared to the result of Algorithm 2. According to Algorithm 5, when node v 4 fails, the u(b 1 , v 1 , v 1 , v 4 ) of node v 5 = 6.6%, and the u(b 1 , v 5 , v 4 ) of node v 1 = 6.3%. Among them, the unit assistance probability of the block of node v 1 , v 1 ) is the largest and c(b 1 , v 1 ) = 5 > θ(b 1 ), so we choose node v 1 to store block b 4 , and the final result set A(b 3 ) = {v 1}.

[0122] Table 4. Unit cost assistance probability of block b 2 after deleting node v 1 (retained to 1 digit)

[0123]

[0124]

[0125] The fault-tolerant cooperative storage mechanism of the blockchain network node group in the above embodiments is applicable to current Internet of Things devices, which are required to have basic functions such as computing, storage, and communication. When the device or node is running, the fault-tolerant cooperative storage mechanism of the blockchain network node group in the above embodiments is executed. For example, the content of steps 1 to 7 above is executed, and in step 6, any one of the heuristic schemes can be optionally implemented.

[0126] The above are only the preferred embodiments of the present invention, and do not limit the patent scope of the present invention. Any equivalent structural transformation made under the inventive concept of the present invention by using the content of the specification and drawings of the present invention, or directly / indirectly applied to other related technical fields, is included in the patent protection scope of the present invention.

Claims

1. A fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices, characterized in that, it includes the following steps: Step 1: Use Internet of Things devices as nodes to build a node group, and all nodes cooperate to run the same blockchain copy; Step 2: Calculate the cost of a node storing a block according to the storage resources of the block occupied by the node, the computing resources of the CPU, and the communication resources; Step 3: Quantify the importance of a block to the node group through the total number of accesses to the block by the system, and set a storage cost limit for each block; Step 4: Nodes need to eliminate the original blocks that are unimportant to themselves, quantify the elimination rate through the node's demand for the block, and further calculate the assistable probability brought by the node storing the block according to the elimination rate; Step 5: Build a mathematical model, and give the optimization objective and constraints, specifically as follows: Let the complete blockchain copy B = {b 1 , b 2 , …, b m} consisting of m blocks, and a set of in-group nodes V = {v 1 , v 2 , …, v n}. Let x(b i , v j ) denote the decision variable. The block b i selects the node v j for storage, that is, the decision variable x(b i , c j ) = 1. The cost of storing the block b i by the node v j is c(b i , v j ). The total storage cost of the block b i in the group does not exceed its cost limit θ(b i ). The block assistance probability t(b i , v j , v k ) represents the probability that the node v j provides the block b k when the node v i fails. The node selection problem is to select nodes for blocks to store, but the same node cannot store the same block multiple times; represents the sum of the probabilities that the selected nodes can provide assistance to other nodes for the block b k when the node v i fails, that is, the total block assistance probability. represents finding a v k such that when it fails, the sum of the block assistance probabilities provided by the selected nodes is minimized. Therefore, it can be known that when v k fails, the impact on the block assistance probability in the group is the greatest. So we need to find an allocation method to maximize the minimum total block assistance probability when v k fails; That is, the optimization goal is to find the faulty node v with the worst total assistance probability of the block under the condition that the total cost of storing the block by the nodes does not exceed the storage cost upper limit θ(b i ) k , and select an allocation method to maximize the total assistance probability of the block under this faulty node: Constraint: Block b i The total cost of selecting different nodes for storage does not exceed the storage cost limit of the node group for block b i ; Block b i is assigned to the same node at most once, and the specific formula is as follows; Step 6: Implement the selection of each block for the nodes in the group through three designed heuristic schemes; Step 7: Considering that the nodes in the node group are dynamic in the actual scenario, two node dynamic addition and deletion schemes for the corresponding objective function are designed under the premise of constraints.

2. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, the nodes need to eliminate the original blocks that are unimportant to themselves, and quantify the elimination rate through the node's demand for the block, including: When data is packaged into a new block, the node group will receive the new block through the blockchain network. Therefore, the number of blocks stored by the nodes in the group is continuously increasing; according to the characteristics of Internet of Things devices or nodes such as low capacity and low computing resources, let the nodes eliminate the original blocks that are unimportant to themselves, and quantify the elimination rate through the node's demand for the block, so as to improve the scalability of the application of blockchain technology.

3. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, setting a storage cost limit for each block, enabling the block to reasonably select nodes to store the block, avoiding resource waste, and saving the cost overhead brought by node storage.

4. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, The node v k The failure occurs when any one of the nodes in the node group fails; because in the actually formed node group, it is inevitable for nodes to fail or go offline, the present invention considers the total assistance probability in the scenario where the node group fails, and through the objective function and constraint conditions, selects a suitable node set for the block to store, and optimizes the total assistance probability of each block; so that when a node fails and goes offline, the normal nodes in the node group can still assist any block of the entire blockchain copy, providing a high guarantee for the normal operation of the entire node group and improving the stability of the node group.

5. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 2, characterized in that, the Internet of Things devices need to meet basic capabilities such as computing, storage, and communication.

6. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, The block assistance probability t(b i , v j , v k ) includes the following calculation process: where v k represents a faulty node and cannot provide block queries; for node v u , if v u needs to store a new block and eliminate block b i with probability d(b i , v u ), then v u needs to obtain b i from other nodes; the probability that node v j can provide b i is 1 - d(b i , v j ), that is, the survival rate of block b i in node v j ; thus the probability that v u obtains b j provided by v i is (1 - d(b i , v j )) * d(b i , v u ); since v u can be any node other than v k and v j , so when v k fails, the probability that v j can assist other nodes and provide b i is expressed as: When the assisting node v j becomes the faulty node v k , that is, v j = v k , then the average probability that v j can assist other nodes and provide b i is 0.

7. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 4, characterized in that, Before selecting a suitable node set for a block through the objective function and constraint conditions, it is necessary to analyze the mathematical model, reduce the Max–min knapsack problem (MMKP) to the node selection problem in the mathematical model of the present invention, so as to prove that the node selection problem is NP-hard.

8. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, three heuristic schemes are designed to implement the selection of nodes in the group for each block, specifically including: From three perspectives: the gain of the total cooperation probability of the block brought by the node storing the block, the block unit cooperation probability of the node storing the block under unit cost, and the average cooperation probability of the node for the block in case of different node failures, a node selection heuristic scheme based on the gain of block cooperation probability, a node selection heuristic scheme based on storage cost, and a node selection heuristic scheme based on faulty nodes are respectively proposed.

9. The fault-tolerant cooperative storage mechanism for a blockchain network node group based on Internet of Things devices according to claim 1, characterized in that, the two node dynamic addition and deletion schemes include: Based on the objective function and constraint conditions, in view of the dynamic changes of devices or nodes in the actual scenario within the group, a node dynamic addition scheme and a node dynamic deletion scheme are proposed.

Citation Information

Patent Citations

  • Block data distribution method for a block chain fragmentation storage strategy

    CN112231394A

  • Cone block chain storage system and consensus storage method

    CN112241435A