CN114449476A - Block link point consensus method for safety communication in Internet of vehicles - Google Patents

Block link point consensus method for safety communication in Internet of vehicles Download PDF

Info

Publication number
CN114449476A
CN114449476A CN202210176217.2A CN202210176217A CN114449476A CN 114449476 A CN114449476 A CN 114449476A CN 202210176217 A CN202210176217 A CN 202210176217A CN 114449476 A CN114449476 A CN 114449476A
Authority
CN
China
Prior art keywords
node
nodes
group
consensus
voting
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210176217.2A
Other languages
Chinese (zh)
Inventor
王强
徐少毅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jiaotong University
Original Assignee
Beijing Jiaotong University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jiaotong University filed Critical Beijing Jiaotong University
Priority to CN202210176217.2A priority Critical patent/CN114449476A/en
Publication of CN114449476A publication Critical patent/CN114449476A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/30Services specially adapted for particular environments, situations or purposes
    • H04W4/40Services specially adapted for particular environments, situations or purposes for vehicles, e.g. vehicle-to-pedestrians [V2P]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W24/00Supervisory, monitoring or testing arrangements
    • H04W24/02Arrangements for optimising operational condition
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/06Optimizing the usage of the radio link, e.g. header compression, information sizing, discarding information
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W28/00Network traffic management; Network resource management
    • H04W28/02Traffic management, e.g. flow control or congestion control
    • H04W28/08Load balancing or load distribution
    • H04W28/09Management thereof
    • H04W28/0958Management thereof based on metrics or performance parameters
    • H04W28/0967Quality of Service [QoS] parameters
    • H04W28/0983Quality of Service [QoS] parameters for optimizing bandwidth or throughput
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W84/00Network topologies
    • H04W84/02Hierarchically pre-organised networks, e.g. paging networks, cellular networks, WLAN [Wireless Local Area Network] or WLL [Wireless Local Loop]
    • H04W84/10Small scale networks; Flat hierarchical networks
    • H04W84/12WLAN [Wireless Local Area Networks]

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a block link point consensus method for safety communication in a vehicle networking system. The method comprises the following steps: dividing all nodes into a plurality of groups by improving a K-means grouping algorithm, and selecting one node as an initial clustering center when each group is iterated for the first time; a voting mechanism is introduced to score the performance of each node in each group, the better the performance, the higher the node score, the comprehensive evaluation is carried out in each group based on the node score and the distance, and a main node is selected; and performing rotation query in each group, and when a certain group is queried, if a request exists in the group, performing consensus process on each node in the group through a PBFT algorithm, wherein nodes of other groups except the main node do not participate in the consensus process. The method of the invention provides an innovative consensus node grouping algorithm, and ensures the dynamic property of the system. By reducing the number of nodes participating in the consensus process, the time delay required for generating an effective block once is reduced, the throughput is improved, and the communication overhead is reduced.

Description

