CN113114670A - Multi-protocol connection method, equipment and storage medium of block chain network - Google Patents
Multi-protocol connection method, equipment and storage medium of block chain network Download PDFInfo
- Publication number
- CN113114670A CN113114670A CN202110385369.9A CN202110385369A CN113114670A CN 113114670 A CN113114670 A CN 113114670A CN 202110385369 A CN202110385369 A CN 202110385369A CN 113114670 A CN113114670 A CN 113114670A
- Authority
- CN
- China
- Prior art keywords
- node
- address information
- protocol
- network
- connection
- 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
- 238000000034 method Methods 0.000 title claims abstract description 28
- 230000005540 biological transmission Effects 0.000 claims description 32
- 238000004590 computer program Methods 0.000 claims description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 230000006870 function Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000001010 compromised effect Effects 0.000 description 1
- 230000000670 limiting effect Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000035945 sensitivity Effects 0.000 description 1
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
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/18—Multiprotocol handlers, e.g. single devices capable of handling multiple protocols
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Computer Security & Cryptography (AREA)
- Computer And Data Communications (AREA)
Abstract
The invention discloses a multi-protocol connection method, equipment and a storage medium of a block chain network, belonging to the technical field of information.
Description
Technical Field
The present invention relates to the field of information technology, and in particular, to a method, an apparatus, and a storage medium for multi-protocol connection in a blockchain network.
Background
In the existing scheme, one blockchain network is adopted, and the same network transmission protocol is adopted, for example, the TCP protocol is adopted for network connection, and other network participants must use the TCP protocol to access the blockchain network. The nodes of the whole network adopt the same network protocol for network connection, if the nodes are assumed to be TCP protocol, other nodes must be TCP, and if the nodes want to adopt other protocol UDP, the nodes can be directly rejected by the nodes of the other party. However, the TCP protocol must establish a connection, perform error check, and ensure that the files are received according to the sending sequence, which also makes the transmission efficiency and speed of the TCP protocol not superior. The UDP protocol is well known for simplicity and high efficiency, but the reliability and accuracy of transmission are greatly compromised, and there are various transmission requirements in the blockchain network, and it is obvious that all the transmission requirements cannot be met by only using one network transmission protocol.
Disclosure of Invention
Objects of the invention
In view of the above technical problems, the present invention provides a method, an apparatus, and a storage medium for multi-protocol connection of a blockchain network, which can adopt different configurations according to different requirements, thereby improving the diversity of blockchain network transmission.
Second, technical scheme
In order to solve the technical problems, the technical scheme provided by the invention is as follows:
in a first aspect, a multi-protocol connection method for a blockchain network, where the blockchain network includes a first node and a second node responding to a connection request of the first node, and multiple transport protocols are configured in the first node, includes:
the first node acquires address information of the second node; the address information comprises a mark field and a protocol address, and the mark field is used for marking the type of a transmission protocol applicable to the second node;
and the first node calls a corresponding transmission protocol according to the address information of the second node and establishes connection with the second node.
Preferably, before the first node acquires the address information of the second node, the method further includes the following steps:
the first node constructs an address information set according to a plurality of transmission protocols; the address information set comprises a plurality of address information, and the plurality of address information correspond to a plurality of transmission protocols configured by the address information set one by one;
the first node accesses the block chain network through a built-in guide node.
Preferably, after the first node accesses the blockchain network, the first node is disconnected from the guide node after forming stable connection with the N nodes.
Preferably, the specific steps of the first node accessing the blockchain network through the built-in bootstrap node are as follows:
the first node acquires address information of a guide node;
the first node calls a corresponding transmission protocol according to the address information of the guide node and establishes connection with the guide node;
the first node sends its set of address information to the bootstrapping node.
Preferably, the first node broadcasts its own set of address information to nodes connected to it.
Preferably, the address information in the address information set is provided with a priority ranking.
In a second aspect, a computer device, one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any one of the first aspect and its preferred aspects.
In a third aspect, a storage medium stores a computer program which, when executed by a processor, implements a method as set forth in any one of the first aspect and its preferred embodiments.
Third, beneficial effect
Compared with the prior art, the technical scheme provided by the invention has the beneficial effects that different configurations can be adopted according to different requirements, the transmission diversity of the block chain network is improved, and the overall performance of the block chain network is improved.
Drawings
Fig. 1 is a flowchart illustrating a block chain network multi-protocol connection method according to embodiment 1 of the present invention;
fig. 2 is a schematic diagram illustrating a specific step of S200 in embodiment 1 of the present invention;
fig. 3 is a schematic diagram of a block chain network connection in embodiment 1 of the present invention;
fig. 4 is a schematic structural diagram of an apparatus provided in embodiment 2.
Detailed Description
For a further understanding of the present invention, reference will now be made in detail to the embodiments illustrated in the drawings.
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the present invention are shown in the drawings.
The terms first, second, and the like in the present invention are provided for convenience of describing the technical solution of the present invention, and have no specific limiting effect, but are all generic terms, and do not limit the technical solution of the present invention. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Example 1
As shown in fig. 1, a multi-protocol connection method for a blockchain network, where the blockchain network includes a first node and a second node responding to a connection request of the first node, and multiple transport protocols are configured in the first node, includes:
s100, the first node constructs an address information set according to a plurality of transmission protocols. The address information set comprises a plurality of address information, and the plurality of address information correspond to a plurality of transmission protocols configured by the address information set.
S200, the first node accesses the block chain network through a built-in guide node. The method comprises the following specific steps:
s201, the first node acquires the address information of the guide node.
S202, the first node calls a corresponding transmission protocol according to the address information of the guide node and establishes connection with the guide node.
S203, the first node sends the address information set to the guide node.
S300, the first node acquires the address information of the second node. Wherein the address information comprises a mark field and a protocol address, and the mark field is used for marking the type of the transmission protocol applicable to the second node.
S400, the first node calls a corresponding transmission protocol according to the address information of the second node and establishes connection with the second node. Preferably, after the first node accesses the blockchain network, the first node is disconnected from the bootstrap node after forming stable connections with the N nodes.
S500, the first node broadcasts the address information set of the first node to the nodes connected with the first node. Preferably, the address information in the address information set is provided with a priority order.
In the above scheme, the first node constructs its own address information set after starting, the address information in the address information set corresponds to its configured network transmission protocol one by one, and configures one address information for each protocol, and the address information used here includes an IP address and a tag field, and the tag field is added before the IP address for tagging the protocol type, so the IP addresses of the address information in the address information set are all the same, but the protocol types in the tag field are all the same and correspond to the network transmission protocol configured by the first node one by one. After the first node is started, the first node accesses the blockchain network through a built-in guide node, the first node sends an address information set of the first node to the guide node, other nodes in the blockchain network can acquire the address information of the first node through the guide node so as to establish connection with the first node, the first node can also actively establish connection with other nodes, and after the first node is connected with enough nodes, the first node can be disconnected with the guide node so as to guide resources of the nodes. The address information in the address information set is prioritized according to settings, for example, when the contents such as video transmission and the like are mainly used among nodes, the priority of the UDP protocol can be set up to be adjusted up, so that the transmission among the nodes is more consistent with the application scene, the system overhead of network connection is reduced, and the overall performance of the block chain is improved.
Specifically, taking the node a configured with the TCP protocol and the UDP protocol as an example, the node a constructs a network address of the blockchain network where the node a is located according to the network protocol configured by the node a, for example, if the TCP protocol is selected, the network address of the node is: /tcp/122.224.166.11: 13802/pid; if the UDP protocol is selected, its network address: (viii)/udp/122.224.166.11: 13802/pid; the address information set of node a includes two address information corresponding to the TCP protocol and the UDP protocol, respectively: d {/tcp/122.224.166.11: 13802/pid; /udp/122.224.166.11:13802/pid }
Where D is the set of address information.
The two pieces of address information may be prioritized according to information such as the protocol usage of the entire network or the protocol of the pre-connection node.
After the A node is started, network connection is carried out according to a built-in guide node or a configured seed node, if the built-in guide node is/tcp/ip: Port/pid, the node starts to initiate network connection to the ip and the Port where the pid node is located by using tcp, and if the address format of the guide node or the configured seed node is as follows: port/pid, udp is enabled to initiate network connection. After the connection of the node A is stable, the node A is disconnected with the guide node or the seed node, so that the resource of the guide node or the seed node is saved, and the guide node or the seed node store can serve more nodes. After the connection is stable, the node A broadcasts the network address of the node A to other nodes connected with the node A, and the other nodes can store the network address for other nodes in the network to search for the network.
As shown in fig. 2, node a and node B transmit through UDP, node B and node D transmit through TCP, node D and node C transmit through UDP, and node C and node a are both compatible with UDP and TCP, a network transmission protocol can be selected according to requirements, a blockchain network shown in fig. 2 can be compatible with multiple network transmission protocols, nodes can freely select which communication protocol to use for communication according to their usage scenarios, if their requirements are higher TPS, a large number of transactions are broadcast in a short time, a UDP protocol can be selected, which protocol has the advantage of reducing the overhead of network connection, or it is only a node that is deployed, without service sensitivity, or it can be selected. UDP has many advantages that TCP does not have, UDP does not have flow control, it can be spread quickly, it is very helpful for low-latency applications, such as making a decentralized voice communication, UDP can be selected to be widely used in audio and video transmission.
The scheme provided by the embodiment diversifies network connection modes between nodes, is not limited to a single network protocol, freely switches network protocol modes required by the nodes according to respective service scenes, can well perform compatibility on other nodes of the network, can freely select whether to support a TCP (transmission control protocol) or UDP (user datagram protocol) protocol or both the TCP and UDP (user datagram protocol) protocols when a new chain is deployed, and has higher freedom in selecting the protocols.
Example 2
A computer device, the device comprising: one or more processors; memory for storing one or more programs that, when executed by the one or more processors, cause the one or more processors to perform the method of embodiment 1.
A storage medium storing a computer program which, when executed by a processor, implements the method as described in embodiment 1 above.
Fig. 4 is a schematic structural diagram of an apparatus provided in this embodiment.
As shown in fig. 4, as another aspect, the present application also provides an apparatus 500 including one or more Central Processing Units (CPUs) 501 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)502 or a program loaded from a storage section 508 into a Random Access Memory (RAM) 503. In the RAM503, various programs and data necessary for the operation of the apparatus 500 are also stored. The CPU501, ROM502, and RAM503 are connected to each other via a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
The following components are connected to the I/O interface 505: an input portion 506 including a keyboard, a mouse, and the like; an output portion 507 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 508 including a hard disk and the like; and a communication section 509 including a network interface card such as a LAN card, a modem, or the like. The communication section 509 performs communication via a network such as the internet, and the processing driver 510 is also connected to the I/O interface 505 as necessary. A removable medium 511 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 510 as necessary, so that a computer program read out therefrom is mounted into the storage section 508 as necessary.
In particular, according to the embodiments disclosed in the present application, the method described in the above embodiment 1 may be implemented as a computer software program. For example, embodiments disclosed herein include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program comprising program code for performing the method described in any of the embodiments above. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 509, and/or installed from the removable medium 511.
As yet another aspect, the present application also provides a computer-readable storage medium, which may be the computer-readable storage medium included in the apparatus of the above-described embodiment; or it may be a separate computer readable storage medium not incorporated into the device. The computer readable storage medium stores one or more programs for use by one or more processors in performing the methods described herein.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units or modules described in the embodiments of the present application may be implemented by software or hardware. The described units or modules may also be provided in a processor, for example, each of the described units may be a software program provided in a computer or a mobile intelligent device, or may be a separately configured hardware device. Wherein the designation of a unit or module does not in some way constitute a limitation of the unit or module itself.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the present application. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.
Claims (8)
1. A multi-protocol connection method for a blockchain network, wherein the blockchain network includes a first node and a second node responding to a connection request of the first node, and a plurality of transmission protocols are configured in the first node, and the connection method comprises:
the first node acquires address information of the second node; the address information comprises a mark field and a protocol address, and the mark field is used for marking the type of a transmission protocol applicable to the second node;
and the first node calls a corresponding transmission protocol according to the address information of the second node and establishes connection with the second node.
2. The method of claim 1, wherein the step of the first node obtaining the address information of the second node further comprises:
the first node constructs an address information set according to a plurality of transmission protocols; the address information set comprises a plurality of address information, and the plurality of address information correspond to a plurality of transmission protocols configured by the address information set one by one;
the first node accesses the block chain network through a built-in guide node.
3. The method of claim 2, wherein after the first node accesses the blockchain network, the first node disconnects from the bootstrap node after forming a stable connection with the N nodes.
4. The method according to claim 3, wherein the specific steps of the first node accessing the blockchain network through the built-in bootstrap node are as follows:
the first node acquires address information of a guide node;
the first node calls a corresponding transmission protocol according to the address information of the guide node and establishes connection with the guide node;
the first node sends its set of address information to the bootstrapping node.
5. The method of claim 2, wherein the first node broadcasts its own set of address information to nodes connected to it.
6. A method according to claim 2, wherein the address information in the address information set is prioritized.
7. A computer device, characterized by one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method recited in any of claims 1-6.
8. A storage medium storing a computer program, characterized in that the program, when executed by a processor, implements the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110385369.9A CN113114670A (en) | 2021-04-09 | 2021-04-09 | Multi-protocol connection method, equipment and storage medium of block chain network |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110385369.9A CN113114670A (en) | 2021-04-09 | 2021-04-09 | Multi-protocol connection method, equipment and storage medium of block chain network |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113114670A true CN113114670A (en) | 2021-07-13 |
Family
ID=76715625
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110385369.9A Pending CN113114670A (en) | 2021-04-09 | 2021-04-09 | Multi-protocol connection method, equipment and storage medium of block chain network |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113114670A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114257600A (en) * | 2021-08-02 | 2022-03-29 | 美的集团股份有限公司 | Block chain network communication method, communication device and computer storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5941949A (en) * | 1997-05-14 | 1999-08-24 | Citrix Systems, Inc. | System and method for transmitting data from a server application to more than one client node |
CN103299603A (en) * | 2011-01-14 | 2013-09-11 | 阿尔卡特朗讯公司 | Peer node and method for improved peer node selection |
WO2016168909A1 (en) * | 2015-04-20 | 2016-10-27 | Topology Lp | Communicating in a peer-to-peer network |
US20180337847A1 (en) * | 2017-05-16 | 2018-11-22 | Peking University Shenzhen Graduate School | Indexing a multi-layer blockchain system |
CN110049058A (en) * | 2019-04-25 | 2019-07-23 | 深圳市云语科技有限公司 | A kind of Transmission system bottom method for selecting transmission protocol |
-
2021
- 2021-04-09 CN CN202110385369.9A patent/CN113114670A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5941949A (en) * | 1997-05-14 | 1999-08-24 | Citrix Systems, Inc. | System and method for transmitting data from a server application to more than one client node |
CN103299603A (en) * | 2011-01-14 | 2013-09-11 | 阿尔卡特朗讯公司 | Peer node and method for improved peer node selection |
WO2016168909A1 (en) * | 2015-04-20 | 2016-10-27 | Topology Lp | Communicating in a peer-to-peer network |
US20180337847A1 (en) * | 2017-05-16 | 2018-11-22 | Peking University Shenzhen Graduate School | Indexing a multi-layer blockchain system |
CN110049058A (en) * | 2019-04-25 | 2019-07-23 | 深圳市云语科技有限公司 | A kind of Transmission system bottom method for selecting transmission protocol |
Non-Patent Citations (1)
Title |
---|
趣链科技: "干货|更通用的P2P网络协议栈——Libp2p", 《HTTPS://WWW.HYPERCHAIN.CN/NEWS/268.HTML》 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114257600A (en) * | 2021-08-02 | 2022-03-29 | 美的集团股份有限公司 | Block chain network communication method, communication device and computer storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3026394A1 (en) | Method and system for updating in-vehicle navigation map, in-vehicle navigation device and mobile terminal | |
US8903972B2 (en) | Method and apparatus for sharing contents using information of group change in content oriented network environment | |
US11083004B2 (en) | Data transmission method and apparatus | |
US9628567B2 (en) | Methods and systems for efficient discovery of devices in a peer-to-peer network | |
US12041688B2 (en) | Screen projection method and system | |
CN111405042A (en) | Discovery method and device of electronic equipment, computer readable storage medium and electronic device | |
CN112486074A (en) | Data processing system, method and device | |
CN112312061A (en) | Video conference method, device, electronic equipment and storage medium | |
CN106330504B (en) | Method for realizing application and service controller | |
CN113114670A (en) | Multi-protocol connection method, equipment and storage medium of block chain network | |
CN113612825A (en) | Internet of things message middleware server cluster expansion method and system | |
CN108900579A (en) | Communication system, communication method, device, equipment and medium | |
CN113162836A (en) | Virtual local area network communication method and device, cloud server, medium and electronic equipment | |
CN110784510A (en) | Method for accessing target service node to bus and information interaction method of service node | |
US20140136597A1 (en) | Relay enabled dynamic virtual private network | |
CN112383617B (en) | Method, device, terminal equipment and medium for performing long connection | |
CN113395309B (en) | Communication method and computer network | |
CN103283185A (en) | Prioritization of data communication | |
CN111988287A (en) | Data transmission method and device and electronic equipment | |
CN112839071A (en) | Training system, training data access method and device, electronic device and medium | |
EP4418729A1 (en) | Processing method for network allocation vector (nav) timer and related apparatus | |
CN117082152B (en) | Service processing method, system and device | |
CN114727429A (en) | Communication method, communication group, electronic device, and storage medium | |
CN116962354A (en) | Communication method, device, related equipment and storage medium | |
CN116866430A (en) | Base station data proxy analysis method, system, terminal equipment and storage medium |
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 | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210713 |