CN108833515B - Block chain node optimization method and device and computer readable storage medium - Google Patents
Block chain node optimization method and device and computer readable storage medium Download PDFInfo
- Publication number
- CN108833515B CN108833515B CN201810567632.4A CN201810567632A CN108833515B CN 108833515 B CN108833515 B CN 108833515B CN 201810567632 A CN201810567632 A CN 201810567632A CN 108833515 B CN108833515 B CN 108833515B
- Authority
- CN
- China
- Prior art keywords
- node
- information
- new node
- new
- historical
- 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.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/14—Session management
- H04L67/141—Setup of application sessions
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/02—Details
- H04L12/16—Arrangements for providing special services to substations
- H04L12/18—Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
- H04L41/0813—Configuration setting characterised by the conditions triggering a change of settings
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Mobile Radio Communication Systems (AREA)
Abstract
The invention discloses a block chain link point optimization method, which comprises the following steps: when a new node is determined to be generated, acquiring historical node information; determining an optimal node corresponding to the new node according to the historical node information; connecting the new node to the optimal node. The invention also discloses a block link point optimization device and a computer readable storage medium. The invention realizes the optimization of node network connection according to the node information, and further realizes the high-speed and high-efficiency communication of the network nodes and the smooth expansion of the network while ensuring the network communication safety in the high-speed expansion and uniform network hash.
Description
Technical Field
The present invention relates to the field of block chain technologies, and in particular, to a method and an apparatus for optimizing block chain link points, and a computer-readable storage medium.
Background
The block chain is a permanent non-reversible record formed by overlapping (linking) encrypted data (blocks) according to time sequence, and is a credit voucher formed by computer encryption technology. The block chain technology belongs to a mode of citizen participation accounting, and has five characteristics of decentralization, openness, autonomy, information non-tamper property, anonymity and the like. These characteristics make the blockchain technology have certain advantages in the application of various fields, can reduce the auditing and clearing cost, reduce the distrust to the central node, and make the flow of assets more transparent.
In the traditional block chain network communication, the peer-to-peer network communication is generally realized by adopting a point-to-point connection technology, however, in the high-speed expansion and the uniform network hashing, the high-speed node communication and the network are safely and smoothly expanded, and the realization of the high-speed node communication and the network cannot be realized only by the point-to-point connection technology.
The above is only for the purpose of assisting understanding of the technical aspects of the present invention, and does not represent an admission that the above is prior art.
Disclosure of Invention
The invention mainly aims to provide a block chain node optimization method, a block chain node optimization device and a computer readable storage medium, and aims to solve the technical problem of low communication efficiency of a block chain network node.
In order to achieve the above object, the present invention provides a block link point optimization method, including the steps of:
when a new node is determined to be generated, acquiring historical node information;
determining an optimal node corresponding to the new node according to the historical node information;
connecting the new node to the optimal node.
In one embodiment, the step of obtaining the history node information includes:
acquiring a history node corresponding to the new node;
and acquiring historical node information according to the historical nodes.
In one embodiment, the step of obtaining the history node information according to the history node includes:
broadcasting new node information of the new node to the historical node;
and verifying the new node based on the new node information, and returning the historical node information of the historical node to the new node when the new node passes the verification.
In one embodiment, the step of authenticating the new node based on the new node information comprises:
analyzing the new node information to acquire verification information of the new node;
and verifying the new node according to the verification information.
In an embodiment, the step of determining an optimal node corresponding to the new node according to the historical node information includes:
determining whether a first node in the same region as the new node exists or not according to the historical node information;
when determining that a first node in the same region as the new node exists, determining the first node as an optimal node;
and when determining that the first node in the same region as the new node does not exist, acquiring a second node with the optimal communication quality with the new node, and determining that the second node is the optimal node.
In one embodiment, after the step of connecting the new node to the optimal node, the block link point optimization method further comprises:
acquiring a preset updating period;
and updating the network connection of the new node based on the preset updating period.
In an embodiment, the step of updating the network connection of the new node based on the preset update period includes:
acquiring the adjacent node of the new node;
and updating the network connection of the new node based on the preset updating period and the adjacent node.
In one embodiment, after the step of connecting the new node to the optimal node, the block link point optimization method further comprises:
when the new node is successfully connected with the optimal node, acquiring the connection information of the new node and the optimal node;
and broadcasting the connection information to all nodes of the current block network.
Further, to achieve the above object, the present invention also provides a block link point optimizing device including: a memory, a processor and a block-linked point optimizer stored on the memory and executable on the processor, the block-linked point optimizer, when executed by the processor, implementing the steps of the block-linked point optimization method as described above.
Furthermore, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a block-chain node optimization program, which when executed by a processor, implements the steps of the block-chain node optimization method as described above.
According to the block link point optimization method, when a new node is determined to be generated, historical node information is obtained, an optimal node corresponding to the new node is determined according to the historical node information, the new node is connected to the optimal node, node network connection optimization according to the node information is achieved, and high-speed and high-efficiency communication of network nodes and smooth expansion of a network are further achieved in high-speed expansion and uniform network hashing while network communication safety is guaranteed.
Drawings
Fig. 1 is a schematic structural diagram of a terminal to which a block link point optimization device belongs in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a first embodiment of the block link point optimization method of the present invention;
FIG. 3 is a schematic flow chart of a block link point optimization method according to a second embodiment of the present invention;
FIG. 4 is a schematic flow chart of a block link point optimization method according to a third embodiment of the present invention;
FIG. 5 is a schematic flow chart of a block link point optimization method according to a fourth embodiment of the present invention;
FIG. 6 is a schematic flow chart of a fifth embodiment of the block link point optimization method of the present invention;
FIG. 7 is a flowchart illustrating a block link point optimization method according to a sixth embodiment of the present invention;
FIG. 8 is a schematic flow chart diagram illustrating a block link point optimization method according to a seventh embodiment of the present invention;
fig. 9 is a flowchart illustrating an eighth embodiment of the block link point optimization method according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a terminal belonging to a block link point optimization device in a hardware operating environment according to an embodiment of the present invention.
The terminal of the embodiment of the invention can be a PC, and can also be a mobile terminal device with a display function, such as a smart phone, a tablet computer, an electronic book reader, an MP3(Moving Picture Experts Group Audio Layer III, dynamic video Experts compress standard Audio Layer 3) player, an MP4(Moving Picture Experts Group Audio Layer IV, dynamic video Experts compress standard Audio Layer 4) player, a portable computer, and the like.
As shown in fig. 1, the terminal may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Optionally, the terminal may further include a camera, a Radio Frequency (RF) circuit, a sensor, an audio circuit, a WiFi module, and the like. Such as light sensors, motion sensors, and other sensors. Specifically, the light sensor may include an ambient light sensor that may adjust the brightness of the display screen according to the brightness of ambient light, and a proximity sensor that may turn off the display screen and/or the backlight when the mobile terminal is moved to the ear. As one of the motion sensors, the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally, three axes), detect the magnitude and direction of gravity when the mobile terminal is stationary, and can be used for applications (such as horizontal and vertical screen switching, related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer and tapping) and the like for recognizing the attitude of the mobile terminal; of course, the mobile terminal may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, and an infrared sensor, which are not described herein again.
Those skilled in the art will appreciate that the terminal structure shown in fig. 1 is not intended to be limiting and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a block link point optimization program.
In the terminal shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to invoke the block link point optimization program stored in the memory 1005.
When the processor 1001 calls the block link point optimization program stored in the memory 1005, the following operations are performed:
when a new node is determined to be generated, acquiring historical node information;
determining an optimal node corresponding to the new node according to the historical node information;
connecting the new node to the optimal node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring a history node corresponding to the new node;
and acquiring historical node information according to the historical nodes.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
broadcasting new node information of the new node to the historical node;
and verifying the new node based on the new node information, and returning the historical node information of the historical node to the new node when the new node passes the verification.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
analyzing the new node information to acquire verification information of the new node;
and verifying the new node according to the verification information.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
determining whether a first node in the same region as the new node exists or not according to the historical node information;
when determining that a first node in the same region as the new node exists, determining the first node as an optimal node;
and when determining that the first node in the same region as the new node does not exist, acquiring a second node with the optimal communication quality with the new node, and determining that the second node is the optimal node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring a preset updating period;
and updating the network connection of the new node based on the preset updating period.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring the adjacent node of the new node;
and updating the network connection of the new node based on the preset updating period and the adjacent node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
when the new node is successfully connected with the optimal node, acquiring the connection information of the new node and the optimal node;
and broadcasting the connection information to all nodes of the current block network.
The invention provides a block link point optimization method, and referring to fig. 2, fig. 2 is a schematic flow chart of a first embodiment of the block link point optimization method of the invention.
In this embodiment, the block link point optimization method includes:
step S1000, when a new node is determined to be generated, historical node information is acquired;
in a hypercube network, in order to realize high availability and regularized expansibility network node hash distribution, the traditional point-to-point connection technology only realizes peer-to-peer network communication, but in high-speed expansion and uniform network hash, an intelligent expansion adjusting node mechanism is required to be monitored and introduced to adjust and optimize the connection between nodes in order to achieve high-speed node communication and network safety and smooth expansion.
In this embodiment, when a new node is received, new node information of the new node is obtained, and the new node information is broadcasted to each existing node in the current block network, where the history node information is node information of each history node existing in the current block network. Specifically, each historical node information in the current block network is monitored in real time, and when identification information generated by a new node is received, the generation of the new node in the current block network can be determined according to the identification information; and if the identification information generated by the new node is not received, determining that no new node is generated in the current block network. And when a new node is determined to be generated, acquiring new node information of the new node, wherein the new node information comprises address information, version information, verification information, instruction information corresponding to the requested event and the like of the new node, and broadcasting the node information to historical nodes in the current block network. When the historical node receives the new node information, the new node is verified based on the new node information, and when the new node passes the verification, the historical node information of the historical node is returned; the history node includes the address information of the current history node and the return information corresponding to the received different events.
Step S2000, determining an optimal node corresponding to the new node according to the historical node information;
in this embodiment, when the optimal node corresponding to the new node is calculated according to the historical node information, the historical node information includes the address information of the historical node, and the optimal node corresponding to the new node can be further determined according to the address information. Specifically, whether the corresponding history node and the new node belong to the same region can be determined according to the address information, when it is determined that a history node belonging to the same region as the new node exists in the current block network, the history node is a first node, the first node is a history node belonging to the same region as the new node in the current block network, and the first node is also an optimal node corresponding to the new node. And when the first node does not exist in the current block network, acquiring the communication quality between the current block network and the new node, and determining the historical node with the best communication quality with the new node as a second node which is the optimal node corresponding to the new node in the current block network.
And S3000, connecting the new node to the optimal node.
In this embodiment, when the optimal node corresponding to the new node is obtained through calculation, the new node is connected to the optimal node, and connection information between the new node and the optimal node is obtained; when the connection information is acquired, the connection information is broadcasted to the current block network, so that all nodes in the current block network can acquire the connection information.
Further, when the new node establishes a connection with the optimal node, the current time of establishing the connection between the new node and the optimal node is recorded, and a preset update period corresponding to the new node is obtained, so that the network connection of the new node is updated once every other preset update period. Specifically, when updating the network connection of the new node, acquiring a neighboring node of the new node, communicating the new node with the neighboring node, and acquiring communication quality information of the new node and the neighboring node; and if the communication quality information is within a preset optimization condition range, optimizing the network connection of the new node, and if the communication data is not within the optimization condition range, not optimizing the network connection of the new node. When the network connection of the new node is determined to be optimized, the information of the new node is broadcasted again, and when the historical node information returned by the historical node is received, the optimal node corresponding to the new node is recalculated according to the historical node information, so that the network connection of the new node is further optimized.
According to the block link point optimization method provided by the embodiment, when a new node is determined to be generated, historical node information is acquired, an optimal node corresponding to the new node is determined according to the historical node information, and then the new node is connected to the optimal node, so that node network connection is optimized according to the node information, and further, in high-speed expansion and uniform network hashing, high-speed and high-efficiency communication of network nodes and smooth expansion of a network are realized while network communication safety is guaranteed.
Based on the first embodiment, a second embodiment of the block link point optimization method of the present invention is provided, and referring to fig. 3, in this embodiment, step S1000 includes:
step S1100, obtaining a historical node corresponding to the new node;
and step S1200, obtaining historical node information according to the historical nodes.
In this embodiment, each node in the current block network is monitored in real time, and when it is determined that a new node is generated, a history node corresponding to the new node is obtained, where the history node is each node existing in the current block network. When the history node is obtained, broadcasting new node information of the current new node to the history node, wherein the new node information includes address information, version information, verification information, instruction information corresponding to the requested event and other information of the new node. The network address of the new node can be determined according to the address information, the version of the new node can be verified according to the version information, and the event information requested by the new node can be determined according to the instruction information corresponding to the requested event.
Broadcasting the new node information to all the historical nodes, and when the historical nodes receive the new node information, analyzing the new node information to obtain information such as address information, version information, verification information, instruction information corresponding to the requested event and the like of the new node; therefore, the new node is verified according to the verification information obtained by analysis, and when the new node passes the verification, the historical node information of the historical node is returned to the new node, wherein the historical node comprises the address information of the current historical node, the return information corresponding to different received events and other information; and when the historical node information is acquired, the new node further determines a corresponding optimal node according to the received historical node information.
In the block link point optimization method provided in this embodiment, the historical node information of the historical nodes around the new node is accurately obtained by obtaining the historical node corresponding to the new node and then obtaining the historical node information according to the historical node, so that the optimal node corresponding to the new node can be further accurately calculated according to the historical node information.
Based on the second embodiment, a third embodiment of the block link point optimization method of the present invention is provided, and referring to fig. 4, in this embodiment, step S1200 includes:
step S1210, broadcasting the new node information of the new node to the historical node;
step S1220, verifying the new node based on the new node information, and returning the history node information of the history node to the new node when the new node passes the verification.
In this embodiment, when the history node corresponding to the new node is acquired, the history node information of the history node may be acquired according to the history node. Specifically, when the new node information is acquired, the new node information is broadcasted to the history node; when the history node receives new node information broadcasted by the new node, analyzing the new node information, and verifying the new node through the verification information obtained by analysis; when the history node receives the new node information and the new node passes the verification, the history node information of the history node is packaged and returned to the new node, and the history node information comprises the address information of the current history node, the return information corresponding to different received events and other information.
In the block link node optimization method provided in this embodiment, the new node information of the new node is broadcasted to the historical node, the new node is verified based on the new node information, and when the new node passes the verification, the historical node information of the historical node is returned to the new node, so that the historical node information is accurately obtained, and thus the optimal node corresponding to the new node can be further accurately calculated according to the historical node information.
Based on the third embodiment, a fourth embodiment of the block link point optimization method of the present invention is proposed, and referring to fig. 5, in this embodiment, step S1220 includes:
step S1221, analyzing the new node information to obtain verification information of the new node;
step S1222, verifying the new node according to the verification information.
In this embodiment, when the history node receives new node information sent by the new node, in order to ensure that the new node is a valid node, the identity of the new node needs to be verified; specifically, when the new node information is acquired, the new node information is analyzed to acquire verification information of the new node, and the identity of the new node can be verified according to the verification information. If the new node is determined to meet the preset standard requirement according to the verification information, the new node is determined to pass the verification, the new node is a legal node, and the historical node information of the historical node is returned to the new node; and if the new node is determined to be not in accordance with the preset standard requirement according to the verification information, determining that the verification of the new node fails, and if the new node is an illegal node, rejecting the event request sent by the new node.
In the block link point optimization method provided in this embodiment, the new node information is analyzed to obtain the verification information of the new node, and then the new node is verified according to the verification information, so that the identity information of the new node is verified, and only when the identity information of the new node passes the verification, the new node is allowed to be accessed, thereby avoiding the access of an illegal node and improving the security of a network node.
Based on the first embodiment, a fifth embodiment of the block link point optimization method of the present invention is proposed, and referring to fig. 6, in this embodiment, step S2000 includes:
step S2100, determining whether a first node of the same region as the new node exists according to the historical node information;
step S2200, when determining that there is a first node in the same region as the new node, determining that the first node is an optimal node;
step S2300, when it is determined that there is no first node in the same region as the new node, obtaining a second node having the optimal communication quality with the new node, and determining that the second node is the optimal node.
In this embodiment, the history node information is node information returned by a history node in a current network, and the history node corresponds to different contents according to different types of received events. When the optimal node corresponding to the new node is calculated according to the historical node information, the historical node information includes the address information of the historical node, and the optimal node corresponding to the new node can be further determined according to the address information.
Specifically, whether the corresponding history node and the new node belong to the same region can be determined according to the address information, and when it is determined that a history node belonging to the same region as the new node exists in the current block network, the history node is a first node, and the first node is a history node belonging to the same region as the new node in the current block network. When the first node exists in the current block network, determining the first node as an optimal node corresponding to the new node; when the first node does not exist in the current block network, the communication quality between the current block network and the new node is obtained, and the communication quality can be determined according to evaluation information such as the communication time length and the communication speed of the new node and the historical node obtained by the ping instruction; and determining the historical node with the best communication quality with the new node in the current block network as a second node, wherein the second node is the optimal node corresponding to the new node.
In the block link point optimization method provided in this embodiment, whether a first node in the same region as the new node exists is determined according to the historical node information, then when it is determined that the first node in the same region as the new node exists, the first node is determined to be an optimal node, and then when it is determined that the first node in the same region as the new node does not exist, a second node having the optimal communication quality with the new node is obtained, and the second node is determined to be the optimal node, so that the determination of the optimal node in the current block link network is realized, and thus, the optimization and adjustment of the whole network connection are further realized.
Based on the first embodiment, a sixth embodiment of the block link point optimization method of the present invention is proposed, and referring to fig. 7, in this embodiment, after step S3000, the block link point optimization method further includes:
step S4000, acquiring a preset updating period;
and step S5000, updating the network connection of the new node based on the preset updating period.
In this embodiment, when the new node is connected to the optimal node, a preset update period corresponding to the new node is obtained, where the preset update period is a preset node update period. When the new node is connected to the corresponding optimal node, recording the current moment of connection establishment between the new node and the optimal node, and acquiring a preset updating period corresponding to the new node; and updating the network connection of the new node every other preset updating period.
Specifically, an adjacent node corresponding to the new node is obtained during updating, and the adjacent node is a node sharing the same transmission medium section with the new node; and connecting the new node with the adjacent node, and acquiring communication quality information of the communication between the new node and the adjacent node, wherein the communication quality information comprises evaluation data such as communication duration, communication efficiency and the like of the current communication. And optimizing the network connection of the new node according to the communication quality information, if the communication quality information is within a preset optimization condition range, optimizing the network connection of the new node, and if the communication data is not within the optimization condition range, not optimizing the network connection of the new node. When the network connection optimization of the new node is determined, the information broadcasting is carried out again on the new node information of the new node at present, and when the historical node information returned by the historical node is received, the optimal node corresponding to the new node is recalculated according to the historical node information, so that the network connection optimization of the new node is further realized.
According to the block link point optimization method provided by the embodiment, the preset update period is obtained, and then the network connection of the new node is updated based on the preset update period, so that the timing optimization of the network connection of the new node according to the preset update duration is realized, the optimization adjustment of the whole network connection is further realized, the high-speed communication of the nodes is realized while the safe communication is ensured, and the communication efficiency of the whole network nodes is improved.
Based on the sixth embodiment, a seventh embodiment of the block link point optimization method of the present invention is provided, and referring to fig. 8, in this embodiment, step S5000 includes:
step S5100, obtaining an adjacent node of the new node;
step S5200, based on the preset update period and the neighboring node, updates the network connection of the new node.
In this embodiment, when the preset update period is obtained, the network connection of the new node is updated once every other preset update period. Specifically, when updating the network connection of the new node, acquiring an adjacent node corresponding to the new node; and connecting the new node with the adjacent node, and acquiring communication quality information of the communication between the new node and the adjacent node, wherein the communication quality information comprises evaluation data such as communication duration, communication efficiency and the like of the current communication.
And optimizing the network connection of the new node according to the communication quality information, if the communication quality information is within a preset optimization condition range, optimizing the network connection of the new node, and if the communication data is not within the optimization condition range, not optimizing the network connection of the new node. The optimization condition is a preset optimization range, the optimization range can be divided through a set standard threshold, and for communication data larger than the standard threshold, the communication quality information is determined to be within the preset optimization condition range; for communication data not greater than the criterion threshold, it is determined that the communication data is not within the optimization condition. When the network connection optimization of the new node is determined, the information broadcasting is carried out again on the new node information of the new node at present, and when the historical node information returned by the historical node is received, the optimal node corresponding to the new node is recalculated according to the historical node information, so that the network connection optimization of the new node is further realized.
In the block link point optimization method provided in this embodiment, by acquiring the neighboring node of the new node and then updating the network connection of the new node based on the preset update period and the neighboring node, the network connection of the new node is optimized according to the neighboring node corresponding to the new node, so that the optimization and adjustment of the full network connection are further achieved, while the secure communication is ensured, the high-speed communication of the nodes is achieved, and the communication efficiency of the full network node is improved.
Based on the first embodiment, an eighth embodiment of the block link point optimization method of the present invention is provided, and referring to fig. 9, in this embodiment, after step S3000, the block link point optimization method further includes:
step S6000, when the new node is successfully connected with the optimal node, obtaining the connection information of the new node and the optimal node;
step S7000, broadcasting the connection information to all nodes of the current block network.
In this embodiment, when the new node is connected to the optimal node, if the new node is successfully connected to the optimal node, the corresponding connection success information may be obtained, and the new node and the optimal node may be determined to be successfully connected according to the connection success information; and if the connection failure information is acquired, determining that the connection between the new node and the optimal node fails. When the new node and the optimal node are successfully connected, acquiring connection information of the new node and the optimal node, wherein the connection information comprises information such as connection addresses and connection states of the new node and the optimal node; when the connection information is acquired, the connection information is broadcasted to all nodes of the current block network, so that all nodes know the current connection state of the new node.
In the block link point optimization method provided in this embodiment, when the new node and the optimal node are successfully connected, the connection information between the new node and the optimal node is obtained, and then the connection information is broadcasted to all nodes of the current block network, so that when the new node and the optimal node are successfully connected, the connection information between the new node and the optimal node is broadcasted in the whole network.
Further, to achieve the above object, the present invention also provides a computer readable storage medium having stored thereon a block link node optimization program, which when executed by a processor, performs the operations of:
when a new node is determined to be generated, acquiring historical node information;
determining an optimal node corresponding to the new node according to the historical node information;
connecting the new node to the optimal node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring a history node corresponding to the new node;
and acquiring historical node information according to the historical nodes.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
broadcasting new node information of the new node to the historical node;
and verifying the new node based on the new node information, and returning the historical node information of the historical node to the new node when the new node passes the verification.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
analyzing the new node information to acquire verification information of the new node;
and verifying the new node according to the verification information.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
determining whether a first node in the same region as the new node exists or not according to the historical node information;
when determining that a first node in the same region as the new node exists, determining the first node as an optimal node;
and when determining that the first node in the same region as the new node does not exist, acquiring a second node with the optimal communication quality with the new node, and determining that the second node is the optimal node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring a preset updating period;
and updating the network connection of the new node based on the preset updating period.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
acquiring the adjacent node of the new node;
and updating the network connection of the new node based on the preset updating period and the adjacent node.
Further, the blockchain node optimization program when executed by the processor further performs the following operations:
when the new node is successfully connected with the optimal node, acquiring the connection information of the new node and the optimal node;
and broadcasting the connection information to all nodes of the current block network.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.
Claims (9)
1. A block chain node optimization method is characterized by comprising the following steps:
when a new node is determined to be generated, acquiring historical node information; the historical node information at least comprises address information of the historical node and return information corresponding to different events received by the historical node;
determining an optimal node corresponding to the new node according to the historical node information;
connecting the new node to the optimal node;
the step of determining the optimal node corresponding to the new node according to the historical node information comprises the following steps:
determining whether a first node in the same region as the new node exists or not according to the historical node information;
when determining that a first node in the same region as the new node exists, determining the first node as an optimal node;
and when determining that the first node in the same region as the new node does not exist, acquiring a second node with the optimal communication quality with the new node, and determining that the second node is the optimal node.
2. The block link point optimization method of claim 1, wherein the step of obtaining historical node information comprises:
acquiring a history node corresponding to the new node;
and acquiring historical node information according to the historical nodes.
3. The block link point optimization method of claim 2, wherein the step of obtaining historical node information from the historical nodes comprises:
broadcasting new node information of the new node to the historical node;
and verifying the new node based on the new node information, and returning the historical node information of the historical node to the new node when the new node passes the verification.
4. The block-link node optimization method of claim 3, wherein the step of validating the new node based on the new node information comprises:
analyzing the new node information to acquire verification information of the new node;
and verifying the new node according to the verification information.
5. The block-link point optimization method of claim 1, wherein after the step of connecting the new node to the optimal node, the block-link point optimization method further comprises:
acquiring a preset updating period;
and updating the network connection of the new node based on the preset updating period.
6. The block link point optimization method of claim 5, wherein the step of updating the network connection of the new node based on the preset update period comprises:
acquiring the adjacent node of the new node;
and updating the network connection of the new node based on the preset updating period and the adjacent node.
7. The block-link point optimization method of claim 1, wherein after the step of connecting the new node to the optimal node, the block-link point optimization method further comprises:
when the new node is successfully connected with the optimal node, acquiring the connection information of the new node and the optimal node;
and broadcasting the connection information to all nodes of the current block network.
8. A block chain node optimization apparatus, comprising: memory, a processor and a block-linked point optimization program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the block-linked point optimization method of any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a block-chain node optimization program which, when executed by a processor, implements the steps of the block-chain node optimization method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810567632.4A CN108833515B (en) | 2018-06-05 | 2018-06-05 | Block chain node optimization method and device and computer readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810567632.4A CN108833515B (en) | 2018-06-05 | 2018-06-05 | Block chain node optimization method and device and computer readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108833515A CN108833515A (en) | 2018-11-16 |
CN108833515B true CN108833515B (en) | 2021-12-28 |
Family
ID=64143737
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810567632.4A Active CN108833515B (en) | 2018-06-05 | 2018-06-05 | Block chain node optimization method and device and computer readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108833515B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111431802B (en) * | 2020-03-25 | 2022-09-16 | 中国工商银行股份有限公司 | Block chain node communication optimization system and method |
CN114095329A (en) * | 2020-11-30 | 2022-02-25 | 北京八分量信息科技有限公司 | Method for realizing network topology role by optimizing node communication |
CN112291117B (en) * | 2020-12-24 | 2021-04-20 | 江苏荣泽信息科技股份有限公司 | Block chain network construction system based on customized OS |
CN112738262B (en) * | 2020-12-30 | 2024-04-02 | 普华云创科技(北京)有限公司 | Computing method and system for selecting optimal node |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107147501A (en) * | 2017-06-27 | 2017-09-08 | 中国联合网络通信集团有限公司 | Timestamp processing method and processing device |
CN107278364A (en) * | 2017-05-04 | 2017-10-20 | 深圳前海达闼云端智能科技有限公司 | Node authentication method and entity authentication system |
CN107666484A (en) * | 2017-09-19 | 2018-02-06 | 上海交通大学 | A kind of CDN sharing methods and system based on block chain |
CN107733855A (en) * | 2017-08-31 | 2018-02-23 | 中国科学院信息工程研究所 | A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously |
CN107995270A (en) * | 2017-11-24 | 2018-05-04 | 成都赤乌软件技术有限公司 | A kind of method that distributed document storage is realized based on block chain |
-
2018
- 2018-06-05 CN CN201810567632.4A patent/CN108833515B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107278364A (en) * | 2017-05-04 | 2017-10-20 | 深圳前海达闼云端智能科技有限公司 | Node authentication method and entity authentication system |
CN107147501A (en) * | 2017-06-27 | 2017-09-08 | 中国联合网络通信集团有限公司 | Timestamp processing method and processing device |
CN107733855A (en) * | 2017-08-31 | 2018-02-23 | 中国科学院信息工程研究所 | A kind of block catenary system and application process that can support publicly-owned chain, alliance's chain and privately owned chain simultaneously |
CN107666484A (en) * | 2017-09-19 | 2018-02-06 | 上海交通大学 | A kind of CDN sharing methods and system based on block chain |
CN107995270A (en) * | 2017-11-24 | 2018-05-04 | 成都赤乌软件技术有限公司 | A kind of method that distributed document storage is realized based on block chain |
Also Published As
Publication number | Publication date |
---|---|
CN108833515A (en) | 2018-11-16 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108833515B (en) | Block chain node optimization method and device and computer readable storage medium | |
US10977761B2 (en) | Digital watermark embedding method and extraction method, digital watermark embedding apparatus and extraction apparatus, and digital watermark system | |
CN108876369B (en) | Block chain-based data communication method and device and computer-readable storage medium | |
US9710977B2 (en) | Vehicle data collection and verification | |
CN107766747B (en) | Method for verifying integrity of application program installation package, mobile terminal and server | |
CN109544737A (en) | User's passing method and system | |
CN107729815B (en) | Image processing method, image processing device, mobile terminal and computer readable storage medium | |
CN108923929B (en) | Block link point consensus method, device and computer readable storage medium | |
US20090075592A1 (en) | Method and device for controlling and providing indications of communication events | |
CN108401026B (en) | Block chain-based data storage method, system and computer-readable storage medium | |
CN109995876B (en) | File transmission method, device, system and computer storage medium | |
CN109559110A (en) | Noninductive method of payment and system | |
CN112035897A (en) | Block chain evidence storage method and related device | |
CN112865956A (en) | Certificate updating method and device, terminal equipment and server | |
WO2021164376A1 (en) | Recommendation method, apparatus and device, and computer-readable storage medium | |
CN110808872A (en) | Method and device for realizing flow experiment and electronic equipment | |
CN111090866A (en) | Application authority management method, mobile terminal and computer readable storage medium | |
CN110516471A (en) | Product promotion method and relevant device based on information security | |
CN110502263B (en) | Upgrade package manufacturing method, system and computer readable storage medium | |
CN105468947A (en) | Information processing method and device and electronic equipment | |
CN107633161B (en) | Terminal for access control of protected data and related product | |
CN109039873A (en) | Chat record display methods, device and computer readable storage medium | |
US20150112997A1 (en) | Method for content control and electronic device thereof | |
CN112149172A (en) | Business data management method, device, equipment and computer readable storage medium | |
US8600340B1 (en) | Movement detection system for a portable device such as a portable phone |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |