Node credibility consensus method
By grouping nodes and electing consensus nodes, the problems of high communication costs and long consensus delays in traditional blockchains when resource constraints are solved, and more efficient node credibility consensus is achieved.
Patent Information
- Application Number
- CN202411740188.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-11-29
AI Technical Summary
In the case of limited node energy and low computing power, traditional blockchains require a large amount of resources to agree on, resulting in high communication costs and extended consensus times, making it difficult to meet the requirements of lightweight usage scenarios.
By grouping nodes and electing consensus nodes within each node group, consensus within and between groups is carried out, communication overhead is reduced, and consensus delay is shortened.
It improves the judgment accuracy of malicious nodes, reduces communication complexity, improves consensus efficiency, and adapts to scenarios with limited number of nodes and network bandwidth.
Smart Images

Figure CN119520536A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of network communication technology, and specifically relates to a node credibility consensus method, system, device and readable storage medium. Background Art
[0002] With the increasing development of network communication and other technologies, decentralized node cluster systems are widely used in various fields. For example, drones can not only carry weapons directly for attack, but also perform auxiliary tasks such as enemy reconnaissance, intelligence collection, and information relay on the battlefield. However, since the working space of drone clusters is an open battlefield environment, they are often threatened by the enemy, which in turn affects the normal operation and security of the entire cluster. Therefore, in scenarios such as drone clusters, the credibility of network nodes needs to be maintained to ensure overall credibility.
[0003] Blockchain is essentially a distributed storage database. Due to its inherent advantages, it is relatively suitable for deployment in decentralized systems such as drone clusters to ensure the credibility of node identities. However, traditional blockchains often need to store a large amount of block information for verification, and require a considerable amount of computing resources and network bandwidth in the process of reaching consensus. In some scenarios today, the available resources for device task execution are limited, and too many resources cannot be allocated to blockchain maintenance.
[0004] When node energy is limited and computing power is low, the classic PBFT protocol requires all nodes to communicate. As the number of nodes in the network increases, the communication cost will increase sharply. In a cluster system, the limited network bandwidth can hardly support massive communication and information forwarding.
[0005] Therefore, in response to the above technical problems, it is necessary to provide a lightweight node consensus method.
[0006] The information disclosed in this background technology section is only intended to enhance the understanding of the overall background of the invention and should not be regarded as an acknowledgment or any form of suggestion that the information constitutes the prior art already known to a person skilled in the art. Summary of the invention
[0007] The purpose of the present invention is to provide a node credibility consensus method, system, device and readable storage medium, which can reduce the communication overhead of node consensus and shorten the consensus delay under the premise of ensuring the credibility of node identity.
[0008] In order to achieve the above object, a technical solution provided by a specific embodiment of the present invention is as follows:
[0009] In a first aspect, the present invention provides a node credibility consensus method, which comprises:
[0010] Group the nodes and elect consensus nodes in each node group;
[0011] Each node monitors the adjacent nodes in its node group, generates transaction information based on the abnormal behavior of the adjacent nodes, and sends it to the consensus node in the corresponding node group. The transaction information includes the node information where the abnormal behavior occurs and the type of abnormal behavior;
[0012] Generate credibility change information of the node with abnormal behavior based on the transaction information, reach consensus on the credibility change information among the consensus nodes of each node group, and update the credibility information of each node based on the consensus result;
[0013] Based on the updated node credibility information, the trusted nodes are screened, the trusted nodes are grouped and the consensus nodes of each node group are reselected to conduct a new round of node credibility consensus.
[0014] In one or more embodiments of the present invention, grouping nodes includes:
[0015] Determine the number of node groups, and select the cluster center of each node group from the cluster one by one; the first selected cluster center is any node in the cluster, and the Nth selected cluster center is the node in the cluster with the largest sum of distances to the selected N-1 cluster centers, where N is a positive integer greater than or equal to 2;
[0016] Based on each of the cluster centers, the trusted nodes in the cluster are clustered to form a plurality of node groups.
[0017] In one or more embodiments of the present invention, the method further comprises:
[0018] Obtain the mean of the spatial positions of each node in the node group, and select the node closest to the spatial position corresponding to the mean as the central node of the node group;
[0019] Based on the distance to the central node, a value is assigned to the nodes in the node group where the central node is located, and the distance to the central node is proportional to the size of the node value assigned.
[0020] In one or more embodiments of the present invention, the consensus nodes of each node group are selected, including:
[0021] Calculate the node score based on the size of the node assignment, the updated credibility of each node, and the number of times each node serves as a consensus node;
[0022] In the first round of node consensus, the consensus node of the corresponding node group is selected based on the node assignment;
[0023] In non-first-round node consensus, the consensus nodes of the corresponding node group are selected based on the node score.
[0024] In one or more embodiments of the present invention, the scoring formula is:
[0025] score=α×TVal-β×DisScoe-γ×Cnt
[0026] Among them, size(Gi) is the number of nodes in the node group Gi; num is the node value assigned based on the distance from the node to the central node; score is the score of the node; TVal is the credibility of the node; Cnt is the number of times the node serves as a consensus node; DisScore is the size of the node assignment; α, β, γ are the preset weight values.
[0027] In one or more embodiments of the present invention, the method further comprises:
[0028] Record the number of nodes that report transaction information on the same suspicious node;
[0029] If the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is greater than or equal to a preset verification threshold, the transaction information corresponding to the suspicious node is credible;
[0030] If the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is less than a preset verification threshold, the transaction information corresponding to the suspicious node is unreliable.
[0031] In one or more embodiments of the present invention, the method further comprises:
[0032] Set up a preliminary consensus node in each node group;
[0033] If it is detected that a consensus node of a node group has abnormal forwarding behavior, the transaction information corresponding to the abnormal forwarding behavior of the consensus node is sent to the standby consensus node of the same node group;
[0034] If the transaction information corresponding to the abnormal forwarding behavior of the consensus node is credible, the preliminary consensus node initiates a consensus node change consensus to other nodes in the node group;
[0035] Based on the consensus results, new consensus nodes are selected.
[0036] In one or more embodiments of the present invention, the screening of trusted nodes includes:
[0037] If the node credibility is greater than or equal to a preset first credibility threshold, the node is a fully trusted node;
[0038] If the node credibility is less than a preset first credibility threshold and greater than or equal to a preset second credibility threshold, the node is a receiving-only node, which does not participate in consensus node election and cannot report transaction information; the trusted nodes include fully trusted nodes and receiving-only nodes;
[0039] If the node credibility is less than a preset third credibility threshold, the node is a blacklist node.
[0040] In one or more embodiments of the present invention, the method further comprises:
[0041] Generate a credibility table entry for all nodes in the cluster based on the consensus result of credibility change between the consensus nodes of each node group;
[0042] Filter the trusted nodes based on the credibility table items, group the trusted nodes and reselect the consensus nodes of each node group;
[0043] The credibility table items, node grouping information, and new consensus node data of each node group are stored in the blockchain, and the block is broadcast to all trusted nodes.
[0044] In one or more embodiments of the present invention, each node monitors the forwarding status of an adjacent node in the node group, including:
[0045] Parse the generation time of the information sent by the adjacent nodes in the same node group and the timestamp of receiving the information to determine whether the sending node has delayed forwarding behavior;
[0046] Verify the content of the information received from the adjacent nodes in the same node group to determine whether the sending node has tampered with the information;
[0047] Create a first table entry recording adjacent nodes in the same group and a second table entry recording nodes sending information to the current node;
[0048] At preset time intervals, the first table entry and the second table entry are compared and reset, and based on the comparison result, it is determined whether there is an action of not forwarding information.
[0049] Compared with the prior art, the node credibility consensus method provided by the present invention, in a macro sense, groups the node network and elects a consensus node for each node group, and respectively performs consensus of the nodes within the group and the consensus of the consensus nodes between groups on the abnormal forwarding behavior, thereby improving the accuracy of judging malicious nodes, while effectively reducing the complexity of communication and improving the consensus efficiency.
[0050] Furthermore, the present invention takes into account the impact of distance on node consensus in the Internet of Things, optimizes the grouping strategy, and uses the spatial position of the node as the principle of grouping. At the same time, each round of consensus requires regrouping of nodes, which can effectively counteract changes in network topology caused by node mobility.
[0051] At the node consensus level, the node credibility threshold is set to increase or decrease the credibility for different forwarding behaviors, reflecting the node performance in real time. At the same time, in order to avoid the "monopoly" phenomenon of consensus nodes in each node group, that is, always a few specific nodes are elected as consensus nodes, the present invention establishes a scoring election mechanism for consensus nodes to prevent excessive concentration of power and encourage nodes to honestly and actively participate in the consensus process.
[0052] At the blockchain application level, the present invention sets up the blockchain network before executing the task, sets up a new blockchain and discards the old blockchain storage for each task execution, so as to reduce the block data's occupancy of the node storage and realize a blockchain solution with lightweight storage and efficient consensus. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] Figure 1 This is a schematic diagram of a node credibility consensus scenario in one embodiment of the present invention;
[0055] Figure 2 It is a flowchart of a node credibility consensus method in one embodiment of the present invention;
[0056] Figure 3 It is a structural block diagram of a node credibility consensus system in one embodiment of the present invention;
[0057] Figure 4 is a structural block diagram of an electronic device in one embodiment of the present invention;
[0058] Figure 5 is a graph showing a corresponding relationship between the number of transactions sent and forwarded in a network and the number of network summary points in an identification delay forwarding scenario in one embodiment of the present invention;
[0059] Figure 6 is a graph showing a corresponding relationship between the number of transactions sent and forwarded in a network and the number of network summary points in a scenario of identifying selfish nodes in one embodiment of the present invention;
[0060] Figure 7 It is a corresponding relationship diagram between the number of transactions sent and forwarded in the network and the number of network summary points in the scenario of identifying data tampering nodes in one embodiment of the present invention. DETAILED DESCRIPTION
[0061] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0062] Unless explicitly stated otherwise, throughout the specification and claims, the term “comprise” or variations such as “include” or “comprising”, etc., will be understood to include the stated elements or components but not to exclude other elements or components.
[0063] In the existing technical solution, there is a method for node credibility consensus in a decentralized system, which specifically includes: each node detects the abnormal forwarding behavior of other nodes in the cluster. When the client sends a request to the master node, the master node broadcasts the request to other nodes, and the nodes execute the three-stage consensus process of the PBFT algorithm to reach a consensus on the abnormal forwarding behavior detected by each node. After the node completes the three-stage process, it returns a message to the client. After the client receives the same message from a preset number of nodes, it means that the consensus has been completed correctly, and then the credibility changes of each node can be evaluated based on the consensus results.
[0064] The PBFT algorithm can certainly achieve node credibility consensus for decentralized systems, but since the classic PBFT protocol requires all nodes to communicate, as the number of nodes in the network increases, the communication cost will increase dramatically. In small decentralized systems such as drone clusters, limited network bandwidth is difficult to support massive communications and information forwarding behaviors. At the same time, due to the inherent defects of the PBFT algorithm, the communication complexity of using the PBFT algorithm for node credibility consensus is too high and the scalability is relatively low. When the number of nodes reaches a certain level, the performance will degrade very quickly. At the same time, in the case of unstable network, the consensus delay is extremely high, which is difficult to meet the requirements of some lightweight usage scenarios. On the other hand, the movement of nodes may bring about changes in the network topology, and it is difficult to deal with frequent node exits or joins.
[0065] The inventor of the present invention has found the main shortcomings of the prior art, and based on the shortcomings of the prior art, proposed a new technical implementation idea: cluster the nodes in the cluster according to their physical locations, prioritize the consensus strategy, first conduct consensus on the nodes in the node group, and further conduct consensus on the consensus results among the consensus nodes elected by each node group, and update the credibility of each node based on the consensus results. From the grouping method to the consensus mode, the complexity of communication is improved and the consensus is made lighter, reducing the communication load pressure. Before the next round of consensus begins, based on the updated node credibility, screen the trusted nodes, regroup and elect the consensus nodes. Record the updated grouping information and consensus nodes in the block, and broadcast the block among the trusted nodes.
[0066] Please refer to Figure 1 , which shows a schematic diagram of an application scenario of the node credibility consensus method provided by the present invention under one implementation mode. The scenario is a decentralized network composed of drones. The specific implementation scenario is: the drones are centrally managed before performing the task, and will be recycled after the task is completed, and released again when the next task is performed. During the two tasks, the drones in the cluster can be managed in a centralized manner, and the credibility of the drones is guaranteed by trusted management facilities. During the execution of the task, the drones work in a decentralized manner, and there may be situations where nodes are lost, damaged, or hijacked. Therefore, the node credibility consensus method provided by the present invention can be applied, and the drone blockchain can be used to identify and eliminate these abnormal nodes to ensure the overall credibility of the task process. The implementation scenario specifically includes: drone grouping, drone blockchain network, and centralized drone management facilities.
[0067] It should be noted that communication connections are set up between drone groups, drone blockchain networks and centralized drone management facilities. The communication network derived from the above communication connections can include various connection types, including but not limited to: wired connection, wireless connection or fiber optic cable connection, etc. At the same time, the communication network can be a local area network, a metropolitan area network, a wide area network or any combination of the three.
[0068] It is understandable that the centralized drone management facility is only used for the centralized management of drones and the related settings for initializing the formation of a decentralized blockchain network in this application scenario. Specifically, it includes: sending a wake-up command to the drone; after the drone receives the wake-up message and performs self-check, each generates a public-private key pair (PubKey and PriKey) for encrypting and decrypting information in this mission, as well as a signature and verification pair (SignKey and VerifyKey) of the message from the node; the successfully generated node sends this information and identity information such as ID and Mac address to the central server as a response; based on the confirmation information received, the registration server generates certificate information for each node; the registration server initializes the credibility information for each node, selects a suitable node as the consensus node for the first round of consensus, and records this information in the genesis block; distributes certificates and public-private keys; sends the genesis block to the drone node; the drone node communicates and networks to form a decentralized blockchain network.
[0069] When starting to conduct credibility consensus on the decentralized drone nodes that perform tasks, first cluster and group them based on the location of the drone nodes in the cluster to form multiple drone groups as mentioned above. Trusted nodes establish mutual supervision and detect the forwarding behavior and task execution of neighboring nodes in the group; for suspicious behaviors of neighboring nodes, such as delayed forwarding, selfish behavior, and only sending, blockchain transaction information is generated and sent to the consensus node elected in the group; the consensus node verifies the transaction information after receiving it, and then reaches a consensus on the transaction information among the consensus nodes of each group; a credibility table for the global node is generated based on the consensus result; then the consensus node uses a clustering algorithm to regroup the trusted nodes in the current network based on the location information, and selects new consensus nodes from them to form the next round of consensus committees; the credibility table and consensus committee node data are recorded in the drone blockchain network, and the new block is broadcast to all trusted nodes; the node updates the data and starts the next round of consensus.
[0070] It should also be noted that, under one embodiment of the present invention, a user terminal is also required to implement the node credibility consensus method. The user terminal is installed with a computer software program that matches the node credibility consensus method provided by the present method, which is used for the user to configure some parameters necessary for implementing the present method, such as the initial value of the node credibility, node classification, credibility intervals corresponding to different types of nodes, credibility penalties / reward values caused by abnormal forwarding behavior, etc.; the user terminal may include but is not limited to desktop computers (PC terminals), desktop computers, smart phones, handheld computers, tablet computers, personal digital assistants (PDAs), and other portable electronic devices or wearable electronic devices, and the embodiments of the present invention do not limit the above content.
[0071] It should also be noted that the node credibility consensus method of the embodiment of the present invention can be applied to the node credibility consensus system of the embodiment of the present invention. The node credibility consensus system can be configured in a terminal. The terminal can include but is not limited to a PC (Personal Computer), a PDA (tablet computer), a smart phone, a smart wearable device, and the like.
[0072] Please refer to Figure 2 FIG. 1 is a flow chart of a node credibility consensus method in one embodiment of the present invention. The node credibility consensus method specifically includes the following steps:
[0073] S201: Group the nodes and elect consensus nodes in each node group;
[0074] It is understandable that the purpose of grouping nodes in the present invention is to achieve hierarchical intra-group consensus and inter-group consensus, thereby reducing the amount of information forwarding required for consensus and increasing the efficiency of consensus. Optionally, each node can be numbered, and the corresponding nodes can be divided into a desired number of node groups based on random extraction / ordered arrangement of the numbers. Or grouping can be performed based on node communication resources so that the mean values of node communication resources in each group are similar. The embodiment of the present invention does not limit the strategy for node grouping.
[0075] It should be noted that the distance between nodes can affect the network topology of the corresponding centralized system and the communication quality between nodes. Therefore, in one embodiment of the present invention, clustering is preferably performed based on the distance between nodes. Specifically, the distance from each node in the cluster to the cluster center can be obtained. The nodes are grouped based on the Euclidean distance from each node to the cluster center. The nodes are divided into the node group corresponding to the cluster center closest to the node. The number of cluster centers should be consistent with the desired number of node groups.
[0076] Among them, the cluster center can be any point in the node distribution area, and the embodiment of the present invention may not limit the type and location of the cluster center. In order to ensure the conservation of resources and achieve the purpose of lightweight in the process of node consensus, it is preferred to take the nodes in the cluster as the cluster center. At the same time, it is understandable that if the selection of the cluster center is too concentrated, it may lead to a large difference in the number of nodes in each generated node group, which greatly reduces the positive effect of the grouping. Therefore, it is preferred to ensure that the cluster center is relatively dispersed in the cluster.
[0077] In an exemplary embodiment of the present invention, grouping nodes includes: determining the number of node groups, and selecting the cluster center of each node group from the cluster one by one; wherein the first selected cluster center is any node in the cluster, and the Nth selected cluster center is the node in the cluster with the largest sum of distances to the selected N-1 cluster centers; based on each of the cluster centers, clustering the trusted nodes in the cluster to form multiple node groups, where N is a positive integer greater than or equal to 2.
[0078] For example, when selecting cluster centers, first randomly select a node in the cluster as the first cluster center; the second cluster center should be the node in the cluster that is farthest from the first cluster center; the third cluster center should be the node in the cluster that has the largest sum of distances to the first cluster center and the second cluster center; the Nth selected cluster center is the node in the cluster that has the largest sum of distances to the selected N-1 cluster centers. And so on, cluster centers are selected until the number of cluster centers is consistent with the number of node groups obtained by the desired division.
[0079] Based on the above exemplary embodiments, the node used as the first cluster center can be used to enable the system to automatically select other cluster center points. While achieving grouping, it reduces the subjective uncertainty caused by manual selection and maximizes the beneficial effects of grouping nodes and hierarchical consensus. It should be noted that if there are multiple nodes with the same and farthest distance to the selected cluster centers, one of the above nodes can be selected as the new cluster center, or a selection can be made based on the credibility of the current node.
[0080] On the other hand, the consensus nodes elected in each node group not only serve as the recipients of abnormal behavior transaction information within the group, but will also directly participate in the subsequent inter-group consensus. Therefore, the consensus nodes have greater rights than general nodes in the credibility consensus. Therefore, the election of consensus nodes needs to consider parameters in multiple dimensions to improve the efficiency of system consensus.
[0081] In an exemplary embodiment of the present invention, consensus nodes of each node group are selected, including: calculating the score of the node based on the size of the node assignment, the updated credibility of each node and the number of times each node serves as a consensus node, and electing the consensus node of the corresponding node group based on the size of the score.
[0082] The size of the node assignment depends on the size of the Euclidean distance between the central node of the node group and the spatial position of the node. The central node of the node group is the node closest to the mean of the spatial positions of each node in the node group. It should be noted that in scenarios where some computing resources are obviously insufficient, the node corresponding to the cluster center during clustering can be used as the central node.
[0083] It is understandable that in the first round of node consensus, since the credibility of each node is initialized to the same value and no node has ever served as a consensus node, in the first round of node consensus, only the size of the value assigned to each node is used to select the consensus node of each node group. Furthermore, since the distance from the central node to itself is always 0, in the first round of node consensus, the central node of each node group is assumed to be the corresponding consensus node. In non-first round node consensus, multiple parameters jointly determine the size of the node score, so the node score should be calculated and the consensus node of the node group should be selected based on the score size.
[0084] In an exemplary embodiment, the scoring formula is:
[0085] scoe=α×TVal-β×DisScore-γ×Cnt
[0086] Among them, size(Gi) is the number of nodes in the node group Gi; num is the node value assigned based on the distance from the node to the central node; score is the score of the node; TVal is the credibility of the node; Cnt is the number of times the node serves as a consensus node; DisScore is the size of the node assignment; α, β, γ are the preset weight values.
[0087] It should be noted that the weight value can be adaptively adjusted based on the user according to different usage scenarios. For example, if an application scenario has extremely strict requirements on security, the weight α corresponding to the node credibility can be increased; if the node resources in an application scenario are very uneven, it is necessary to avoid excessive concentration of power and aggravate the phenomenon of resource imbalance, so the weight γ corresponding to the number of times the node serves as a consensus node can be increased.
[0088] On the other hand, if nodes with high scores are taken as consensus nodes, then under the condition that other conditions are constant, the closer the node is to the central node of the corresponding node group, the higher the score should be. At this time, the setting of the weight value can make the scoring strategy applicable to any decentralized system without changing the system's node assignment rules. For example, in one implementation scenario, the decentralized system sets the node assignment to be inversely proportional to the distance from the node to the central node, that is, the greater the distance from the node to the central node, the smaller the node assignment. In the consensus, the weight β of the node assignment should be adaptively modified to a negative number, so that as the node assignment increases (as the distance from the node to the central node decreases), the node score increases.
[0089] S202: Each node monitors the adjacent nodes in its node group, generates transaction information based on the abnormal behavior of the adjacent nodes, and sends it to the consensus node in the corresponding node group;
[0090] It should be noted that the adjacent nodes of a node described in the present invention refer to the nodes in the same node group that directly communicate and interconnect with the node. The transaction information includes the node information where the abnormal behavior occurs and the type of abnormal behavior. Based on the node information of the abnormal behavior, the consensus node can determine the node where the abnormal behavior occurs, and the type of abnormal behavior determines the credibility change data of the node's behavior after consensus. At the same time, the type of abnormal behavior may include but is not limited to: forwarding behavior, task execution behavior, etc. The embodiment of the present invention does not limit the type of abnormal behavior and the credibility change value corresponding to different types of abnormal behavior, and can be adaptively adjusted based on the usage scenario.
[0091] In an exemplary embodiment, each node monitors the forwarding status of adjacent nodes in its node group, including: parsing the generation time of information received from adjacent nodes in the same node group and the timestamp of receiving the information, to determine whether the sending node has delayed forwarding behavior; verifying the content of information received from adjacent nodes in the same node group, to determine whether the sending node has tampered with the information; creating a first table entry that records adjacent nodes in the same group and a second table entry that records nodes sending information to this node; comparing the first table entry and the second table entry at preset time intervals and resetting the first table entry and the second table entry, and determining whether there is selfish behavior of not forwarding information based on the comparison result.
[0092] It should be noted that the time period is the time for adjacent nodes in a node group to communicate at least once. The setting of the time period depends on the sending and receiving frequency of each node in the cluster, and the present invention does not limit the specific value of the time period.
[0093] It should also be noted that when implementing the node credibility consensus method provided by the present invention, a second time period should also be set. If the node has not detected abnormal behavior of the adjacent node within the second time period, the normal blockchain transaction information of the adjacent node should be reported to the consensus node.
[0094] In particular, the selection of consensus nodes based on the above implementation can ensure the credibility of consensus nodes to a certain extent, but it is still impossible to completely avoid the election of malicious nodes as consensus nodes. In view of the above situation, the present invention also provides another implementation, which is as follows:
[0095] A preliminary consensus node is set in each node group; if abnormal forwarding behavior is detected in the consensus node of the node group, the transaction information corresponding to the abnormal forwarding behavior of the consensus node is sent to the preliminary consensus node of the same node group; if the transaction information corresponding to the abnormal forwarding behavior of the consensus node is credible, the preliminary consensus node initiates a consensus node change consensus to other nodes in the node group; based on the consensus result, a new consensus node is selected.
[0096] Among them, the new consensus node can be a node in the group or a consensus node of other node groups, and the present invention does not limit this. The election of the preparatory consensus node can adopt the same election strategy as the consensus node election. For the first round of node credibility consensus, based on the node assignment, the node with the closest Euclidean distance to the central node can be selected as the preparatory consensus node in addition to the central node; for non-first round elections, based on the node score value, the node with the best score in addition to the consensus node can be selected as the preparatory consensus node.
[0097] S203: Generate credibility change information of the node with abnormal behavior based on the transaction information, reach consensus on the credibility change information among the consensus nodes of each node group, and update the credibility information of each node based on the consensus result;
[0098] It should be noted that the node credibility consensus method described in the present invention also includes: recording the number of nodes that report transaction information for the same suspicious node; if the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is greater than or equal to a preset verification threshold, the transaction information corresponding to the suspicious node is credible; if the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is less than the preset verification threshold, the transaction information corresponding to the suspicious node is unreliable.
[0099] Most of the nodes in the node group are in a communication and interconnected state. Therefore, for the abnormal behavior of the same node, there should be multiple nodes that detect the abnormal behavior. Based on this property, if the number of different nodes reporting the transaction information of the same node reaches a preset threshold, it can be considered that the node does have malicious behavior, and the abnormal behavior transaction information of the node is regarded as a credible message. It can be understood that in one embodiment of the present invention, only credible transaction information is processed to generate credibility change information corresponding to the node where the abnormal behavior occurs; for untrustworthy transaction information, the consensus node confidently discards it.
[0100] For example, after a consensus node receives a suspicious behavior message about the same node, if the number of nodes reporting exceeds 2 / 3 of the total number of nodes in the current node group, the credibility change is accepted. Next, the consensus node, as a client of the PBFT algorithm, initiates a consensus on the credibility change of the node to the blockchain network. After consensus by all consensus nodes in the group, the credibility change is accepted by all nodes.
[0101] It should also be noted that the credibility change information of the node depends on the abnormal behavior type corresponding to the node. As described above, the embodiment of the present invention does not limit the type of abnormal behavior and the credibility change values corresponding to different types of abnormal behaviors.
[0102] For example, the credibility reward and punishment strategy corresponding to the node behavior shown in the following table can be adopted. Among them, when the consensus node does not receive the transaction information of a certain node in a round of node credibility consensus, or the transaction information received from the node is unreliable, the node is deemed to have performed normal forwarding behavior in this round of node consensus. For nodes whose credibility has not reached the upper limit, their credibility value can be increased; for nodes whose credibility has reached the upper limit, their credibility is maintained at the upper limit value and is not increased.
[0103] Table 1 Credibility rewards and penalties corresponding to node behaviors
[0104] Forwarding behavior type Credibility Rewards and Penalties Normal forwarding 0(+1) Delayed forwarding -1 Receive data but do not forward it -2 Forwarding wrong data / tampering -3
[0105] In the embodiment of the present invention, the node consensus algorithms used for consensus on transaction information of abnormal behavior within the group or consensus on node credibility changes between groups may include but are not limited to: Byzantine Fault Tolerant consensus algorithm, Tendermint-BFT algorithm, etc., and the embodiment of the present invention does not limit this.
[0106] S204: Based on the updated node credibility information, screen the trusted nodes, group the trusted nodes and reselect the consensus nodes of each node group to conduct a new round of node credibility consensus.
[0107] In an exemplary embodiment of the present invention, if the node credibility is greater than or equal to a preset first credibility threshold, the node is a fully trusted node; if the node credibility is less than the preset first credibility threshold and greater than or equal to the preset second credibility threshold, the node is a receiving-only node, which does not participate in the consensus node election and cannot report transaction information; the trusted node includes a fully trusted node and a receiving-only node; if the node credibility is less than a preset third credibility threshold, the node is a blacklist node. It can be understood that the first credibility threshold is greater than the second credibility threshold and greater than the third credibility threshold.
[0108] Fully trusted nodes in the network have complete permissions to monitor the behavior of neighboring nodes, generate transaction information, and participate in elections to become consensus nodes. Receive-only nodes will not be selected as members of the consensus committee in the network, and only have the authority to receive blocks and synchronize; receive-only nodes will receive credibility rewards when they maintain normal forwarding behavior, and when the credibility returns to the initial value, they will be treated as general nodes. Blacklist nodes come from nodes whose suspicious behavior is reported during the consensus process and whose credibility is reduced to the third credibility threshold due to credibility penalties. These nodes are considered malicious nodes and are recorded in the blacklist. In the subsequent task execution process, blacklist nodes will be excluded from the blockchain, and other nodes in the system will not forward data to this node, nor will they accept data from this node.
[0109] In particular, reconnected nodes in the network, that is, nodes that have lost contact with other nodes in the network for a period of time and then rejoined, need to reset their credibility values after rejoining the network. The reset credibility value should be less than the first credibility threshold and greater than the third credibility threshold. That is, the reconnected nodes in the network are configured as receiving-only nodes.
[0110] It should be noted that the node credibility consensus method provided by the present invention also includes: generating credibility table items of all nodes in the cluster based on the consensus results of credibility changes between the consensus nodes of each node group; screening trusted nodes based on the credibility table items, grouping the trusted nodes and reselecting the consensus nodes of each node group; storing the credibility table items, node grouping information and new consensus node data of each node group in the blockchain, and broadcasting the block to all trusted nodes. The characteristics of blockchain include decentralization, immutability, transparency, security and programmability. Each data block is linked to the previous block to form a continuous chain, which ensures the integrity and security of the node history.
[0111] In order to further illustrate the remarkable effect brought by the present invention, a specific control experiment is given as follows:
[0112] In order to evaluate the performance of the proposed method, OMNeT++6.03 was used for simulation, and the network was set to generate a new block every 500ms, in which the credibility changes of all nodes were recorded. The initial values of various items were set using the OMNeT initial file to simulate the tasks in the initial setting phase; in the network maintenance phase, the msg forwarding simulation transaction and block generation and forwarding, as well as the selection of consensus nodes, were set.
[0113] In the experimental comparison, the general PBFT algorithm reaches consensus among all nodes; the YPBFT algorithm randomly selects a part of the nodes as consensus nodes, and the other nodes only receive the consensus results; the LPBFT algorithm is the node credibility consensus algorithm provided by the present invention.
[0114] In the simulation experiment, the initial credibility of the node is set to 10. After the credibility drops to 5, it can only accept blocks. When the credibility drops to 0 or below, it will be identified as a malicious node and recorded in the blacklist. In the experiment, three types of malicious nodes in the network are simulated: delayed forwarding, non-forwarding, and tampering data, and the credibility changes are set to -1, -2, and -3 respectively.
[0115] In the experiment, the simulation time is set to every 500ms, and the current leader node (randomly selected from the consensus committee nodes) generates and sends a new blockchain. According to the number of malicious nodes recorded, it can be determined whether there are new malicious nodes that have been identified. The number of blocks generated during this period is used as a measure of consensus delay. The blocks required for different types of malicious nodes to be confirmed are shown in Table 2.
[0116] Table 2 The number of blocks required to confirm different types of malicious nodes
[0117]
[0118] Based on the above table, it can be seen that compared with the prior art, the node credibility consensus algorithm provided by the present invention always requires fewer blocks on average for the identification of three different types of abnormal forwarding. In other words, the consensus delay of the node credibility consensus algorithm provided by the present invention is significantly improved compared with the prior art.
[0119] In the simulation experiment, the number of transactions sent and forwarded in the network is used as a measure of the blockchain communication overhead. This experiment examines the network communication overhead during the period when the nodes in the system reach a consensus on a single malicious node. The test results are as follows: Figure 5-7 Specifically, Figure 5 In the scenario of identifying delayed forwarding nodes; Figure 6 To identify selfish nodes; Figure 7 To identify the scenario of data tampering nodes.
[0120] The number of transactions required for nodes to reach consensus on different types of malicious nodes decreases with the severity of the malicious node behavior, that is, the worse the malicious behavior, the faster it will be identified as a malicious node by the network and expelled from the network. At the same time, under the same malicious behavior and the same total number of nodes, the LPBFT algorithm always requires less sending and forwarding than the traditional PBFT algorithm and the YPBFT algorithm, which also proves the superiority of the present invention in reducing communication overhead and improving consensus efficiency.
[0121] Please refer to Figure 3 As shown, based on the same inventive concept as the aforementioned node credibility consensus method, a node credibility consensus system 300 is provided in one embodiment of the present invention, which includes: a grouping module 301, a monitoring module 302, a consensus module 303 and an update module 304.
[0122] Specifically, the grouping module 301 is used to group the nodes and elect a consensus node in each node group; the monitoring module 302 is used to enable each node to monitor the adjacent nodes in its node group, generate transaction information based on the abnormal behavior of the adjacent nodes, and send it to the consensus node in the corresponding node group, wherein the transaction information includes the node information of the abnormal behavior and the type of abnormal behavior; the consensus module 303 is used to generate the credibility change information of the node where the abnormal behavior occurs based on the transaction information, and reach a consensus on the credibility change information among the consensus nodes of each node group, and update the credibility information of each node based on the consensus result; the update module 304 is used to screen the trusted nodes based on the updated node credibility information, group the trusted nodes and reselect the consensus nodes of each node group to conduct a new round of node credibility consensus.
[0123] Please refer to Figure 4 As shown, an embodiment of the present invention further provides an electronic device 400, which includes at least one processor 401, a memory 402 (such as a non-volatile memory), a memory 403, and a communication interface 404, and the at least one processor 401, the memory 402, the memory 403, and the communication interface 404 are connected together via a bus 405. At least one processor 401 is used to call at least one program instruction stored or encoded in the memory 402, so that the at least one processor 401 performs various operations and functions of the node credibility consensus method described in various embodiments of this specification.
[0124] In an embodiment of the present specification, the electronic device 400 may include, but is not limited to, a personal computer, a server computer, a workstation, a desktop computer, a laptop computer, a notebook computer, a mobile electronic device, a smart phone, a tablet computer, a cellular phone, a personal digital assistant (PDA), a handheld device, a messaging device, a wearable electronic device, a consumer electronic device, and the like.
[0125] An embodiment of the present invention also provides a computer-readable medium, which carries computer execution instructions. When the computer execution instructions are executed by a processor, they can be used to implement various operations and functions of the node credibility consensus method described in the various embodiments of this specification.
[0126] The computer-readable medium in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device.
[0127] In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, device, or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0128] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, 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 disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0129] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatuses, systems, and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as a combination of processes and / or blocks in the flowchart and / or block diagram, 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 generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flowchart. 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.
[0130] The foregoing description of specific exemplary embodiments of the present invention is for the purpose of illustration and demonstration. These descriptions are not intended to limit the present invention to the precise form disclosed, and it is clear that many changes and variations can be made based on the above teachings. The purpose of selecting and describing the exemplary embodiments is to explain the specific principles of the present invention and its practical application, so that those skilled in the art can realize and utilize various different exemplary embodiments of the present invention and various different selections and changes. The scope of the present invention is intended to be limited by the claims and their equivalents.
[0131] It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above and that the invention can be implemented in other specific forms without departing from the spirit or essential features of the invention. Therefore, the embodiments should be considered exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description, and it is intended that all variations falling within the meaning and scope of the equivalent elements of the claims be included in the invention. Any reference numeral in a claim should not be considered as limiting the claim to which it relates.
[0132] In addition, it should be understood that although the present specification is described according to implementation modes, not every implementation mode contains only one independent technical solution. This description of the specification is only for the sake of clarity. Those skilled in the art should regard the specification as a whole. The technical solutions in each embodiment may also be appropriately combined to form other implementation modes that can be understood by those skilled in the art.
Claims
1. A node credibility consensus method, characterized in that: include: Group the nodes and elect consensus nodes in each node group; Each node monitors the adjacent nodes in its node group, generates transaction information based on the abnormal behavior of the adjacent nodes, and sends it to the consensus node in the corresponding node group. The transaction information includes the node information where the abnormal behavior occurs and the type of abnormal behavior; Generate credibility change information of the node with abnormal behavior based on the transaction information, reach consensus on the credibility change information among the consensus nodes of each node group, and update the credibility information of each node based on the consensus result; Based on the updated node credibility information, the trusted nodes are screened, the trusted nodes are grouped and the consensus nodes of each node group are reselected to conduct a new round of node credibility consensus.
2. The node credibility consensus method according to claim 1, characterized in that: Grouping nodes involves: Determine the number of node groups, and select the cluster center of each node group from the cluster one by one; the first selected cluster center is any node in the cluster, and the Nth selected cluster center is the node in the cluster with the largest sum of distances to the selected N-1 cluster centers, where N is a positive integer greater than or equal to 2; Based on each of the cluster centers, the trusted nodes in the cluster are clustered to form a plurality of node groups.
3. The node credibility consensus method according to claim 1, characterized in that: The method further comprises: Obtain the mean of the spatial positions of each node in the node group, and select the node closest to the spatial position corresponding to the mean as the central node of the node group; Based on the distance to the central node, a value is assigned to the nodes in the node group where the central node is located, and the distance to the central node is proportional to the size of the node value assigned.
4. The node credibility consensus method according to claim 3 is characterized in that: Select the consensus nodes of each node group, including: Calculate the node score based on the size of the node assignment, the updated credibility of each node, and the number of times each node serves as a consensus node; In the first round of node consensus, the consensus node of the corresponding node group is selected based on the node assignment; In non-first-round node consensus, the consensus nodes of the corresponding node group are selected based on the node score.
5. The node credibility consensus method according to claim 4, characterized in that: The scoring formula is: score=α×TVal-β×DisScore-γ×Cnt Among them, size(Gi) is the number of nodes in the node group Gi; num is the node value assigned based on the distance from the node to the central node; score is the score of the node; TVal is the credibility of the node; Cnt is the number of times the node serves as a consensus node; DisScore is the size of the node assignment; α, β, γ are the preset weight values.
6. The node credibility consensus method according to claim 1, characterized in that: The method further comprises: Record the number of nodes that report transaction information on the same suspicious node; If the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is greater than or equal to a preset verification threshold, the transaction information corresponding to the suspicious node is credible; If the ratio of the reported number of nodes to the total number of nodes in the corresponding node group is less than a preset verification threshold, the transaction information corresponding to the suspicious node is unreliable.
7. The node credibility consensus method according to claim 6, characterized in that: The method further comprises: Set up a preliminary consensus node in each node group; If it is detected that a consensus node of a node group has abnormal forwarding behavior, the transaction information corresponding to the abnormal forwarding behavior of the consensus node is sent to the standby consensus node of the same node group; If the transaction information corresponding to the abnormal forwarding behavior of the consensus node is credible, the preliminary consensus node initiates a consensus node change consensus to other nodes in the node group; Based on the consensus results, new consensus nodes are selected.
8. The node credibility consensus method according to claim 1, characterized in that: The screening of trusted nodes includes: If the node credibility is greater than or equal to a preset first credibility threshold, the node is a fully trusted node; If the node credibility is less than a preset first credibility threshold and greater than or equal to a preset second credibility threshold, the node is a receiving-only node, which does not participate in consensus node election and cannot report transaction information; the trusted nodes include fully trusted nodes and receiving-only nodes; If the node credibility is less than a preset third credibility threshold, the node is a blacklist node.
9. The node credibility consensus method according to claim 8, characterized in that: The method further comprises: Generate a credibility table entry for all nodes in the cluster based on the consensus result of credibility change between the consensus nodes of each node group; Filter the trusted nodes based on the credibility table items, group the trusted nodes and reselect the consensus nodes of each node group; The credibility table items, node grouping information, and new consensus node data of each node group are stored in the blockchain, and the block is broadcast to all trusted nodes.
10. The node credibility consensus method according to claim 1, characterized in that: Each node monitors the forwarding status of adjacent nodes in the node group, including: Parse the generation time of the information sent by the adjacent nodes in the same node group and the timestamp of receiving the information to determine whether the sending node has delayed forwarding behavior; Verify the content of the information received from the adjacent nodes in the same node group to determine whether the sending node has tampered with the information; Create a first table entry that records adjacent nodes in the same group and a second table entry that records nodes that send information to the current node; compare the first table entry and the second table entry at preset time intervals and reset the first table entry and the second table entry, and determine whether there is an act of not forwarding information based on the comparison result.
Citation Information
Patent Citations
Packet forwarding method and system with low storage overhead
CN109889449A
Block chain node consensus method and device, equipment and medium
CN115314369A
Distributed underwater acoustic positioning method and network based on credible propagation of information elements of communication nodes
CN115914995A
Transaction processing method and device based on block chain, equipment and medium
CN116957792A
Data-interoperability-oriented trusted processing method and system
US20210126867A1