A blockchain sharding optimization method for IoT data storage
By optimizing the sharding method through reputation management and the NSGA-II algorithm, the problems of low throughput and poor security of the IoT blockchain are solved, and more efficient sharding throughput and security are achieved, which is suitable for blockchain systems for IoT data storage.
Patent Information
- Application Number
- CN202211347262.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-09-26
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Existing blockchain sharding technologies in the Internet of Things suffer from low throughput and poor security. In particular, Rapidchain's random sharding strategy leads to a high frequency of cross-shard transactions, Nscheme's greedy strategy can only obtain local optimal solutions, and PBFT-type consensus sharding reduces blockchain security.
The sharding method is optimized using the NSGA-II algorithm based on node reputation and the frequency of cross-shard transactions between nodes. Through reputation management and sharding optimization, the node reputation value is calculated and malicious nodes are evenly distributed, reducing the number of cross-shard transactions and improving throughput and security.
It effectively improves the throughput and security of IoT blockchain sharding, ensures the uniform distribution of malicious nodes, prevents dishonest behavior, and improves the overall security and throughput of the system.
Smart Images

Figure CN115913662B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology, and in particular to a blockchain sharding optimization method for Internet of Things data storage. Background Art
[0002] The Internet of Things (IoT) relies heavily on traditional centralized management for information security, but this approach struggles to ensure the privacy and security of IoT data. Blockchain technology, with its decentralized, tamper-proof, and traceable nature, can address privacy and security issues in IoT data storage. However, the computing and storage capabilities of IoT devices are insufficient to maintain an entire blockchain network.
[0003] Blockchain sharding divides all nodes in a blockchain network into distinct shards, each of which processes different tasks in parallel. This effectively improves blockchain performance, reduces consensus communication costs, and alleviates data storage pressures. Sharding ensures that blockchain throughput increases linearly with the number of participating nodes. Sharding effectively addresses the limited computing power and storage requirements of IoT devices, but it also reduces the decentralization and security of the blockchain. Therefore, while maintaining decentralization and security, improving the throughput of IoT blockchain shards has become a hot topic of research.
[0004] Existing sharding technologies include Rapidchain and Nscheme. Rapidchain's sharding mechanism randomly assigns blockchain nodes to shards, but this sharding technology suffers from a high frequency of cross-shard transactions, limiting the throughput of blockchain shards. Nscheme's sharding mechanism greedily assigns nodes to shards based on transaction volume, but this greedy strategy can only achieve local optimal solutions. Furthermore, traditional PBFT-based consensus sharding reduces blockchain security, as PBFT-based consensus sharding only provides fault tolerance and cannot proactively adjust nodes to maintain system security. Summary of the Invention
[0005] The purpose of the present invention is to overcome the shortcomings of the prior art and provide a blockchain sharding optimization method for IoT data storage. The sharding method is optimized by the NSGA-II algorithm based on node reputation and cross-shard transaction frequency between nodes, thereby improving the security of IoT shards and data storage efficiency.
[0006] The purpose of the present invention is achieved through the following technical solutions:
[0007] A blockchain sharding optimization method for IoT data storage includes reputation management and sharding optimization based on NSGA-II. The reputation management includes:
[0008] S1. Calculate the reputation value of each node in the blockchain network based on its hardware information, behavior information, and transaction participation information;
[0009] S2. The leader node in the blockchain network evaluates the security of each shard in the blockchain network based on the latest reputation table;
[0010] S3. The super nodes in the blockchain network evaluate the throughput performance of each shard in the blockchain network based on the latest transaction table.
[0011] Sharding optimization based on NSGA-II includes:
[0012] S4. Initialize the population of IoT node sharding schemes and evaluate and rank the sharding schemes;
[0013] S5. Perform selection, crossover, and mutation operations on the population of the sharding scheme to screen out a better population.
[0014] Furthermore, S1 specifically includes the following steps:
[0015] S101. Each node in the blockchain network maintains a reputation table and a transaction table locally. The reputation table records the reputation value of each node in the blockchain network, and the transaction table records the transaction interactions of each node in the blockchain network.
[0016] S102. When a node first joins the blockchain network, a basic reputation value is assigned based on its hardware capabilities;
[0017] S103. Determine whether each node in the blockchain network has malicious behavior and whether it participates in transaction packaging based on the consensus results of each node in the blockchain network;
[0018] S104. Each node in the blockchain network updates the reputation table and transaction table, and forwards the latest reputation table and transaction table to other nodes according to the Gossip protocol to synchronize the entire blockchain network status.
[0019] Furthermore, in S102, the basic reputation value is calculated as follows:
[0020] BaseF i =(CpuF i +CptF i +BWF i ) / 3 (1)
[0021]
[0022]
[0023]
[0024] Among them, BaseF i is the basic reputation of node i, CpuF i is the CPU score, which is the ratio of the CPU computing power of node i to the maximum computing power; CptF i is the disk score, which is the ratio of the disk capacity of node i to the maximum disk capacity; BWF i is the bandwidth score, which is the ratio of node i’s bandwidth capability to its maximum bandwidth.
[0025] Furthermore, in S103, the formula for calculating the contribution reputation value and the node reputation value is as follows:
[0026]
[0027] NodeRe i =αBaseF i +βCtrF i (6)
[0028] CtrF i is the contribution reputation value of node i, BH i Indicates the malicious behavior of node i, with a value of 0 or 1, TrsM i The number of transactions verified by node i, TrsM max Indicates the maximum number of transactions, TOL i Indicates the online time of node i, TOL max NodeRe is the maximum running time of the node; i is the node reputation value, abbreviated as r j , which consists of basic reputation value and contribution reputation value, where α+β=1, α=0.3, β=0.7.
[0029] Furthermore, S2 specifically includes the following steps:
[0030] S201. The super node calculates the average reputation value of all nodes in the blockchain network based on the latest reputation table, which is recorded as the network average reputation value, and the average reputation value of all nodes in each shard in the blockchain network, which is recorded as the intra-shard average reputation value;
[0031] S202. The super node calculates the sum of the average value of the average reputation value of all shards and the absolute value of the difference between the average reputation value of the shards according to formula (7), and records it as the risk score. The lower the current risk score, the higher the security of the blockchain network.
[0032]
[0033] Fit1 is the fitness function, where k is the number of shards, N is the total number of nodes in the blockchain network, and N i is the number of nodes in each shard, rj is the reputation value of node j. The lower the value of this function, the more evenly the malicious nodes are distributed in each shard in the blockchain network.
[0034] Furthermore, S3 specifically includes the following steps:
[0035] S301. The super node calculates the total number of transactions in the blockchain network, the number of intra-shard transactions, and the number of inter-shard transactions based on the latest transaction table;
[0036] S302. The leader node calculates the frequency of cross-shard transactions within the blockchain network and records the frequency as a transaction score. The lower the current transaction score, the higher the throughput of the blockchain network.
[0037]
[0038] Fit2 is the fitness function, where k is the number of shards, N i is the number of nodes in the ith shard, f j is the frequency of transactions within the shard of node j, and F is the total transaction frequency in the blockchain network. The lower the value of this function, the fewer cross-shard transactions in the blockchain network.
[0039] Furthermore, S4 specifically includes the following steps:
[0040] S401. Randomly generate 200 to 1000 blockchain network sharding schemes using the unbiased random number generation scheme RandHound, and initialize the parent population based on the combination of these sharding schemes;
[0041] S402. Calculate the risk score and transaction score of each sharding scheme as the population fitness, and perform non-dominated sorting based on the population fitness. Introducing the risk score can evenly distribute malicious nodes and improve the security of the blockchain network.
[0042] S403. Calculate the congestion complexity. The calculation formula is as follows, where for the objective function f m , is the maximum value of the objective function, is the minimum value of the objective function, and the congestion degree n is calculated d The formula is as follows:
[0043]
[0044] S404. Select the top 20% of the most crowded solutions as sharding solutions to ensure the diversity of the population, make it easier to generate new populations, and facilitate local search for the global optimal solution.
[0045] Furthermore, S5 specifically includes:
[0046] S501. Using the elite retention strategy, select the optimal sharding scheme from the sharding schemes generated in the last three iterations as the parent of the next generation to prevent the optimal individuals from being destroyed by the mutation operation. The selection operation first combines the parent population and the child population into a new population, and then adds the children to the new parent population in order according to the Pareto rank until the population is full.
[0047] S502. Using a single-point crossover method with a crossover probability of 0.8, randomly select two blockchain nodes and swap the shards they are on.
[0048] S503. Select a mutation probability of 0.2, randomly select a blockchain node, and remove it from the shard.
[0049] S504. Repeat the above steps until the sharding scheme in the population begins to converge or the number of iterations reaches the specified number, then stop the iteration and select the sharding scheme with the middle congestion among the sharding schemes with the highest priority in the latest parent population as the sharding scheme for the next blockchain network.
[0050] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and runnable on the processor, characterized in that when the processor executes the program, the steps of the blockchain sharding optimization method for IoT data storage are implemented.
[0051] The present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that when the computer program is executed by a processor, the steps of the blockchain sharding optimization method for IoT data storage are implemented.
[0052] Compared with the prior art, the technical solution of the present invention has the following beneficial effects:
[0053] 1. The sharding mechanism in this invention uses a genetic algorithm to reduce the number of cross-shard transactions within a shard, making it easier to find the global optimal solution. This can effectively reduce the average speed of blockchain transaction processing and improve the throughput of the IoT blockchain.
[0054] 2. The sharding scheme of this invention ensures a uniform distribution of malicious and honest nodes, preventing dishonest behavior and double-spending attacks, thereby effectively improving the security of IoT blockchain sharding. Large-scale IoT systems have numerous nodes and poor security. The blockchain system of this invention can improve throughput while ensuring the security of large-scale IoT systems.
[0055] 3. The present invention can be combined with a self-organizing sharding scheme to implement a decentralized sharding scheme and further improve the security of sharding. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 It is a schematic flow diagram of the method of the present invention.
[0057] Figure 2 It is a flowchart of reputation management.
[0058] Figure 3 This is a flowchart of the sharding optimization part based on NSGA-II. DETAILED DESCRIPTION
[0059] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0060] like Figure 1 As shown in FIG, the present invention provides a blockchain sharding optimization method for IoT data storage, including reputation management and sharding optimization scheme based on NSGA-II. Reputation management includes node reputation evaluation and transaction evaluation. Figure 2 , the specific steps are as follows:
[0061] S1. Calculate the reputation value of each node in the blockchain network based on its hardware information, behavior information, and transaction participation information;
[0062] S101. Each node in the blockchain network maintains a reputation table and a transaction table locally. The reputation table records the reputation value of each node in the blockchain network, and the transaction table records the transaction interactions of each node in the blockchain network.
[0063] S102. When a node first joins the blockchain network, a basic reputation value is assigned based on its hardware capabilities. The basic reputation value is calculated as follows:
[0064] BaseF i =(CpuF i +CptF i +BWF i ) / 3 (1)
[0065]
[0066]
[0067]
[0068] Among them, BaseF i is the basic reputation of node i, CpuF i is the CPU score, which is the ratio of the CPU computing power of node i to the maximum computing power; CptF iis the disk score, which is the ratio of the disk capacity of node i to the maximum disk capacity; BWF i is the bandwidth score, which is the ratio of node i’s bandwidth capability to its maximum bandwidth.
[0069] S103. Based on the consensus results of each node in the blockchain network, determine whether it has malicious behavior and whether it participates in transaction packaging; the formula for calculating the contribution reputation value and node reputation value is as follows:
[0070]
[0071] NodeRe i =αBaseF i +βCtrF i (6)
[0072] CtrF i is the contribution reputation value of node i, BH i Indicates the malicious behavior of node i, with a value of 0 or 1, TrsM i The number of transactions verified by node i, TrsM max Indicates the maximum number of transactions, TOL i Indicates the online time of node i, TOL max NodeRe is the maximum running time of the node; i is the node reputation value, abbreviated as r j , which consists of basic reputation value and contribution reputation value, where α+β=1, α=0.3, β=0.7.
[0073] S104. Each node in the blockchain network updates the reputation table and transaction table, and forwards the latest reputation table and transaction table to other nodes according to the Gossip protocol to synchronize the entire blockchain network status.
[0074] S2. The leader node in the blockchain network evaluates the security of each shard in the blockchain network based on the latest reputation table. The specific process is as follows:
[0075] S201. The super node calculates the average reputation value of all nodes in the blockchain network based on the latest reputation table, which is recorded as the network average reputation value, and the average reputation value of all nodes in each shard in the blockchain network, which is recorded as the intra-shard average reputation value;
[0076] S202. The super node calculates the sum of the average value of the average reputation value of all shards and the absolute value of the difference between the average reputation value of the shards according to formula (7), and records it as the risk score. The lower the current risk score, the higher the security of the blockchain network.
[0077]
[0078] Fit1 is the fitness function, where k is the number of shards, N is the total number of nodes in the blockchain network, and N i is the number of nodes in each shard, r i is the reputation value of node j. The lower the value of this function, the more evenly the malicious nodes are distributed in each shard in the blockchain network.
[0079] S3. The super nodes in the blockchain network evaluate the throughput performance of each shard in the blockchain network based on the latest transaction table. The specific process is as follows:
[0080] S301. The super node calculates the total number of transactions in the blockchain network, the number of intra-shard transactions, and the number of inter-shard transactions based on the latest transaction table;
[0081] S302. The leader node calculates the frequency of cross-shard transactions within the blockchain network and records the cross-shard transaction frequency as a transaction score. The lower the current transaction score, the higher the throughput of the blockchain network.
[0082]
[0083] Fit2 is the fitness function, where k is the number of shards, N i is the number of nodes in the ith shard, f j is the frequency of transactions within the shard of node j, and F is the total transaction frequency in the blockchain network. The lower the value of this function, the fewer cross-shard transactions in the blockchain network.
[0084] See Figure 3 ,The sharding optimization scheme based on NSGA-II includes the following steps:
[0085] S4. Initialize the population of blockchain node sharding schemes and evaluate and rank the sharding schemes; the specific process is as follows:
[0086] S401. Randomly generate 200 to 1000 blockchain sharding schemes using the unbiased random number generation scheme RandHound, and initialize the parent population based on the combination of these sharding schemes;
[0087] S402. Calculate the risk score and transaction score of each sharding scheme as the population fitness, and perform non-dominated sorting based on the population fitness. Introducing the risk score can evenly distribute malicious nodes and improve the security of the blockchain network.
[0088] S403. Calculate the congestion complexity. The calculation formula is as follows, where for the objective function f m , is the maximum value of the objective function, is the minimum value of the objective function, and the congestion degree n is calculated d The formula is as follows:
[0089]
[0090] S404. Select a sharding scheme with high congestion to ensure the diversity of the population, make it easier to generate new populations, and facilitate global search to find the global optimal solution.
[0091] S5. Perform selection, crossover, and mutation operations on the population of the sharding scheme to screen out a better population. The specific process is as follows:
[0092] S501. Using an elite retention strategy, select the optimal sharding scheme from the sharding schemes generated in the last three iterations as the parent for the next generation to prevent the optimal individuals from being destroyed by mutation. The selection operation first combines the parent and child populations into a new population, and then adds the new parent population in order according to the Pareto rank until the population is full.
[0093] S502. Using a single-point crossover method with a crossover probability of 0.8, randomly select two blockchain nodes and swap the shards they are on.
[0094] S503. Select a mutation probability of 0.2, randomly select a blockchain node, and remove it from the shard.
[0095] S504. Repeat the above steps until the sharding scheme in the population begins to converge or the number of iterations reaches the specified number, then stop the iteration and select the sharding scheme with the middle congestion among the sharding schemes with the highest priority in the latest parent population as the sharding scheme for the next blockchain network.
[0096] The present application also provides a specific implementation of an electronic device capable of implementing all steps of the blockchain sharding optimization method for IoT data storage in the above embodiment. The electronic device specifically includes the following contents:
[0097] Processor, memory, communications interface, and bus;
[0098] Among them, the processor, memory, and communication interface communicate with each other through the bus; the communication interface is used to realize information transmission between related devices such as server-side devices, metering devices, and user-side devices.
[0099] The processor is used to call the computer program in the memory, and when the processor executes the computer program, all steps of the blockchain sharding optimization method for IoT data storage in the above embodiment are implemented.
[0100] The embodiments of the present application also provide a computer-readable storage medium capable of implementing all steps of the blockchain sharding optimization method for IoT data storage in the above-mentioned embodiments. The computer-readable storage medium stores a computer program, which, when executed by a processor, implements all steps of the blockchain sharding optimization method for IoT data storage in the above-mentioned embodiments.
[0101] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0102] Although the present application provides method operation steps such as embodiments or flowcharts, more or fewer operation steps may be included based on conventional or non-creative work. The order of steps listed in the embodiments is only one way of executing the steps among many steps and does not represent the only execution order. When an actual device or client product is executed, it can be executed in the order shown in the embodiments or the drawings or in parallel (for example, in a parallel processor or multi-threaded processing environment).
[0103] It will be understood by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowcharts and / or block diagrams. Figure 1 a process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0105] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.
[0106] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0107] The present invention is not limited to the embodiments described above. The above description of the specific embodiments is intended to describe and illustrate the technical solutions of the present invention. The above specific embodiments are merely illustrative and not restrictive. Without departing from the scope of the present invention and the scope of protection of the claims, those skilled in the art may make various specific modifications based on the teachings of the present invention, all of which fall within the scope of protection of the present invention.
Claims
1. A blockchain sharding optimization method for IoT data storage, characterized in that: It includes two parts: reputation management and sharding optimization based on NSGA-II. The reputation management includes: S1. Calculate the reputation value of each node in the blockchain network based on its hardware information, behavior information, and transaction participation information; S2. The leader node in the blockchain network evaluates the security of each shard in the blockchain network based on the latest reputation table; S3. The super nodes in the blockchain network evaluate the throughput performance of each shard in the blockchain network based on the latest transaction table. Sharding optimization based on NSGA-II includes: S4. Initialize the population of IoT node sharding schemes and evaluate and rank the sharding schemes; including the following steps: S401. Generate 200 to 1000 random blockchain network sharding schemes using the unbiased random number generation scheme RandHound, and initialize the parent population based on the combination of these sharding schemes. S402. Calculate the risk score and transaction score for each sharding scheme as population fitness and perform non-dominated sorting based on population fitness. Introducing the risk score can evenly distribute malicious nodes, improving the security of the blockchain network. S403. Calculate the congestion complexity. The calculation formula is as follows, where for the objective function , is the maximum value of the objective function, is the minimum value of the objective function and calculates the congestion The formula is as follows: (9) S404. Select the top 20% of the most congested solutions as the sharding solutions. This ensures population diversity, makes it easier to generate new populations, and facilitates local search for the global optimal solution. S5. Perform selection, crossover, and mutation operations on the sharding scheme population to select a better population; specifically, the following operations are performed: S501. Using an elite retention strategy, select the optimal sharding scheme from the three most recent iterations to serve as the parent for the next generation. This prevents the optimal individuals from being destroyed by mutation. The selection process first combines the parent and child populations into a new population. Then, individuals are added to the new parent population in order of Pareto rank until the population is full. S502. Using a single-point crossover method with a crossover probability of 0.8, randomly select two blockchain nodes and swap the shards they reside on. S503. Set the mutation probability to 0.2, randomly select a blockchain node, and remove it from the shard. S504. Repeat the above steps until the sharding schemes in the population begin to converge or the number of iterations reaches the specified number. Then, the iterations are stopped and the sharding scheme with the highest priority in the latest parent population with the middle congestion level is selected as the sharding scheme for the next blockchain network.
2. According to the blockchain sharding optimization method for IoT data storage according to claim 1, it is characterized in that: S1 specifically includes the following steps: S101. Each node in the blockchain network maintains a local reputation table and a transaction table. The reputation table records the reputation value of each node in the blockchain network, and the transaction table records the transaction interactions of each node in the blockchain network. S102. When a node first joins the blockchain network, it is assigned a basic reputation value based on its hardware capabilities. S103. Determine whether each node in the blockchain network has engaged in malicious activity and whether it has participated in transaction packaging based on the consensus results of each node in the blockchain network. S104. Each node in the blockchain network updates its reputation table and transaction table and forwards the latest reputation table and transaction table to other nodes according to the Gossip protocol to synchronize the entire blockchain network status.
3. According to claim 2, a blockchain sharding optimization method for IoT data storage is characterized in that: In S102, the basic reputation value is calculated as follows: ( ) / 3; (1) ; (2) ; (3) ; (4) in is the basic reputation of node i, is the CPU score, which is the ratio of the CPU computing power of node i to the maximum computing power; is the disk score, which is the ratio of the disk capacity of node i to the maximum disk capacity; is the bandwidth score, which is the ratio of the bandwidth capacity of node i to the maximum bandwidth.
4. According to a blockchain sharding optimization method for IoT data storage according to claim 2, it is characterized in that: In S103, the formula for calculating the contribution reputation value and the node reputation value is as follows: = / 3; (5) ; (6) is the contribution reputation value of node i, Indicates the malicious behavior of node i, with a value of 0 or 1. is the number of transactions verified by node i, Indicates the maximum number of transactions, Indicates the online time of node i, The maximum running time of the node; is the node reputation value, abbreviated as , which consists of basic reputation value and contribution reputation value, =1, take =0.
7.
5. According to a blockchain sharding optimization method for IoT data storage according to claim 1, it is characterized in that: S2 specifically includes the following steps: S201. The super node calculates the average reputation value of all nodes in the blockchain network based on the latest reputation table, recorded as the network average reputation value, and the average reputation value of all nodes in each shard of the blockchain network, recorded as the intra-shard average reputation value; S202. The super node calculates the sum of the average of the intra-shard average reputation values of all shards and the absolute value of the difference between the average intra-shard average reputation values according to formula (7), and records it as the risk score. The lower the current risk score, the higher the security of the blockchain network. ; (7) is the fitness function, where k is the number of shards and N is the total number of nodes in the blockchain network. The number of nodes in each shard is the reputation value of node j. The lower the value of this function, the more evenly the malicious nodes are distributed in each shard in the blockchain network.
6. According to a blockchain sharding optimization method for IoT data storage according to claim 1, it is characterized in that: S3 specifically includes the following steps: S301. The super node calculates the total number of transactions in the blockchain network, the number of intra-shard transactions, and the number of inter-shard transactions based on the latest transaction table; S302. The leader node calculates the frequency of cross-shard transactions within the blockchain network and records this frequency as a transaction score. The lower the current transaction score, the higher the throughput of the blockchain network. ; (8) is the fitness function, where k is the number of shards, is the number of nodes in the i-th shard, is the frequency of transactions within the shard of node j, and F is the total transaction frequency in the blockchain network. The lower the value of this function, the fewer cross-shard transactions in the blockchain network.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the blockchain sharding optimization method for IoT data storage according to any one of claims 1 to 6 are implemented.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the blockchain sharding optimization method for IoT data storage as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Multi-chain management method and system based on block chain
CN106530083A
A method for implementing a network scalability block chain
CN109544334A