Block link point consensus method for safety communication in Internet of vehicles
Technical Field
The invention relates to the technical field of block chain consensus, in particular to a block chain link point consensus method for safety communication in a vehicle networking system.
Background
With the advent of 5G, an "everything interconnected" era will be opened. The Internet of Vehicles (IoV) is not only an important branch of the Internet of things in the field of transportation, but also an important typical representative application of an intelligent transportation system in the Internet of things. IoV will make possible the advent of networked and autonomous automobiles. In this mode, the vehicle will be able to communicate with everything in its environment, including pedestrians, communication infrastructure, transportation equipment, etc. With the rapid construction and development of modern intelligent transportation and smart cities, the role played by the internet of vehicles is increasingly important. However, the security problem of user information transmission in the car networking brings great challenges to the development of the car networking and the automatic driving. First, since the information disseminated by the vehicle user relates to the privacy of the user and to critical messages, it would be irreparable lost if manipulated and tampered with by a malicious user. Secondly, the difficulty of tracing important data of a user is also a great obstacle influencing the development of the internet of vehicles, if all activities of the vehicles can be verified, the user sending information must be responsible for the behaviors of the vehicles, and therefore the safety of the operation environment of the internet of vehicles is greatly improved. The emerging Block Chain technology (Block Chain, BC) has the characteristics of decentralization, tamper resistance, traceability and the like, can realize safe transmission among strange nodes without depending on a trusted third party, and can provide a solution for 5G car networking safety data sharing.
The block chain can be mainly divided into: private chains, public chains, and federation chains. The three have different openness degrees and are applied to different scenes. The private chain is opened for a single person or entity, and only failures caused by the nodes and network reasons are considered, but the condition that malicious nodes exist in the set is not considered. The public chain belongs to the chain with the highest depocenter degree, the most important chain is bitcoin, Ether Fang and the like, the public chain allows each participant to view information on the chain, and the main consensus algorithm is workload Proof (Proof of Work, PoW), rights and interests Proof (Proof of Stake, PoS) and authorized shares Proof (Delegated Proof of Stake, DPoS). The federation chain is a chain directly constructed by a certain number or size of organizations and institutions in a federation form, and is open only to specific organizations and institutions. One of the most common consensus computing methods in the federation chain is the Practical Byzantine Fault Tolerance Protocol (PBFT), and the PBFT consensus algorithm ensures that the information consistency is maintained when the information is transmitted by distributed nodes, but in order to pursue complete decentralization, all nodes except the client nodes in the system participate in the consensus process, and in one round of consensus process, the time complexity is O (n2), n is the number of nodes participating in the consensus, and as the number of nodes increases, the time required for achieving the consensus increases greatly, so the method can only be used in scenes with a small number of nodes.
The PBFT algorithm is used to process and solve the problem of the byzantine general. The problem of the byzantine general is mainly described by how to deliver messages to troops in the case of traitors to achieve consistent behavior among troops, i.e., the PBFT has the capability of making the system still work and operate in the case where some malicious nodes exist on the system and constantly send error information. The consistency problem is the most basic problem or the most important problem for the distributed field, and the consensus algorithm solves the problem of how to reach the consistency agreement in the distributed system. The master node, the slave nodes and the view are three important components in the operation process of the PBFT algorithm. The master node and the slave nodes are responsible for different processes, the master node is a starting end for algorithm operation, and the master node collects and sorts the received requests; the slave node runs the algorithm, and when the slave node receives the request, the algorithm is run so as to ensure the effectiveness of the algorithm; all nodes execute requests under the same view, and when a master node fails, an attempt to change the current master node is made. For the PBFT algorithm, in addition to supporting fault-tolerant failure nodes, fault-tolerant rogue nodes also need to be supported. For example, assuming that the number of node clusters is n, the number of malicious nodes is f, so that the master node determines whether the replies of n-f nodes are correct or incorrect, and in the worst case, if f malicious nodes exist in the n-f nodes, the master node needs to determine whether the replies of n-2f nodes are correct or incorrect, and since most of the malicious nodes are successful, the master node can correctly determine only when n-2f > f, so that the total number n of nodes needs to be greater than 3f +1 to make the system reach the consistency, that is, the PBFT algorithm can tolerate the damage of (n-1)/3 illegal nodes at most.
As a developing technology, a block chain still has difficulty in meeting the requirement of 5G internet of vehicles data sharing in terms of performance and safety, and the existing PBFT consensus algorithm has several disadvantages:
(1) the expandability is poor, and the large-scale data sharing requirement of the 5G car networking is difficult to meet;
(1) the consensus efficiency is low, and the real-time and efficient data sharing requirements of the 5G Internet of vehicles are difficult to meet;
(2) the security is not enough, is difficult to satisfy the data sharing demand of 5G car networking privacy security.
The consensus algorithm, as a core technology of modern block chains, determines the practical application and scene of the block chain, and in recent years, in the block chain technology development trend, security, privacy and performance have become important focuses of block chain technology research. However, in the scenario of internet of vehicles, there is little research on reducing consensus time delay and reducing communication overhead. At present, the consensus algorithm is difficult to meet strict constraints on time delay in the car networking scene, and therefore, how to provide a block chain consensus algorithm to meet the car networking application scene is a problem to be solved urgently.
Disclosure of Invention
The embodiment of the invention provides a block chain link point consensus method for safety communication in an internet of vehicles, which is designed to ensure the safety of communication and meet the requirement of low time delay based on a block chain system in the scenes of the internet of vehicles such as 5G.
In order to achieve the purpose, the invention adopts the following technical scheme.
A block link point consensus method for secure communication in a vehicle networking, comprising:
dividing all nodes into a plurality of groups by improving a K-means grouping algorithm, and selecting one node as an initial clustering center when each group is iterated for the first time;
a voting mechanism is introduced to score the performance of each node in each group, the better the performance, the higher the node score, the comprehensive evaluation is carried out in each group based on the node score and the distance, and a main node is selected;
and performing alternate query in each group, and when a certain group is queried, if a request exists in the group, performing a consensus process on each node in the group through a practical Byzantine fault-tolerant Protocol (PBFT) algorithm, wherein nodes of other groups except the main node do not participate in the consensus process and are in an idle period.
Preferably, the dividing all the nodes into a plurality of groups by improving the grouping algorithm of K-means, and selecting a node as an initial clustering center when each group is iterated for the first time includes:
assuming that a set formed by all nodes is D, firstly providing an initial node set U and initializing m groups;
step (2) randomly selects a node as a clustering center C for the group k (k is 1, …, m)k
Step (3) calculating a clustering center CkAverage value d of distances from nodes in set UcAs a threshold radius;
step (4) judging that the node i (i belongs to D/U) in the set D to the clustering center CkDistance d ofiDetermining the distance diAnd a threshold radius dcIf d is a magnitude relation ofiIs less than dcIf yes, the node j is classified as the current group k;
step (5) updating the clustering center of the group k, and taking the centroid of the group element as the center C of the next iterationk
Step (6) traversing each group in turn, and repeatedly executing the steps (2) - (5) until a termination condition is met;
and (7) if the nodes in the set D are not classified into any group, calculating the distances from the nodes to the centers of the groups one by one aiming at the nodes, and taking the group with the minimum distance as a node grouping result.
Preferably, the method further comprises: when the number of nodes in the system changes, the system does not need to be restarted, and the nodes are automatically grouped according to the processing process of the improved K-means grouping algorithm.
Preferably, the joining or exiting of the node needs to be performed in an idle period of the node, for the node which wants to join, the node is firstly allocated to the group with the shortest distance through the improved K-means grouping algorithm, and when the group is in the idle period, the group is recorded in a group node list; for the node which wants to quit, firstly, an application is made to the system, and after the application is passed, the node is deleted from the small group node list when the small group where the node is located is in an idle period.
Preferably, the voting mechanism is introduced to score the performance of each node in each group, the better the performance of each node is, the higher the node score is, the node score and the distance in each group are comprehensively evaluated to select a master node, which includes:
all nodes in each group are divided into: the main node and the voting nodes are generated by electing from the preparation nodes, a total of a preparation nodes are assumed to be in a group, b voting nodes and one main node are required to be selected from the a preparation nodes when one round of consensus starts, the voting nodes have voting weights, the performance of the previous round of consensus process of the preparation nodes is voted, a plurality of preparation nodes with higher scores are selected as preferred nodes, the average distance from each preferred node to each other group is calculated, the score and the average distance of each preferred node are comprehensively evaluated, and the node with the best comprehensive evaluation is selected as the main node;
the production node is responsible for the packaging transaction and generates the data block.
Preferably, the voting mechanism is introduced to score the performance of each node in each group, the better the performance of each node is, the higher the node score is, the node score and the distance in each group are comprehensively evaluated to select a master node, which specifically includes:
step 1, voting and scoring other nodes by voting nodes in each group according to the expression of nodes in the previous round of consensus process, and selecting n (b +1< n < a) nodes before the node with the highest score as high-quality nodes;
the rules for voting are as follows: firstly, if the last round of consensus process is selected as a main node, adding two points; the master node is good in performance, an effective data block is generated, and one point is added, or one point is reduced; if the previous round is a voting node, adding one minute; the consensus process works well, plus one minute, otherwise minus one minute. Thirdly, the previous round is a preparation node without adding a score; the consensus process works well, plus one minute, otherwise minus one minute. The node score is recorded as s;
step 2, calculating g1Preferred nodes in a group to group set g2,g3,...,gmMean value d of distances of all nodes in each groupa1And calculating the comprehensive evaluation of the node j:
Rj=α1*s+α2*da1
α1and alpha2Is a weight coefficient;
and 3, sorting the node scores in a descending order, selecting the first b +1 nodes with the highest evaluation, and putting the nodes into a set D ═ n1,n2,…,nb+1};
Step 4, for G ═ G1,g2,...,gmPutting the first element in the D into a main node set P as g1The main nodes in the group and other elements are put into a voting node set V;
step 5, traversing the group set { g in sequence2,g3,...,gmRepeatedly executing the processing procedures of the step 1 to the step 4; and (4) until m nodes exist in the main node set P, namely, m main nodes are selected from the m small groups, and the selection process is ended.
Preferably, the internet of vehicles comprises: 5G car networking.
It can be seen from the technical solutions provided by the embodiments of the present invention that the method of the embodiments of the present invention provides an innovative consensus node grouping algorithm, and when the number of nodes in the system changes, the system does not need to be restarted, and node grouping is performed automatically, thereby ensuring the dynamic performance of the system. And a voting mechanism is introduced to score the expression of the consensus nodes, the better the expression, the higher the node score, the risk of node malignancy is reduced, and the safety of the system is improved. The main node and the group node where the request is located jointly form a consensus node, and the number of nodes participating in the consensus process is reduced, so that the time delay required for generating an effective block once is reduced, the throughput is improved, and the communication overhead is reduced.
Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a GEPBFT consensus process according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a process of improving a grouping algorithm in a K-means grouping algorithm according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating the grouping result according to an embodiment of the present invention;
fig. 4 is a flowchart of a master node election algorithm according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the accompanying drawings are illustrative only for the purpose of explaining the present invention, and are not to be construed as limiting the present invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof. It will be understood that when an element is referred to as being "connected" or "coupled" to another element, it can be directly connected or coupled to the other element or intervening elements may also be present. Further, "connected" or "coupled" as used herein may include wirelessly connected or coupled. As used herein, the term "and/or" includes any and all combinations of one or more of the associated listed items.
It will be understood by those skilled in the art that, unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs. It will be further understood that terms, such as those defined in commonly used dictionaries, should be interpreted as having a meaning that is consistent with their meaning in the context of the prior art and will not be interpreted in an idealized or overly formal sense unless expressly so defined herein.
For the convenience of understanding the embodiments of the present invention, the following description will be further explained by taking several specific embodiments as examples in conjunction with the drawings, and the embodiments are not to be construed as limiting the embodiments of the present invention.
The embodiment of the invention is improved on the basis of the traditional PBFT algorithm, and provides a block link point consensus method (mechanism) for safety communication in the Internet of vehicles, which comprises the following steps:
(1) the method comprises the steps of dividing all common nodes into G groups by innovatively improving a K-means grouping algorithm, selecting G nodes as clustering center nodes, and then distributing each common node to the nearest clustering center by calculating the distance between each common node and each clustering center. Conventional PBFTs are only suitable for use in systems where nodes are fixed, and when network nodes change dynamically, the system must be restarted and reconfigured to accommodate the changed system. By using the K-means clustering algorithm, when the number of nodes in the system changes, the system does not need to be restarted, and the nodes are automatically grouped, so that the dynamic property of the system is ensured.
(2) After the nodes are divided into the G groups, the voting nodes in each group vote and score the preliminary nodes according to the member reputation evaluation according to the performance of the nodes in the previous round of consensus process, and the nodes with high scores are selected as the preferred nodes. Second, a master node is selected in each set of preferred nodes based on distance. The consensus process will first take place within the polling group and then between the master nodes. Therefore, the number of times of consensus process is reduced on the basis of reducing the scale of the consensus node, the time complexity is changed from O (n2) to O (n), the communication delay is reduced, and the throughput is improved. Meanwhile, through the selection of the main node, the production nodes with good performance can obtain certain remuneration and reward, so that the production nodes are stimulated to work more honestly and reliably, and the risk of the nodes doing harm is reduced.
The conventional PBFT algorithm consensus process needs the common participation of all consensus nodes in a network, a large amount of point-to-point communication exists, the common negotiation is consistent, communication resources are greatly occupied, and particularly, the communication delay is increased.
The invention provides a grouping and Election-Based PBFT (generalized electric Based reactive inductance tool) system, which comprises common nodes and common identification nodes, wherein the common nodes do not participate in a common identification process, and only the common identification nodes participate in the common identification process. Compared with the traditional PBFT algorithm, the system overhead required by the nodes for consensus is omitted.
The GEPBFT consensus process flow chart based on the improved K-means algorithm provided by the embodiment of the invention is shown in figure 1, and the specific implementation flow is as follows:
(1) grouping nodes: and grouping the initial consensus nodes according to a modified K-means algorithm.
(2) And (3) master node election: and for each group, determining the main node by using a main node election method based on reputation evaluation.
(3) Group consensus: determining the common block production master nodes in the round by adopting a rotation query mode, performing rotation query by the system according to the group number, when a certain group is queried, if a request exists in the group, forming common node by the nodes in the group and the master nodes together, and executing a PBFT algorithm to perform common identification until the next time the request in the other group is queried in a rotation manner; and if a group is inquired and no request exists in the group, skipping the group, and continuing to rotate and inquire according to the group number until the group with the request is inquired.
(4) The block production master node sends a broadcast message to other master nodes in preparation for starting master node consensus.
(5) And (3) common identification of the main nodes: and further executing a PBFT algorithm between the selected main nodes for consensus.
(6) Each master node sends broadcast messages to the other nodes in the group.
(7) Verification within the group: after receiving the packaged message from the group of main nodes, the nodes of each group verify the digital signature of the packaged message, execute the request content after successful verification, and then update the account book information of the local block chain by each node to ensure the consistency of data.
The realization of the GEPBFT consensus process lies in the realization of two key algorithms, namely a grouping algorithm based on improved K-means and a main node selection algorithm based on reputation evaluation, and the specific realization principle of the two algorithms is described below.
1. Grouping algorithm based on improved K-means:
in the information propagation process, the delay is related to the propagation distance and the propagation speed, and in an actual network, the distance is an important factor influencing the propagation delay. In practice, most node positions do not change much in a short time, so that the distance between two nodes at any time can be approximately regarded as the distance between the nodes in a fixed period. Based on the hypothesis, a grouping algorithm is designed, nodes with close distances in a fixed time period in the system are divided into a group, the positions of the nodes are allowed to change slightly, and a plurality of groups led by a plurality of main nodes are formed after the main node selection algorithm, so that the algorithm reduces the communication time delay of information transmission between the nodes by reducing the communication distance.
Assuming that a set formed by all nodes is D, for convenience of calculation, an initial node set U needs to be provided first, since the cost required for calculating a distance matrix for a large number of nodes is huge, an initial node set with fewer nodes is needed, the nodes in the initial set U are grouped first to reduce the cost required for calculating the distance matrix, and for nodes which are not grouped or will be added in the future, which group is to be added can be determined according to grouping information, fig. 2 is a processing flow chart of a grouping algorithm in a grouping algorithm for improving K-means provided by an embodiment of the present invention, and specific algorithm steps are as follows:
1) m packets are initialized.
2) Randomly selecting nodes as a clustering center C for a subgroup k (k 1, …, m)k
3) Calculating a clustering center CkAverage value d of distances from nodes in set UcAs the threshold radius.
4) Judging the distance D from the node i (i belongs to D/U) in the set D to the clustering center CiAnd a threshold radius dcIf d is a magnitude relation ofiIs less than dcThen node j is assigned to the current group.
5) Updating the cluster center of the group, and taking the mass center of the group element as the center C of the next iterationk
6) And sequentially traversing each group, and repeatedly executing the steps 3-5. Until a termination condition (maximum number of iterations, minimum error variation) is met.
7) If there are nodes in the set D that are not classified in any one subgroup. For the nodes, the distances from the nodes to the centers of the groups need to be calculated one by one, and the group with the minimum distance is taken as a node grouping result.
The idea of the grouping algorithm is that all nodes are placed in a two-dimensional plane, each central node is taken as a circle center, a threshold radius is taken as a circle radius to draw a circle, namely m circles are drawn in the whole two-dimensional plane, and the m circles do not have overlapped parts, so that the nodes in the circles are divided into uniform groups, and thus the grouping of m groups is completed. Because m circles do not overlap with each other, nodes not included in any circle exist in the two-dimensional plane, and for the nodes not included, the nodes are grouped, and it is necessary to calculate the distances from the nodes to each central node one by one, calculate the minimum distance, and classify the nodes into corresponding groups. Fig. 3 is a diagram illustrating a grouping result according to an embodiment of the present invention.
The algorithm allows nodes to join or leave dynamically, taking into account the dynamics of the system. The consensus node participating in the consensus process is formed by the main node and the nodes of the group where the current request node is located, the nodes of other groups except the main node do not participate in the consensus process, the group is in an idle period in the previous consensus process, and the change of the nodes in the idle period does not influence the consensus process, so that the node addition or the node withdrawal needs to be carried out in the idle period. For a node which wants to join, the node is firstly distributed to a group with the shortest distance through a grouping algorithm, and then the group is recorded in a group node list when waiting for the group to be in an idle period; for a node which wants to quit, firstly, an application is made to the system, and after the application is passed, the node is deleted from the small group node list when the small group where the node is located is in an idle period; if the exited node wants to join again, the node joining process needs to be repeated, the distance from the node to each central node is recalculated, the minimum value is selected, and the minimum value is added into the group node list again.
2. The main node selection algorithm based on reputation evaluation comprises the following steps:
after the initial node is subjected to the grouping processing, m small groups are obtained, and m nodes which are close in distance and excellent in performance are selected from the m small groups as the main nodes by the main node selection algorithm. Thus, the message propagation delay of the main node consensus phase can be reduced. Meanwhile, the safety of the system is considered, the node consensus process performance is considered, and the condition that the main node fails or is a Byzantine node is effectively avoided.
Within each group are three types of nodes: a master node (production node), a preparation node and a voting node. Wherein the production node and the voting node are elected from the preparation node. Assuming that there are a total of a nodes (preparation nodes) in the group, a round of consensus begins by selecting b (b < a) voting nodes and a master node. And the voting nodes have voting right, vote and score the performance of the preparation nodes in the previous round of consensus process, and select the node with higher score as the preferred node. Then, the average distance from each preferred node to other subgroups is calculated, and the node with the best comprehensive evaluation (consensus process performance, average distance) is selected as the production node. The production node is responsible for the packaging transaction and generates the data block. Well-behaved production nodes will receive a corresponding reward, which will help them to work more honestly and reliably.
Fig. 4 is a flowchart of a master node election algorithm provided in the embodiment of the present invention, and the specific implementation flow is as follows:
1) and (4) voting the other nodes by the voting nodes in each group according to the expression of the nodes in the previous round of consensus process, and selecting n (b +1< n < a) nodes before the node with the highest score as high-quality nodes. The rules for voting are as follows: firstly, if the consensus process in the previous round is selected as a production node, adding two points; becomes a production node and performs well, produces an effective data block, and adds one more, otherwise, reduces one less. If the previous round is a voting node, adding one minute; the consensus process is good (no malicious operations such as tampering, deleting data and the like), one point is added, and otherwise, one point is subtracted. Thirdly, preparing nodes (non-production nodes) in the previous round without adding points; the consensus process works well, plus one minute, otherwise minus one minute. The node score is denoted as s.
2) Calculate g1Preferred preliminary nodes in the group to g2,g3,...,gmMean distance d of all nodes in each groupa1And calculating the comprehensive evaluation of the node j:
Rj=α1*s+α2*da1
α1and alpha2Are the weight coefficients.
3) Sorting the node scores in descending order, selecting the first b +1 nodes with the highest evaluation, and putting the nodes into a set D ═ n1,n2,…,nb+1}。
4) For G ═ G1,g2,...,gmPutting the first element in the D into a main node set P as g1Production nodes in the group. Other elements are put into the voting node set V.
5) For g2Repeating the step 1 to obtain preferred preparation nodes, calculating the distances from the preferred nodes in the group to the master node set P, and calculating the distance average value da2
6) Calculating the node score:
R2=β1*s+β2*da2
β1and beta2Also a weight coefficient.
7) And repeating the steps 3-4. Thus, g can be obtained2A production node and a voting node.
8) The step of selecting the main node by other groups is the same as that of g2And grouping until m nodes exist in the main node set, namely selecting m main nodes from the m small groups, and ending the selection process.
In summary, the advantages and positive effects of the embodiments of the present invention are as follows:
1) based on the idea of K-means algorithm, an innovative consensus node grouping algorithm is provided. When the number of nodes in the system changes, the system does not need to be restarted, and the nodes are automatically grouped, so that the dynamic property of the system is ensured.
2) And (3) a voting mechanism is introduced to score the consensus node performance, the better the performance, the higher the node score, and the higher the probability of becoming a production node (master node) in the next round of consensus. In addition, the production nodes with good performance can obtain certain remuneration and reward, so that the production nodes are stimulated to work more honestly and reliably, the risk of node cheating is reduced, and the safety of the system is improved.
3) One main node is selected from each group based on consensus expression and distance, consensus nodes are formed by the main nodes and the small group nodes where the requests are located, and by means of the method for reducing the number of the nodes participating in the consensus process, time delay required for generating an effective block once is reduced, throughput is improved, communication overhead is reduced, and the requirement of low time delay based on a block chain system in the car networking scenes such as 5G is met.
Those of ordinary skill in the art will understand that: the figures are merely schematic representations of one embodiment, and the blocks or flow diagrams in the figures are not necessarily required to practice the present invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for apparatus or system embodiments, since they are substantially similar to method embodiments, they are described in relative terms, as long as they are described in partial descriptions of method embodiments. The above-described embodiments of the apparatus and system are merely illustrative, and the units described as separate parts may or may not be physically separate, and the parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the preferred embodiment of the present invention, but the scope of the present invention is not limited thereto, and any changes or substitutions that can be easily conceived by those skilled in the art within the technical scope of the present invention are included in the scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (7)

