CN110875938A - Method and device for sending information in block chain - Google Patents
Method and device for sending information in block chain Download PDFInfo
- Publication number
- CN110875938A CN110875938A CN201811011457.7A CN201811011457A CN110875938A CN 110875938 A CN110875938 A CN 110875938A CN 201811011457 A CN201811011457 A CN 201811011457A CN 110875938 A CN110875938 A CN 110875938A
- Authority
- CN
- China
- Prior art keywords
- node
- neighbor
- information
- distance parameter
- parameter value
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
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
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1044—Group management mechanisms
-
- 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/50—Network services
- H04L67/52—Network services specially adapted for the location of the user terminal
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0852—Delays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L43/00—Arrangements for monitoring or testing data switching networks
- H04L43/08—Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
- H04L43/0876—Network utilisation, e.g. volume of load or congestion level
- H04L43/0894—Packet rate
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Physics (AREA)
- Theoretical Computer Science (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The application discloses a method for sending information in a block chain, which is applied to any node in the block chain and comprises the steps of obtaining a distance parameter value of each neighbor node in a neighbor list of the node, updating the neighbor list, wherein the distance parameter value represents the distance between the node and the neighbor node; selecting a plurality of neighbor nodes with similar distances to the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list; and sending information to each target node. The invention objectively evaluates the distance between the target node and the neighbor node before sending information to the neighbor node, preferentially selects the close neighbor node as the target node for sending the information, and effectively accelerates the information transmission efficiency in the block chain.
Description
Technical Field
The present invention relates to the field of block chain technology, and more particularly, to a method and an apparatus for sending information in a block chain.
Background
In a blockchain network, each node may establish a connection with another node.
In the prior art, when a node is a member of a blockchain network, the node must maintain a neighbor list. When the node needs to send information, a plurality of neighbor nodes are selected from the neighbor list in a free or random mode to send the information.
The neighbor nodes selected in a free or random manner may include neighbor nodes closer to the node sending the information, or may include neighbor nodes farther from the node sending the information. It can be understood that when a node communicates with a neighboring node at a longer distance, the information transmission efficiency is low, which causes a problem of low information transmission efficiency in the whole block chain network.
Disclosure of Invention
In view of this, the present invention provides a method and an apparatus for sending information in a blockchain, which effectively increase the efficiency of information propagation in the blockchain.
In order to achieve the above purpose, the invention provides the following specific technical scheme:
a method for sending information in a block chain is applied to any node in the block chain, and comprises the following steps:
acquiring a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, wherein the distance parameter value represents the distance between the node and the neighbor node;
selecting a plurality of neighbor nodes with similar distances to the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and sending information to each target node.
Optionally, obtaining a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, includes:
measuring network parameters between a node and a neighbor node when the node sends information to the neighbor node, and acquiring a distance parameter value of each neighbor node receiving the information;
and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Optionally, the distance parameter value is a time delay value or an inverse of a network bandwidth value.
Optionally, the obtaining a distance parameter value of each neighboring node that receives the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Optionally, the obtaining a distance parameter value of each neighboring node that receives the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Optionally, the selecting, according to the distance parameter value of each neighbor node in the neighbor list, a plurality of neighbor nodes whose distances from the nodes are close to each other as target nodes includes:
and sequencing the neighbor nodes in the list according to the sequence of the distance parameter values from small to large, and selecting the neighbor nodes with preset number as target nodes according to the sequence.
Optionally, the selecting, according to the distance parameter value of each neighbor node in the neighbor list, a plurality of neighbor nodes whose distances from the nodes are close to each other as target nodes includes:
and according to the distance parameter value of each neighbor node in the neighbor list, taking the neighbor node with the distance parameter value smaller than a preset value as a target node.
Optionally, the method further includes:
when the node accesses the network, initializing a neighbor list, and endowing each neighbor node in the neighbor list with an infinite distance parameter value.
An apparatus for transmitting information in a block chain, comprising:
the system comprises a parameter acquisition unit, a node selection unit and a parameter updating unit, wherein the parameter acquisition unit is used for acquiring a distance parameter value of each neighbor node in a neighbor list of the node and updating the neighbor list, and the distance parameter value represents the distance between the node and the neighbor node;
the node selection unit is used for selecting a plurality of neighbor nodes with the distances close to the distances between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and the information sending unit is used for sending information to each target node.
Optionally, the parameter obtaining unit is specifically configured to measure a network parameter between the node and a neighboring node when the node sends information to the neighboring node, and obtain a distance parameter value of each neighboring node that receives the information; and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Optionally, the distance parameter value is a time delay value or an inverse of a network bandwidth value.
Optionally, the parameter obtaining unit is specifically configured to obtain a delay value and a network bandwidth value between the node and each neighboring node that receives the information; and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Optionally, the parameter obtaining unit is specifically configured to obtain a delay value and a network bandwidth value between the node and each neighboring node that receives the information; and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Optionally, the node selecting unit is specifically configured to sort the neighbor nodes in the list according to a sequence of distance parameter values from small to large, and select a preset number of neighbor nodes as the target nodes according to the sort.
Optionally, the node selecting unit is specifically configured to take, as the target node, the neighbor node whose distance parameter value is smaller than the preset value according to the distance parameter value of each neighbor node in the neighbor list.
Optionally, the apparatus further comprises:
and the initialization unit is used for initializing the neighbor list when the node accesses the network and endowing each neighbor node in the neighbor list with an infinite distance parameter value.
Compared with the prior art, the invention has the following beneficial effects:
the invention discloses a method for sending information in a block chain, which is applied to any node in the block chain, wherein before the node sends the information to a neighbor node, the distance between the node and each neighbor node is objectively evaluated by acquiring a distance parameter value of each neighbor node in a neighbor list of the node, and the neighbor node which is close is preferentially selected as a target node for sending the information, so that the problem of low information transmission efficiency in the block chain caused by the fact that the neighbor node is selected to send the information in a free or random mode in the prior art is solved, and the information transmission efficiency in the block chain is effectively accelerated.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic flow chart of a method for sending information in a block chain according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for sending information in a block chain according to another embodiment of the present invention;
fig. 3 is a schematic structural diagram of an apparatus for sending information in a block chain according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the 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.
The present embodiment discloses a method for sending information in a block chain, which is applied to any one node in the block chain, and for convenience of description, a node for sending information, that is, an execution main body of the embodiment, is represented by an initial node, please refer to fig. 1, where the method specifically includes the following steps:
s101: acquiring a distance parameter value of each neighbor node in a neighbor list of an initial node, and updating the neighbor list;
the distance parameter value represents a distance between the initial node and a neighboring node, and it should be noted that the distance between the nodes is not a physical distance between the nodes, but refers to an information transmission distance between the nodes. It can be understood that the smaller the distance parameter value of the neighboring node, the smaller the information transmission distance between the neighboring node and the initial node, and the faster the information transmission.
It should be further noted that, there are various ways to obtain the distance parameter value of each neighbor node in the neighbor list of the initial node, such as: the method comprises the steps that when an initial node is idle, namely the initial node does not send information, distance parameter values of all neighbor nodes in a neighbor list of the initial node are obtained, or in order to reduce data processing pressure of the initial node, the distance parameter values of each neighbor node receiving the information are obtained while the initial node sends the information, and the distance parameter values of other neighbor nodes in the neighbor list of the initial node are directly obtained from the neighbor list by the initial node.
S102: selecting a plurality of neighbor nodes with the distances similar to those between the initial nodes as target nodes according to the distance parameter values of each neighbor node in the neighbor list;
according to the distance parameter value of each neighbor node in the neighbor list, a plurality of neighbor nodes with similar distances to the nodes are selected as target nodes, and various implementation manners can be adopted, which are described in two manners below by way of example.
In a first mode
And sequencing the neighbor nodes in the list according to the sequence of the distance parameter values from small to large, and selecting the neighbor nodes with preset number as target nodes according to the sequence.
For example, 20 neighbor nodes exist in the neighbor list of the initial node, after the neighbor nodes in the list are sorted in the order of the distance parameter values from small to large, the top 10 neighbor nodes are selected from the sorting in the neighbor list of the initial node as target nodes.
The advantage of this approach is that the originating node sends information to the same number of target nodes at a time.
Mode two
And taking the neighbor node with the distance parameter value smaller than the preset value as a target node according to the distance parameter value of each neighbor node in the neighbor list of the initial node.
If the distance parameter value of each neighbor node in the neighbor list of the initial node is smaller than the preset value, the neighbor nodes smaller than the preset value are selected as the target nodes.
The method has the advantages that the distance parameter value of the target node selected each time is smaller than the preset value, so that the time for the initial node to send the information to the target node each time is relatively stable.
S103: information is sent to each target node.
The method for sending the information in the block chain is applied to any node in the block chain, before the initial node sends the information to the neighbor nodes, the distance between the initial node and each neighbor node is objectively evaluated by obtaining the distance parameter value of each neighbor node in the neighbor list of the initial node, and the neighbor node close to the initial node is preferentially selected as the target node for sending the information, so that the problem of low information transmission efficiency in the block chain caused by selecting the neighbor node to send the information in a free or random mode in the prior art is solved, and the transmission efficiency of the information in the block chain is effectively accelerated.
It should be added that the information transmission in this embodiment may be the first time information is transmitted when the initial node accesses the network, or may not be the first time information is transmitted. Referring to fig. 2, when an initial node first transmits information when accessing a network, a method for transmitting information in a block chain includes the following steps:
s201: when the initial node is accessed to the network, initializing a neighbor list, and endowing each neighbor node in the neighbor list with an infinite distance parameter value;
s202: acquiring a distance parameter value of each neighbor node in a neighbor list of an initial node, and updating the neighbor list;
s203: selecting a plurality of neighbor nodes with the distances similar to those between the initial nodes as target nodes according to the distance parameter values of each neighbor node in the neighbor list;
s204: information is sent to each target node.
It should be noted that, when the initial node accesses the network, a neighbor list needs to be initialized, and each neighbor node in the neighbor list may be any node in the block chain except the initial node. In practical application, each neighbor node in the neighbor list is allocated to the target node by the system according to a certain principle.
The method comprises the steps of giving an infinite distance parameter value to each neighbor node in a neighbor list when initializing the neighbor list, respectively measuring network parameters between the initial node and each neighbor node in the neighbor list, obtaining the distance parameter value of each neighbor node, and updating the distance parameter value of each neighbor node in the neighbor list, namely replacing the infinite distance parameter value given to each neighbor node with the corresponding distance parameter value obtained through detection. And then selecting a plurality of neighbor nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list, and sending information to each target node.
When the initial node does not transmit information for the first time, the distance parameter value of each neighbor node in the neighbor list of the initial node is not already the initially assigned infinite distance parameter value. At the moment, according to the distance parameter value of each neighbor node in the neighbor list, selecting a plurality of neighbor nodes as target nodes, sending information to each target node, measuring the network parameters between the initial node and the target nodes while sending the information to each target node, obtaining the distance parameter value of each neighbor node receiving the information, updating the distance parameter value of each neighbor node receiving the information in the neighbor list, and keeping the distance parameter value of each neighbor node not receiving the information unchanged. It can be understood that the network parameters between the initial node and each neighbor node are changed in real time, and therefore, the distance parameter values of the neighbor nodes in the neighbor list obtained by the initial node after sending information each time may be changed, so that the target nodes selected by the initial node from the neighbor list each time may be different, but the near neighbor node is preferentially selected as the target node for sending information each time, and the information propagation efficiency in the block chain is effectively accelerated.
It should be noted that there are various measurement methods for the distance between the initial node and the neighboring node, i.e. the distance parameter has various expressions. This embodiment is illustrated in the following four ways.
In a first mode
The method comprises the steps of measuring network parameters between an initial node and neighbor nodes, obtaining a Time delay value of each neighbor node, such as Round-Trip Time (RTT), and taking the Time delay value as a distance parameter value.
The measurement method of the time delay value is to add a time stamp to the sent message, and the receiving end reserves the time stamp in the feedback message. The sending end is an initial node, and the receiving end is a neighbor node. And after the sending end receives the feedback, representing the time delay value between the initial node and the neighbor node by the difference value of the current time and the time stamp. The method does not need to use special measurement grouping by both the initial node and the neighbor node, and is a lightweight but reliable measurement method, wherein the smaller the delay value is, the closer the distance between the initial node and the neighbor node is.
RTT is an important performance indicator in a computer network, and indicates the total time delay from when a sending end sends data to when the sending end receives an acknowledgement from a receiving end (the receiving end immediately sends an acknowledgement after receiving the data). It is understood that the transmitting end is an initial node and the receiving end is a target node.
Mode two
And measuring network parameters between the initial node and the neighbor nodes, acquiring a network bandwidth value between the initial node and each neighbor node, and taking the reciprocal of the network bandwidth value as a distance parameter value.
It is understood that the network bandwidth value represents the amount of data that can pass through the link per unit time, and the information is transmitted faster the larger the network bandwidth value is, that is, the distance between the initial node and the neighboring node is closer the larger the network bandwidth value is, and the distance between the initial node and the neighboring node is inversely proportional to the network bandwidth value. Since the distance parameter value represents the distance between the initial node and the neighboring node, the reciprocal of the network bandwidth value is taken as the distance parameter value.
Mode III
Measuring network parameters between the initial node and the neighbor nodes, acquiring a time delay value and a network bandwidth value between the initial node and each neighbor node, and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the initial node and the neighbor nodes according to preset weights of the time delay value and the network bandwidth value to obtain a distance parameter value of each neighbor node.
And the preset weights of the time delay value and the network bandwidth value are preset by the system.
It should be noted that the distance parameter value represents the distance between the initial node and the neighboring node, and therefore, a smaller distance parameter value represents a closer distance between the initial node and the neighboring node, a smaller delay value represents a closer distance between the initial node and the neighboring node, and a larger network bandwidth value represents a closer distance between the initial node and the neighboring node. Therefore, the distance between the initial node and the neighboring node is proportional to the delay value, and the distance between the initial node and the neighboring node is inversely proportional to the network bandwidth value, that is, the distance parameter value is proportional to the delay value, and the distance parameter value is inversely proportional to the network bandwidth value.
On this basis, specifically, one embodiment of performing weighted summation on the delay value and the network bandwidth value between the initial node and the neighboring node is as follows:
S1=Doff+KBw
wherein, S1 is a distance parameter value, Doff is a time delay value, the unit is ms, Bw is a network bandwidth value, the unit is mb/S, and K is smaller than zero.
Mode IV
The method includes the steps that network parameters between an initial node and neighbor nodes are measured, a time delay value and a network bandwidth value between the node and each neighbor node receiving information are obtained, it is to be noted that the distance between the initial node and each neighbor node is in direct proportion to the time delay value, the distance between the initial node and each neighbor node is in inverse proportion to the network bandwidth value, and on the basis, the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value is calculated respectively, so that the distance parameter value of each neighbor node receiving the information is obtained.
The specific value of the time delay value and the network bandwidth value between the calculation node and the neighbor node receiving the information is as follows:
S1=Doff/Bw
wherein, S1 is a distance parameter value, Doff is a delay value, and the unit is ms, and Bw is a width Bw, and the unit is mb/S.
The above four modes are four optional modes of the distance parameter value in the embodiment, and the invention is not limited thereto.
According to the method for sending the information in the block chain, the distance between the target node and the neighbor node is objectively evaluated before the information is sent to the neighbor node, and the neighbor node which is close to the target node is preferentially selected as the target node for sending the information, so that the information transmission efficiency in the block chain is effectively improved.
Referring to fig. 3, the present embodiment correspondingly discloses a device for sending information in a block chain, which includes:
a parameter obtaining unit 301, configured to obtain a distance parameter value of each neighbor node in a neighbor list of a node, and update the neighbor list, where the distance parameter value represents a distance between the node and the neighbor node;
optionally, the parameter obtaining unit 301 is specifically configured to measure a network parameter between a node and a neighboring node when the node sends information to the neighboring node, and obtain a distance parameter value of each neighboring node that receives the information; and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Optionally, the distance parameter value is a time delay value or a reciprocal of a network bandwidth value;
optionally, the parameter obtaining unit 301 is specifically configured to obtain a delay value and a network bandwidth value between a node and each neighboring node that receives information; and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Optionally, the parameter obtaining unit 301 is specifically configured to obtain a delay value and a network bandwidth value between a node and each neighboring node that receives information; and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
A node selecting unit 302, configured to select, according to a distance parameter value of each neighbor node in the neighbor list, multiple neighbor nodes with distances close to distances between the nodes as target nodes;
optionally, the node selecting unit 302 is specifically configured to sort the neighbor nodes in the list according to a sequence of distance parameter values from small to large, and select a preset number of neighbor nodes as target nodes according to the sort.
Optionally, the node selecting unit 302 is specifically configured to take, as a target node, a neighboring node whose distance parameter value is smaller than a preset value according to the distance parameter value of each neighboring node in the neighboring list.
An information sending unit 303, configured to send information to each of the target nodes.
Optionally, the apparatus further comprises:
the initialization unit is used for initializing a neighbor list when the node is accessed to a network and endowing each neighbor node in the neighbor list with an infinite distance parameter value; and respectively detecting the network state between the node and each neighbor node in the neighbor list, and acquiring the distance between each neighbor node.
The device for sending information in a block chain disclosed by the embodiment is applied to any node in the block chain, before the node sends information to a neighbor node, the distance between the node and each neighbor node is objectively evaluated by acquiring the distance parameter value of each neighbor node in the neighbor list of the node, and the neighbor node which is close is preferentially selected as a target node for sending the information, so that the problem of low information transmission efficiency in the block chain caused by the fact that the neighbor node is selected to send the information in a free or random mode in the prior art is solved, and the information transmission efficiency in the block chain is effectively accelerated.
The device for sending the information in the block chain comprises a processor and a memory, wherein the parameter acquisition unit, the node selection unit, the information sending unit, the initialization unit and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more, and the information transmission efficiency between the nodes in the block chain is improved by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
An embodiment of the present invention provides a storage medium, on which a program is stored, and the program, when executed by a processor, implements a method for transmitting information in a blockchain.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes the sending method of the information in the block chain when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps:
acquiring a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, wherein the distance parameter value represents the distance between the node and the neighbor node;
selecting a plurality of neighbor nodes with similar distances to the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and sending information to each target node.
Further, obtaining a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, including:
measuring network parameters between a node and a neighbor node when the node sends information to the neighbor node, and acquiring a distance parameter value of each neighbor node receiving the information;
and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Further, the distance parameter value is a time delay value or an inverse of a network bandwidth value.
Further, the obtaining of the distance parameter value of each neighbor node receiving the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Further, the obtaining of the distance parameter value of each neighbor node receiving the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information. Further, the selecting a plurality of neighbor nodes with a distance similar to the distance between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list includes:
and sequencing the neighbor nodes in the list according to the sequence of the distance parameter values from small to large, and selecting the neighbor nodes with preset number as target nodes according to the sequence.
Further, the selecting a plurality of neighbor nodes with a distance similar to the distance between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list includes:
and according to the distance parameter value of each neighbor node in the neighbor list, taking the neighbor node with the distance parameter value smaller than a preset value as a target node.
Further, the method further comprises:
when the node accesses the network, initializing a neighbor list, and endowing each neighbor node in the neighbor list with an infinite distance parameter value.
The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device:
acquiring a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, wherein the distance parameter value represents the distance between the node and the neighbor node;
selecting a plurality of neighbor nodes with similar distances to the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and sending information to each target node.
Further, obtaining a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, including:
measuring network parameters between a node and a neighbor node when the node sends information to the neighbor node, and acquiring a distance parameter value of each neighbor node receiving the information;
and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Further, the distance parameter value is a time delay value or an inverse of a network bandwidth value.
Further, the obtaining of the distance parameter value of each neighbor node receiving the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
Further, the obtaining of the distance parameter value of each neighbor node receiving the information includes:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information. Further, the selecting a plurality of neighbor nodes with a distance similar to the distance between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list includes:
and sequencing the neighbor nodes in the list according to the sequence of the distance parameter values from small to large, and selecting the neighbor nodes with preset number as target nodes according to the sequence.
Further, the selecting a plurality of neighbor nodes with a distance similar to the distance between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list includes:
and according to the distance parameter value of each neighbor node in the neighbor list, taking the neighbor node with the distance parameter value smaller than a preset value as a target node.
Further, the method further comprises:
when the node accesses the network, initializing a neighbor list, and endowing each neighbor node in the neighbor list with an infinite distance parameter value.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus 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 apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims (10)
1. A method for sending information in a block chain is applied to any node in the block chain, and the method comprises the following steps:
acquiring a distance parameter value of each neighbor node in a neighbor list of the node, and updating the neighbor list, wherein the distance parameter value represents the distance between the node and the neighbor node;
selecting a plurality of neighbor nodes with similar distances to the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and sending information to each target node.
2. The method of claim 1, wherein obtaining distance parameter values for each neighbor node in a neighbor list of a node and updating the neighbor list comprises:
measuring network parameters between a node and a neighbor node when the node sends information to the neighbor node, and acquiring a distance parameter value of each neighbor node receiving the information;
and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
3. The method of claim 1 or 2, wherein the distance parameter value is a delay value or an inverse of a network bandwidth value.
4. The method of claim 2, wherein obtaining the distance parameter value of each neighboring node that receives the information comprises:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively carrying out weighted summation on the time delay value and the network bandwidth value between the node and each neighbor node receiving the information according to the preset weights of the time delay value and the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
5. The method of claim 2, wherein obtaining the distance parameter value of each neighboring node that receives the information comprises:
acquiring a time delay value and a network bandwidth value between a node and each neighbor node receiving information;
and respectively calculating the ratio of the time delay value between the node and each neighbor node receiving the information to the network bandwidth value to obtain the distance parameter value of each neighbor node receiving the information.
6. The method of claim 1, wherein selecting a plurality of neighboring nodes with a similar distance to the node as the target node according to the distance parameter value of each neighboring node in the neighbor list comprises:
and sequencing the neighbor nodes in the list according to the sequence of the distance parameter values from small to large, and selecting the neighbor nodes with preset number as target nodes according to the sequence.
7. The method of claim 1, wherein selecting a plurality of neighboring nodes with a similar distance to the node as the target node according to the distance parameter value of each neighboring node in the neighbor list comprises:
and according to the distance parameter value of each neighbor node in the neighbor list, taking the neighbor node with the distance parameter value smaller than a preset value as a target node.
8. The method of claim 1, further comprising:
when the node accesses the network, initializing a neighbor list, and endowing each neighbor node in the neighbor list with an infinite distance parameter value.
9. An apparatus for transmitting information in a block chain, comprising:
the system comprises a parameter acquisition unit, a node selection unit and a parameter updating unit, wherein the parameter acquisition unit is used for acquiring a distance parameter value of each neighbor node in a neighbor list of the node and updating the neighbor list, and the distance parameter value represents the distance between the node and the neighbor node;
the node selection unit is used for selecting a plurality of neighbor nodes with the distances close to the distances between the nodes as target nodes according to the distance parameter value of each neighbor node in the neighbor list;
and the information sending unit is used for sending information to each target node.
10. The apparatus according to claim 9, wherein the parameter obtaining unit is specifically configured to measure a network parameter between a node and a neighboring node when the node sends information to the neighboring node, and obtain a distance parameter value of each neighboring node that receives the information; and in the neighbor list, updating the distance parameter value of each neighbor node which receives the information, and keeping the distance parameter value of each neighbor node which does not receive the information unchanged.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811011457.7A CN110875938A (en) | 2018-08-31 | 2018-08-31 | Method and device for sending information in block chain |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811011457.7A CN110875938A (en) | 2018-08-31 | 2018-08-31 | Method and device for sending information in block chain |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110875938A true CN110875938A (en) | 2020-03-10 |
Family
ID=69715263
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811011457.7A Pending CN110875938A (en) | 2018-08-31 | 2018-08-31 | Method and device for sending information in block chain |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110875938A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111740915A (en) * | 2020-08-05 | 2020-10-02 | 百度在线网络技术(北京)有限公司 | Neighbor node determination method, device, equipment and storage medium |
CN111818087A (en) * | 2020-07-27 | 2020-10-23 | 深圳壹账通智能科技有限公司 | Block chain node access method, device, equipment and readable storage medium |
CN114466022A (en) * | 2021-12-31 | 2022-05-10 | 苏州浪潮智能科技有限公司 | Method, device and medium for acquiring server seed nodes in cluster |
CN115567541A (en) * | 2022-12-01 | 2023-01-03 | 杭州蚂蚁酷爱科技有限公司 | Block chain network, node set maintenance method and device |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988449A (en) * | 2005-12-20 | 2007-06-27 | 中国科学院声学研究所 | Data distributing/obtaining method based on network information |
US20100091823A1 (en) * | 2008-10-13 | 2010-04-15 | Cisco Technology, Inc. | Two-hop Relay for Reducing Distance Vector Routing Information |
CN102238684A (en) * | 2011-08-01 | 2011-11-09 | 南京邮电大学 | Routing method based on bandwidth and delay bi-objective optimization |
CN103595741A (en) * | 2012-08-14 | 2014-02-19 | 中国科学院声学研究所 | A node in P2P stream media and a method for optimizing a neighbor node table of the node |
CN104285412A (en) * | 2012-05-16 | 2015-01-14 | 阿尔卡特朗讯公司 | A method and computer program products for routing a data unit |
CN104639467A (en) * | 2015-03-06 | 2015-05-20 | 北京邮电大学 | Bandwidth allocation method, device and optical network system |
CN106686060A (en) * | 2016-12-05 | 2017-05-17 | 中国科学院声学研究所 | Content spread method and system |
US20190116117A1 (en) * | 2016-04-28 | 2019-04-18 | Fairflow Technologies Holding B.V. | Distributing and aggregating resource data in a network |
-
2018
- 2018-08-31 CN CN201811011457.7A patent/CN110875938A/en active Pending
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1988449A (en) * | 2005-12-20 | 2007-06-27 | 中国科学院声学研究所 | Data distributing/obtaining method based on network information |
US20100091823A1 (en) * | 2008-10-13 | 2010-04-15 | Cisco Technology, Inc. | Two-hop Relay for Reducing Distance Vector Routing Information |
CN102238684A (en) * | 2011-08-01 | 2011-11-09 | 南京邮电大学 | Routing method based on bandwidth and delay bi-objective optimization |
CN104285412A (en) * | 2012-05-16 | 2015-01-14 | 阿尔卡特朗讯公司 | A method and computer program products for routing a data unit |
CN103595741A (en) * | 2012-08-14 | 2014-02-19 | 中国科学院声学研究所 | A node in P2P stream media and a method for optimizing a neighbor node table of the node |
CN104639467A (en) * | 2015-03-06 | 2015-05-20 | 北京邮电大学 | Bandwidth allocation method, device and optical network system |
US20190116117A1 (en) * | 2016-04-28 | 2019-04-18 | Fairflow Technologies Holding B.V. | Distributing and aggregating resource data in a network |
CN106686060A (en) * | 2016-12-05 | 2017-05-17 | 中国科学院声学研究所 | Content spread method and system |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111818087A (en) * | 2020-07-27 | 2020-10-23 | 深圳壹账通智能科技有限公司 | Block chain node access method, device, equipment and readable storage medium |
CN111740915A (en) * | 2020-08-05 | 2020-10-02 | 百度在线网络技术(北京)有限公司 | Neighbor node determination method, device, equipment and storage medium |
CN114466022A (en) * | 2021-12-31 | 2022-05-10 | 苏州浪潮智能科技有限公司 | Method, device and medium for acquiring server seed nodes in cluster |
CN114466022B (en) * | 2021-12-31 | 2023-07-21 | 苏州浪潮智能科技有限公司 | Method, device and medium for obtaining server seed nodes in cluster |
CN115567541A (en) * | 2022-12-01 | 2023-01-03 | 杭州蚂蚁酷爱科技有限公司 | Block chain network, node set maintenance method and device |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110875938A (en) | Method and device for sending information in block chain | |
US20170171344A1 (en) | Scheduling method and server for content delivery network service node | |
US11018944B2 (en) | Method and apparatus for virtualized network function scaling that is initiated by network management and/or element management | |
CN109951494B (en) | Simulation data processing method and device, simulation equipment and storage medium | |
CN110768912A (en) | API gateway current limiting method and device | |
CN106453122B (en) | A kind of choosing method and device of Stream Data Transmission node | |
CN107707612B (en) | Method and device for evaluating resource utilization rate of load balancing cluster | |
CN110381151A (en) | A kind of warping apparatus detection method and device | |
CN111966289A (en) | Partition optimization method and system based on Kafka cluster | |
CN112584422A (en) | 5G terminal performance obtaining method and device | |
CN111562884B (en) | Data storage method and device and electronic equipment | |
CN116321303A (en) | Data caching method, device, equipment and readable storage medium | |
CN109597680B (en) | Task queuing response parameter estimation method and device | |
WO2019105400A1 (en) | Method and device for triggering measurement and reporting, and storage medium thereof | |
GB2581309A (en) | Policy-based optimization of cloud resources on tiered storage operations | |
US11470167B2 (en) | Method and apparatus for generating information | |
US10387578B1 (en) | Utilization limiting for nested object queries | |
CN109587198B (en) | Image-text information pushing method and device | |
CN111967938B (en) | Cloud resource recommendation method and device, computer equipment and readable storage medium | |
CN111181864A (en) | Method and apparatus for determining link congestion status from an application to a server | |
CN105978807A (en) | Method and system for measuring distance between nodes | |
CN115801896A (en) | Calculation network node distribution method and device, electronic equipment and storage medium | |
US11886928B2 (en) | Automated service tiering between edge computing sites and a core data center | |
CN113642638B (en) | Capacity adjustment method, model training method, device, equipment and storage medium | |
US11579915B2 (en) | Computing node identifier-based request allocation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
TA01 | Transfer of patent application right | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20210701 Address after: Room 4-a1, 4th floor, block B, Chuangxin building, 11 Hepingli East Street, Dongcheng District, Beijing Applicant after: ZHONGSI BOAN TECHNOLOGY (BEIJING) Co.,Ltd. Address before: 50 Raffles Place, 34-04 Luta, Singapore Applicant before: YUANYI TECHNOLOGY HOLDINGS Co.,Ltd. |
|
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |