Device for block chain link point deployment and election

文档序号:195957 发布日期:2021-11-02 浏览:35次 中文

阅读说明:本技术 一种区块链节点部署与选举的装置 (Device for block chain link point deployment and election ) 是由 张卫平 张浩宇 张思琪 李显阔 于 2021-08-06 设计创作,主要内容包括:本发明提供了一种区块链节点部署与选举的装置,包括节点生成模块、区块存储模块、广播模块、选举模块和节点记录模块,所述节点生成模块用于创建节点,所述广播模块节点之间互相发送广播信息,所述区块存储模块用于存储区块链信息,所述选举模块用于记录节点的状态并参与竞选超级节点,所述节点记录模块用于记录所有的节点信息。通过本装置构成的区块链网络在节点部署时能减少大量的无效重复传播,在选举时能够避免节点集团持续当选超级节点,进而防止垄断现象。(The invention provides a device for deploying and electing block chain link points, which comprises a node generating module, a block storing module, a broadcasting module, an electing module and a node recording module, wherein the node generating module is used for creating nodes, broadcasting information is mutually sent among the broadcasting module nodes, the block storing module is used for storing block chain information, the electing module is used for recording the states of the nodes and participating in election of super nodes, and the node recording module is used for recording all node information. The block chain network formed by the device can reduce a large amount of invalid repeated propagation when the nodes are deployed, and can avoid a node group from continuously selecting super nodes during election, thereby preventing monopoly.)

1. A device for node deployment and election of a block chain is characterized by comprising a node generation module, a block storage module, a broadcast module, an election module and a node recording module, wherein the node generation module is used for creating nodes, broadcast information is mutually sent among the broadcast modules, the block storage module is used for storing block chain information, the election module is used for recording the state of the nodes and participating in election of super nodes, and the node recording module is used for recording all node information; the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends the new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

the newly created broadcast information comprises broadcast data packets, the broadcast data packets comprise node information which is not yet broadcast, each node deletes the information of the node in the broadcast data packet and then rebroadcasts the information to the nodes in the broadcast data packet, and when the intersection in the broadcast data packet received by one node is the node, all the nodes all receive the newly created broadcast information; when the node rebroadcasts the newly created broadcast information, the node can select five nodes with the maximum rebroadcasting value for rebroadcasting, and if the node J rebroadcasts the newly created broadcast information, the node J rebroadcasts the newly created broadcast information1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

the nodes are divided into common nodes, candidate nodes and super nodes, the change and expiration election of the super nodes is carried out at regular intervals, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node is selected from the candidate nodes to serve as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing capability values for the corresponding nodes.

2. The apparatus according to claim 1, wherein the history weight R isiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, UiAnd (N) is 0, and N is the current times of selecting the super node.

3. The apparatus according to claim 2, wherein the super node obtains a vote P for each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and t (i) is the voting condition of the node with sequence number i, when the node with sequence number i votes for the candidate node, t (i) is 1, and when the node with sequence number i votes for the rest candidate nodes or throws away the vote, t (i) is 0.

Technical Field

The invention relates to the technical field of block chains, in particular to a device for node deployment and election of a block chain.

Background

The block chain is a term in the field of information technology, and essentially, the block chain is a shared database, data or information stored in the shared database has the characteristics of 'unforgeability', 'whole-course trace', 'traceability', 'public transparency', 'collective maintenance', and the like, based on the characteristics, the block chain technology lays a solid 'trust' foundation, creates a reliable 'cooperation' mechanism, has a wide application prospect, the data of the block chain is completely stored in each node, a super node can be selected from the nodes, and the reliability of the whole block chain can be influenced by the selection method.

Many blockchain election systems have been developed, and through extensive search and reference, it is found that the existing election systems such as those disclosed in KR101723405B1, KR1020170123861A and KR101857223B1 include: deploying a block chain, binding a credible timestamp and a credible random number aiming at an voter participating in voting, initiating a voting transaction of the block chain, voting by utilizing a transaction data string, recording voting information, determining a voting result of the voter, and dynamically displaying all voting transactions sent by a block chain link point participating in the voting to a node initiating the voting; however, the system generates a large amount of repeated invalid broadcasts when deploying the nodes, and at the same time, it cannot be avoided that the super nodes are controlled in a certain node group during election, so that monopoly of the super nodes is caused, and thus the reliability of the whole block chain is affected.

Disclosure of Invention

The invention aims to provide a device for node deployment and election of a block chain,

in order to overcome the defects of the prior art, the invention adopts the following technical scheme:

a device for node deployment and election of a block chain comprises a node generation module, a block storage module, a broadcast module, an election module and a node recording module, wherein the node generation module is used for creating nodes, broadcast information is mutually sent among the nodes of the broadcast module, the block storage module is used for storing block chain information, the election module is used for recording the state of the nodes and participating in election of super nodes, and the node recording module is used for recording all node information;

further, the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends the new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

further, the newly created broadcast information includes a broadcast data packet, the broadcast data packet includes node information that has not been broadcast yet, each node deletes information of its own node in the broadcast data packet and then rebroadcasts the node information to nodes in the broadcast data packet, and when an intersection in the broadcast data packet received by one node is its own node, it indicates that all nodes have received the newly created broadcast information;

further, when the node rebroadcasts the newly created broadcast information, the node selects five nodes with the maximum rebroadcasting value for rebroadcasting, and if the node J is the node J1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

further, the nodes are divided into common nodes, candidate nodes and super nodes, the change and expiration election of the super nodes is carried out at each certain time, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node selected from the candidate nodes is called as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

further, the voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing a capability value for the corresponding node;

further, the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

further, the super node obtains the ticket number P of each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

the beneficial effects obtained by the invention are as follows:

when a block chain system formed by the device deploys new nodes, the broadcasting object of each node is selected based on the selection by adding the node information which is not broadcasted in the broadcasting information, so that a large amount of repeated invalid broadcasting is reduced, and in the election process of super nodes, each node is endowed with different weights, so that the super nodes are prevented from monopolizing in a certain node group, and the benefit distribution of the whole block chain is more fair.

Drawings

The invention will be further understood from the following description in conjunction with the accompanying drawings. The components in the figures are not necessarily to scale, emphasis instead being placed upon illustrating the principles of the embodiments. Like reference numerals designate corresponding parts throughout the different views.

Fig. 1 is a schematic view of an overall structural framework.

Fig. 2 is a schematic diagram of a broadcast structure of the new node.

FIG. 3 is a schematic diagram of supernode election.

Fig. 4 is a schematic diagram of a new node deployment process.

Fig. 5 is a schematic diagram of a common node ticket counting supervision.

Detailed Description

In order to make the objects and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the following embodiments; it should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. Other systems, methods, and/or features of the present embodiments will become apparent to those skilled in the art upon review of the following detailed description. It is intended that all such additional systems, methods, features and advantages be included within this description, be within the scope of the invention, and be protected by the accompanying claims. Additional features of the disclosed embodiments are described in, and will be apparent from, the detailed description that follows.

The same or similar reference numerals in the drawings of the embodiments of the present invention correspond to the same or similar components; in the description of the present invention, it should be understood that if there is an orientation or positional relationship indicated by terms such as "upper", "lower", "left", "right", etc., based on the orientation or positional relationship shown in the drawings, it is only for convenience of description and simplification of description, but it is not indicated or implied that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and are not to be construed as limitations of the present patent, and specific meanings of the terms may be understood by those skilled in the art according to specific situations.

The first embodiment.

Referring to fig. 1 to 4, this embodiment provides a device for node deployment and election of a block chain, including a node generation module, a block storage module, a broadcast module, an election module, and a node recording module, where the node generation module is configured to create nodes, the broadcast module nodes send broadcast information to each other, the block storage module is configured to store block chain information, the election module is configured to record a state of a node and participate in election of a super node, and the node recording module is configured to record all node information;

the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends a new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

the newly created broadcast information comprises broadcast data packets, the broadcast data packets comprise node information which is not yet broadcast, each node deletes the information of the node in the broadcast data packet and then rebroadcasts the information to the nodes in the broadcast data packet, and when the intersection in the broadcast data packet received by one node is the node, all the nodes all receive the newly created broadcast information;

when the node rebroadcasts the newly created broadcast informationSelecting five nodes with the maximum rebroadcasting value for rebroadcasting, if the node J is the node J1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

the nodes are divided into common nodes, candidate nodes and super nodes, the change-over election of the super nodes is carried out at each certain time, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node is selected from the candidate nodes and called as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing a capability value for the corresponding node;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

the number P of votes obtained by the super node for each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

the embodiment further includes a computer-readable storage medium, where the computer-readable storage medium includes a device program for node deployment and election of a blockchain, and when executed by a processor, the device program for node deployment and election of a blockchain implements a device step for node deployment and election of a blockchain.

Example two.

With continuing reference to fig. 1-5, this embodiment further provides a device for node deployment and election of a block chain, including a node generation module, a block storage module, a broadcast module, an election module, and a node recording module, where the node generation module is configured to create nodes, the broadcast module nodes send broadcast information to each other, the block storage module is configured to store block chain information, the election module is configured to record a state of a node and participate in election of a super node, and the node recording module is configured to record all node information;

the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends a new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

the newly created broadcast information comprises broadcast data packets, the broadcast data packets comprise node information which is not yet broadcast, each node deletes the information of the node in the broadcast data packet and then rebroadcasts the information to the nodes in the broadcast data packet, and when the intersection in the broadcast data packet received by one node is the node, all the nodes all receive the newly created broadcast information;

when the node rebroadcasts the newly created broadcast information, the node can select five nodes with the maximum rebroadcasting value for rebroadcasting, and if the node J rebroadcasts the newly created broadcast information, the node J rebroadcasts the newly created broadcast information1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

the nodes are divided into common nodes, candidate nodes and super nodes, the change-over election of the super nodes is carried out at each certain time, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node is selected from the candidate nodes and called as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing a capability value for the corresponding node;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

the number P of votes obtained by the super node for each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

the node deployment and election device for the block chain comprises a node generation module, a block storage module, a broadcasting module, an election module and a node recording module, wherein the node generation module is used for creating nodes, the broadcasting module is used for broadcasting information to surrounding nodes and receiving the broadcast information from the surrounding nodes, the block storage module is used for storing original block chain information and receiving new block information contained in the broadcast information, the election module is used for recording the state of the nodes to participate in election of super nodes, and the node recording module is used for recording all node information;

the node generating module creates a new node message, the broadcasting module sends the creating message containing the new node to the nearest node, the nearest node is called as a first node, the first node adds the new node message in the node recording module after receiving the creating message, the first node packs all the node messages into full node messages and sends the full node messages back to the new node, the new node records the full node messages in the node recording module after receiving the full node messages, the first node sends the new broadcast message to the surrounding nodes after receiving the creating message, the new broadcast message contains two parts of contents, one is a new data packet containing the newly created node messages, the other is a broadcast data packet containing the node messages which are not broadcasted, after a certain node receives the new broadcast message, the node message of the node is deleted in the broadcast data packet, the method comprises the steps that newly created broadcast information is sent to a plurality of nearest nodes in a broadcast data packet, one node can receive the same newly created broadcast information of a plurality of newly created data packets, intersection of the broadcast data packets is calculated, when the intersection result is the node of the node, newly created node information is considered to be broadcasted to all the nodes, the node sends newly created completion information to surrounding nodes, the newly created completion information comprises two parts of contents, namely the newly created data packet which comprises the newly created node information, and the newly created node information which comprises a broadcast completion mark, the node directly broadcasts after receiving the newly created completion packet to other nodes, and after the first node receives the newly created packet, the first node sends a success notice to the newly created node, so that the new node is successfully deployed;

when the node receives the newly created broadcast information and the newly created completion information of a plurality of same newly created data packets, the node only retransmits the newly created broadcast information and/or the newly created completion information to surrounding nodes when receiving the newly created broadcast information and/or the newly created completion information for the first time, so that the retransmitted information explosion is prevented;

when the node rebroadcasts the newly created broadcast information, the node calculates the rebroadcasting values of the peripheral nodes and the nodes thereof in the broadcast data packet, selects the five nodes with the maximum rebroadcasting values for rebroadcasting, and if the node J is in the state of being in the newly created broadcast information, the node J is selected to be in the state of being in the broadcast data packet, the node J1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The retransmission value Z of (a) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

after receiving the creation information, the first node compares the new node information with the original node information in the node recording module, if node conflict occurs, a conflict notification is sent to the newly created node, and after receiving the conflict notification, the newly created node creates new node information through the node generating module and repeats the process until a successful notification is received;

the device can only deploy a new node once successfully, and the node can automatically destroy the node generation module to provide a memory space after receiving a success notice.

Example three.

Still referring to the drawings, the present embodiment provides an apparatus for node deployment and election of a block chain, including a node generation module, a block storage module, a broadcast module, an election module, and a node recording module, where the node generation module is configured to create nodes, the broadcast module nodes send broadcast information to each other, the block storage module is configured to store block chain information, the election module is configured to record a state of a node and participate in election of a super node, and the node recording module is configured to record all node information;

the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends a new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

the newly created broadcast information comprises broadcast data packets, the broadcast data packets comprise node information which is not yet broadcast, each node deletes the information of the node in the broadcast data packet and then rebroadcasts the information to the nodes in the broadcast data packet, and when the intersection in the broadcast data packet received by one node is the node, all the nodes all receive the newly created broadcast information;

when the node rebroadcasts the newly created broadcast information, the node can select five nodes with the maximum rebroadcasting value for rebroadcasting, and if the node J rebroadcasts the newly created broadcast information, the node J rebroadcasts the newly created broadcast information1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

the nodes are divided into common nodes, candidate nodes and super nodes, the change-over election of the super nodes is carried out at each certain time, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node is selected from the candidate nodes and called as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing a capability value for the corresponding node;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

the number P of votes obtained by the super node for each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

the node deployment and election device for the block chain comprises a node generation module, a block storage module, a broadcasting module, an election module and a node recording module, wherein the node generation module is used for creating nodes, the broadcasting module is used for broadcasting information to surrounding nodes and receiving the broadcast information from the surrounding nodes, the block storage module is used for storing original block chain information and receiving new block information contained in the broadcast information, the election module is used for recording the state of the nodes to participate in election of super nodes, and the node recording module is used for recording all node information;

the node generating module creates a new node message, the broadcasting module sends the creating message containing the new node to the nearest node, the nearest node is called as a first node, the first node adds the new node message in the node recording module after receiving the creating message, the first node packs all the node messages into full node messages and sends the full node messages back to the new node, the new node records the full node messages in the node recording module after receiving the full node messages, the first node sends the new broadcast message to the surrounding nodes after receiving the creating message, the new broadcast message contains two parts of contents, one is a new data packet containing the newly created node messages, the other is a broadcast data packet containing the node messages which are not broadcasted, after a certain node receives the new broadcast message, the node message of the node is deleted in the broadcast data packet, the method comprises the steps that newly created broadcast information is sent to a plurality of nearest nodes in a broadcast data packet, one node can receive the same newly created broadcast information of a plurality of newly created data packets, intersection of the broadcast data packets is calculated, when the intersection result is the node of the node, newly created node information is considered to be broadcasted to all the nodes, the node sends newly created completion information to surrounding nodes, the newly created completion information comprises two parts of contents, namely the newly created data packet which comprises the newly created node information, and the newly created node information which comprises a broadcast completion mark, the node directly broadcasts after receiving the newly created completion packet to other nodes, and after the first node receives the newly created packet, the first node sends a success notice to the newly created node, so that the new node is successfully deployed;

when the node receives the newly created broadcast information and the newly created completion information of a plurality of same newly created data packets, the node only retransmits the newly created broadcast information and/or the newly created completion information to surrounding nodes when receiving the newly created broadcast information and/or the newly created completion information for the first time, so that the retransmitted information explosion is prevented;

when the node rebroadcasts the newly created broadcast information, the node calculates the rebroadcasting values of the peripheral nodes and the nodes thereof in the broadcast data packet, selects the five nodes with the maximum rebroadcasting values for rebroadcasting, and if the node J is in the state of being in the newly created broadcast information, the node J is selected to be in the state of being in the broadcast data packet, the node J1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The retransmission value Z of (a) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

after receiving the creation information, the first node compares the new node information with the original node information in the node recording module, if node conflict occurs, a conflict notification is sent to the newly created node, and after receiving the conflict notification, the newly created node creates new node information through the node generating module and repeats the process until a successful notification is received;

the device can only deploy a new node once successfully, and can automatically destroy the node generation module to provide a memory space after the node receives a success notice;

the election module detects the computing capability of the node per se and generates a computing capability value C, when the computing capability value is larger than a threshold value, the election module recommends the node per se as a candidate node and broadcasts the candidate node to other nodes through the broadcasting module, a super node responsible packing block is selected from the candidate node by the node network at intervals, and after a node successfully selects a super node, the super node does not participate in next round of super node election any more;

all nodes except the super node have voting weights, and each node has different voting weights QiWhere i is the serial number of the node in the node network, and the voting weight QiComprises the following steps:

wherein k isiThe basic coefficient is 0, RiThe historical proportion of the corresponding node is obtained;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with sequence number i is at the firstWhen n elections of unselected super nodes, Ui(N) is 0, and N is the current times of selecting the super node;

the super node collects the votes of each node and counts the votes, and the ordinary node supervises the vote counting process of the super node;

the voting module of the node packs a voting data packet and passes through the broadcasting module to broadcast outwards when the super node conducts voting, the voting data packet contains node information and signature information of the node and candidate node information of voting, the super node receives the voting data packet and then conducts ticket singing, the ticket singing mode is that ticket information is broadcasted outwards, the ticket information contains signature information and voting information of a certain node, the ordinary node verifies the ticket information, the ticket is valid after the verification is passed, if the verification is not passed, the ticket singing is invalid, and the super node obtains the ticket number P of each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and t (i) is the voting condition of the node with sequence number i, when the node with sequence number i votes for the candidate node, t (i) is 1, and when the node with sequence number i votes for the rest candidate nodes or throws away the vote, t (i) is 0.

Example four.

A device for node deployment and election of a block chain comprises a node generation module, a block storage module, a broadcast module, an election module and a node recording module, wherein the node generation module is used for creating nodes, broadcast information is mutually sent among the nodes of the broadcast module, the block storage module is used for storing block chain information, the election module is used for recording the state of the nodes and participating in election of super nodes, and the node recording module is used for recording all node information;

the node generation module creates a new node message, the broadcast module sends the creation message containing the new node to a first node, the first node sends a new broadcast message to surrounding nodes, and the rest nodes receive the new broadcast message and then relay the message until all nodes receive the new broadcast message;

the newly created broadcast information comprises broadcast data packets, the broadcast data packets comprise node information which is not yet broadcast, each node deletes the information of the node in the broadcast data packet and then rebroadcasts the information to the nodes in the broadcast data packet, and when the intersection in the broadcast data packet received by one node is the node, all the nodes all receive the newly created broadcast information;

when the node rebroadcasts the newly created broadcast information, the node can select five nodes with the maximum rebroadcasting value for rebroadcasting, and if the node J rebroadcasts the newly created broadcast information, the node J rebroadcasts the newly created broadcast information1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The rebroadcast value Z of (2) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

the nodes are divided into common nodes, candidate nodes and super nodes, the change-over election of the super nodes is carried out at each certain time, the common nodes and the candidate nodes have voting right, the super nodes carry out statistics on vote singing, the common nodes supervise the vote singing, one node is selected from the candidate nodes and called as the super node of the next round, and the super node of the round does not participate in the election of the super node of the next round;

voting weight Q of the nodeiComprises the following steps:

wherein i is the node number, kiThe basic coefficient is 0, RiAs a history proportion of the corresponding node, CiComputing a capability value for the corresponding node;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

the number P of votes obtained by the super node for each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

the node deployment and election device for the block chain comprises a node generation module, a block storage module, a broadcasting module, an election module and a node recording module, wherein the node generation module is used for creating nodes, the broadcasting module is used for broadcasting information to surrounding nodes and receiving the broadcast information from the surrounding nodes, the block storage module is used for storing original block chain information and receiving new block information contained in the broadcast information, the election module is used for recording the state of the nodes to participate in election of super nodes, and the node recording module is used for recording all node information;

the node generating module creates a new node message, the broadcasting module sends the creating message containing the new node to the nearest node, the nearest node is called as a first node, the first node adds the new node message in the node recording module after receiving the creating message, the first node packs all the node messages into full node messages and sends the full node messages back to the new node, the new node records the full node messages in the node recording module after receiving the full node messages, the first node sends the new broadcast message to the surrounding nodes after receiving the creating message, the new broadcast message contains two parts of contents, one is a new data packet containing the newly created node messages, the other is a broadcast data packet containing the node messages which are not broadcasted, after a certain node receives the new broadcast message, the node message of the node is deleted in the broadcast data packet, the method comprises the steps that newly created broadcast information is sent to a plurality of nearest nodes in a broadcast data packet, one node can receive the same newly created broadcast information of a plurality of newly created data packets, intersection of the broadcast data packets is calculated, when the intersection result is the node of the node, newly created node information is considered to be broadcasted to all the nodes, the node sends newly created completion information to surrounding nodes, the newly created completion information comprises two parts of contents, namely the newly created data packet which comprises the newly created node information, and the newly created node information which comprises a broadcast completion mark, the node directly broadcasts after receiving the newly created completion packet to other nodes, and after the first node receives the newly created packet, the first node sends a success notice to the newly created node, so that the new node is successfully deployed;

when the node receives the newly created broadcast information and the newly created completion information of a plurality of same newly created data packets, the node only retransmits the newly created broadcast information and/or the newly created completion information to surrounding nodes when receiving the newly created broadcast information and/or the newly created completion information for the first time, so that the retransmitted information explosion is prevented;

when the node rebroadcasts the newly created broadcast information, the node calculates the rebroadcasting values of the peripheral nodes and the nodes thereof in the broadcast data packet, selects the five nodes with the maximum rebroadcasting values for rebroadcasting, and if the node J is in the state of being in the newly created broadcast information, the node J is selected to be in the state of being in the broadcast data packet, the node J1To node J2Having sent the newly created broadcast information, node J2Is selecting the node to be rebroadcast, node J3Node J is a candidate node requiring rebroadcasting3The retransmission value Z of (a) is:

wherein, t1Is node J2And node J3Time of information transfer between, t2Is node J1And node J2Time of information transfer between, t3Is node J1And node J3The information transfer time therebetween;

after receiving the creation information, the first node compares the new node information with the original node information in the node recording module, if node conflict occurs, a conflict notification is sent to the newly created node, and after receiving the conflict notification, the newly created node creates new node information through the node generating module and repeats the process until a successful notification is received;

the device can only deploy a new node once successfully, and can automatically destroy the node generation module to provide a memory space after the node receives a success notice;

the election module detects the computing capability of the node per se and generates a computing capability value C, when the computing capability value is larger than a threshold value, the election module recommends the node per se as a candidate node and broadcasts the candidate node to other nodes through the broadcasting module, a super node responsible packing block is selected from the candidate node by the node network at intervals, and after a node successfully selects a super node, the super node does not participate in next round of super node election any more;

except super nodeAll nodes outside the nodes have voting weights, and each node has different voting weights QiWhere i is the serial number of the node in the node network, and the voting weight QiComprises the following steps:

wherein k isiThe basic coefficient is 0, RiThe historical proportion of the corresponding node is obtained;

the historical specific gravity RiComprises the following steps:

wherein, WiSelecting a history accumulated value of a super node for a corresponding node, wherein j is a serial number of a candidate node;

the history accumulated value WiThe calculation formula of (2) is as follows:

when the node with the sequence number i successfully elects the super node in the nth election, Ui(n) 1, when the node with the sequence number i elects the non-elected super node in the nth time, Ui(N) is 0, and N is the current times of selecting the super node;

the super node collects the votes of each node and counts the votes, and the ordinary node supervises the vote counting process of the super node;

the election module of the node packs an election data packet and broadcasts the election data packet outwards through the broadcasting module when the super node conducts election, the election data packet comprises node information and signature information of the node and candidate node information of voting, and the super node receives the election data packet and then broadcasts the election data packetThe ticket is played in a mode of broadcasting a piece of ticket information outwards, the ticket information comprises signature information and voting information of a certain node, the ordinary node verifies the ticket information, the ticket information is valid after the verification is passed, if the verification is not passed, the ticket is invalid, and the super node obtains the ticket number P of each candidate nodejAnd (4) carrying out statistics:

Pj=∑Qi·T(i),

wherein j is the sequence number of the candidate node, and T (i) is the voting condition of the node with the sequence number i, when the node with the sequence number i votes for the candidate node, T (i) is 1, and when the node with the sequence number i votes for the rest candidate nodes or throws away the vote, T (i) is 0;

each node is provided with a pair of secret keys which comprise a private key and a public key, the private key is kept by the node, the public key and node information are published to all the nodes in a matched mode, node information of the node in the election data packet and candidate node information of voting are subjected to Hash operation to obtain a first Hash value, the first Hash value and the private key of the node are subjected to Hash operation to obtain signature information, the common node receives the vote information and then obtains a corresponding public key through the vote information, the public key is used for unlocking the signature information in the vote information to obtain a text, the voting node information in the text and the candidate node information of the voting in the vote information are compared, and the vote is effective if the comparison is correct;

each node with the voting right must vote for a certain candidate node or a jettisoninged ticket, when the super node receives the votes of all the other nodes and plays the votes effectively, the candidate node with the largest number of votes is called a new super node and is responsible for block packaging work, and after the block packaging is finished, the candidate node broadcasts to the other nodes and adds a new block into a block chain;

the voting mode can prevent certain nodes from continuously electing super nodes, and prevent the phenomenon of fraud.

Although the invention has been described above with reference to various embodiments, it should be understood that many changes and modifications may be made without departing from the scope of the invention. That is, the methods, systems, and devices discussed above are examples. Various configurations may omit, substitute, or add various procedures or components as appropriate. For example, in alternative configurations, the methods may be performed in an order different than that described, and/or various components may be added, omitted, and/or combined. Moreover, features described with respect to certain configurations may be combined in various other configurations, as different aspects and elements of the configurations may be combined in a similar manner. Further, elements therein may be updated as technology evolves, i.e., many elements are examples and do not limit the scope of the disclosure or claims.

Specific details are given in the description to provide a thorough understanding of the exemplary configurations including implementations. However, configurations may be practiced without these specific details, for example, well-known circuits, processes, algorithms, structures, and techniques have been shown without unnecessary detail in order to avoid obscuring the configurations. This description provides example configurations only, and does not limit the scope, applicability, or configuration of the claims. Rather, the foregoing description of the configurations will provide those skilled in the art with an enabling description for implementing the described techniques. Various changes may be made in the function and arrangement of elements without departing from the spirit or scope of the disclosure.

In conclusion, it is intended that the foregoing detailed description be regarded as illustrative rather than limiting, and that it be understood that these examples are illustrative only and are not intended to limit the scope of the invention. After reading the description of the invention, the skilled person can make various changes or modifications to the invention, and these equivalent changes and modifications also fall into the scope of the invention defined by the claims.

20页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:场景同步方法、终端、服务器及系统

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类