1. A block link point consensus method for secure communication in a vehicle networking, comprising:
dividing all nodes into a plurality of groups by improving a K-means grouping algorithm, and selecting one node as an initial clustering center when each group is iterated for the first time;
a voting mechanism is introduced to score the performance of each node in each group, the better the performance, the higher the node score, the comprehensive evaluation is carried out in each group based on the node score and the distance, and a main node is selected;
and performing alternate query in each group, and when a certain group is queried, if a request exists in the group, performing a consensus process on each node in the group through a practical Byzantine fault-tolerant Protocol (PBFT) algorithm, wherein nodes of other groups except the main node do not participate in the consensus process and are in an idle period.
2. The method of claim 1, wherein the dividing of all nodes into groups by improving the K-means grouping algorithm, and selecting a node as an initial clustering center in a first iteration of each group comprises:
assuming that a set formed by all nodes is D, firstly providing an initial node set U and initializing m groups;
step (2) randomly selects a node as a clustering center C for the group k (k is 1, …, m)k
Step (3) calculating a clustering center CkAverage value d of distances from nodes in set UcAs a threshold radius;
step (4) judging that the node i (i belongs to D/U) in the set D to the clustering center CkDistance d ofiDetermining the distance diAnd a threshold radius dcIf d is a magnitude relation ofiIs less than dcIf yes, the node j is classified as the current group k;
step (5) performing replacement on the clustering centers of the subgroup kNew, the centroid of the subgroup element is taken as the center C of the next iterationk
Step (6) traversing each group in turn, and repeatedly executing the steps (2) - (5) until a termination condition is met;
and (7) if the nodes in the set D are not classified into any group, calculating the distances from the nodes to the centers of the groups one by one aiming at the nodes, and taking the group with the minimum distance as a node grouping result.
3. The method of claim 1, further comprising: when the number of nodes in the system changes, the system does not need to be restarted, and the nodes are automatically grouped according to the processing process of the improved K-means grouping algorithm.
4. The method according to claim 1, wherein the joining or exiting of the node needs to be performed in an idle period of the node, and for the node which wants to join, the node is firstly allocated to the group with the shortest distance by the above improved K-means grouping algorithm, and when the group is in the idle period, the group is recorded in a group node list; for the node which wants to quit, firstly, an application is made to the system, and after the application is passed, the node is deleted from the small group node list when the small group where the node is located is in an idle period.
5. The method according to any one of claims 1 to 4, wherein the introducing voting mechanism scores the performances of the nodes in each group, the better the performances, the higher the node scores, and the comprehensive evaluation is performed in each group based on the scores and the distances of the nodes to select a master node, comprising:
all nodes in each group are divided into: the method comprises the steps that a main node, a preparation node and voting nodes are elected from the preparation nodes, a total a preparation nodes are assumed to be arranged in a group, b voting nodes and one main node need to be elected from the a preparation nodes when one round of consensus starts, the voting nodes have voting weights, the performance of the preparation nodes in the last round of consensus process is voted, a plurality of preparation nodes with higher scores are elected to be used as preferred nodes, the average distance from each preferred node to each other group is calculated, the score and the average distance of each preferred node are comprehensively evaluated, and the node with the best comprehensive evaluation is selected to be used as the main node;
the production node is responsible for the packaging transaction and generates the data block.
6. The method according to claim 5, wherein the introducing voting mechanism scores the performance of each node in each group, the better the performance of each node is, the higher the node score is, and the comprehensive evaluation is performed in each group based on the node score and the distance to select a master node, which specifically comprises:
step 1, voting and scoring other nodes by voting nodes in each group according to the expression of nodes in the previous round of consensus process, and selecting n (b +1< n < a) nodes before the node with the highest score as high-quality nodes;
the rules for voting are as follows: firstly, if the last round of consensus process is selected as a main node, adding two points; the master node is good in performance, an effective data block is generated, and one point is added, or one point is reduced; if the previous round is a voting node, adding one minute; the consensus process works well, plus one minute, otherwise minus one minute. Thirdly, the previous round is a preparation node without adding a score; the consensus process works well, plus one minute, otherwise minus one minute. The node score is recorded as s;
step 2, calculating g1Preferred nodes in a group to group set g2,g3,...,gmMean distance d of all nodes in each groupa1And calculating the comprehensive evaluation of the node j:
Rj=α1*s+α2*da1
α1and alpha2Is a weight coefficient;
and 3, sorting the node scores in a descending order, selecting the first b +1 nodes with the highest evaluation, and putting the nodes into a set D ═ n1,n2,…,nb+1};
Step 4, for G ═ G1,g2,...,gmPutting the first element in the D into a main node set P as g1The main nodes in the group and other elements are put into a voting node set V;
step 5, traversing the group set { g in sequence2,g3,...,gmRepeatedly executing the processing procedures of the steps 1 to 4; and (4) until m nodes exist in the main node set P, namely, m main nodes are selected from the m small groups, and the selection process is ended.
7. The method of claim 1, wherein the network of vehicles comprises: 5G car networking.
CN202210176217.2A 2022-02-24 2022-02-24 Block link point consensus method for safety communication in Internet of vehicles Pending CN114449476A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210176217.2A CN114449476A (en) 2022-02-24 2022-02-24 Block link point consensus method for safety communication in Internet of vehicles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210176217.2A CN114449476A (en) 2022-02-24 2022-02-24 Block link point consensus method for safety communication in Internet of vehicles

Publications (1)

Publication Number Publication Date
CN114449476A true CN114449476A (en) 2022-05-06

Family

ID=81372792

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210176217.2A Pending CN114449476A (en) 2022-02-24 2022-02-24 Block link point consensus method for safety communication in Internet of vehicles

Country Status (1)

Country Link
CN (1) CN114449476A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115473895A (en) * 2022-09-01 2022-12-13 北京大数据先进技术研究院 Digital object warehouse node consensus group division method and device under ubiquitous environment
CN115829597A (en) * 2023-02-21 2023-03-21 中国标准化研究院 Chain linking method of food traceability information and food traceability system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115473895A (en) * 2022-09-01 2022-12-13 北京大数据先进技术研究院 Digital object warehouse node consensus group division method and device under ubiquitous environment
CN115473895B (en) * 2022-09-01 2023-09-12 北京大数据先进技术研究院 Method and device for dividing digital object warehouse node consensus groups under ubiquitous environment
CN115829597A (en) * 2023-02-21 2023-03-21 中国标准化研究院 Chain linking method of food traceability information and food traceability system
CN115829597B (en) * 2023-02-21 2023-08-08 中国标准化研究院 Food tracing information uplink method and food tracing system

Similar Documents

Publication Publication Date Title
CN109447795B (en) Byzantine consensus method supporting rapid achievement of final confirmation
Yun et al. DQN-based optimization framework for secure sharded blockchain systems
CN111311414A (en) Block chain multi-party consensus method based on consistent hash algorithm
CN110113388A (en) A kind of method and apparatus of the block catenary system common recognition based on improved clustering algorithm
CN114449476A (en) Block link point consensus method for safety communication in Internet of vehicles
JP2020048195A (en) Method for establishing agreement between nodes in block chain network, block chain system configured using distributed network of plural nodes, and method for establishing agreement between nodes to be executed using processor in block chain system
CN111682942B (en) Binary weighted Byzantine fault-tolerant consensus method applied to license chain
CN112540926A (en) Resource allocation fairness federal learning method based on block chain
CN113141414B (en) Grouped multi-chain asynchronous consensus method for block chain nodes in CNFS protocol
CN113395363A (en) Data processing method, device and equipment based on block chain and storage medium
CN112468255B (en) Block link point time synchronization method based on network consensus and VRF algorithm
CN111935207A (en) Block chain system consensus method based on improved C4.5 algorithm
CN115633035B (en) Improved PBFT (physical layer transmission) based block chain consensus algorithm for Internet of things
RU2706459C1 (en) Method of single coordinated decision making in distributed computer system
CN114503143A (en) Unifying protocol consensus
CN111798234B (en) Lightweight block chain system and construction method
CN116094721A (en) Clustering-based extensible shard consensus algorithm
CN115796261A (en) Block chain-based lightweight group consensus federated learning method
CN114861211A (en) Meta-universe scene-oriented data privacy protection method, system and storage medium
CN108648076B (en) Method and system for electing common node and generating node information table
CN111046439A (en) Intelligent contract task verifiable method and system based on block chain
CN110545261A (en) Consensus algorithm applied to block chain network
WO2022183518A1 (en) Cloud-computing-oriented high-performance blockchain architecture method
CN114297680B (en) Block chain cross-chain consensus method and system for Internet of things environment
CN115883578A (en) 5G power network node trust management method based on block chain technology

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination