Rapid consensus method for large-scale heterogeneous dynamic nodes based on DAG block chain

By dividing dynamic IoT network areas on the DAG blockchain, evaluating node status and credit, and using multiple signatures to establish data exchange channels, the problems of network instability and pseudo-node attacks in large-scale dynamic IoT environments are solved, and information is improved Share timeliness and security of consensus processes.

CN119094558APending Publication Date: 2024-12-06ZHEJIANG SHUREN UNIV +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202411183814.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In a large-scale dynamic IoT environment, frequent node changes lead to unstable network connections, unable to ensure timeliness of information sharing, and limited defense capabilities when facing pseudo-nodes and pseudo-data attacks, resulting in reduced security and reliability of consensus processes.

Method used

Using a fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain, by constructing a heterogeneous dynamic Internet of Things network, dividing it into multiple regions, dynamically adjusting the regional boundaries, evaluating node status and credit, and using local outlier factor algorithm Determine the node level and establish a trusted data exchange channel through multiple signatures.

Benefits of technology

It improves the timeliness of information sharing and network connection stability, identify and defend against pseudo-node attacks, and enhances the security and reliability of the consensus process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119094558A_ABST
    Figure CN119094558A_ABST
Patent Text Reader

Abstract

The invention provides a rapid consensus method for large-scale heterogeneous dynamic nodes based on a DAG block chain, and relates to the field of block chains, and the method comprises the steps: constructing a heterogeneous dynamic Internet of Things network based on the block chain; dividing the heterogeneous dynamic Internet of Things network into a plurality of areas; selecting full nodes of each region; determining the node level of each node through a local outlier factor algorithm; the node corresponding to the local area takes the target transaction as a local transaction; carrying out verification by adopting an intra-region weight voting consensus mode, packaging the successfully verified local transaction into a block, and uploading the block to a local DAG region slave chain; the target transactions are constructed into a data transaction set by all nodes; verifying by adopting a multi-region weight voting consensus mode, packaging a successfully verified data transaction set into blocks, and uploading the blocks to a DAG global main chain; through a multi-signature mode, transaction events in a DAG area slave chain and a DAG global main chain are bidirectionally anchored, and a credible data exchange channel is established.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a fast consensus method for large-scale heterogeneous dynamic nodes based on a DAG blockchain. Background Art

[0002] With the continuous development of IoT technology, a large number of IoT nodes have been deployed in the fields of smart transportation, smart medical care, industrial production, etc. These IoT nodes use advanced sensors and communication technologies to realize the intelligent collection of information such as the environment and equipment status, thereby generating a large amount of perception data. At present, most IoT nodes send and store perception data in the monitoring center, and the data sharing between nodes is still mainly relayed through the monitoring center. In this centralized data sharing process, once the monitoring center is attacked by malicious attacks, that is, malicious attackers use eavesdropping, false forgery, tampering and other attack methods to interfere with the operation of the system, it poses a threat to the integrity and privacy of the data, causing data leakage, tampering, data traceability difficulties and other problems, and even paralyzing the entire IoT network in serious cases. Therefore, how to ensure the safe and fast sharing of data between IoT nodes has become one of the current problems that need to be solved urgently.

[0003] In the development of blockchain, a new data blockchain structure called Direct Acyclic Graph (DAG) has attracted widespread attention. Compared with the traditional blockchain chain structure, the DAG-based blockchain processes transactions in parallel and allows non-linear transaction sorting, solving the limitations of a single chain in the entire network in the chain structure and achieving higher throughput and lower transaction confirmation latency. Currently, there are many forms of DAG-based consensus algorithms, including DAG consensus algorithms for static nodes and DAG consensus algorithms for dynamic nodes. Static node algorithms mostly use a fixed set of nodes for transaction confirmation, aiming to solve data processing and transmission problems in the Internet of Things. The dynamic node algorithm designs different mechanisms to improve transaction throughput and reduce latency, and improves consensus efficiency through methods such as asynchronous graph structure, selection trade-offs, and Gossip protocols.

[0004] However, in a large-scale dynamic IoT environment, frequent changes in nodes will lead to unstable network connections, and thus the timeliness requirements of information sharing cannot be guaranteed; at the same time, existing methods have limited defense capabilities when facing attacks from pseudo nodes and pseudo data, resulting in reduced security and reliability in the consensus process. Summary of the invention

[0005] In order to solve the technical problems that in a large-scale dynamic Internet of Things environment, frequent changes of nodes will lead to unstable network connections, and thus the timeliness requirements of information sharing cannot be guaranteed; at the same time, the existing methods have limited defense capabilities when facing pseudo-node and pseudo-data attacks, resulting in reduced security and reliability in the consensus process, the present invention provides a fast consensus method for large-scale heterogeneous dynamic nodes based on DAG blockchain.

[0006] The technical solution provided by the embodiment of the present invention is as follows:

[0007] First aspect:

[0008] The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain provided by the embodiment of the present invention includes:

[0009] S1: Build a heterogeneous dynamic IoT network based on blockchain and register the identities of nodes in the network;

[0010] S2: Divide the heterogeneous dynamic IoT network into multiple regions according to path length, node density, and resource load;

[0011] S3: Select the full set of nodes in each area to monitor the physical communication status, resource load and number of nodes in each area during the movement process;

[0012] S4: dynamically adjusting the boundaries of adjacent areas according to the physical communication status, the resource load and the number of nodes in each area during the movement process;

[0013] S5: Evaluate the status and credit of the nodes in the adjusted area to determine the status credit evaluation value of each node;

[0014] S6: Analyze the state credit evaluation value through a local outlier factor algorithm to determine the node level of each node, where the node level includes an honest node, a general node, and a malicious node;

[0015] S7: Determine whether the target transaction only occurs locally; if so, proceed to S8; otherwise, proceed to S11;

[0016] S8: The node corresponding to the local area takes the target transaction as a local transaction;

[0017] S9: Determine the local regional consensus node and full node based on the distance between nodes and node levels;

[0018] S10: Verify through local regional consensus nodes and full nodes using the regional weighted voting consensus method, package the successfully verified local transactions into blocks, and upload them to the local DAG regional slave chain;

[0019] S11: The full node constructs the target transaction into a data transaction set;

[0020] S12: Determine multi-region consensus nodes and multi-region full nodes based on the distance between nodes and node levels;

[0021] S13: Verification is performed through multi-region consensus nodes and multi-region full nodes using a multi-region weighted voting consensus method, and the successfully verified data transaction sets are packaged into blocks and uploaded to the DAG global main chain;

[0022] S14: Through multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel.

[0023] Second aspect:

[0024] The computer-readable storage medium provided by an embodiment of the present invention stores a computer program thereon, which, when executed by a processor, implements the fast consensus method for large-scale heterogeneous dynamic nodes based on the DAG blockchain as described in the first aspect.

[0025] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0026] (1) In the present invention, the heterogeneous dynamic IoT network is divided into multiple regions according to the path length, node density and resource load, and the full node set of each region is selected to monitor the physical communication status, resource load and number of nodes in each region during the movement process. According to the physical communication status, resource load and number of nodes in each region during the movement process, the boundaries of adjacent regions are dynamically adjusted. By dividing the network into multiple regions, locally managing and monitoring the physical communication status and resource load of the nodes, and flexibly adjusting the regional boundaries, the network connection in the region can be kept stable, and the regional division can be updated in a timely manner, thereby improving the timeliness of information sharing.

[0027] (2) In the present invention, the status and credit of the nodes in the adjusted area are evaluated to determine the status credit evaluation value of each node. The status credit evaluation value is analyzed by the local outlier factor algorithm to determine the node level of each node. The node level includes honest nodes, general nodes and malicious nodes. And through the multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel. By evaluating the status and credit of the node, potential pseudo nodes and malicious behaviors can be identified, thereby effectively defending against pseudo node attacks; the multi-signature mechanism provides an additional security layer to ensure the reliability of transaction events, prevent data tampering and pseudo data attacks, and improve the security and reliability of the consensus process. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0029] Figure 1 A flowchart of a fast consensus method for large-scale heterogeneous dynamic nodes based on a DAG blockchain provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The technical solution of the present invention is described below in conjunction with the accompanying drawings.

[0031] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "example" in the present invention should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of the word "example" is intended to present the concept in a specific way. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or it can be either of the two.

[0032] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same. "of", "corresponding, relevant" and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference between them is not emphasized, the meanings they intend to express are the same.

[0033] In the embodiments of the present invention, sometimes a subscript such as W1 may be mistakenly written as a non-subscript such as W1. When the difference is not emphasized, the meanings to be expressed are consistent.

[0034] In order to make the technical problems, technical solutions and advantages to be solved by the present invention more clear, a detailed description will be given below with reference to the accompanying drawings and specific embodiments.

[0035] Reference Manual Attached Figure 1 , showing a flow chart of a fast consensus method for large-scale heterogeneous dynamic nodes based on a DAG blockchain provided by an embodiment of the present invention.

[0036] The embodiment of the present invention provides a fast consensus method for large-scale heterogeneous dynamic nodes based on the DAG blockchain. The method can be implemented by a fast consensus device for large-scale heterogeneous dynamic nodes based on the DAG blockchain. The fast consensus device for large-scale heterogeneous dynamic nodes based on the DAG blockchain can be a terminal or a server. The processing flow of the fast consensus method for large-scale heterogeneous dynamic nodes based on the DAG blockchain can include the following steps:

[0037] S1: Build a heterogeneous dynamic IoT network based on blockchain and register the identities of nodes in the network.

[0038] Optionally, after building a heterogeneous dynamic IoT network based on blockchain, the physical state weight, communication state weight, weight of the number of times the evaluation factor participates in consensus verification, weight of the number of transactions that reach consensus in the evaluation factor verification, weight of the number of transactions that fail to reach consensus generated by the evaluation factor, state credit assessment mean μ, state credit assessment standard deviation, and direction speed similarity measurement are initialized.

[0039] In the present invention, the initialization weights and evaluation factors can be dynamically adjusted according to the actual operation of the network, ensuring that the network can adapt to the changing environment and requirements and optimize network performance.

[0040] In a possible implementation, the identity registration of nodes in the network in S1 specifically includes:

[0041] According to the identity information of each node, a pair of public and private keys (PK i ,SK i ), the identity information includes the type and geographical location of the node.

[0042] Use the private key corresponding to each node to sign its own identity information and obtain the signature information:

[0043] ξ i =Sign(SK i ,ID i )

[0044] Among them, ξ i Represents the signature information of the i-th node, SK i Represents the private key of the i-th node, ID i Represents the identity information of the i-th node, and Sign() represents the signature function.

[0045] Heterogeneous dynamic IoT network, through the public and private PK corresponding to each node i Verify the signature information and complete the node identity registration.

[0046] In the present invention, the identity information of each node is signed by its private key, ensuring the confidentiality of the identity information during transmission. The public key is used to verify the signature, ensuring the integrity and authenticity of the identity information. At the same time, using blockchain technology to register node identities can not only improve the security and credibility of the network, but also simplify the management process and enhance the transparency and flexibility of the system.

[0047] S2: Divide the heterogeneous dynamic IoT network into multiple regions based on path length, node density, and resource load.

[0048] It should be noted that during the initial division process, it is necessary to ensure that each area has a fixed number of base stations, which are responsible for the collection and transmission of transactions within the area and maintain communication with base stations in adjacent areas.

[0049] In the present invention, ensuring that each area has a fixed number of base stations can not only improve network coverage and performance, but also optimize management and coordination, and enhance the overall stability of the system and user experience.

[0050] S3: Select a full set of nodes in each area to monitor the physical communication status, resource load, and number of nodes in each area during the movement process.

[0051] Specifically, the nodes with better power and performance and ranking in the top 1 / 3 of computing power among the total number of nodes in the region are identified as the single-region full-node candidate set. After confirmation by voting by other nodes in the region, the nodes in the single-region full-node candidate set whose votes exceed 2 / 3 of the number of nodes in the region are determined as the single-region full-node set.

[0052] In the present invention, by selecting nodes with good power and performance and high computing power ranking as the full node set of a single region, it is ensured that the full node set has strong computing power and better network performance, which helps to improve the processing efficiency of the entire region. At the same time, high-performance nodes are more adaptable to dynamic changes in the network, can provide stronger fault tolerance, and ensure the stability of the network in the face of node changes or failures.

[0053] S4: Dynamically adjust the boundaries of adjacent areas based on the physical communication status, resource load, and number of nodes in each area during the movement process.

[0054] In a possible implementation, S4 specifically includes:

[0055] S401: Determine the physical communication status of each node in the respective area:

[0056]

[0057] in, represents the state evaluation value of the communication process between the i-th node and the full node r at time t, Indicates the computing power of the i-th node at time t, represents the power consumption of the i-th node at time t, represents the available storage of the i-th node at time t, represents the number of offline times during the communication between the i-th node and the full node r at time t, represents the offline time of the ith node in the communication process with the full node r at time t, represents the communication delay between the ith node and the full node r at time t, ω1 represents the weight corresponding to the physical state of the ith node, and ω2 represents the weight corresponding to the communication state of the ith node.

[0058] S402: Determine whether the number of nodes in each area is greater than a first threshold or whether the resource load is greater than a second threshold. If so, calculate the load balance of each area:

[0059]

[0060] in, Indicates the load balance degree of the area at time t, Indicates the number of nodes in area Area at time t.

[0061] It should be noted that those skilled in the art can set the first threshold and the second threshold according to actual needs, and the present invention is not limited thereto.

[0062] S403: Compare the load balances of adjacent areas, and divide a preset number of nodes in a high load balance area into a low load balance area:

[0063]

[0064] Among them, M represents the number of nodes that need to be divided, D B Indicates the high load balancing area, D A Indicates the low load balancing area, N B Indicates the total number of nodes in the high load balancing zone.

[0065] It should be noted that those skilled in the art can set the size of the preset number according to actual needs, and the present invention is not limited thereto.

[0066] For example, suppose the current area is A and the adjacent area is B. B >D A When , the number of nodes M that migrate to the new area is calculated from all the nodes in area B according to the formula, and the adjacent M nodes whose movement trajectories are toward area A and are close to each other are selected and adjusted to be divided into area A, thus realizing the adaptive regional division of heterogeneous dynamic nodes.

[0067] In the present invention, by calculating the load balance of each area and dynamically adjusting the area boundaries, the resource load of each area can be better balanced to avoid overloading of some areas while idle resources in other areas, thereby improving the resource utilization efficiency of the entire network. At the same time, by migrating heavily loaded nodes to lightly loaded areas, the communication delay in the network can be reduced, and the data transmission rate and response speed can be improved.

[0068] Furthermore, dynamically adjusting region boundaries allows the network to make adaptive adjustments based on node movement and load changes, enabling the network to flexibly respond to dynamically changing demands and environments.

[0069] S5: Evaluate the status and credit of the nodes in the adjusted area to determine the status credit evaluation value of each node.

[0070] In a possible implementation manner, S5 specifically includes:

[0071] S501: The initial node in the heterogeneous dynamic IoT network broadcasts a physical status query packet in each adjusted area.

[0072] S502: When each node receives the query packet, it sends its own physical state to the set of all nodes in the corresponding area.

[0073] S503: Each full node set calculates the state evaluation value of each node in each adjusted area according to the physical state of each node in the corresponding area:

[0074]

[0075] in, represents the state evaluation value of the communication process between the i-th node and the full node r at time t, Indicates the computing power of the i-th node at time t, represents the power consumption of the i-th node at time t, represents the available storage of the i-th node at time t, represents the number of offline times during the communication between the i-th node and the full node r at time t, represents the offline time of the ith node in the communication process with the full node r at time t, represents the communication delay between the ith node and the full node r at time t, ω1 represents the weight corresponding to the physical state of the ith node, and ω2 represents the weight corresponding to the communication state of the ith node.

[0076] S504: Determine the number of consensus verifications that each node has participated in after reaching consensus, the number of transactions that have reached consensus, and the number of generated transactions that have not reached consensus.

[0077] S505: Calculate the credit evaluation value of each node based on the number of consensus verifications participated in by each node, the number of transactions that have reached consensus, and the number of generated transactions that have not reached consensus:

[0078]

[0079] Among them, Cr i t represents the credit evaluation value of the i-th node at time t, It represents the number of times the i-th node participates in consensus verification at time t, ConTrant represents the number of consensus transactions verified by the i-th node at time t, UnsuccTrant represents the number of transactions generated by the i-th node at time t that have not reached consensus, ω3 represents the weight corresponding to the number of times the i-th node participates in consensus verification at time t, ω4 represents the weight corresponding to the number of consensus transactions verified by the i-th node at time t, and ω5 represents the weight corresponding to the number of transactions generated by the i-th node at time t that have not reached consensus.

[0080] In the present invention, by calculating and evaluating the credit value of the node, those nodes with poor performance or untrustworthy can be identified and isolated to prevent these nodes from affecting the normal operation of the network.

[0081] Furthermore, by evaluating the status and credit value of the nodes, the selection of consensus nodes can be optimized, and those nodes with good performance can be selected as consensus nodes to improve the efficiency and accuracy of the consensus process.

[0082] S506: Calculate the state credit evaluation value of each node by combining the state evaluation value, the credit evaluation value, and the historically accumulated state credit evaluation value:

[0083]

[0084] Among them, StatCr i t Represents the status credit evaluation value of the i-th node at time t, HisStatCr i Represents the historical cumulative state credit value of the i-th node in the previous round of consensus, represents the maximum state evaluation value of all nodes at time t, represents the maximum credit evaluation value of all nodes at time t, λ1 represents the weight corresponding to the historical accumulated state credit value of the i-th node in the previous round of consensus, λ2 represents the weight corresponding to the maximum state evaluation value of all nodes at time t, λ3 represents the weight corresponding to the maximum credit evaluation value of all nodes at time t, λ1+λ2+λ3=1.

[0085] In the present invention, the comprehensive status evaluation value and credit evaluation value can help the system to make adaptive adjustments in the face of dynamic changes. At the same time, considering the historical accumulated status credit evaluation value can better reflect the long-term performance of the node and support a more robust dynamic adjustment strategy.

[0086] In summary, by comprehensively considering the physical status, credit behavior and historical performance of the nodes, a comprehensive and accurate evaluation result can be provided. This not only helps to optimize resource management and improve network performance, but also enhances the credibility of nodes, promotes fair competition, and supports dynamic adjustment and adaptation, ultimately improving the reliability and security of the entire system.

[0087] S6: Analyze the status credit evaluation value through the local outlier factor algorithm to determine the node level of each node. The node level includes honest nodes, general nodes and malicious nodes.

[0088] Among them, the Local Outlier Factor (LOF) algorithm is a commonly used anomaly detection algorithm that aims to identify outliers in a data set relative to its neighboring data points. It evaluates the degree of anomaly based on the local density of the data point. The LOF algorithm is particularly suitable for dealing with situations where data is unevenly distributed or there are local density changes.

[0089] In a possible implementation manner, S6 specifically includes:

[0090] S601: Calculate the mean value and standard deviation of the status credit evaluation of all nodes in each region:

[0091]

[0092] Among them, μ t StatCr represents the mean value of the status credit evaluation of all nodes in a single region, N represents the total number of nodes in a single region, and StatCr i t represents the state credit evaluation value of the i-th node at time t, σ t Indicates the standard deviation of the status credit evaluation of all nodes in a single region.

[0093] S602: According to the status credit evaluation mean and status credit evaluation standard deviation of all nodes in each region, the node level of each node is divided into honest nodes, general nodes and malicious nodes:

[0094]

[0095] Among them, Grade i tIndicates the status credit level of the i-th node at time t, A represents an honest node, B represents a general node, and C represents a malicious node.

[0096] In the present invention, the node level division can help to allocate network resources more reasonably, for example, more computing and storage resources are allocated to honest nodes, thereby optimizing resource utilization efficiency. At the same time, the automatic level adjustment mechanism of the node can quickly respond to changes in the node status, ensuring that the system can still maintain stable operation when facing node movement or resource load changes.

[0097] Optionally, the full node set in each region dynamically updates the node level based on network updates, node additions, and node cross-region behaviors, and adjusts the current identity in a timely manner to ensure secure consensus in a heterogeneous dynamic environment.

[0098] Specifically, after completing the node registration, the full node set in the region regularly evaluates the node status credit through the node level local outlier factor division mechanism, and divides the level according to its evaluation value to assign the initial identity (malicious node C, general node B, honest node A) to participate in the consensus process. When the network is updated synchronously after a round of consensus, the full node set will promptly update the status credit evaluation value of each node. If the evaluation value exceeds the level threshold, the identity will be assigned in time according to the new level status.

[0099] When a new node joins the network, it first submits a joining request to the main server, along with its public key and other identity information for verification. During the verification process, it queries the resources and node load of the target area to ensure that the target area can accept the new node. After completing the node registration, it attempts to establish a communication test with the surrounding nodes in the area. During the communication process, the full set of nodes in the area collects their physical state and communication state information, and assigns an initial identity through the node level division mechanism to participate in the consensus process.

[0100] Cross-regional behaviors are mainly divided into two situations: nodes move to new regions and nodes enter new regions due to boundary adjustments. When a node enters a new region, first, its identity information such as regional identification is updated. The historical event transactions of the node in the original region are stored locally in the form of hash values, and included in the newly generated transactions and published on the chain to achieve cross-regional data traceability. Secondly, the full set of nodes in the new region evaluates its status credit, divides the level according to the obtained status credit evaluation value, assigns identity and participates in consensus.

[0101] In the present invention, the node status credit evaluation value is analyzed by the local outlier factor algorithm to determine the node level, which can not only improve the accuracy of node evaluation and network security, but also optimize resource management and enhance the robustness and adaptability of the system. At the same time, the dynamic update and level division of node status provide a continuous feedback mechanism, which helps to continuously optimize network strategies and protocols and improve network performance.

[0102] S7: Determine whether the target transaction only occurs locally. If so, proceed to S8. Otherwise, proceed to S11.

[0103] S8: The node corresponding to the local area takes the target transaction as a local transaction.

[0104] S9: Determine the local area consensus node and full node based on the distance between nodes and node levels.

[0105] In a possible implementation manner, S9 specifically includes:

[0106] S901: Set the number of honest nodes participating in the consensus to be between a third threshold and a fourth threshold, where the third threshold is less than the fourth threshold.

[0107] It should be noted that those skilled in the art can set the third threshold and the fourth threshold according to actual needs, and the present invention does not limit this.

[0108] S902: When the number of honest nodes in the local area is less than the third threshold, the consensus is suspended, and the heterogeneous dynamic IoT network performs regional adaptive adjustment according to the physical communication status, resource load and number of nodes during the movement of the nodes until the number of honest nodes in the local area is greater than the third threshold.

[0109] S903: When the number of honest nodes in the local area is between the third threshold and the fourth threshold, the existing honest nodes are used as consensus nodes in the local area.

[0110] In the present invention, by screening out honest nodes with higher status credit evaluation values, the potential impact of malicious nodes on the consensus process is reduced, thereby enhancing the security of the system. At the same time, by selecting nodes with high status credit evaluation values ​​for consensus, the most resource-rich and reliable nodes in the network can be better utilized, thereby improving the efficiency of the consensus process.

[0111] S904: When the number of honest nodes in the local area is greater than the third threshold, all honest nodes are sorted from high to low according to the status credit evaluation value, and the honest nodes with higher status credit evaluation values ​​in the local area are selected as the local area consensus nodes, and the local area consensus nodes are added to the local area communicable list.

[0112] It should be noted that after determining the local regional consensus node, it is also necessary to obtain the nodes in the same area that communicate quickly within the communication time, select the nodes with similar moving directions and moving speeds as the transaction publishing nodes, and quantify the similarity of speed and direction between the nodes:

[0113]

[0114] Among them, ε ij represents the j-direction speed similarity measure between transaction publishing node i and surrounding nodes, represents the velocity vector of transaction publishing node i, Represents the velocity vector of the surrounding node j.

[0115] The similarity measurement results between nodes are sorted by numerical value, and the nodes with the highest ranking are selected as candidate consensus nodes. When some consensus nodes move across regions or change their levels, these nodes will be removed from the local area communication list. At this time, new consensus nodes will be added to the candidate consensus nodes to ensure the normal progress of the consensus process.

[0116] In the present invention, quantitative selection is performed based on the speed and direction similarity between nodes, which can dynamically adapt to the changes and positions of nodes in the network and optimize the management and allocation of node resources. At the same time, when the number of honest nodes is insufficient, regional adaptive adjustment is automatically performed to cope with dynamic changes in the network environment and improve the adaptability and stability of the system.

[0117] S905: Select a first random full node outside the local area communicable list from the full node set, and calculate the hash value of the transaction.

[0118] S906: Send the hash value of the transaction to each consensus node in the local area communicable list for consensus. When the approval ratio in the feedback information received by the first random full node reaches a first preset ratio, the first random full node is used as the full node of the local area.

[0119] It should be noted that those skilled in the art can set the size of the first preset ratio according to actual needs, and the present invention is not limited thereto.

[0120] In the present invention, by determining consensus nodes and full nodes according to the distance and level between nodes, it is possible to optimize resource management and communication efficiency while ensuring the quality of the consensus process and network security.

[0121] S10: Verification is performed through local regional consensus nodes and full nodes using the regional weighted voting consensus method, and the successfully verified local transactions are packaged into blocks and uploaded to the local DAG regional slave chain.

