Disclosure of Invention
The invention aims to provide a block link point excitation method based on online time, which is characterized in that a public link maintains an online time statistical data set of a node through a P2P network in real time, and the final reward required by the node is dynamically adjusted according to the online time factor of the data node.
the purpose of the invention can be realized by the following technical scheme:
A block link point excitation method based on online time maintains a statistical data set of the online time of a node through a P2P network by a public link in real time according to the online time factor of the data node, and dynamically adjusts the final reward required by the node.
Further, the method specifically comprises the following steps:
step S1, the system is started for the first time, a local node is generated, NodeID is recorded as LocalID, and the local node initializes an online time statistical data set;
Step S2, the system reads the public node information, writes the public node information into a K bucket after the ping-pong handshake is completed, and synchronizes the local node online time statistical data set with the nodes in the K bucket;
Step S3, the system refreshes the K barrels at preset time intervals;
Step S4, synchronizing the online time statistical data set of the local node with the refreshed K barrel node;
Step S5, calculating the online time of the computer and updating the online time statistical data set;
step S6, finding out the node closer to the TargetID, and sending a synchronization instruction;
in step S7, the node that received the instruction updates the local online time statistics data set.
Further, the step S3 includes the following steps:
step S31, the system randomly generates a target node ID, and records the target node ID as a targetID;
step S32, calculating the distance between the TargetID and the LocalID, and recording the distance as Dlt;
step S33, marking the NodeID of the node in the K bucket as KadID, calculating the distance between KadID and targetID, and marking the distance as Dkt;
Step S34, finding out the nodes with Dlt larger than Dkt in the K bucket, and sending FindNode commands to the nodes;
In step S35, after receiving the FindNode command, the node also executes the processes of step S32-step S34, and sends the node found in the K bucket back to the local node using the Neighbours command.
And step S36, after receiving the neighbor nodes, the local node writes the received nodes into the K bucket and then keeps connection.
The invention has the beneficial effects that: according to the block chain link point excitation method based on the online time, the public link maintains an online time statistical data set of a node through a P2P network in real time, and a scientific and accurate basis is provided for a data node excitation mechanism, so that the final reward required by the node can be dynamically adjusted according to the online time factor of the data node, the excitation of the node in the block chain network is realized, the distribution range of the block chain network is expanded, and the resource utilization rate is improved.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it is to be understood that the terms "opening," "upper," "lower," "thickness," "top," "middle," "length," "inner," "peripheral," and the like are used in an orientation or positional relationship that is merely for convenience in describing and simplifying the description, and do not indicate or imply that the referenced component or element must have a particular orientation, be constructed and operated in a particular orientation, and thus should not be considered as limiting the present invention.
The invention provides a block link point excitation method based on online time, which is characterized in that a public link maintains a statistical data set of the online time of a node through a P2P network in real time according to the online time factor of the data node, and the final reward which should be paid to the node is dynamically adjusted, and the method specifically comprises the following steps:
Step S1, the system is started for the first time, a local node is generated, NodeID is recorded as LocalID, and the local node initializes the online time statistical data set.
And step S2, the system reads the public node information, writes the public node information into a K bucket after the ping-pong handshake is completed, and synchronizes the online time statistical data set of the local node with the node in the K bucket.
in step S3, the system refreshes K buckets once every preset time.
Specifically, step S3 includes the steps of:
In step S31, the system randomly generates a target node ID, which is recorded as TargetID, and records the number of discovery times and the refresh time from 1.
in step S32, the distance between TargetID and localcid is calculated and recorded as Dlt.
Step S33, the NodeID of the node in the K bucket is recorded as KadID, and the distance between KadID and TargetID is calculated and recorded as Dkt.
In step S34, find out nodes in the K bucket whose Dlt (Dlt is the distance between KadID and locaidid, because any distance from locaidid is called Dlt) is greater than Dkt, and send FindNode command to these nodes, where FindNode command includes TargetID.
In step S35, after the above node receives the FindNode command, it also executes the process from step S32 to step S34 (at this time, the last KadID becomes the new locald), and sends the node found in the K bucket back to the local node using the neighborirs command.
And step S36, after receiving the neighbor nodes, the local node writes the received nodes into the K bucket and then keeps connection.
And step S4, synchronizing the online time statistical data set of the local node with the refreshed K barrel node.
step S5, calculate the local online time and update the online time statistics data set.
in step S6, a node closer to the TargetID is found and a synchronization command is sent.
In step S7, the node that received the instruction updates the local online time statistics data set.
And step S8, acquiring the online time statistical data set and calculating the RMB with the amount corresponding to the online time.
According to the block chain link point excitation method based on the online time, the public link maintains an online time statistical data set of a node through a P2P network in real time, and a scientific and accurate basis is provided for a data node excitation mechanism, so that the final reward required by the node can be dynamically adjusted according to the online time factor of the data node, the excitation of the node in the block chain network is realized, the distribution range of the block chain network is expanded, and the resource utilization rate is improved.
in the description herein, references to the description of "one embodiment," "an example," "a specific example" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
The foregoing is merely exemplary and illustrative of the present invention and various modifications, additions and substitutions may be made by those skilled in the art to the specific embodiments described without departing from the scope of the invention as defined in the following claims.