CN108683727B - Block processing method and main node - Google Patents
Block processing method and main node Download PDFInfo
- Publication number
- CN108683727B CN108683727B CN201810450439.2A CN201810450439A CN108683727B CN 108683727 B CN108683727 B CN 108683727B CN 201810450439 A CN201810450439 A CN 201810450439A CN 108683727 B CN108683727 B CN 108683727B
- Authority
- CN
- China
- Prior art keywords
- node
- main
- connection
- master node
- block
- 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
- 238000003672 processing method Methods 0.000 title claims abstract description 20
- 238000000034 method Methods 0.000 claims abstract description 25
- 238000005065 mining Methods 0.000 claims description 31
- 238000004590 computer program Methods 0.000 claims description 11
- 238000004364 calculation method Methods 0.000 claims description 9
- 230000005540 biological transmission Effects 0.000 claims description 8
- 238000012545 processing Methods 0.000 claims description 4
- 230000015572 biosynthetic process Effects 0.000 abstract 1
- 238000004891 communication Methods 0.000 description 11
- 230000008569 process Effects 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000009412 basement excavation Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000007774 longterm Effects 0.000 description 2
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000977 initiatory effect Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 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
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q20/00—Payment architectures, schemes or protocols
- G06Q20/22—Payment schemes or models
- G06Q20/223—Payment schemes or models based on the use of peer-to-peer networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04W—WIRELESS COMMUNICATION NETWORKS
- H04W76/00—Connection management
- H04W76/10—Connection setup
- H04W76/11—Allocation or use of connection identifiers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Strategic Management (AREA)
- Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Computer And Data Communications (AREA)
Abstract
The embodiment of the invention provides a block processing method and a main node. The method comprises the following steps: the main node broadcasts the identification information and the IP address of the main node to the block chain network; the main node receives connection requests of other main nodes in the block chain network; the main node establishes connection with the other main nodes according to the connection request; the main node receives transaction information sent by a transaction node in the blockchain network; the main node generates a block according to the transaction information and sends the block to the other main nodes through the connection. The embodiment of the invention enables the transaction information in the block chain network to be directly sent to the main node without being broadcasted to the block chain network, thereby avoiding the formation of network storm and network congestion.
Description
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a block processing method and a main node.
Background
The blockchain network comprises a plurality of participating nodes, and when one participating node in the plurality of participating nodes generates transaction information, the transaction information needs to be broadcast to the blockchain network, so that each participating node in the blockchain network receives and records the transaction information, an effective supervision mechanism is formed, and cheating among the participating nodes is avoided.
However, when there are many participating nodes in the blockchain network, if each participating node needs to broadcast the transaction information to the blockchain network after generating the transaction information, a network storm is easily formed, resulting in network congestion.
Disclosure of Invention
Embodiments of the present invention provide a block processing method and a master node, so as to avoid a network congestion problem caused by a network storm formed in a block chain network.
In a first aspect, an embodiment of the present invention provides a block processing method, including:
the main node broadcasts the identification information and the IP address of the main node to a block chain network;
the main node receives connection requests of other main nodes in the block chain network;
the main node establishes connection with other main nodes according to the connection request;
the main node receives transaction information sent by a transaction node in the block chain network;
and the main node generates a block according to the transaction information and sends the block to other main nodes through the connection.
In a second aspect, an embodiment of the present invention provides a master node, including:
the sending module is used for broadcasting the identification information and the IP address of the main node to the block chain network;
a receiving module, configured to receive connection requests of other host nodes in the block chain network;
the connection establishing module is used for establishing connection with the other main nodes according to the connection request;
the receiving module is further configured to: receiving transaction information sent by a transaction node in the block chain network;
the block generating module is used for generating a block according to the transaction information;
the sending module is further configured to send the block to the other host nodes through the connection.
In a third aspect, an embodiment of the present invention provides a master node, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of the first aspect.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method of the first aspect.
According to the block processing method and the main node provided by the embodiment of the invention, the main node broadcasts the identification information and the IP address of the main node to the block chain network, and the main node receives the connection requests of other main nodes in the block chain network; establishing connection with the other main nodes according to the connection request; after a transaction information generation block sent by a transaction node is received, the block is sent to other main nodes, so that the other main nodes can contend for the accounting right of the next block, the transaction information in the block chain network can be directly sent to the main nodes without being broadcasted to the block chain network, and the network storm and network congestion are avoided.
Drawings
Fig. 1 is a schematic diagram of an application scenario provided in an embodiment of the present invention;
FIG. 2 is a flowchart of a block processing method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of another application scenario provided in the embodiment of the present invention;
FIG. 4 is a flowchart of a block processing method according to another embodiment of the present invention;
fig. 5 is a schematic structural diagram of a master node according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of a master node according to an embodiment of the present invention.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The block processing method provided by the invention can be applied to the communication system shown in fig. 1. As shown in fig. 1, the communication system includes: access network device 11, terminal device 12, and server 13. It should be noted that the communication System shown in fig. 1 may be applicable to different network formats, for example, may be applicable to Global System for Mobile communication (GSM), Code Division Multiple Access (CDMA), Wideband Code Division Multiple Access (WCDMA), Time Division-Synchronous Code Division Multiple Access (TD-SCDMA), Long Term Evolution (Long Term Evolution, LTE), and future 5G network formats. Optionally, the communication system may be a system in a scenario of high-reliability and Low-Latency Communications (URLLC) transmission in a 5G communication system.
Therefore, optionally, the access Network device 11 may be a Base Station (BTS) and/or a Base Station Controller in GSM or CDMA, a Base Station (NodeB, NB) and/or a Radio Network Controller (RNC) in WCDMA, an evolved Node B (eNB or eNodeB) in LTE, or a relay Station or an access point, or a Base Station (gbb) in a future 5G Network, and the present invention is not limited thereto.
The terminal device 12 may be a wireless terminal or a wired terminal. A wireless terminal may refer to a device that provides voice and/or other traffic data connectivity to a user, a handheld device having wireless connection capability, or other processing device connected to a wireless modem. A wireless terminal, which may be a mobile terminal such as a mobile telephone (or "cellular" telephone) and a computer having a mobile terminal, for example, a portable, pocket, hand-held, computer-included, or vehicle-mounted mobile device, may communicate with one or more core Network devices via a Radio Access Network (RAN), and may exchange language and/or data with the RAN. For another example, the Wireless terminal may also be a Personal Communication Service (PCS) phone, a cordless phone, a Session Initiation Protocol (SIP) phone, a Wireless Local Loop (WLL) station, a Personal Digital Assistant (PDA), and other devices. A wireless Terminal may also be referred to as a system, a Subscriber Unit (Subscriber Unit), a Subscriber Station (Subscriber Station), a Mobile Station (Mobile), a Remote Station (Remote Station), a Remote Terminal (Remote Terminal), an Access Terminal (Access Terminal), a User Terminal (User Terminal), a User Agent (User Agent), and a User Device or User Equipment (User Equipment), which are not limited herein. Optionally, the terminal device 12 may also be a smart watch, a tablet computer, or the like. In this embodiment, the terminal device 12 and the server 13 may be blockchain nodes in a blockchain network.
The present invention provides a block processing method, which aims to solve the above technical problems in the prior art.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Fig. 2 is a flowchart of a block processing method according to an embodiment of the present invention. The embodiment of the present invention provides a block processing method for solving the above technical problems in the prior art, and the method specifically includes the following steps:
As shown in fig. 3, the master node 1, the master node 2, the master node 3, and the master node 4 are blockchain nodes in a blockchain network, and the master node 1, the master node 2, the master node 3, and the master node 4 may specifically be mining nodes in the blockchain network, where the mining nodes may be used to store transaction information generated by transaction nodes in the blockchain network. It is to be understood that the blockchain network is not limited to include mining nodes, trading nodes, and may include other participating nodes. In this embodiment, not all participating nodes record transaction information, but transaction information is recorded mainly by the mining node in the blockchain network, and the transaction node in the blockchain network can directly send the transaction information to the mining node without broadcasting into the blockchain network.
Optionally, the master node 1, the master node 2, the master node 3, and the master node 4 may broadcast respective identification information and an IP address to the blockchain network at an initial stage of registering in the blockchain network, for example, the master node 1 broadcasts the identification information and the IP address of the master node 1 to the blockchain network at the initial stage of registering in the blockchain network, and after receiving the identification information and the IP address of the master node 1, the master node 2, the master node 3, and the master node 4 may establish a connection with the master node 1 according to the identification information and the IP address of the master node 1, specifically, after receiving the identification information and the IP address of the master node 1, the master node 2, the master node 3, and the master node 4 send a connection request to the master node 1.
Optionally, the broadcasting, by the master node, the identification information and the IP address of the master node to the blockchain network includes: and the main node broadcasts the identification information, the IP address and the identity information of the main node to the block chain network, wherein the identity information is used for identifying the main node as a mining node.
Specifically, when the master node 1, the master node 2, the master node 3, and the master node 4 are in an initial stage of registering in the blockchain network, the respective identification information and the IP address are broadcast to the blockchain network, and at the same time, the respective identity information is also broadcast to the blockchain network, for example, the identity information of the master node 1 is used to indicate that the master node 1 is a mining node, and the transaction nodes in the blockchain network can send the respective transaction information to the mining node. Similarly, the identity information of the host node 2 is used to indicate that the host node 2 is a mining node, and the transaction nodes in the blockchain network can send respective transaction information to the mining node; the identity information of the main node 3 is used for indicating that the main node 3 is a mining node, and the transaction nodes in the blockchain network can send respective transaction information to the mining node; the identity information of the master node 4 is used to indicate that the master node 4 is a mining node, and the transaction nodes in the blockchain network can send respective transaction information to the mining node.
Optionally, the identification information, the IP address broadcast and/or the identity information respectively sent by the master node 1, the master node 2, the master node 3 and the master node 4 may be stored in the same block or different blocks in the blockchain network. In addition, if at least one of the master node 1, the master node 2, the master node 3, and the master node 4 changes the IP address, the master node may also broadcast its identification information and the updated IP address to the blockchain network, so as to update its own IP address.
For example, the master node 1 may receive connection requests transmitted by the master nodes 2, 3, and 4, respectively. The master node 2 may receive connection requests respectively sent by the master node 1, the master node 3, and the master node 4. The master node 3 may receive connection requests respectively sent by the master node 1, the master node 2, and the master node 4. The master node 4 may receive connection requests respectively sent by the master node 1, the master node 2, and the master node 3.
And 203, the main node establishes connection with other main nodes according to the connection request.
Optionally, the host node 1 may establish connections with the host node 2, the host node 3, and the host node 4 respectively according to connection requests sent by the host node 2, the host node 3, and the host node 4 respectively.
Similarly, the master node 2 may establish connection with the master node 1, the master node 3, and the master node 4 respectively according to the connection requests sent by the master node 1, the master node 3, and the master node 4 respectively.
Similarly, the master node 3 may establish connection with the master node 1, the master node 2, and the master node 4 respectively according to the connection requests sent by the master node 1, the master node 2, and the master node 4 respectively.
Similarly, the master node 4 may establish connection with the master node 1, the master node 2, and the master node 3 respectively according to the connection requests sent by the master node 1, the master node 2, and the master node 3 respectively.
Optionally, the establishing, by the master node, a connection with the other master nodes according to the connection request includes: and the main node establishes Transmission Control Protocol (TCP) connection or User Datagram Protocol (UDP) connection with other main nodes according to the connection request. For example, the master node 1 may establish a Transmission Control Protocol (TCP) connection or a User Datagram Protocol (UDP) connection with the master node 2, the master node 3, and the master node 4 according to connection requests respectively sent by the master node 2, the master node 3, and the master node 4.
Similarly, the master node 2 may establish a TCP connection or a UDP connection with the master node 1, the master node 3, and the master node 4 according to the connection requests respectively sent by the master node 1, the master node 3, and the master node 4.
Similarly, the master node 3 may establish a TCP connection or a UDP connection with the master node 1, the master node 2, and the master node 4 according to the connection requests respectively sent by the master node 1, the master node 2, and the master node 4.
Similarly, the master node 4 may establish a TCP connection or a UDP connection with the master node 1, the master node 2, and the master node 3 according to the connection requests respectively sent by the master node 1, the master node 2, and the master node 3.
Optionally, the master node and the other master nodes form a peer-to-peer network. As shown in fig. 3, the master node 1 may form a Peer-to-Peer network, i.e., a fully connected network of (Peer to Peer, P2P) with the master node 2, the master node 3, and the master node 4.
That is, a fully-connected network of P2P is established between the mining nodes, and the master nodes 1-4 are connected to each other two by two as shown in fig. 3. That is, after one mining node declares its own identity, other mining nodes establish a TCP or UDP connection with it according to its IP address and node identifier, that is, open a connection channel above an IP layer, so as to perform subsequent message transmission between each other.
And step 204, the main node receives the transaction information sent by the transaction node in the block chain network.
Optionally, the master node 1, the master node 2, the master node 3, and the master node 4 may respectively receive transaction information sent by a transaction node in the blockchain network.
And step 205, the main node generates a block according to the transaction information, and sends the block to the other main nodes through the connection.
The main node 1, the main node 2, the main node 3 and the main node 4 contend for the accounting right of the current block in the block chain network, for example, the main node 1 contends for the accounting right, the main node 1 which contends for the accounting right can generate a block according to the received transaction information, and the block is sent to the main node 2, the main node 3 and the main node 4 through TCP connection or UDP connection respectively established between the main node 1 and the main node 2, the main node 3 and the main node 4. So that the master nodes 2, 3, 4 in the blockchain network can determine that the master node 1 has taken over the accounting right of the current block, so that the master nodes 2, 3, 4 take over the accounting right of the next block in the blockchain network.
In this embodiment, the IP address of the master node is specifically a public network IP address, and the master node may communicate with not only other master nodes but also other participating nodes other than the master node.
It should be noted that the block processing method described in this embodiment is applicable to the private chain network, because each node is not required to participate in accounting, only 3-5 mining nodes are reserved, and there are fewer mining nodes in the private chain network. In the public link network, the number of mining nodes is large, and the establishment and maintenance of the full-connection network of P2P are too complicated, so that the public link network is not recommended to use the method of the embodiment.
The method comprises the steps that identification information and an IP address of a main node are broadcasted to a block chain network through the main node, and the main node receives connection requests of other main nodes in the block chain network; establishing connection with the other main nodes according to the connection request; after a transaction information generation block sent by a transaction node is received, the block is sent to other main nodes, so that the other main nodes can contend for the accounting right of the next block, the transaction information in the block chain network can be directly sent to the main nodes without being broadcasted to the block chain network, and the network storm and network congestion are avoided.
Fig. 4 is a flowchart of a block processing method according to another embodiment of the invention. On the basis of the foregoing embodiments, the block processing method provided in this embodiment specifically includes the following steps:
The implementation manner and the specific process of step 401 are the same as those of step 201, and are not described herein again.
Step 402 is consistent with step 202 in implementation and specific process, and is not described herein again.
And step 403, the master node establishes connection with the other master nodes according to the connection request.
The step 403 is consistent with the step 203 in implementation and specific process, and is not described herein again.
The step 404 is consistent with the step 204 in implementation and specific process, and is not described here again.
And 405, the main node sends the transaction information to at least one secondary node so that the at least one secondary node performs mining calculation, wherein the mining calculation is used for robing the accounting right of the block in the block chain network.
In the blockchain network, if some nodes do not determine that the nodes are mine excavation nodes and want to undertake mine excavation work by sending broadcast messages to the blockchain network, the nodes can be used as secondary nodes, and as shown in fig. 3, the primary node 3 corresponds to a secondary node 3A, a secondary node 3B, a secondary node 3C and a secondary node 3D.
As shown in fig. 3, when the master node 3 receives the transaction information sent by the transaction node in the blockchain network, the master node 3 may send the transaction information to at least one of the secondary node 3A, the secondary node 3B, the secondary node 3C, and the secondary node 3D, so that at least one of the secondary node 3A, the secondary node 3B, the secondary node 3C, and the secondary node 3D performs calculation for preempting the current block accounting right to find an appropriate random number so as to make accounting successful.
And 406, the main node receives the accounting right robbing success message sent by the at least one secondary node.
When at least one of the auxiliary node 3A, the auxiliary node 3B, the auxiliary node 3C and the auxiliary node 3D robs the accounting right of the current block in the block chain network, the accounting right robbing success message is sent to the corresponding main node, namely the main node 3.
And step 407, the main node generates a block according to the transaction information, and sends the block to the other main nodes through the connection.
The master node 3 may generate a block according to the accounting right preemption success message and the received transaction information, and transmit the block to the master node 1, the master node 2, and the master node 4 through TCP connection or UDP connection between the master node 3 and the master nodes 1, 2, and 4, respectively.
According to the embodiment of the invention, at least one auxiliary node corresponding to the main node robs the accounting right of the current block in the block chain network, so that the success probability of the main node rob the accounting right is improved.
Fig. 5 is a schematic structural diagram of a master node according to an embodiment of the present invention. As shown in fig. 5, the master node 50 may execute the processing procedure provided in the block processing method embodiment, and includes: a sending module 51, a receiving module 52, a connection establishing module 53 and a block generating module 54; the sending module 51 is configured to broadcast the identification information and the IP address of the host node to the blockchain network; the receiving module 52 is configured to receive connection requests of other host nodes in the blockchain network; the connection establishing module 53 is configured to establish a connection with the other host node according to the connection request; the receiving module 52 is further configured to: receiving transaction information sent by a transaction node in the block chain network; the block generating module 54 is configured to generate a block according to the transaction information; the sending module 51 is further configured to send the block to the other host nodes through the connection.
Optionally, the sending module 51 is specifically configured to: and broadcasting the identification information, the IP address and the identity information of the main node to a block chain network, wherein the identity information is used for identifying the main node as a mining node.
Optionally, the sending module 51 is further configured to: sending the transaction information to at least one secondary node to enable the at least one secondary node to perform mining calculation, wherein the mining calculation is used for robbing accounting right of blocks in the block chain network; the receiving module 52 is further configured to: and receiving the accounting right robbing success message sent by the at least one secondary node.
Optionally, the connection establishing module 53 is specifically configured to: and establishing Transmission Control Protocol (TCP) connection or User Datagram Protocol (UDP) connection with the other main nodes according to the connection request.
Optionally, the master node and the other master nodes form a peer-to-peer network.
The master node in the embodiment shown in fig. 5 may be configured to execute the technical solution of the above method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
Fig. 6 is a schematic structural diagram of a master node according to an embodiment of the present invention. As shown in fig. 6, the terminal device 60 includes a memory 61, a processor 62, a computer program, and a communication interface 63; wherein a computer program is stored in the memory 61 and is configured to be executed by the processor 62 for performing the block processing method described in the above embodiments.
The master node in the embodiment shown in fig. 6 may be configured to execute the technical solution of the above method embodiment, and the implementation principle and the technical effect are similar, which are not described herein again.
In addition, the present embodiment also provides a computer-readable storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the block processing method described in the above embodiments.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
Claims (8)
1. A block processing method, comprising:
the method comprises the steps that a main node broadcasts identification information, an IP address and identity information of the main node to a block chain network, wherein the identity information is used for identifying the main node as a mining node;
the main node receives connection requests of other main nodes in the block chain network;
the main node establishes Transmission Control Protocol (TCP) connection or User Datagram Protocol (UDP) connection with other main nodes according to the connection request;
the main node receives transaction information sent by a transaction node in the block chain network;
and the main node generates a block according to the transaction information and sends the block to other main nodes through the transmission control protocol TCP connection or the user datagram protocol UDP connection, so that the other main nodes contend for the accounting right of the next block.
2. The method of claim 1, wherein before the master node generating blocks from the transaction information and sending the blocks to the other master nodes over the connection, further comprising:
the main node sends the transaction information to at least one secondary node so that the at least one secondary node performs mining calculation, wherein the mining calculation is used for robbing accounting right of blocks in the block chain network;
and the main node receives the accounting right robbing success message sent by the at least one secondary node.
3. The method of claim 1, wherein the master node and the other master nodes form a peer-to-peer network.
4. A master node, comprising:
the system comprises a sending module, a block chain network processing module and a searching module, wherein the sending module is used for broadcasting identification information, an IP address and identity information of a main node to the block chain network, and the identity information is used for identifying the main node as a mining node;
a receiving module, configured to receive connection requests of other host nodes in the block chain network;
the connection establishing module is used for establishing Transmission Control Protocol (TCP) connection or User Datagram Protocol (UDP) connection with the other main nodes according to the connection request;
the receiving module is further configured to: receiving transaction information sent by a transaction node in the block chain network;
the block generating module is used for generating a block according to the transaction information;
the sending module is further configured to send the block to the other master node through the TCP connection or the UDP connection, so that the other master node contends for an accounting right of a next block.
5. The master node of claim 4, wherein the sending module is further configured to: sending the transaction information to at least one secondary node to enable the at least one secondary node to perform mining calculation, wherein the mining calculation is used for robbing accounting right of blocks in the block chain network;
the receiving module is further configured to: and receiving the accounting right robbing success message sent by the at least one secondary node.
6. The master node of claim 4, wherein the master node and the other master nodes form a peer-to-peer network.
7. A master node, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any one of claims 1-3.
8. A computer-readable storage medium, having stored thereon a computer program for execution by a processor to perform the method according to any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810450439.2A CN108683727B (en) | 2018-05-11 | 2018-05-11 | Block processing method and main node |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810450439.2A CN108683727B (en) | 2018-05-11 | 2018-05-11 | Block processing method and main node |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108683727A CN108683727A (en) | 2018-10-19 |
CN108683727B true CN108683727B (en) | 2021-09-07 |
Family
ID=63805980
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810450439.2A Active CN108683727B (en) | 2018-05-11 | 2018-05-11 | Block processing method and main node |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108683727B (en) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111314393B (en) * | 2018-12-11 | 2023-04-18 | 京东科技控股股份有限公司 | Data processing method, device and equipment based on block chain |
CN111404897A (en) * | 2020-03-06 | 2020-07-10 | 深圳前海达闼云端智能科技有限公司 | Message distribution method and device, storage medium and electronic equipment |
CN111478908B (en) * | 2020-04-09 | 2022-05-03 | 杭州溪塔科技有限公司 | Method and device for establishing communication between users in P2P network and electronic equipment |
CN111836269B (en) * | 2020-07-10 | 2023-05-30 | 全链通有限公司 | Micro base station deployment method, equipment and storage medium based on block chain |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105956923A (en) * | 2016-04-20 | 2016-09-21 | 上海如鸽投资有限公司 | Asset transaction platform and digital certification and transaction method for assets |
CN107294729A (en) * | 2017-07-25 | 2017-10-24 | 中国联合网络通信集团有限公司 | Communication means and device in block chain between different nodes |
Family Cites Families (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20170357966A1 (en) * | 2016-06-09 | 2017-12-14 | Mastercard International Incorporated | Method and system for use of a proprietary private blockchain |
WO2018119585A1 (en) * | 2016-12-26 | 2018-07-05 | 深圳前海达闼云端智能科技有限公司 | Permission control method, apparatus and system for block chain, and node device |
CN106934611B (en) * | 2017-03-21 | 2021-05-28 | 北京汇通金财信息科技有限公司 | Data processing method and device |
CN107146087A (en) * | 2017-04-11 | 2017-09-08 | 广东网金控股股份有限公司 | A kind of quick common recognition bookkeeping methods and system based on block chain alliance chain |
-
2018
- 2018-05-11 CN CN201810450439.2A patent/CN108683727B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105956923A (en) * | 2016-04-20 | 2016-09-21 | 上海如鸽投资有限公司 | Asset transaction platform and digital certification and transaction method for assets |
CN107294729A (en) * | 2017-07-25 | 2017-10-24 | 中国联合网络通信集团有限公司 | Communication means and device in block chain between different nodes |
Also Published As
Publication number | Publication date |
---|---|
CN108683727A (en) | 2018-10-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108712506B (en) | Block chain node communication method and device and block chain node | |
CN108683727B (en) | Block processing method and main node | |
CN109067724B (en) | Block chain data transaction method, device, equipment and storage medium | |
CN108769142B (en) | Transaction information processing method and block generation node | |
CN108989043B (en) | Block processing method and device and block link points | |
CN109640274B (en) | Short message sending method and device based on block chain and computer readable storage medium | |
CN109118360B (en) | Block chain account checking method, device, equipment and storage medium | |
CN109547947B (en) | Method and device for establishing user equipment cooperation group | |
CN108810120B (en) | Block chain node communication method and device and block chain node | |
CN109087100B (en) | Key distribution method, device, equipment and storage medium | |
CN108900528B (en) | Block chain real-name authentication method, device, equipment and storage medium | |
CN102421145B (en) | Method and system for carrying out direct communication of data among base stations | |
CN108476536A (en) | The method and apparatus of wireless communication | |
EP3667995B1 (en) | Synchronization signal block indication method and determining method, network device, and terminal device | |
US20150163365A1 (en) | Method And Device For Charging Local Traffic On Wireless Side | |
CN108877290B (en) | Parking space scheduling method, device, equipment and storage medium | |
WO2017008701A1 (en) | Data transmission method, apparatus, and user device | |
CN108777710B (en) | Inter-node communication method and device of block chain and block chain node | |
US20230188303A1 (en) | Data transmission processing method and apparatus, communication device and storage medium | |
CN108777712B (en) | Block chain node communication method and device and block chain node | |
CN109087096B (en) | Block chain account checking method, device, equipment and storage medium | |
CN109639715B (en) | Method, device and equipment for avoiding double-flower attack and computer readable storage medium | |
CN108243631B (en) | Network access method and equipment | |
CN108848144B (en) | Method and device for accessing nodes in block chain and block chain link point | |
CN103442450A (en) | Wireless communication method and wireless communication equipment |
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 |