[0122] Among them, intra-region weighted voting consensus is a mechanism used in distributed systems to make decisions and confirm data transactions or status updates. This consensus mechanism is usually used in scenarios where consensus needs to be reached among multiple nodes, such as transaction verification in blockchain networks.

[0123] In a possible implementation manner, S10 specifically includes:

[0124] S1001: The consensus nodes in the local area's communicable list vote on the data transaction set and feed back the voting results to the full nodes in the corresponding local area.

[0125] In the present invention, by conducting voting and consensus in a local area, the consensus time can be effectively shortened. Compared with voting across the entire network, this regional method can reduce network communication delays and improve processing speed.

[0126] S1002: The full nodes in each local area count the transaction votes according to the voting results and the credit weight of the consensus node:

[0127]

[0128] Among them, T i _votes t Indicates transaction T at time t i The final number of votes received, Indicates that consensus node j gives transaction T at time t i A vote in favor of Indicates that consensus node j gives transaction T at time t i The vote against Represents the state credit weight of consensus node j at time t.

[0129] In the present invention, by considering the state credit weight of the consensus node for voting statistics, the reliability of the consensus result can be improved, ensuring that nodes with high trustworthiness can judge the validity of the transaction.

[0130] S1003: Determine whether the number of data transaction tickets corresponding to each transaction is greater than a first preset number. If so, determine that the data transaction has passed the verification, and update the status of each transaction that has passed the verification to a consensus state. Otherwise, return each transaction that has not passed the verification to the next round of re-consensus.

[0131] It should be noted that those skilled in the art can set the first preset number according to actual needs, and the present invention is not limited thereto.

[0132] S1004: Each local area full node packages the consensus transactions into blocks and performs hash verification.

[0133] In the present invention, hash verification is performed after packaging transactions into blocks, which can effectively prevent tampering and forgery and ensure the integrity and security of data on the blockchain.

[0134] S1005: Upload the successfully verified block to the DAG area slave chain, and synchronously update the transaction status to the on-chain status.

[0135] It should be noted that if there are transactions that do not meet the conditions for being put on the chain, the transaction will be screened to the next round for consensus. If the transaction has not passed the consensus after multiple rounds, it will be judged as a consensus failure and the transaction will be deleted.

[0136] In the present invention, multiple rounds of consensus processing are performed on transactions that have not passed verification, which can increase the probability of transactions passing verification, improve the fault tolerance of the entire system and the accuracy of transactions. At the same time, transactions that have not passed consensus after multiple rounds are deleted, which can effectively prevent malicious or illegal transactions from burdening the system and protect the health of the blockchain network.

[0137] S11: The full node constructs the target transaction into a data transaction set.

[0138] S12: Determine multi-region consensus nodes and multi-region full nodes based on the distance between nodes and node levels.

[0139] In a possible implementation manner, S12 specifically includes:

[0140] S1201: The heterogeneous dynamic IoT network selects a plurality of local area trust lists with short communication times from around the area where the transaction set is published.

[0141] In the present invention, by selecting multiple local area trusted lists with short communication times, it is possible to ensure that during the cross-region consensus process, the communication delay between participating nodes is minimized, thereby improving the consensus efficiency.

[0142] S1202: Sort the status credit evaluation values ​​of the consensus nodes in the local area trusted list from high to low.

[0143] S1203: Select the consensus node with the highest status credit evaluation value in each region as the multi-region consensus node, and add the multi-region consensus node to the multi-region trusted list.

[0144] S1204: Select a second random full node outside the multi-region trusted list from the full node set of each region to calculate the hash value of the transaction.

[0145] In the present invention, by calculating and propagating the hash value of the transaction and confirming the full node based on the feedback of the multi-region consensus nodes, the integrity and tamper-proof ability of the data are improved.

[0146] S1205: Send the hash value of the transaction to each multi-region consensus node in the multi-region communicable list for consensus, and when the recognition ratio in the feedback information received by the second random full node reaches a second preset ratio, use the second random full node as a multi-region full node.

[0147] It should be noted that those skilled in the art can set the size of the second preset ratio according to actual needs, and the present invention is not limited thereto.

[0148] It should be noted that after each round of multi-region consensus voting, the multi-region full nodes need to be updated.

[0149] In the present invention, multi-region full nodes are updated after each round of consensus, which can reflect the latest network status and ensure the accuracy of the consensus process and the effectiveness of the current nodes.

[0150] S13: Verification is performed through multi-region consensus nodes and multi-region full nodes using a multi-region weighted voting consensus method. The successfully verified data transaction sets are packaged into blocks and uploaded to the DAG global main chain.

[0151] Among them, multi-region weighted voting consensus is an extended consensus mechanism suitable for distributed systems or networks, especially those large-scale systems that require coordination between multiple regions. This mechanism combines intra-region weighted voting and inter-region coordination to ensure the overall consistency and reliability of the system.

[0152] In a possible implementation manner, S13 specifically includes:

[0153] S1301: Each consensus node in the multi-region communicable list votes on the data transaction set and feeds back the voting results to the corresponding multi-region full node.

[0154] S1302: Each multi-region full node counts the number of transaction tickets based on the voting results and the status credit weight of the consensus node:

[0155]

[0156] S1303: Determine whether the number of data transaction tickets corresponding to each transaction is greater than the second preset number. If so, determine that the data transaction has passed the verification, and update the status of each transaction that has passed the verification to the consensus state. Otherwise, return each transaction that has not passed the verification to the next round of re-consensus.

[0157] It should be noted that those skilled in the art can set the second preset number according to actual needs, and the present invention is not limited thereto.

[0158] In the present invention, the state credit weight is used to count the number of transaction tickets, which can ensure that the reputation and stability of the node are effectively reflected in the consensus process, and improve the security and reliability of the consensus result. At the same time, the transaction set is verified in multiple regions, which reduces the burden on a single region and avoids resource consumption across the entire network.

[0159] S1304: Merge all data transactions in a consensus state into a consensus transaction set.

[0160] S1305: Multi-region full nodes package the consensus transaction set into blocks and perform hash verification.

[0161] S1306: Upload the block with successful hash verification to the DAG global main chain, and synchronously update the transaction status to the on-chain status.

[0162] It should be noted that if there are other transactions in the transaction set that do not meet the conditions for being put on the chain, the transaction will be merged into the new transaction set of the next round for consensus. If the transaction has not passed the consensus after multiple rounds, it will be judged as a consensus failure and the transaction will be deleted.

[0163] In the present invention, only verified data transactions can be updated to the consensus state and finally uploaded to the DAG global main chain. This mechanism ensures the accuracy and consistency of the data. At the same time, by uploading blocks to the DAG global main chain, the consistency and global availability of the data are ensured, so that data in all regions can be updated and shared synchronously.

[0164] S14: Through multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel.

[0165] Among them, multi-signature is a security technology that is widely used in blockchain and other digital systems to enhance the security of transactions. It requires multiple private keys to sign a transaction or data to complete the operation. It aims to increase control over transactions and prevent the risk of unsafe operations.

[0166] In a possible implementation manner, S14 specifically includes:

[0167] S1401: Each participating node uses a private key to sign the data event involved in the event transaction:

[0168] sig i =Sign(EventData,SK i )

[0169] Among them, sig i Indicates the signature of the participating node i on the participating data event, Sign() indicates the signature function, EventData indicates the data event in the event transaction, SK i Represents the private key of the i-th node.

[0170] S1402: Use hash to combine the signatures of each participating node to obtain a multi-signature:

[0171] ComSig=hash(sig1,sig2,...sig n )

[0172] Among them, ComSig means multi-signature.

[0173] In the present invention, the use of signatures from multiple nodes for data anchoring can effectively prevent single point failure or malicious tampering. Multi-signatures increase the security of data because multiple nodes’ authentication is required to operate, reducing the risk of a single node.

[0174] S1403: Pack the multi-signed data from the DAG area into anchor blocks and send them to the DAG global main chain.

[0175] S1404: The DAG global main chain verifies the multi-signature of the DAG area slave chain:

[0176] Auth(EventData sub )=ComSig(EventData sub ,sig main )

[0177] Among them, Auth(EventData sub ) represents the function of verifying the data from the chain in the area, EventData sub Indicates the data of the area slave chain, sig main Represents the global main chain key collection used for authentication.

[0178] S1405: When the data on the DAG global main chain needs to be transmitted back to the target DAG regional slave chain, the DAG global main chain will package the multi-signed data blocks into anchor blocks after confirmation and send them to the target DAG regional slave chain.

[0179] S1406: The target area slave chain verifies the multi-signature of the DAG global main chain and records the data locally:

[0180] Auth(EventData main )=ComSig(EventData main ,sig sub )

[0181] Among them, sig sub Represents the zone slave chain key collection used for anchoring.

[0182] S1407: When both parties pass the verification, the multi-signature bidirectional anchoring between the DAG master and slave chains is completed, and a trusted data exchange channel is established.

[0183] In the present invention, by bidirectionally anchoring the data of the DAG regional slave chain and the DAG global main chain, the consistency of the data between the two chains can be ensured. At the same time, the data exchange channel established by the bidirectional anchoring provides a reliable mechanism for exchanging data. This channel can prevent the forgery or tampering of data during transmission, thereby enhancing the trust of data exchange.

[0184] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0185] (1) In the present invention, the heterogeneous dynamic IoT network is divided into multiple regions according to the path length, node density and resource load, and the full node set of each region is selected to monitor the physical communication status, resource load and number of nodes in each region during the movement process. According to the physical communication status, resource load and number of nodes in each region during the movement process, the boundaries of adjacent regions are dynamically adjusted. By dividing the network into multiple regions, locally managing and monitoring the physical communication status and resource load of the nodes, and flexibly adjusting the regional boundaries, the network connection in the region can be kept stable, and the regional division can be updated in a timely manner, thereby improving the timeliness of information sharing.

[0186] (2) In the present invention, the status and credit of the nodes in the adjusted area are evaluated to determine the status credit evaluation value of each node. The status credit evaluation value is analyzed by the local outlier factor algorithm to determine the node level of each node. The node level includes honest nodes, general nodes and malicious nodes. And through the multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel. By evaluating the status and credit of the node, potential pseudo nodes and malicious behaviors can be identified, thereby effectively defending against pseudo node attacks; the multi-signature mechanism provides an additional security layer to ensure the reliability of transaction events, prevent data tampering and pseudo data attacks, and improve the security and reliability of the consensus process.

[0187] It should be understood that the processor in the embodiment of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0188] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link DRAM (SLDRAM), and direct rambus RAM (DR RAM).

[0189] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware or any other combination. When implemented by software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the process or function described in the embodiment of the present invention is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more available media sets. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a tape), an optical medium (for example, a DVD), or a semiconductor medium. The semiconductor medium can be a solid-state hard disk.

[0190] It should be understood that the term "and / or" in this article only describes the association relationship of associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. A and B can be singular or plural. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship, but it may also indicate an "and / or" relationship. Please refer to the context for specific understanding.

[0191] In the present invention, "at least one" means one or more, and "more than one" means two or more. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can be represented by: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0192] It should be understood that in various embodiments of the present invention, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0193] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0194] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described equipment, devices and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0195] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses and methods can be implemented in other ways. For example, the device embodiments described above are only schematic, for example, the division of the units is only a logical function division, and there may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0196] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0197] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0198] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0199] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, a fast consensus method for large-scale heterogeneous dynamic nodes based on a DAG blockchain as described in the method embodiment is implemented.

[0200] The computer-readable storage medium provided by the present invention can implement the steps and effects of the fast consensus method of large-scale heterogeneous dynamic nodes based on the DAG blockchain of the above-mentioned method embodiment. To avoid repetition, the present invention will not go into details.

[0201] The beneficial effects brought about by the technical solution provided by the embodiment of the present invention include at least:

[0202] (1) In the present invention, the heterogeneous dynamic IoT network is divided into multiple regions according to the path length, node density and resource load, and the full node set of each region is selected to monitor the physical communication status, resource load and number of nodes in each region during the movement process. According to the physical communication status, resource load and number of nodes in each region during the movement process, the boundaries of adjacent regions are dynamically adjusted. By dividing the network into multiple regions, locally managing and monitoring the physical communication status and resource load of the nodes, and flexibly adjusting the regional boundaries, the network connection in the region can be kept stable, and the regional division can be updated in a timely manner, thereby improving the timeliness of information sharing.

[0203] (2) In the present invention, the status and credit of the nodes in the adjusted area are evaluated to determine the status credit evaluation value of each node. The status credit evaluation value is analyzed by the local outlier factor algorithm to determine the node level of each node. The node level includes honest nodes, general nodes and malicious nodes. And through the multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel. By evaluating the status and credit of the node, potential pseudo nodes and malicious behaviors can be identified, thereby effectively defending against pseudo node attacks; the multi-signature mechanism provides an additional security layer to ensure the reliability of transaction events, prevent data tampering and pseudo data attacks, and improve the security and reliability of the consensus process.

[0204] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

[0205] There are a few points to note:

[0206] (1) The drawings of the embodiments of the present invention only relate to the structures related to the embodiments of the present invention, and other structures may refer to the general design.

[0207] (2) For the sake of clarity, in the drawings used to describe the embodiments of the present invention, the thickness of the layers or regions is exaggerated or reduced, that is, these drawings are not drawn according to the actual scale. It is understood that when an element such as a layer, film, region or substrate is referred to as being "on" or "under" another element, the element may be "directly" "on" or "under" the other element or there may be intermediate elements.

[0208] (3) In the absence of conflict, the embodiments of the present invention and the features therein may be combined with each other to obtain new embodiments.

[0209] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. The protection scope of the present invention shall be based on the protection scope of the claims.

Claims

1. A fast consensus method for large-scale heterogeneous dynamic nodes based on DAG blockchain, characterized by: include: S1: Build a heterogeneous dynamic IoT network based on blockchain and register the identities of nodes in the network; S2: Divide the heterogeneous dynamic IoT network into multiple regions according to path length, node density, and resource load; S3: Select the full set of nodes in each area to monitor the physical communication status, resource load and number of nodes in each area during the movement process; S4: dynamically adjusting the boundaries of adjacent areas according to the physical communication status, the resource load and the number of nodes in each area during the movement process; S5: Evaluate the status and credit of the nodes in the adjusted area to determine the status credit evaluation value of each node; S6: Analyze the state credit evaluation value through a local outlier factor algorithm to determine the node level of each node, where the node level includes an honest node, a general node, and a malicious node; S7: Determine whether the target transaction only occurs locally; if so, proceed to S8; Otherwise, go to S11; S8: The node corresponding to the local area takes the target transaction as a local transaction; S9: Determine the local regional consensus node and full node based on the distance between nodes and node levels; S10: Verify through local regional consensus nodes and full nodes using the regional weighted voting consensus method, package the successfully verified local transactions into blocks, and upload them to the local DAG regional slave chain; S11: The full node constructs the target transaction into a data transaction set; S12: Determine multi-region consensus nodes and multi-region full nodes based on the distance between nodes and node levels; S13: Verification is performed through multi-region consensus nodes and multi-region full nodes using a multi-region weighted voting consensus method, and the successfully verified data transaction sets are packaged into blocks and uploaded to the DAG global main chain; S14: Through multi-signature method, the transaction events in the DAG regional slave chain and the DAG global main chain are bidirectionally anchored to establish a trusted data exchange channel.

2. According to claim 1, the fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain is characterized in that: The identity registration of nodes in the network in S1 specifically includes: Generate a pair of public and private keys (PK i ,SK i ), the identity information includes the type and geographical location of the node; The private key corresponding to each node is used to sign its own identity information to obtain the signature information: ξ i =Sign(SK i ,ID i ) Among them, ξ i Represents the signature information of the i-th node, SK i Indicates the private key of the i-th node, ID i Represents the identity information of the i-th node, and Sign() represents the signature function; The heterogeneous dynamic IoT network uses the public and private PK corresponding to each node i Verify the signature information and complete the node identity registration.

3. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S4 specifically includes: S401: Determine the physical communication status of each node in the respective area: in, represents the state evaluation value of the communication process between the i-th node and the full node r at time t, Indicates the computing power of the i-th node at time t, represents the power consumption of the i-th node at time t, represents the available storage of the i-th node at time t, represents the number of offline times during the communication between the i-th node and the full node r at time t, represents the offline time of the ith node in the communication process with the full node r at time t, represents the communication delay between the ith node and the full node r at time t, ω1 represents the weight corresponding to the physical state of the ith node, and ω2 represents the weight corresponding to the communication state of the ith node; S402: Determine whether the number of nodes in each area is greater than a first threshold or whether the resource load is greater than a second threshold. If so, calculate the load balance of each area: in, Indicates the load balance degree of the area at time t, Indicates the number of nodes in the area Area at time t; S403: Compare the load balances of adjacent areas, and divide a preset number of nodes in a high load balance area into a low load balance area: Among them, M represents the number of nodes that need to be divided, D B Indicates the high load balancing area, D A Indicates the low load balancing area, N B Indicates the total number of nodes in the high load balancing zone.

4. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S5 specifically includes: S501: The initial node in the heterogeneous dynamic IoT network broadcasts a physical state query packet in each adjusted area; S502: When each node receives the query packet, it sends its own physical state to the set of all nodes in the corresponding area; S503: Each of the full node sets calculates the state evaluation value of each node in each adjusted area according to the physical state of each node in the corresponding area: in, represents the state evaluation value of the communication process between the i-th node and the full node r at time t, Indicates the computing power of the i-th node at time t, represents the power consumption of the i-th node at time t, represents the available storage of the i-th node at time t, represents the number of offline times during the communication between the i-th node and the full node r at time t, represents the offline time of the ith node in the communication process with the full node r at time t, represents the communication delay between the ith node and the full node r at time t, ω1 represents the weight corresponding to the physical state of the ith node, and ω2 represents the weight corresponding to the communication state of the ith node; S504: Determine the number of consensus verifications that each node has participated in after reaching consensus, the number of transactions that have reached consensus, and the number of generated transactions that have not reached consensus; S505: Calculate the credit evaluation value of each node according to the number of consensus verifications participated in by each node, the number of transactions that have reached consensus, and the number of generated transactions that have not reached consensus: in, represents the credit evaluation value of the i-th node at time t, represents the number of times the i-th node participates in consensus verification at time t, ConTrant represents the number of consensus transactions verified by the i-th node at time t, UnsuccTrant represents the number of transactions generated by the i-th node at time t that do not reach consensus, ω3 represents the weight corresponding to the number of times the i-th node participates in consensus verification at time t, ω4 represents the weight corresponding to the number of consensus transactions verified by the i-th node at time t, and ω5 represents the weight corresponding to the number of transactions generated by the i-th node at time t that do not reach consensus; S506: Calculate the state credit evaluation value of each node by combining the state evaluation value, the credit evaluation and the historically accumulated state credit evaluation value: in, Represents the status credit evaluation value of the i-th node at time t, HisStatCr i Represents the historical cumulative state credit value of the i-th node in the previous round of consensus, represents the maximum state evaluation value of all nodes at time t, represents the maximum credit evaluation value of all nodes at time t, λ1 represents the weight corresponding to the historical accumulated state credit value of the i-th node in the previous round of consensus, λ2 represents the weight corresponding to the maximum state evaluation value of all nodes at time t, λ3 represents the weight corresponding to the maximum credit evaluation value of all nodes at time t, λ1+λ2+λ3=1.

