Minimum overhead node group construction and multi-block allocation mechanism of blockchain system based on lightweight devices
By building a minimum overhead node group and multi-block allocation mechanism in the blockchain system, the hardware threshold problem of lightweight devices when storing blockchain data is solved, and higher storage scalability and data security are achieved. .
Patent Information
- Application Number
- CN202211614360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-15
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2042-12-15
AI Technical Summary
Blockchain technology has challenges in storage scalability, especially for lightweight devices, the hardware barrier to storing complete blockchain copies is high, making it difficult for these devices to effectively use blockchain technology.
A blockchain system minimum overhead node group construction and multi-block allocation mechanism based on lightweight equipment are proposed. By counting the storage capacity of nodes, computing the communication overhead between nodes, and redundantly according to the stability threshold of blocks. Remain control, constructing mathematical models to optimize storage, query and communication overhead.
It has realized the construction of a blockchain node group on devices with limited hardware conditions, lowered the hardware threshold of blockchain technology, improved storage scalability, and ensured the security and correctness of data.
Smart Images

Figure CN116132459B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain storage technology, and in particular to a blockchain system minimum overhead node group construction and a multi-block allocation mechanism based on lightweight devices. Background Art
[0002] According to the development needs of today's information society, blockchain technology is gradually maturing. Compared with traditional technologies, blockchain integrates distributed architecture, consensus protocol, timestamp, cryptography and other technologies, and has the characteristics of decentralization, tamper-proof, traceability, resource sharing, and persistence. The nodes in the blockchain network can manage data by themselves. They can independently verify the correctness of transactions or data, and forward transactions or data in a peer-to-peer network, so they can share resources in a mutually untrusted environment. As new data is continuously generated, they are encrypted and packaged into blocks and stored in leaf nodes with a data structure of a merkle tree, and finally permanently linked to the main chain of the blockchain. Since blocks are generated based on the data of the previous block, as the length of the blockchain increases, it will become more difficult to tamper with old data, thereby ensuring the security of the data. The first program to apply blockchain technology was the digital cryptocurrency Bitcoin. The birth of Bitcoin marked the arrival of the blockchain 1.0 era, and since then blockchain technology has received widespread attention. The emergence of Ethereum is to cope with more complex digital currency scenarios. It adds smart contracts on the basis of blockchain, thus opening the blockchain 2.0 era. Nowadays, blockchain technology is not only used in digital currency. Many companies and researchers have begun to try to use blockchain technology to empower other industries in society.
[0003] Although blockchain technology has high potential value in many application scenarios, its storage scalability has not yet been well resolved. In the blockchain system, data is continuously packaged into blocks and linked to the blockchain. Over time, the total amount of data in the blockchain has exploded. As of October 1, 2021, the total transaction data volume of Bitcoin was about 367.16GB. As of October 28, 2022, the total data volume of the full node has reached 434.71GB. In just about a year, the amount of blockchain data has increased by nearly 68GB. Therefore, if users want to become full nodes of the blockchain, the hardware threshold will become higher and higher. In addition, as the amount of full node data continues to grow, the verification of data and the processing of transactions will become slower, which will bring security issues to the blockchain system. Therefore, the storage scalability of the blockchain is a major challenge for the implementation of blockchain technology in many fields. For example, in the supply chain and logistics related industries, blockchain technology can simplify the supply chain management process and provide higher security for decentralized data. However, in the supply chain and logistics related industries, the amount of data generated every day is also huge. After a period of time, nodes with low storage performance will be eliminated or face upgrades, so users need to manage these nodes regularly. For example, in today's information age where everything is connected, for things like mobile phones,
[0004] , car computers, smart homes and other intelligent devices have low storage capacity and it is difficult to expand their storage capacity. Therefore, it will be difficult to apply blockchain technology to these IoT devices.
[0005] In the existing solutions to the storage scalability problem of blockchain, light nodes using the SPV protocol do not need to store a complete copy of the blockchain. Compared with full nodes that store complete blockchain data and can independently verify transactions or data, light nodes only need to store information on the block header, where the block header information includes the hash value of the previous block, the "mining" difficulty value, the nonce value, the root hash value of the merkle tree of the block itself, and timestamp information. The data size of the block header is only 80 bytes, so the total amount of data in the light node is very small, which can meet the needs of most node devices. However, the light node itself does not store the block body. When the light node needs to verify transactions or data, it must rely on the full node. In addition, too many light nodes and too few full nodes will affect the security of the blockchain system. In addition to the light node method, relevant scholars use off-chain databases to store data on the blockchain, thereby greatly reducing the storage pressure of blockchain nodes. Among the many solutions, the most popular is the use of the Interstellar File System. Although this method reduces the total amount of data in the full node, the most important data on the blockchain is transferred to a third party, reducing the supervision of the blockchain node on the data, which will reduce the security of the data to a certain extent; in addition, the blockchain node needs to be synchronized with the off-chain database. If the off-chain database encounters difficulties, this will directly affect the performance of the blockchain system. Another solution is that the nodes in the blockchain network maintain at least one complete copy of the blockchain through collaboration. This is the idea of the consensus unit. The consensus unit stores only part of the blocks on each node, thereby increasing the communication of internal nodes and ensuring that each node has the ability to verify transactions. The participants of the consensus unit are nodes from the same community or with cooperative relationships, but in actual application scenarios, it is more necessary to consider small storage capacity devices that cannot expand capacity. They are potential users of blockchain technology; in addition, according to the nature of the consensus unit, when the number of nodes inside it is too large, the communication between nodes becomes complicated, which will directly affect the efficiency of the entire consensus unit.
[0006] In existing work, the participants of the consensus unit are nodes from the same community or with cooperative relationships, but in actual application scenarios, the participating devices represent nodes in the blockchain. We need to consider small storage capacity devices that cannot easily expand capacity, such as personal mobile phones, laptops, cars, drones and other devices. The volume of these devices is huge, so we will need to join the blockchain system The device is organized into a node group, but considering that they have certain historical data, in order to expand the sharing of this data and ensure the security of historical data, they use blockchain technology to store historical data on the chain, and the devices willing to form a node group often have their own storage capacity that cannot store the current blockchain copy, so we need to consider whether the total storage capacity contributed by the device itself can meet the current existing blockchain data volume. In addition, the device needs to purchase network services to broadcast messages in the node group using the p2p network, which will generate communication overhead; for small devices, the farther the distance between two devices, the higher the cost of communication overhead. In the process of forming a node group, the distance between devices or nodes is also one of the factors we need to consider. Depending on the hardware parameters, devices with strong functionality often have higher hardware and maintenance costs. We further subdivide the device costs. When the device needs to purchase storage hardware to provide storage space for the block, storage costs will be incurred. When the device in the node group needs to access the block that it does not store, it will occupy the computing resources of other devices and incur query costs. In addition, when a node group only stores a complete copy of the blockchain, if the block data in the device is accidentally deleted or overwritten, the blockchain copy in the node group will become incomplete. According to the number of verifications of the block in the blockchain system, we associate a stability threshold for each block. The higher the stability threshold, the more important the block is, and the more redundancy should be, but the specific number of redundancies also depends on the total data volume of the node group. Therefore, when we apply the concept of node groups to different fields, lower usage costs can attract more devices to join the blockchain system. With the increase in the number of devices, the security, sharing and other characteristics brought by blockchain technology can be better utilized. Summary of the invention
[0007] The present invention proposes a minimum overhead node group construction and multi-block allocation mechanism for a blockchain system based on lightweight devices, with the aim of at least solving the problems in the prior art. For example, mobile phones, car computers, smart homes, etc. want to use blockchain technology, but the hardware conditions may not meet the requirements of the "full node" of the chain. However, the number of these devices is huge, so we will organize the devices that need to join the blockchain system into a node group, and each device contributes its own computing resources, communication resources, and storage resources to jointly maintain a complete blockchain copy, thereby realizing blockchain technology.
[0008] Here we correspond one device to one node. For the specific allocation of node groups and blocks, we need to consider the upper limit of each node's storage capacity and the node group's requirement for the number of redundancies for each block. Under the above conditions, we try to minimize the cost of the entire system. This will solve the current storage scalability problem of blockchain, lower the threshold for devices to use blockchain technology, enable more devices in life to join blockchain technology, and further improve the security of device data.
[0009] The steps for constructing a minimum overhead node group and multi-block allocation mechanism for a blockchain system based on lightweight devices are as follows:
[0010] S1. Statistics require the use of nodes using blockchain technology.
[0011] S2. Measure the upper limit of the data storage capacity of these nodes and calculate the overhead of the node storing a unit amount of data.
[0012] S3. Measure the geographical distance between nodes, calculate the communication overhead per unit distance between nodes, and calculate the query overhead per unit data volume generated when the node itself queries data.
[0013] S4. Count the blockchains used by these nodes, calculate the amount of data in each block in the blockchain, and associate different stability thresholds for each block based on the number of times the block is verified in the blockchain system.
[0014] S5. Build a node group. Each node group will store at least one complete copy of the blockchain. The node group determines the degree of redundancy of the block in the node group through the stability threshold of the block.
[0015] S6. Construct a mathematical model, assuming that the block set B = {b1, b2, ..., b m} has m blocks to form a complete blockchain, s i Indicates block b i Data size (MB). The node set V in the blockchain network is {v1, v2, ..., v n}By combining, we get the node cluster P = {P1, P2, ..., P k}, in order for each node group to have enough data to store a complete copy of the blockchain, the total node data is divided into k parts, and the amount of data in each part must exceed the amount of data in the blockchain copy, that is, k needs to satisfy in
[0016] Since block b i The stability threshold r needs to be met in the node group i , let f(b i ,P k ) indicates that in the node group P k Storage block bi The block allocation problem is to allocate blocks to nodes, that is, nodes v j The set of stored blocks is denoted by Q(v j ) represents the unit data query cost between any nodes, and the edge set e xy ∈E represents the geographical distance between nodes, d xy ∈D represents. Represents node v j Storage block b i The unit cost, ω j Indicates the upper limit of the amount of block data (MB) stored by the node, where the block capacity stored by the node cannot exceed the storage capacity of the node Then node v j The storage cost is
[0017] Each node cannot be covered by multiple node groups. The storage overhead of a node group is the sum of the storage overhead of all nodes in the group, and the calculation formula is:
[0018] Let the node group P k There is a node v in x ∈P k , v y ∈P k , x≠y, since the blocks stored by a single node in the group are not complete, L(v x ) is represented as node v x The missing block set in U(b i ,P k ) represents the node group P k Storage block b i When querying blocks that it does not have, the node group P will incur query overhead with other nodes. k The query cost formula is:
[0019] The node group is composed of different nodes. The nodes in the group need to communicate with each other, and the distance between the nodes in the group will affect the communication overhead of the group. Suppose the node group P k Average distance a k It is defined as the average distance between nodes in the group, that is, Therefore, the calculation formula for the communication overhead of all node groups is: Where t represents the communication cost per unit distance between nodes.
[0020] The optimization goal is to ensure that each block in the system meets the stability threshold R = {r1,…,r m} and the node group stores the complete blockchain and the number of blocks does not exceed the storage capacity of a single nodeωj Minimize all storage overhead, query overhead, and communication overhead in the system under the condition of k ), query overhead I(P k ), the communication overhead A(P) is normalized. Since there are three types of overhead objective functions, we use the weighted method to calculate the total overhead. α, β and γ are weighted coefficients, α, β, γ ≥ 0, α + β + γ = 1. By allocating weights, balancing the relationship between overheads, and minimizing the total overhead of the system, the objective function is:
[0021]
[0022] The constraints of the objective function are: the capacity of each node group needs to exceed the total amount of blockchain data; the capacity of the block set does not exceed the storage capacity of a single node ω j ; Represents the node group P k The total capacity at least exceeds the threshold r i The total capacity of the blockchain. k Storage block b i The number of nodes f(b i ,P k ) needs to exceed the stability threshold r i With node group P k Number of midpoints |P k | and the maximum stable threshold The formula is as follows:
[0023]
[0024]
[0025]
[0026] Based on the objective function and constraints, we first formulate a construction strategy to complete the construction of the node group, and then allocate blocks to the nodes of each node group.
[0027] Compared with the existing technology, it has the following excellent effects:
[0028] The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices provided by the present invention can be applied to most devices in life, so that nodes with limited hardware conditions can also use blockchain technology, lowering the threshold of blockchain technology requirements for devices, thereby improving the storage scalability of blockchain technology; at the same time, each node in the node group retains the ability to verify data, so that the correctness of the data is guaranteed; this mechanism controls the redundancy of each block in the node group by setting a block stability threshold, while ensuring the integrity of the blockchain copy in the node group, reducing unnecessary block redundancy, saving the resource overhead of the (lightweight device) node, and by defining the objective function and constraints, the adopted allocation mechanism can minimize the system overhead, thereby improving the utilization of resources by the node group. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly demonstrate the advantages of the embodiments of the present invention and facilitate understanding by others, the following is a brief introduction to the drawings required for use in the embodiments:
[0030] Figure 1 A schematic diagram of a process of constructing a node group based on capacity gain in an embodiment of the present invention;
[0031] Figure 2 A schematic diagram of a process of constructing a distance-based node group in an embodiment of the present invention;
[0032] Figure 3 A schematic diagram of the process of a block allocation scheme based on storage income in an embodiment of the present invention;
[0033] Figure 4 A schematic diagram of a process of a block allocation solution based on overhead gain in an embodiment of the present invention; DETAILED DESCRIPTION
[0034] The technical scheme in the embodiment of the present invention is described in detail below in conjunction with the drawings in the embodiment of the present invention. Obviously, the specific embodiment described here is only used to explain the present invention and is not used to limit the present invention. The terms used in the specification of the present invention are only for the purpose of describing the specific embodiments and are not intended to limit the present invention.
[0035] In order to solve the storage scalability of blockchain technology, reduce the device storage threshold, and optimize the total cost of the system, an embodiment of the present invention proposes a blockchain system minimum cost node group construction based on lightweight devices and a multi-block allocation mechanism. The specific steps are as follows:
[0036] S1. Investigate the upper limit of the storage data capacity of participating nodes and calculate the overhead of node storage per unit data volume.
[0037] S2: Count the geographical distances between nodes, calculate the communication overhead per unit distance between nodes, and calculate the query overhead per unit data volume generated when the nodes themselves query data.
[0038] S3. Count the blockchain used by the node, calculate the amount of data in each block in the blockchain, and associate different stability thresholds for each block based on the number of times the block is verified in the blockchain system.
[0039] S4. Construct a mathematical model based on steps S1-S3 and give the definitions of blocks, nodes, and node groups.
[0040] S5. By calculating the total cost of storage, query, and communication, the optimization goal and constraints are given.
[0041] S6. Through feasibility analysis of the problem, it is proved that the problem is NP-hard, and a corresponding heuristic solution is designed to complete the construction of the node group and the allocation of blocks under the constraints, and to achieve the optimization goal, and to give the optimized construction and allocation strategy.
[0042] The following first describes steps S1-S5 in detail:
[0043] For steps S1-S5, it is necessary to investigate and count the actual nodes and blockchain copies, and build a mathematical model based on the actual characteristics of the nodes and the actual characteristics of the blocks in the blockchain.
[0044] In the present invention, we regard blocks as the smallest unit of data copies in the blockchain, so a complete blockchain data copy can be represented by a block set. In order to alleviate the pressure of a single node storing block data, in the present invention, the nodes in each node group no longer store a complete blockchain copy. When a node needs to query a block that it does not store, it needs to send a query request to other nodes. It is unsafe for a node group to store only a single blockchain copy. According to the number of previous verifications of the block in the blockchain system, we associate a stability threshold r with each block. i , which represents the ratio of the current number of blocks to the total number of nodes in the current node group. When the block reaches the stable threshold r i When a block is stored in a node, it will consume a certain amount of storage space. Based on the above idea, the definition of a block is as follows.
[0045] Definition 1: Block set B = {b1, b2, …, b m} A complete blockchain data copy consists of m blocks, s i Indicates block b i Data size (MB). For each block b i, there is a stable threshold r i Indicates that block b is stored in the node group i The percentage of nodes in the node group is greater than or equal to r i For the block set B, we get the stable threshold set R = {r1,…,r m}, where 0 <r i ≤1.
[0046] In the blockchain network, a node refers to a device that can store blocks, which can be a personal computer or a server. Each node has its own upper limit on the amount of data it can store (MB). The node needs to maintain and query the stored blocks, so different blocks stored in different nodes will incur different storage costs. In the blockchain network, due to the different distances between nodes or the different node network states, the unit data communication costs between different nodes are also different. Below we give a specific definition of a node.
[0047] Definition 2: The node network undirected graph G = (V, E) is used to describe the communication status between nodes. The node set V = {v1, v2, …, v n} indicates that there are n nodes in the blockchain network that need to participate in reducing storage, and the unit data query overhead between any nodes is represented by the edge set e xy ∈E represents the geographical distance between nodes, d xy ∈D represents. Represents node v j Storage block b i The unit cost, ω j represents the upper limit of the amount of data (MB) stored in the node block. Let Q(v j ) is represented as node v j The set of blocks stored, where the capacity of blocks stored by a node cannot exceed the storage capacity of the node Then node v j The storage cost is
[0048] In traditional blockchain systems, a single node needs to store the entire blockchain to independently verify the entire transaction. As the length of the blockchain increases, the scalability of the system is limited. In order to improve the scalability of the blockchain system and allow small-capacity nodes to contribute storage space to store the blockchain, we divide all nodes into different node groups. In order for each node group to have enough data to store a complete copy of the blockchain, the total amount of node data is divided into k shares, and the amount of data in each share must exceed the amount of data in the blockchain copy, that is, k needs to satisfy in Below we give the specific definition of node group.
[0049] Definition 3: Different nodes are aggregated to form a set of node clusters P = {P1, P2, ..., P k}, P = V means that all nodes participate in the aggregation of the node group, Indicates that the same node cannot be covered by multiple node groups. The storage overhead of a node group is the sum of the storage overhead of all nodes in the group.
[0050]
[0051] Let the node group P k There is a node v in x ∈P k , v y ∈P k , x≠y, since the blocks stored by a single node in the group are not complete, L(v x ) is represented as node v x The missing block set in U(b i ,P k ) represents the node group P k Storage block b i When querying blocks that it does not have, it will generate query overhead with other nodes. k The query cost is
[0052]
[0053] The node group is composed of different nodes, so the nodes in the group need to communicate with each other, and the distance between the nodes in the group will affect the communication overhead of the group. Suppose the node group P k Average distance α k It is defined as the average distance between nodes in the group, that is, Therefore, the communication overhead of the entire node group P is
[0054]
[0055] Where t represents the communication cost per unit distance between nodes.
[0056] When allocating blocks to nodes, our optimization goal is to minimize the total overhead without exceeding the node storage capacity, ensuring the integrity of the blockchain in the node group, and meeting the stability threshold of each block. Therefore, the objective function and constraints are specifically defined as follows.
[0057] Definition 4: Given a block set B = {b1, b2, ..., b m} has m blocks to form a complete blockchain. The node set V in the blockchain network is V = {v1, v2, ..., v n}By combining, we get the node cluster P = {P1, P2, ..., P k}, due to block b i The stability threshold r needs to be met in the node group i , let f(b i ,P k ) indicates that in the node group P k Storage block b i The block allocation problem is to allocate blocks to nodes, that is, nodes v j The block set Q(v j ), the optimization goal is to ensure that each block in the system meets the stability threshold R = {r1,…,r m} and the node group stores the complete blockchain and the number of blocks does not exceed the storage capacity of a single nodeω j Minimize all storage overhead, query overhead, and communication overhead in the system under the condition of k ), query overhead I(P k ), the communication overhead A(P) is normalized. Since there are three types of overhead objective functions, in order to reduce the difficulty of optimization, we use the weighted method to calculate the total overhead. α, β and γ are weighted coefficients, α, β, γ ≥ 0, α + β + γ = 1. By allocating weights, balancing the relationship between overheads, the total overhead of the system is minimized:
[0058]
[0059] Constraints: Constraint (5) indicates that the capacity of each node group must exceed the total amount of blockchain data. Constraint (6) indicates that the capacity of the block set must not exceed the storage capacity of a single node ω j . Represents the node group P k The total capacity at least exceeds the threshold r i The total capacity of the blockchain. Constraint (7) represents the node group P k Storage block b i The number of nodes f(b i ,P k ) needs to exceed the stability threshold r i With node group P k Number of midpoints |P k | and the maximum stable threshold The product of .
[0060]
[0061]
[0062]
[0063] The following describes step S6 in detail:
[0064] First, before giving a heuristic solution, it is necessary to analyze the solution of the above mathematical model. From Definition 3, we can know that the storage cost C(P x ) and the unit storage cost of the node for the block and block data volume s i Related; the query cost of formula (2) I(P k ) and the unit data communication overhead between nodes xy and block data volume s i The out-of-group communication overhead A(P) of formula (3) is only related to the distance d between nodes in the group. xy Related, does not involve the unit storage overhead in the above two formulas and unit data communication overhead e xy And the block data volume s i Therefore, in the optimization objective (4), the calculation of the out-group communication overhead A(P) and the in-group storage overhead C(P x ) and intra-group communication overhead I(P k ) has no direct relationship. The size of the communication overhead A(P) is affected by the node group's choice of nodes, while the storage overhead C(P x ) and communication overhead I(P k ) is the size of the node group's choice of blocks. Through the above analysis, solving the problem of minimizing the total overhead of the node group can be divided into two stages: the construction of the node group and the allocation of blocks.
[0065] Construction of node group: Given a node set V = {v1, v2, ..., v n}, the total capacity of its nodes is The total amount of blockchain data is In order to ensure that each node group has enough capacity to store the total amount of block data, we divide the number of node groups into k parts, and the node cluster is P = {P1, P2, ..., P k The node group construction problem is to assign each node to the node group, while ensuring that the node capacity in each node group can exceed the total data volume of the blockchain. In the node group, consensus and communication are required between nodes, so communication overhead is generated between node groups. The optimization goal is to minimize the communication overhead generated between node groups:
[0066]
[0067] Constraints:
[0068]
[0069] Block allocation: Through the construction of node clusters, the node cluster is P = {P1, P2, ..., P k}, node group Pk Capacity The number of nodes in the node group is |P k |; For the complete blockchain set B = {b1,b2,…,b m}, the block allocation problem is to allocate the blockchain set to the nodes in the node group, f(b i ,P k ) is in the node group P k Storage block b i The number of nodes, block b i Has a stable threshold r i , so in the node group P k Storage block b i The number of nodes required is Since the node storage block will generate storage overhead C(P k ), a node accessing a block that does not exist on its own will incur a query overhead I(P k ), our optimization goal is to not exceed the node storage capacity and satisfy the storage block b i Minimize the storage cost C(P k ) and query overhead I(P k ). Since multiple optimization objectives are involved, we calculate the storage cost C(P k ) and query overhead I(P k ) is weighted, where α and β are weighted coefficients, α, β ≥ 0, α + β = 1, so the weighted optimization objective is:
[0070]
[0071] Constraints:
[0072]
[0073]
[0074] Through the above analysis, we need to divide the solution of the optimization goal into two steps: node group construction and block allocation. Next, we will perform NP-hard proofs for the two stages respectively.
[0075] Theorem 1: The problem of building a node group is NP-hard.
[0076] Proof: The weighted assignment problem is a known NP-hard problem. The weighted assignment problem has the following characteristics: a set of tasks J must be divided by a set of agents I, each task j can only be completed by one agent i, task i is completed at a predetermined level k, and when agent i completes the task at level k, the resource r owned by agent i is ijkwill be consumed. Under the premise of satisfying the resource constraints of agent i, the optimal allocation and completion level of task j to agent i is achieved to minimize the system cost. ij When the cardinality of each agent-task pair (i, j) is 1, the subscript k is meaningless. When each task j consumes the same amount of resources for all agents i, r ij You can use r j To replace, so the weighted assignment problem becomes a transition problem, which is a special case of the weighted assignment problem. The formula is as follows:
[0077] min∑ i∈I ∑ j∈J c ij x ij (13)
[0078] Constraints:
[0079] ∑ i∈I x ij =1 for all j∈J (14)
[0080] a i ≤∑ j∈J r j x ij ≤ b i for all i∈I (15)
[0081] x ij =0 or 1 for all i∈I,j∈J (16)
[0082] Map the above transition problem instance to the instance of the node cluster construction problem, a set of agents I corresponds to the node cluster P, a set of tasks J corresponds to the node set V, ∑ i∈I x ij =1 corresponds to the same node cannot be assigned multiple times, ∑ j∈J r j x ij represents the task resources assigned to agent i, corresponding to the node group P k Total node capacity a i Corresponding node group P k Capacity lower limit b i Corresponding node group P k Capacity limit In the construction of node clusters, the communication overhead is related to the distance between nodes in the cluster. To understand it from another perspective, node v j Join node group Pk The cost is The cost c assigned to agent i for task j ij The overhead A allocated to the node group by the corresponding node jk .
[0083] Through the above mapping relationship, the transition problem and the node group construction problem have the same solution, so the node group construction problem is also an NP-hard problem.
[0084] Theorem 2: The block allocation problem is NP-hard.
[0085] Proof: To prove that the block allocation problem is an NP-hard problem, we introduce the generalized multi-assignment problem, which is a classic generalized assignment problem and also an NP-hard problem. In this paper, the generalized multi-assignment problem is reduced to the block allocation problem. The following is an example of the generalized multi-assignment problem: there is a set of items J, where a single item is j∈J, a set of backpacks I, where a single backpack is i∈I, and c ij is the cost of putting item j into backpack i, b i represents the maximum capacity of backpack i, r ij represents the volume of item j placed in backpack i. ij =1 means item j is put into backpack i, otherwise it is 0, and the number of items j put into the backpack is not less than t j , among which t j No more than the total number of backpacks t j ≤|I|, under the above constraints, find the best allocation of item J to backpack I to minimize the target total cost. The formula is as follows:
[0086] min∑ i∈I ∑ j∈J c ij x ij (17)
[0087] Constraints:
[0088] ∑ i∈I x ij ≥tj for all j∈J (18)
[0089] ∑ j∈J r ij x ij ≤ b i for all i∈I (19)
[0090] x ij =0 or 1 for all i∈I,j∈J (20)
[0091] Map the above generalized multiple assignment problem instance to the block allocation problem instance: In the generalized multiple assignment problem, a set of backpacks I corresponds to the block allocation problem node set V, and a set of items J corresponds to the block set B. Since the size of the block data is fixed in any node, the volume r of the item in the backpack is ij Corresponding block b i The amount of data i , backpack capacity b i Corresponding node v j The upper limit of the amount of data stored w j , when x ij =1, it means that item j is assigned to backpack i, which corresponds to block b i Assigned to node v j ,∑ i∈I x ij Indicates the number of times item j is distributed to different backpacks, corresponding to the node group P k Storage block b i The number of nodes f(b i , P k ), the upper limit t of the number of times item j is assigned to different backpacks j Corresponding block stability threshold
[0092] In the optimization goal of block allocation, the node group overhead is divided into storage overhead C(P x ) and communication overhead I(P k ), by decomposing the cost function, block b i Assigned to node v j The storage cost is If block b i If it is the first allocation, query overhead will be incurred If b i This is not the first allocation, here we use Represents node v j Block b is not included i Access block b i Expenses, use Represents node v j Add block b i Access block b i Overhead, according to formula (2), the newly added block b i It does not increase the communication overhead, so Indicates block b i Assigned to node v j Reduced communication overhead. Therefore, block bi Join to node v j The subsequent overhead is divided into two cases. The first is block b i The first allocation cost is On the contrary, the cost is Through the cost function Induction block b i Assign to node v j Therefore, the cost of storing item j in backpack i in the generalized multiple assignment problem is c ij Corresponding cost function in block allocation problem From the mapping relationship, we can see that the optimization objective of the generalized multiple assignment problem is consistent with the block allocation problem, so the block allocation problem is an NP-hard problem.
[0093] The above content has proved that the node group construction problem and block allocation problem are NP-hard. Therefore, according to the objective function and constraints, a heuristic solution is used to construct a node group for the node set and allocate blocks to the nodes. The node group construction solution and block allocation solution will be introduced in detail below.
[0094] Node cluster construction plan 1: The specific implementation of the node cluster construction plan based on capacity gain is as follows:
[0095] The construction of the node group is to divide the nodes in the node set V into K node groups, and minimize the communication overhead within the group under the premise that the total node capacity of each node group exceeds the total data volume of the blockchain. It has been proved to be an NP-hard problem, so we propose a heuristic node group construction algorithm based on capacity gain, which selects a node in each iteration and puts it into a node group. j Join Group k The communication gain brought by this is ΔA(v j , P k )=A′(v j ,P k )-A k , where A′(v j , P k ) represents node v j Join Group k The communication overhead after k For node v j Join Group k According to the optimization goal, minimize ΔA(v j ,P k ), for this purpose, it is necessary to calculate the communication gain ΔA(v j ,P k ), there are nk such allocations. Considering the constraint The total node capacity of each node group at least exceeds the total data volume of the blockchain, and we give priority to the node group with the smallest node capacity.
[0096] Based on the above ideas, a node cluster construction algorithm based on capacity gain is designed. In Algorithm 1, P is divided into k empty subsets (line 1), and the communication overhead A of each cluster is initialized. x (Line 2), perform iterations, and each iteration selects the node group P with the smallest current capacity min (Lines 3-4), for the minimum communication gain ΔA min Initialize (line 5), then calculate each unassigned node v j In the node group P min The communication overhead A′(v j ,P k )(Lines 6-7), get different nodes in group P min The communication gain ΔA(v j ,P k )(Line 8), select the node group P min Bringing the minimum communication gain ΔA min The node v min (Lines 9-11), node v min Join the node group P min , v min Delete it from the node set V and calculate the current out-group communication cost A (lines 12-13).
[0097]
[0098] Time complexity analysis: The loop is executed n times (line 3), and the time complexity of finding the node group with the smallest capacity is O(k) (line 4). Line 6 needs to examine all nodes, with a complexity of O(n). Calculate P min Join node v j The time complexity of the out-group communication overhead is O(n) (line 7), and the total complexity of the algorithm is O(n 3 ).
[0099] In order to further simplify the scheme display, Figure 1 As shown, for example, the node set V has six nodes {v1, v2, v3, v4, v5, v6}, and the geographical distance between the nodes is d xy ∈D is represented by Table 1. Given six nodes {v1, v2, v3, v4, v5, v6} with storage capacities of {10G, 7G, 12G, 11G, 5G, 16G} respectively, let the total amount of blockchain data be When k=2, the algorithm divides P into two subsets P={P1,P2}. First, the node group P1 with a current capacity of 0 is selected. Since the node group P1 is empty, the total communication overhead of any node in V joining P1 is 0. Therefore, v1 is selected to join the node group P1 and v1 is deleted from V. At this time, the capacity of the node group P1 is 10G. The second time, the node group P2 with a current capacity of 0 is selected. Since the node group P2 is empty, the total communication overhead of any node in V joining P2 is 0. Therefore, v2 is selected to join the node group P2 and v2 is deleted from V. Delete, at this time the capacity of node group P2 is 7G; the third time select the node group P2 with the current minimum capacity of 7G, calculate the total cost of each node in V joining P2, A′(v3,P2)=4, A′(v4,P2)=2, A′(v5,P2)=3, A′(v6,P2)=1, among which the node with the smallest cost change is v6, so select v6 to join node group P2, delete v6 from V, at this time the capacity of node group P2 is 23G; the fourth time select the node group P1 with the current minimum capacity of 10G, calculate Calculate the total cost of each node in V joining P1, A′(v3,P1)=5, A′(v4,P1)=1, A′(v5,P1)=4, so the node with the smallest cost change is v4, so select v4 to join the node group P1, delete v4 from V, and the capacity of the node group P1 is 21G; the fifth time, select the node group P1 with the current minimum capacity of 21G, and calculate the total cost of each node in V joining P1, A′(v3,P2)≈4.3, A′(v5,P2)=3, so the node with the smallest cost change is It is node v5, so v5 is selected to join node group P1, and v5 is deleted from V. At this time, the capacity of node group P1 is 26G; in the last iteration, the node group P2 with the current minimum capacity of 23G is selected. Since there is only one node v3 in the node set V, v3 is selected to join node group P2, and v3 is deleted from V. At this time, the capacity of node group P2 is 35G; the final allocation method is node cluster P = {{P1 = {v1, v4, v5}}, {P2 = v2, v6, v3}}, and the total communication overhead A = 5.6.
[0100] Table 1. Node geographical distance (unit / km)
[0101] <![CDATA[d xy ]]> <![CDATA[v1]]> <![CDATA[v2]]> <![CDATA[v3]]> <![CDATA[v4]]> <![CDATA[v5]]> <![CDATA[v6]]> <![CDATA[v1]]> 0 2 5 1 4 8 <![CDATA[v2]]> 2 0 4 2 3 1 <![CDATA[v3]]> 5 4 0 7 6 3 <![CDATA[v4]]> 1 2 7 0 4 1 <![CDATA[v5]]> 4 3 6 4 0 5 <![CDATA[v6]]> 8 1 3 1 5 0
[0102] Node group construction scheme 2: The specific implementation of the distance-based node group construction scheme is as follows:
[0103] In Algorithm 1, the node group gives priority to the node with the minimum communication gain, and the node calculates the communication gain in each iteration. In order to reduce the computational overhead, we designed a distance-based node group construction algorithm. In this paper, it can be seen from formula (3) that the communication overhead is related to the average distance between nodes; therefore, k nodes are randomly selected as the initial average position of each group, and then the node set is iterated. Considering the capacity constraint, the group with the smallest capacity is selected each time to allocate the node. According to the optimization goal, the group gives priority to the node with the smallest distance to the average position.
[0104] Based on the idea of distance, the specific steps of the algorithm are given. First, divide P into k empty subsets (line 1), randomly select k nodes v * As the average position u k Assign to k node groups, and assign the assigned nodes v * Delete from the node set V (lines 2-4), iterate the node set V (line 5), and select the node group P with the smallest capacity in each iteration min (Line 6), find the node set V and the group P min Average position u min The node with the smallest distance v min (Line 7), v min Join the group min and delete it from the node set V (line 8), and finally calculate the out-of-group communication cost A (line 9).
[0105]
[0106] Algorithm time complexity: The time complexity of allocating k nodes to k node groups is O(nk) (lines 2-4), the time complexity of traversing each node is O(n) (line 5), the time complexity of finding the node group with the smallest capacity is O(k) (line 6), and the time complexity of finding the node set V and the average position u of the group is O(k) (line 6). min The node with the largest distance v min The time complexity of the algorithm is O(n) (line 7), and the total time complexity of the algorithm is O(n 2 ).
[0107] For ease of understanding, an example of this solution is given. Figure 2 The input data of the distance-based node group construction algorithm is consistent with the data in the example of the capacity gain-based node group construction algorithm. Suppose the total amount of blockchain data is When k=2, the algorithm divides P into two subsets P={P1,P2}. First, nodes are randomly selected for the P1 and P2 node groups respectively. Therefore, we divide v2 as the central node to P1 and v3 as the central node to P2. At this time, the capacity of P1 is 7G and the capacity of P2 is 12G. First, we find the node group P1 with the current minimum capacity of 7G. From Table 1, we can see that the node closest to the central node v2 of the node group P1 is v6. Therefore, v6 is added to the node group P1 and v6 is deleted from V. At this time, the capacity of the node group P1 is 23G. The second selection of the node group with the current minimum capacity is P2, which is 12G. The unassigned node closest to the central node v3 is v1. Therefore, v1 is added to the node group P2 and v1 is deleted from V. At this time, the node group The capacity of P2 is 22G; the third time, the node group with the current minimum capacity is P2, which is 22G. The unallocated node closest to the central node v3 of the node group P2 is v5. Therefore, v5 is added to the node group P2 and v5 is deleted from V. At this time, the capacity of the node group P2 is 27G; the fourth time, the node group with the current minimum capacity is P1, which is 23G. The unallocated node closest to the central node v2 of the node group P1 is only v4. Therefore, v4 is added to the node group P2 and v4 is deleted from V. The cycle ends. At this time, the capacity of the node group P1 is 34G; through the calculation formula (3) of the communication overhead A, it can be seen that the total communication overhead A=6.33, and the allocation result is P={{P1={v2,v6,v4}},{P2=v3,v1,v5}}.
[0108] After completing the construction of the node group in the above scheme, the nodes are allocated to different groups. Next, blocks are allocated to each node group. Two block allocation schemes are given below.
[0109] Block Allocation Scheme 1: The specific implementation of the block allocation scheme based on storage income is as follows:
[0110] In formula (2), the query cost is the cost of selecting a node with the minimum unit communication cost of a block to query when a node accesses a block that it does not have. Therefore, adding duplicate blocks will not increase the query cost. From formula (1), it can be seen that the repeated allocation of blocks to nodes will increase the storage cost, but the node does not need to access other nodes that store this block, so the query cost will be reduced. In order to balance the storage cost and query cost, the storage benefit of a block to a node is defined as the difference between the minimum unit query cost of a node accessing this block and the unit data cost of a node storing this block. Let H(k,i,j) represent the storage benefit of a block to a node: If the node v j Select block b i The greater the benefit, the lower the cost for the node to store this block.
[0111] Since the block allocation problem is an NP-hard problem, we propose a heuristic block allocation algorithm based on storage benefits. The algorithm is divided into two stages: In the first stage, each block b is considered i The stability threshold r that needs to be reached i , in each iteration, block b i choose unallocated nodes for allocation. Since the optimization goal is to minimize the total cost, under the constraint of node capacity, the block will give priority to the node with the largest storage benefit H(k,i,j); when all blocks meet the stability threshold r i In order to further utilize the remaining capacity of the node to reduce the total cost, the definition of storage revenue shows that the node storage block b i Than query block b i When the overhead is lower, that is, H(k,i,j)>0, the node stores block b i It will reduce the total overhead of the group. Therefore, the goal of the second stage is that each node selects a block that it does not store and whose storage benefit H(k,i,j) is greater than 0 while satisfying the node's remaining capacity constraint.
[0112] The algorithm steps are as follows: Initialize the block set stored by the node {Q j}(line 1), traverse all blocks (line 2), calculate the storage block b in the group i The number of nodes required (Line 3), when block b i quilt If there are nodes stored, the iteration stops (line 4) and traverses the group P k All nodes v j (Line 5), when the node does not store block b i And the node remaining capacity ω j Greater than the block data size s i , calculate the storage benefit H(k,i,j) and find the node v with the largest storage benefit H(k,i,max) max (If the storage benefits are the same, choose ω j The largest node) (lines 6-7), block b i Join to node v max The block set Q max , update node v max Capacity and Blocks i The number of nodes required (Line 8). Traverse group P k All nodes v in j (Line 9), find the node v j Blockset BQ not stored in j , traverse BQ j (Line 10), find the node with a capacity less than the remaining capacity ωj And for node v j Block b with overhead contribution greater than 1 i , block v i Join to node v j The block set Q j , update node v j Remaining capacity (lines 11-12), calculate the point group storage cost C (P k ), node group query overhead I(P k )(line 13).
[0113]
[0114]
[0115] Time complexity analysis of the algorithm: The time complexity of traversing the complete set of blocks is O(m) (line 2), and each block needs to be Nodes are stored (line 4), and the time complexity of traversing the node set in the group is O(|P k |)(Line 5), the time cost of calculating the node with the largest overhead contribution H(k,i,j) is O(|P k |)(Line 7), the time complexity of traversing each node in the group is O(|P k |)(Line 9), traverse node v j Blockset BQ not stored in j The time complexity is O(m) (line 10), and the time cost of calculating the overhead contribution H(k,i,j) is O(|P k |)(Line 11), the time complexity of computing the node group overhead is O(m|P k | 2 )(Line 13), so the total time complexity of the algorithm is
[0116] For example, in the node group P1 = {v1, v4, v5}, block allocation is performed, assuming that the block set B = {b1, b2, b3, b4, b5, b6}. Given that the data size of each block is S = {4G, 5G, 1G, 5G, 3G, 2G}, the block stability threshold is R = {0.1, 0.2, 0.1, 0.3, 0.2, 0.35}; the node capacity is ω1 = 10G, ω4 = 11G, ω5 = 5G, the unit overhead of node storage blocks is shown in Table 2, and the unit query overhead between nodes is shown in Table 3. According to the above conditions, the allocation case of Algorithm 4.1 is as follows: First, the minimum number of nodes for storing block b1 is calculated as Calculate the storage benefits of each node H(1,1,1) = -3, H(1,1,4) = -1, H(1,1,5) = -4. It can be seen that the node with the maximum storage benefit is v4, so Q4 = {b1}, the remaining capacity of node v4 is ω4 = 11G-4G = 7G, traverse all blocks and reach the minimum number of nodes in all blocks After that, the allocation results are Q1 = {b3, b4, b5}, Q4 = {b1, b2, b6}, Q5 = {b6}. The second step is to check whether there are unstored blocks with H(k, i, j)>0 in each node. In node v1, the remaining capacity is ω1 = 1G, which does not satisfy all the remaining blocks. In node v5, although blocks b3 and b5 meet the capacity constraint, the storage benefits are H(1, 3, 5) = -1 and H(1, 5, 5) = 0 respectively. Therefore, the final allocation result of the entire algorithm is Q1 = {b3, b4, b5}, Q4 = {b1, b2, b6}, Q5 = {b6}. Through calculation, it can be seen that the storage overhead Communication overhead I(P1) = e 1,4 (s1+s2)+e 1,5 s6+e 4,1 (s3+s4+s5)+e 5,1 (s3+s4+s5)+e 5,4 (s1+s2)=103, the specific process is as follows Figure 3 shown.
[0117] Table 2. Unit cost of node storage blocks in node group P1
[0118]
[0119] Table 3. Unit query cost between nodes in node group P1
[0120] <![CDATA[e x,y ]]> <![CDATA[v1]]> <![CDATA[v4]]> <![CDATA[v5]]> <![CDATA[v1]]> 0 4 2 <![CDATA[v4]]> 4 0 1 <![CDATA[v5]]> 2 1 0
[0121] Block allocation scheme 2: The specific implementation of the block allocation scheme based on overhead gain is as follows:
[0122] In Algorithm 3, when block b i Assigned to node v j After that, the unstored block b is not taken into account i Other nodes may query node v j To obtain less query overhead; therefore, the final allocation result is not necessarily optimal. In order to obtain more accurate allocation results, we propose a block allocation algorithm based on overhead gain.
[0123] The algorithm is also divided into two stages: In each iteration of the first stage, each block selects unassigned nodes to allocate, I′i (v j ) is b i Join to node v j Post-query block b i Total cost, I i Yes i Not added to node v j Query block b i Total cost, calculate b i Block added to node v j Then query block b i The overhead gain is ΔI i (v j )←I′ i (v j )-I i , the storage cost gain is The total cost gain is Our goal is to minimize the total cost, so under the node capacity constraint, we select the node that minimizes the total cost gain each time. In each iteration of the second stage, in order to utilize the remaining capacity of the node, the node selects the node that has no storage and ΔI i (v j ) is greater than blocks, thereby further reducing the total overhead of the group.
[0124] Algorithm steps: Initialize the block set stored by the node {Q j}(line 1), traverse block set B (line 2), calculate block b i The number of nodes required Initialize block b i The query cost of I i and gain ΔI i (v j )(row 3), block b i quilt If there are nodes stored, the iteration stops (line 4) and traverses the group P k The node set (line 5) is i And the node remaining capacity ω j Greater than the block data size s i When b i Block added to node v j Post-query block b i Total cost I′ i (v j ) and gain size ΔI i (v j )(Lines 6-8), select the total cost gain The smallest node v min(Line 9), update node v min Add block b i Q min , w min , I i , C(P k ) parameters (lines 10-11), in order to further reduce the overhead, traverse the group P k All nodes (line 12), traverse node v j Blockset BQ not stored in j (Line 13), at node v j Under the remaining capacity constraint (line 14), calculate b i Block added to node v j Post-query block b i Total cost I′ i (v j ) and gain size ΔI i (v j )(Lines 15-16), select query overhead gain ΔI i (v j ) is greater than the storage overhead gain Block b i (Line 17), update node v j Add block b i Q j , w j , I i , C(P k ) parameters (lines 18-19), calculate the group P k All query costs in I(P k )(line 20).
[0125]
[0126]
[0127] Time complexity analysis of the algorithm: The time complexity of traversing the block set is O(m) (line 2), and each block needs to be Node storage (row 4), block b i The time complexity of selecting a node in the group is O(|P k |)(Line 5), calculate b i Block added to node v j Post-query block b i Total cost I′ i (v j ) has a time cost of O(|P k | 2 )(Line 7), the time complexity of traversing the set of nodes in the group is O(|P k|)(Line 12), traverse node v j Blockset BQ not stored in j The time complexity is O(m) (line 13), and the query cost I(P k ) has a time cost of O(m) (line 20), so the total time complexity of the algorithm is
[0128] In order to contrast with Algorithm 4.1, we use the same simulation data as Algorithm 4.1 in Algorithm 4.2, select the node group P1 = {v1, v4, v5} for the block allocation case, and initialize the minimum number of nodes storing block b1 as Query Cost I i = 0, the query costs of adding different nodes are: I′1(v1)=s1(e 4,1 +e 5,1 )=24,I′1(v4)=s1(e 1,4 +e 5,4 )=20,I′1(v5)=s1(e 1,5 +e 4,5 )=12, Through calculation, we know The smallest node is v4, so Q4 = {b1}, I1 = I′1(v4) = 20, C(P1) = 4, traverse all blocks and reach the minimum number of nodes in all blocks After that, the allocation results are Q1 = {b4, b6}, Q4 = {b1, b2, b6}, Q5 = {b3, b5}. The second step is to check whether there is a query overhead |ΔI in the node. i (v j )|Greater than storage overhead The remaining capacity of node v1 is ω1 = 3G, and the amount of data of unstored block b1 is 4G, which does not meet the capacity constraint; Assuming that after node v1 stores block b3, the query overhead benefit of block b3 is ΔI3(v1) = -2, and the storage benefit is Knowable The condition is not met; assuming that after node v1 stores block b5, the query overhead benefit of block b5 is ΔI5(v1)=-6, and the storage benefit is Knowable The profit and capacity conditions are met, so block b5 is assigned to node v1, whose remaining capacity ω1 = 0G, and the final allocation result is Q1 = {b4, b6, b5}. After all nodes are queried, the final allocation results of Algorithm 4.2 are Q1 = {b4, b6, b5}, Q4 = {b1, b2, b6}, Q5 = {b3, b5}, and the query costs of the blocks are: I1 = 20, I2 = 25, I3 = 3, I4 = 30, I5 = 3, I6 = 2, and the total query cost is Storage cost C(P1) = 42. The specific process is as follows: Figure 4 shown.
[0129] The above scheme completes the construction of the node group and the allocation of blocks to each node in the node group. Finally, the minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices in the embodiment of the present invention have been described in detail. Compared with the existing scheme, the present invention is suitable for lightweight devices in life, allowing nodes with limited hardware levels to protect and share data through blockchain technology, thereby lowering the threshold of blockchain technology requirements for equipment, thereby improving the storage scalability of blockchain technology.
Claims
1. The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices are characterized by: The steps include: Use lightweight devices as nodes in the blockchain system, measure the upper limit of the data storage capacity of these nodes, and calculate the overhead of node storage per unit data volume; Measure the geographical distance between nodes, calculate the communication overhead per unit distance between nodes, and calculate the query overhead per unit data volume generated when the nodes themselves query data; The blockchain used by the statistical node is calculated, the amount of data in each block in the blockchain is calculated, and different stability thresholds are associated with each block according to the number of times the block is verified in the blockchain system; Construct a mathematical model, given a set of blocks A complete blockchain consists of m blocks; a collection of nodes in the blockchain network Get a node cluster by combining , due to the block Stability thresholds need to be met in the node group ,set up Indicates that in the node group Storage Block The number of nodes; The optimization goal is to ensure that each block in the system meets the stability threshold The total amount of data stored by the node group and the complete blockchain and the node storage blocks does not exceed its own storage capacity Minimize all storage overhead in the system under the condition of , query overhead and communication overhead ; Since there are three types of cost objective functions, in order to reduce the difficulty of optimization, we use the weighted method to calculate the total cost, and is the weighting coefficient, , , by allocating weights, balancing the relationship between costs, and minimizing the total cost of the system, the objective function is: ; Constraints: The capacity of each node group needs to exceed the total amount of blockchain data, the formula is ,in Representation block The amount of data; The capacity of the block set does not exceed the storage capacity of a single node , the formula is ,in Representation Node The set of blocks stored; Represents a node group The total capacity of at least exceeds the threshold Total blockchain capacity; node group Storage Block Number of nodes Need to exceed the stability threshold With node group Number of midpoints and the maximum stability threshold The product of is expressed as ; Based on the optimization goals and constraints, a strategy is formulated to complete the construction of the node group and allocate blocks to the nodes in each node group.
2. The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices according to claim 1 is characterized in that: The above-mentioned process of formulating strategies to complete the construction of the node group based on the optimization objectives and constraints and allocating blocks to the nodes of each node group includes: Analysis of the objective function shows that the communication overhead and storage overhead , Communication overhead There is no direct connection, so solving the problem of minimizing the total overhead of the node group can be divided into two independent stages: the node group construction problem and the block allocation problem.
3. The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices according to claim 2 is characterized in that: The two independent phases of the problem: the node group construction problem and the block allocation problem, are proved to be NP Difficult question.
4. The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices according to claim 1 is characterized in that: The strategy for completing the construction of the node group includes two methods, namely, a node group construction method based on capacity gain and a node group construction method based on distance. Any method can be used to construct the node group.
5. The minimum overhead node group construction and multi-block allocation mechanism of the blockchain system based on lightweight devices according to claim 1 is characterized in that: The block allocation for the nodes of each node group is performed using two different methods, namely, a block allocation method based on storage gain and a block allocation method based on overhead gain. Block allocation can be completed by executing any one of the methods.
Citation Information
Patent Citations
Resource optimal allocation decision-making method based on deep reinforcement learning and blockchain consensus
CN111507601A
Block data distribution method for a block chain fragmentation storage strategy
CN112231394A