5. According to claim 1, the fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain is characterized in that: The S6 specifically includes: S601: Calculate the mean value and standard deviation of the status credit evaluation of all nodes in each region: Among them, μ t represents the mean value of the status credit evaluation of all nodes in a single region, N represents the total number of nodes in a single region, represents the state credit evaluation value of the i-th node at time t, σ t Represents the standard deviation of the status credit evaluation of all nodes in a single region; S602: Classify the node level of each node into the honest node, the general node and the malicious node according to the state credit evaluation mean value and the state credit evaluation standard deviation of all nodes in each region: in, Indicates the status credit level of the i-th node at time t, A represents an honest node, B represents a general node, and C represents a malicious node.

6. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S9 specifically includes: S901: Setting the number of honest nodes participating in the consensus to be between a third threshold and a fourth threshold, wherein the third threshold is less than the fourth threshold; S902: When the number of honest nodes in the local area is less than a third threshold, the consensus is suspended, and the heterogeneous dynamic IoT network performs regional adaptive adjustment according to the physical communication state, resource load and number of nodes during the movement of the nodes, until the number of honest nodes in the local area is greater than the third threshold; S903: When the number of honest nodes in the local area is between the third threshold and the fourth threshold, all honest nodes are used as local area consensus nodes; S904: when the number of honest nodes in the local area is greater than a third threshold, sort all honest nodes from high to low according to the status credit evaluation value, select the honest node with the highest status credit evaluation value in the local area as the local area consensus node, and add the local area consensus node to the local area communicable list; S905: Selecting a first random full node outside the local area communicable list from the full node set, and calculating a hash value of the transaction; S906: Send the hash value of the transaction to each consensus node in the local area communicable list for consensus. When the approval ratio in the feedback information received by the first random full node reaches a first preset ratio, the first random full node is used as the full node of the local area.

7. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S10 specifically includes: S1001: The consensus nodes in the local area communicable list vote on the data transaction set and feed back the voting results to the full nodes of the corresponding local area; S1002: The full nodes in each local area calculate the number of transaction tickets based on the voting results and the state credit weight of the consensus node: Among them, T i _votes t Indicates transaction T at time t i The final number of votes received, Indicates that consensus node j gives transaction T at time t i A vote in favor of Indicates that consensus node j gives transaction T at time t i The vote against Represents the state credit weight of consensus node j at time t; S1003: Determine whether the number of data transaction tickets corresponding to each transaction is greater than a first preset number. If so, determine that the data transaction has passed the verification, and update the status of each transaction that has passed the verification to a consensus state; otherwise, return each transaction that has not passed the verification to the next round of re-consensus; S1004: Each of the local area full nodes packages the consensus transactions into blocks and performs hash verification; S1005: Upload the successfully verified block to the DAG area slave chain, and synchronously update the transaction status to the on-chain status.

8. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S12 specifically includes: S1201: The heterogeneous dynamic IoT network selects a plurality of local area trust lists with short communication time from around the area where the transaction set is published; S1202: sorting the status credit evaluation values ​​of the consensus nodes in the local area trusted list from high to low; S1203: Select the consensus node with the highest status credit evaluation value in each region as the multi-region consensus node, and add the multi-region consensus node to the multi-region trusted list; S1204: Select a second random full node outside the multi-region trusted list from the full node set of each region, and calculate the hash value of the transaction; S1205: Send the hash value of the transaction to each multi-region consensus node in the multi-region communicable list for consensus, and when the recognition ratio in the feedback information received by the second random full node reaches a second preset ratio, use the second random full node as a multi-region full node.

9. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S13 specifically includes: S1301: Each consensus node in the multi-region communicable list votes on the data transaction set and feeds back the voting result to the corresponding multi-region full node; S1302: Each of the multi-region full nodes calculates the number of transaction tickets based on the voting results and the state credit weight of the consensus node: S1303: Determine whether the number of data transaction tickets corresponding to each transaction is greater than a second preset number. If so, determine that the data transaction has passed the verification, and update the status of each transaction that has passed the verification to a consensus state; otherwise, return each transaction that has not passed the verification to the next round of re-consensus; S1304: Merge all data transactions in a consensus state into a consensus transaction set; S1305: The multi-region full nodes package the consensus transaction set into a block and perform hash verification; S1306: Upload the block with successful hash verification to the DAG global main chain, and synchronously update the transaction status to the on-chain status.

10. The fast consensus method of large-scale heterogeneous dynamic nodes based on DAG blockchain according to claim 1 is characterized in that: The S14 specifically includes: S1401: Each participating node uses a private key to sign the data event involved in the event transaction: say i =Sign(EventData,SK i ) Among them, sig i Indicates the signature of the participating node i on the participating data event, Sign() indicates the signature function, EventData indicates the data event in the event transaction, SK i represents the private key of the i-th node; S1402: Combine the signatures of each participating node using hash to obtain a multi-signature: ComSig=hash(sig1,sig2,...sig n ) Among them, ComSig means multi-signature; S1403: Pack the multi-signed data in the DAG area from the chain into an anchor block and send it to the DAG global main chain; S1404: The DAG global main chain verifies the multi-signature of the DAG regional slave chain: Auth(EventData sub )=ComSig(EventData sub ,one main ) Among them, Auth(EventData sub ) represents the function of verifying the data from the chain in the area, EventData sub Indicates the data of the area slave chain, sig main Represents the global main chain key collection used for authentication; S1405: When the data on the DAG global main chain needs to be transmitted back to the target DAG regional slave chain, the DAG global main chain packages the multi-signed data blocks into anchor blocks after confirmation and sends them to the target DAG regional slave chain; S1406: The target zone slave chain verifies the multi-signature of the DAG global main chain and records the data locally: Auth(EventData main )=ComSig(EventData main ,one sub ) Among them, sig sub Indicates the key collection of the regional slave chain used for anchoring; S1407: When both parties pass the verification, the multi-signature bidirectional anchoring between the DAG master and slave chains is completed, and a trusted data exchange channel is established.

Citation Information

Cited By

  • Intelligent consensus method and device for block chain and directed acyclic graph network fusion

    CN119865302A

  • DAG-based hard wallet transaction rapid synchronization method, medium and system

    CN120410528A

  • Block chain-based information management method and system

    CN120455466A