CN110489486B - Method, seed node and medium for generating block chain network - Google Patents

Method, seed node and medium for generating block chain network Download PDF

Info

Publication number
CN110489486B
CN110489486B CN201910713240.9A CN201910713240A CN110489486B CN 110489486 B CN110489486 B CN 110489486B CN 201910713240 A CN201910713240 A CN 201910713240A CN 110489486 B CN110489486 B CN 110489486B
Authority
CN
China
Prior art keywords
node
accounting
list
nodes
service
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
Application number
CN201910713240.9A
Other languages
Chinese (zh)
Other versions
CN110489486A (en
Inventor
刘攀
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201910713240.9A priority Critical patent/CN110489486B/en
Publication of CN110489486A publication Critical patent/CN110489486A/en
Application granted granted Critical
Publication of CN110489486B publication Critical patent/CN110489486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2255Hash tables
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/27Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present disclosure provides a method, a seed node, and a medium for generating a blockchain network. The method comprises the following steps: in response to receiving a join request to join a blockchain network, determining the identity of a node sending the join request; if the node sending the joining request is determined to be the service node, returning to the first adjacent service node list to form a second sub-network; if the node sending the join request is determined to be the accounting node, returning an accounting node list to form a first sub-network; and if the node sending the joining request is determined to be the relay node, returning a second adjacent service node list and a first adjacent accounting node list of a second position relation standard so that the relay node can carry out block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list. The embodiment of the disclosure can automatically generate the block chain network which is easy to linearly expand and has both safety and performance.

Description

Method, seed node and medium for generating block chain network
Technical Field
The present disclosure relates to the field of blockchain, and in particular, to a method, a seed node, and a medium for generating a blockchain network.
Background
In the current block chain network, there are two main ways of connecting between block chain link points: one is full connection, that is, each block chain node is connected with each other; the other is peer-to-peer connection, such as distributed hash table connection, that is, each block chain link point stores a small part of data and is responsible for a small range of routing in the block chain, if the block chain link point to be transferred is not in the small range of routing, the block chain link point to be transferred is routed to other block chain nodes for which the current block chain link point is responsible for routing, and then the other block chain link points continue to route downwards until the block chain link node to be transferred is routed. At present, the generation of block chain networks of full connection and peer-to-peer connection mainly configures connection relations individually for each block chain node point, and then networking is performed, so that the efficiency is low.
The full-connection mode is not beneficial to the linear expansion of the nodes, and the safety of the nodes is poor, because all the blockchain nodes know the existence of each other, the nodes are easy to be attacked. The peer-to-peer connection mode is beneficial to the linear expansion of the nodes, but the relay of the network messages can reduce the performance due to the partial connection. The prior art lacks a scheme capable of automatically generating a block chain network which is easy to linearly expand and has both safety and performance.
Disclosure of Invention
An object of the present disclosure is to provide a method, a seed node, and a medium for generating a blockchain network, which can automatically generate a blockchain network that is easy to linearly expand and has both security and performance.
According to an aspect of the embodiments of the present disclosure, a method of generating a blockchain network is disclosed, the blockchain network including a first sub-network of accounting nodes and second sub-networks of service nodes, the first sub-network and the second sub-networks being connected by intermediate nodes, the intermediate nodes including a seed node and a relay node, the method being performed by the seed node, the method including:
in response to receiving a join request to join a blockchain network, determining the identity of a node sending the join request;
if the node sending the joining request is determined to be a service node, returning a first adjacent service node list of which the position relation with the service node accords with a first position relation standard to the service node so that the service node establishes connection with the service node of the first adjacent service node list to form a second sub-network;
if the node sending the join request is determined to be the accounting node, returning an accounting node list connected with the seed node to the accounting node so that the accounting node establishes connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network;
and if the node sending the joining request is determined to be the relay node, returning a second adjacent service node list and a first adjacent accounting node list to the relay node, wherein the position relationship between the second adjacent service node list and the relay node conforms to a second position relationship standard, so that the relay node can perform block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
According to an aspect of the disclosed embodiments, a seed node is disclosed, the seed node being located in a blockchain network, the blockchain network including a first sub-network of accounting nodes and second sub-networks of service nodes, the first sub-network and the second sub-networks being connected by intermediate nodes, the intermediate nodes including the seed node and a relay node, the seed node comprising:
a node identity determining unit, configured to determine, in response to receiving a join request to join a blockchain network, an identity of a node that issued the join request;
a first returning unit, configured to, if it is determined that a node that issues a join request is a service node, return a first adjacent service node list to the service node, where a position relationship with the service node meets a first position relationship standard, so that the service node establishes a connection with a service node of the first adjacent service node list to form a second sub-network;
a second returning unit, configured to, if it is determined that the node sending the join request is the accounting node, return an accounting node list connected to the seed node to the accounting node, so that the accounting node establishes a connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network;
and a third returning unit, configured to, if it is determined that the node that sends the join request is the relay node, return a second adjacent service node list and a first adjacent accounting node list, of which the position relationship with the relay node meets a second position relationship standard, to the relay node, so that the relay node performs block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
According to an aspect of the disclosed embodiments, a seed node is disclosed, comprising: a memory storing computer readable instructions; a processor reading computer readable instructions stored by the memory to perform the method as described above.
According to an aspect of embodiments of the present disclosure, a computer program medium is disclosed, having computer readable instructions stored thereon, which, when executed by a processor of a computer, cause the computer to perform the method as described above.
In the embodiment of the disclosure, different identities are allocated for functions in which blockchain nodes participate. And the accounting nodes are connected in a full-connection mode to form a first sub-network. And the service nodes which are not responsible for the accounting of the blocks and only can passively check the uplink blocks are communicated in a peer-to-peer mode to form a second sub-network. The first sub-network and the second sub-network are isolated through the intermediate node, the risk that the accounting node is attacked is reduced, and the safety is improved. And peer-to-peer connection is adopted among service nodes, so that linear expansion is easy. The seed node is the initial node responsible for generating the entire blockchain network. When the blockchain network is generated, the seed node determines whether the node sending the joining request for joining the blockchain network is a service node, an accounting node or a relay node. If the service node is the service node, a first adjacent service node list meeting the condition is returned to the service node for establishing connection. If the node is the accounting node, returning an accounting node list connected with the node to the accounting node, and after the accounting node obtains the accounting node list, establishing connection with the accounting node in the accounting node list and then exchanging information in the accounting node list to form full connection between the accounting nodes. If the relay node is the relay node, returning a qualified adjacent service node list and an adjacent accounting node list. In the whole process, the information of the service node is not disclosed to the accounting node, and the information of the accounting node is not disclosed to the service node. Through the above process, the block chain network can be automatically and safely generated.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows, or in part will be obvious from the description, or may be learned by practice of the disclosure.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
Fig. 1 illustrates an architectural diagram of a blockchain network according to one embodiment of the present disclosure.
Fig. 2A-G illustrate application scenario interface diagrams displayed on a seed node interface in an actual scenario by applying the method for generating a blockchain network according to an embodiment of the present disclosure.
Fig. 3 shows a flow diagram of a method of generating a blockchain network according to one embodiment of the present disclosure.
Fig. 4 shows a specific flow diagram of a billing node establishing a connection with a billing node in the list of billing nodes and exchanging information in the list of billing nodes according to one embodiment of the disclosure.
Fig. 5 shows a specific flow diagram of block-chain communication of a relay node with a service node and a billing node according to one embodiment of the present disclosure.
FIG. 6 illustrates a block diagram of a seed node according to one embodiment of the present disclosure.
FIG. 7 shows a hardware block diagram of a seed node according to one embodiment of the present disclosure.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more example embodiments. In the following description, numerous specific details are provided to give a thorough understanding of example embodiments of the disclosure. One skilled in the relevant art will recognize, however, that the subject matter of the present disclosure can be practiced without one or more of the specific details, or with other methods, components, steps, and so forth. In other instances, well-known structures, methods, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the disclosure.
Some of the block diagrams shown in the figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
The architecture of the block-chain network as a whole generated by the embodiments of the present disclosure is described below with reference to fig. 1.
The block chain network is a network used for recording information to be uplink to a block chain and checking and supervising blocks recorded on the block chain together. The block chain network of the disclosed embodiment comprises a first sub-network 1 and a second sub-network 2.
The first subnetwork 1, the accounting subnetwork, is responsible for uplink (accounting) of the block. The first subnetwork 1 comprises a plurality of accounting nodes. The accounting node is an execution node for accounting to the block chain. The accounting nodes include a consensus node 101 and a candidate node 102. Consensus refers to the co-supervision of the billed content within the billing sub-network before billing onto the blockchain. The content of the blocks to be linked up can be booked only when the content of the blocks to be linked up is agreed in the booked sub-network, so that the booked objectivity is ensured. At a certain moment, for a block to be uplinked, not all accounting nodes participate in consensus and accounting, but the consensus and accounting are performed by a selected part of accounting nodes, wherein the selected part of accounting nodes are called consensus nodes and are called candidate nodes. The portion of the accounting nodes selected at each time is changed, resulting in dynamic differentiation of the consensus node from the candidate nodes. An accounting node may be a consensus node at one time and become a candidate node at another time. The accounting nodes in the first subnetwork 1 are in full connection, i.e. there is a direct connection between every two accounting nodes. Because the distinction between the consensus node and the candidate node is dynamic, each accounting node receives the information to be uplink, and if the current time is not the consensus node, the information is forwarded to the consensus node at the current time for packaging, consensus and uplink.
The second subnetwork 2, namely the service subnetwork, is responsible for uploading information to be uplink and receiving accounting results after the sub-network is uplink, so as to jointly supervise accounting of the accounting sub-network. The second sub-network 2 may be multiple as shown in fig. 1, each second sub-network 2 comprising a plurality of service nodes. The service node is an execution node which uploads information to be uplink and receives an accounting result after the sub-network is uplink by accounting. The information to be uplink may be generated by a ue (not shown). The client-side needs to keep the information to be uplink on the block chain, and then sends the information to be uplink to the service node for uploading, and finally the information is kept by the keeping sub-network. The service node then receives the accounting result. The service nodes are divided into a synchronization node 201 and a lightweight node 202. A synchronous node is a node that receives a complete block of the entire uplink as a billing result. Thus, when the node needs to inquire the block content afterwards, the node can easily search the stored content. A lightweight node refers to a node that receives only the block headers of blocks of the uplink as accounting results. When forming the uplink block, the accounting node packs a plurality of information to be uplink into a block, then applies an abstract algorithm to the block to obtain an abstract of the block, and puts the abstract of the block into the block head uplink. Due to the fact that the content of the block bodies is different, the abstracts obtained after abstract operation are different, and different blocks can be distinguished through the abstracts. Therefore, when the lightweight node needs to check the complete content of the block, the block head is used for querying the uplink block through the accounting node, and the content of the block corresponding to the block head can be obtained. And only the block head is stored in the lightweight node, so that the storage burden of the lightweight node is greatly reduced, and the safety of block information is improved. Each second sub-network is internally connected in a peer-to-peer manner, namely each service node is equal and has no central node, and each service node is responsible for issuing messages to other service nodes and finally reaches a required service node after layer-by-layer issuing. An example of a peer-to-peer connection is a Distributed Hash Table (DHT) connection, in which each block link point stores a small portion of data and is responsible for a small range of routes in a block chain, and if a block link point to be transferred is not in the small range of routes, the block link point is routed to other block chain nodes for which the current block link point is responsible for routing, and then the other block link points continue to route down until the block chain node to be transferred is routed.
As shown in fig. 1, the first sub-network 1 and the second sub-network 2, and the second sub-networks 2 are connected by intermediate nodes. An intermediate node is a node that acts as a communication between a service node and an accounting node. For security reasons the first sub-network is isolated from the second sub-network and the communication between the service node and the accounting node is performed by an intermediate node. When the business node has to uplink the information, the information to be uplink is sent to the intermediate node, and the intermediate node forwards the information to an accounting node for uplink. After the chain is linked, the accounting node sends the recorded blocks back to the intermediate node, and the blocks are broadcasted to the synchronous node and the lightweight node by the intermediate node. For the synchronization node, the intermediate node needs to broadcast the entire block of the uplink to the synchronization node. For the lightweight node, the intermediate node only needs to broadcast the block header of the uplink block to the lightweight node. The intermediate nodes include a seed node 301 and a relay node 302. The functions of the accounting node and the service node are the same when performing communication therebetween, except that the seed node 301 is a generating node of the blockchain network of the embodiment of the present disclosure, and as described below, the methods of generating the blockchain network of the embodiment of the present disclosure are performed by the seed node. The relay node is an intermediate node except the seed node, and only plays a role in communication transfer between the first sub-network and the second sub-network, and does not play a role in generating the whole block chain network.
Each node in fig. 1 may be a conventional computer device such as a desktop computer and a portable computer, a device such as a mobile phone, a PDA, a vehicle-mounted terminal, which has a non-conventional computer device, but can run a software execution program and have a communication function, or a server (e.g., a cloud server). In addition, they may be physical machines or may exist in the form of virtual machines as a part of physical machines. For example, in one device, there may be multiple nodes in FIG. 1. In addition, the nodes may exist in the form of a cloud, which serves as various locations of the cloud where the cloud nodes are distributed.
In the blockchain network of fig. 1, different identities are assigned for the functions in which blockchain nodes participate. And the accounting nodes are connected in a full-connection mode to form a first sub-network. And the service nodes which are not responsible for the accounting of the blocks and only can passively check the uplink blocks are communicated in a peer-to-peer mode to form a second sub-network. The first sub-network and the second sub-network are isolated through the intermediate node, the risk that the accounting node is attacked is reduced, and the safety is improved. And peer-to-peer connection is adopted among service nodes, so that linear expansion is easy. The seed node is the initial node responsible for generating the entire blockchain network. Compared with the mode that all block chain link points are in full connection, the method is beneficial to linear expansion of the block chain nodes, and the safety is improved by only performing full connection in the accounting sub-network. Compared with the mode that all block chain link points are connected in a peer-to-peer mode, the mode that the link points are connected in a full mode is adopted in the accounting sub-network, so that the common identification can be achieved quickly, the link efficiency is improved, and the link performance is improved. Therefore, the blockchain network is easy to linearly expand and has both safety and performance.
The embodiment of the disclosure provides a method for generating a block chain network, which can automatically generate the block chain network of fig. 1. Fig. 2A-G, namely, scene interfaces when the seed node actually generates the blockchain network, are combined next to outline a situation when the method for generating a blockchain network according to the embodiment of the present disclosure is applied to a specific scene.
Before the blockchain network is generated, all accounting nodes, service nodes, seed nodes and the like are actually existed, but are not connected into the blockchain network according to the topology shown in fig. 1. The seed node is a generation node of the block chain network, and each accounting node, the service node and the relay node request to join the block chain network.
As shown in fig. 2A, when a seed node receives a join request of a node XXXXXX to join a blockchain network, in order to improve security, validity of the node XXXXXX needs to be verified first, and the verification method may be to compare with a preset blacklist, verify that it is illegal once belonging to one of the blacklists, and so on. If node XXXXXX is legitimate, it first needs to determine its identity, i.e. whether it is a service node, a billing node, or a relay node, since it is not yet known whether node xxxxxxxx is a service node, a billing node, or a relay node at this time.
If it is determined that its identity is a service node, the administrator is asked whether to send a list of neighboring service nodes to the service node for its connection, as shown in fig. 2B. The service node in the list of contiguous service nodes is a service node that is closer to the service node, e.g., meets a certain location relationship criterion. If it is determined that it is possible to transmit, a list of adjacent service nodes is sent to the service node. Thus, the service node establishes a connection with the service node of the list of adjacent service nodes. Each service node requests its own adjacent service node list from the intermediate node, and establishes connection with its surrounding service nodes. After all the service nodes establish the connection around the service nodes, a second sub-network which is not connected is formed. Disconnected means that none of the service nodes is connected to other second sub-networks. These second sub-networks, and between them and the first sub-network, are communicating via intermediate nodes.
In this way peer-to-peer connections are established inside the second sub-networks.
After sending the first list of adjacent service nodes, an interface is displayed as shown in fig. 2C, indicating that the first list of adjacent service nodes has been sent to the service node.
If it is determined that the node making the join request is an accounting node, as shown in FIG. 2D, the administrator is asked whether to send a list of accounting nodes connected to the seed node to the accounting node for connection. If the determination is that the connection can be made, the list of accounting nodes connected with the seed node is sent to the accounting node for establishing connection with the accounting nodes in the list of accounting nodes. Since the first sub-network needs full connectivity internally, but there may be more seed nodes, as shown in fig. 1, where the seed node only knows the list of accounting nodes connected to itself, after receiving the list of accounting nodes, the seed node also exchanges the list information of accounting nodes obtained by other accounting nodes connected according to the list with other accounting nodes, and updates the list of accounting nodes until all accounting nodes in the first sub-network have the same list of accounting nodes. In this way, a full connection inside the first sub-network is established.
After sending the list of accounting nodes connected to the seed node, an interface is shown in fig. 2E, which indicates that the list of accounting nodes connected to the seed node has been sent to the service node.
If the identity is determined to be a relay node, as shown in fig. 2F, the administrator is asked whether to send to the relay node a list of neighboring service nodes that the relay node is responsible for communicating with (e.g., meeting a certain location relationship criterion with the location of the relay node) and a list of neighboring accounting nodes that the relay node is responsible for communicating with (e.g., meeting a certain location relationship criterion with the relay node). If it is determined that it is possible to transmit, the lists are sent to the relay node. Thus, the relay node establishes connections with the adjacent service node and the adjacent accounting node, respectively, which are responsible for communication according to the lists.
After transmitting these lists, an interface is displayed as shown in fig. 2G, indicating that the lists have been transmitted to the relay node.
Through the process of fig. 2A-G, a complete blockchain network is established.
Specific implementations of embodiments of the present disclosure are described below.
As shown in fig. 3, according to an embodiment of the present disclosure, there is provided a method of generating a blockchain network, the method being performed by a seed node, the method including:
step 410, in response to receiving a join request to join the blockchain network, determining the identity of a node sending the join request;
step 420, if it is determined that the node sending the join request is a service node, returning a first adjacent service node list to the service node, where a position relationship with the service node meets a first position relationship standard, so that the service node establishes a connection with the service node in the first adjacent service node list to form a second sub-network;
step 430, if the node sending the join request is determined to be the accounting node, returning an accounting node list connected with the seed node to the accounting node so that the accounting node establishes connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network;
step 440, if it is determined that the node sending the join request is the relay node, returning a second adjacent service node list and a first adjacent accounting node list to the relay node, where a position relationship with the relay node conforms to a second position relationship standard, so that the relay node performs block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
The specific process of each step described above is described below.
In step 410, in response to receiving a join request to join the blockchain network, the identity of the node that issued the join request is determined.
The identity of the node is the node type of each node, such as a service node, a billing node, a relay node, and the like. Since the service node includes a synchronization node and a lightweight node, the accounting node includes a consensus node and a candidate node, and the identity of the node also includes these specific types. The join request may be issued by any one of the service node, the accounting node and the relay node. The node identity, such as the node identifier or a specific field, may be determined by the node that carries the information about the node from which the join request originated. The seed node is used for generating the seed node which is a block chain network, and each accounting node, the service node and the relay node all request to join the block chain network. The seed node determines the identity of the node sending the joining request based on the joining request, can accurately set corresponding roles for the uplink node, and can establish the block chain network topology based on the roles in a friendly way.
In one embodiment, the determining the identity of the node that issued the join request comprises:
determining the node identification sending the joining request;
according to the node identification, referring to a preset blacklist, filtering the joining request;
and determining the identity of the node sending the joining request according to the specific field in the filtered joining request.
In one embodiment, the identity of the node that determines the join request may be obtained through a handshake protocol between the node that issues the join request and the seed node when communicating the join request. In another embodiment, a node identification field may also be added to the join request, from which the node identification is read.
The node identifiers of various illegal nodes are stored in a preset blacklist, for example, the node writes the blockchain record data before and is blacklisted by a security center (not shown) of the blockchain network. After the node identifier is obtained from the adding request, if the node identifier is found in a preset blacklist, the node is added into the blacklist due to reasons such as illegal reasons, and then the adding request is filtered to ensure that the node is added into a safe block chain.
Specific fields such as "ip-wsx". The field of the message sent by the nodes with different identities is different. In one embodiment, by obtaining a specific field in the join request, the identity of the node issuing the join request can be accurately queried based on a specific field-identity lookup table published in advance in the blockchain network.
The above describes a process of determining the identity of a node issuing a join request in response to receiving a join request to join a blockchain network; the process of forming the second sub-network if it is determined that the node making the join request is a traffic node is described below.
Step 420, if it is determined that the node sending the join request is a service node, returning a first adjacent service node list, the position relationship of which with the service node meets the first position relationship standard, to the service node so that the service node establishes a connection with the service node of the first adjacent service node list to form a second sub-network.
The service node is a node which is not responsible for accounting of the block and can only passively check the uplink block, namely the service node does not participate in the common identification of the block chain and is an execution node for uploading information to be uplink and receiving an accounting result after the sub-network is uplinked. The seed node may return a first list of neighboring service nodes according to the DHT algorithm that meet the first location relationship criterion with the service node that issued the join request. The first location relation criterion is a location relation between service nodes established according to the requirement of block chain management, and may be, for example, a distance from the service node to the service node is smaller than a predetermined threshold or a region block located in an electronic map, which will be described in more detail below. The first adjacent service node list records information of all service nodes meeting the first position relation standard with the service node, such as node identification and other information which can be used for establishing connection. Further, the service node may establish peer-to-peer connection with the service node of the first neighboring service node list according to the DHT algorithm, route information, and construct a second sub-network. Because each service node requests the self adjacent service node list from the seed node and establishes connection with the service nodes around the seed node, when all the service nodes establish the connection around the seed node, each part which is not communicated with the surrounding nodes is a second sub-network. Each second sub-network is internally connected in a peer-to-peer manner, namely each service node is equal and has no central node, and each service node is responsible for issuing messages to other service nodes and finally reaches a required service node after layer-by-layer issuing. And peer-to-peer connection is adopted among the second subnet network service nodes, so that linear expansion is easy.
In one embodiment, the first positional relationship criteria comprises: the distance from the service node is less than a first distance threshold. As long as it is less than the first distance threshold, it is considered close enough to the service node to connect with the service node.
The first distance threshold is the farthest distance between preset service nodes according to the building requirement of the blockchain network, for example, the first distance threshold may be 1 km or 5 km.
In one embodiment, the first positional relationship criteria comprises: and a territorial block co-located with the service node in the electronic map. If the service nodes are located in the same region block, the service nodes are considered to be close enough to be connected with the service nodes.
The electronic map is an electronic map in which the positions of all nodes are recorded, and different management areas, namely regional blocks, for example, a city area in the electronic map are divided according to management needs.
The above describes the process of forming a second sub-network if it is determined that the node making the join request is a service node; the process of forming the first sub-network if it is determined that the node making the join request is a billing node is described below.
And step 430, if the node sending the join request is determined to be the accounting node, returning an accounting node list connected with the seed node to the accounting node so that the accounting node establishes connection with the accounting nodes in the accounting node list and exchanges information in the accounting node list to form a first sub-network.
The accounting node is an execution node for accounting to the block chain, namely a node capable of participating in consensus.
The seed node may return a list of accounting nodes connected to the seed node to the accounting node issuing the join request according to the DHT algorithm. The list of accounting nodes records all information of accounting nodes connected with the seed node, such as node identification and the like, which can be used for establishing connection. Furthermore, the accounting node may establish a connection with the accounting node in the accounting node list through the DHT algorithm and exchange information in the accounting node list with each other. Each accounting node stores an accounting node list of the information of the accounting nodes connected with the accounting node, so that after the information in the accounting node lists is exchanged, all the information of the two accounting nodes is combined by taking and combining, the intercommunication of all the accounting nodes is realized, namely the accounting nodes are fully connected, and the first sub-network is constructed. And meanwhile, the security is improved by only carrying out full connection in the accounting sub-network.
In this way, the billing subnetwork can be accurately constructed from each billing node making a join request, responsible for the uplink (billing) of the block. The content of the blocks to be linked up can be booked only when the content of the blocks to be linked up is agreed in the booked sub-network, so that the booked objectivity is ensured.
As shown in fig. 4, according to one embodiment of the present disclosure, there is provided a method for a billing node to establish a connection with a billing node in the billing node list and exchange information in the billing node list, which is performed by the billing node, in this embodiment, the method for a billing node to establish a connection with a billing node in the billing node list and exchange information in the billing node list comprises the following steps performed by the billing node:
step 510, the accounting node establishes a connection with the accounting node in the accounting node list, and sends an accounting node list exchange request to the accounting node in the accounting node list;
step 520, sending the accounting node list of the accounting node to each accounting node in the accounting node list, and receiving accounting node lists sent by other accounting nodes;
step 530, integrating the received accounting node list into the accounting node list of the accounting node.
The accounting node list exchange request is used to request the other accounting node list of the other party from the connected accounting node list. This allows the information of the list of accounting nodes to be exchanged with each other after the connection. Then, each accounting node can integrate the received accounting node list into the accounting node list of the accounting node by means of merging the received accounting node list with the accounting node list of the accounting node. Therefore, each accounting node continuously establishes the connection and integrates the accounting node list, so that the full connection of all accounting nodes is realized, and each accounting node stores the list of all other accounting nodes.
In one embodiment, step 510 includes:
according to a legal accounting node list, carrying out validity check on accounting nodes in the accounting node list;
and establishing connection with a legal accounting node, and sending an accounting node list exchange request to the legal accounting node.
Legal information such as whether all accounting nodes are qualified to participate in consensus or not is recorded in the legal accounting node list. For example, a certain accounting node has previously tampered with blockchain data, and therefore an illegal node is determined by a security center (not shown) of the blockchain network and removed from the list of legitimate accounting nodes. And through the legal accounting node list, whether the accounting node requested to be added is legal or not can be determined, and illegal accounting nodes are filtered out. Furthermore, a connection can be established with a legitimate accounting node and an accounting node list exchange request can be sent to the legitimate accounting node. The embodiment filters out illegal accounting nodes in a legality checking mode, and improves the reliability of accounting of the accounting nodes.
The above describes the process of forming a first sub-network if it is determined that the node making the join request is a billing node; the following describes how to make the relay node perform block chain communication if it is determined that the node that issued the join request is the relay node.
Step 440, if it is determined that the node sending the join request is the relay node, returning a second adjacent service node list and a first adjacent accounting node list to the relay node, where a position relationship with the relay node conforms to a second position relationship standard, so that the relay node performs block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
The relay node is an intermediate node except the seed node, only plays a role in communication transfer between the first sub-network and the second sub-network, and does not play a role in generating the whole block chain network by the seed node.
The seed node may return a second adjacency service node list and a first adjacency accounting node list, the location relationship of which with the relay node sending the join request conforms to a second location relationship standard, according to the DHT algorithm. The second location relation criterion is a location relation between a relay node and a service node or an accounting node set by the communication management requirement of the block chain, and may be, for example, a region block located in an electronic map and having a distance from the relay node smaller than a predetermined threshold, or the like, which will be described in detail below.
The second adjacent service node list records information of all service nodes meeting the second position relation standard with the relay node, such as node identification and other information which can be used for establishing connection. Furthermore, the relay node may establish a connection with a service node of the second neighboring service node list and then perform communication.
The first adjacent accounting node list records information of all accounting nodes conforming to the second position relation standard with the relay node, such as node identification and the like which can be used for establishing connection. Further, the relay node may communicate after establishing a connection with the billing node of the first list of neighboring billing nodes.
Therefore, the relay node is respectively connected with the service node and the accounting node in the two lists according to the second adjacent service node list and the first adjacent accounting node list, and the adjacent lists are exchanged with each other for information exchange, so that the information of the service node is not disclosed to the accounting node in the whole process, and the information of the accounting node is not disclosed to the service node.
In this way, it is possible to achieve a connection between the first sub-network and the second sub-network, and between the second sub-networks via intermediate nodes (seed node and relay node), the relay node being connected to the seed node. The intermediate node communicates between the service node and the accounting node. The first sub-network and the second sub-network are isolated, the safety of the block chain is effectively guaranteed, and meanwhile the linear expansion of the block chain network is facilitated.
In one embodiment, the second positional relationship criteria comprises: the distance to the relay node is less than a second distance threshold. Less than the second distance threshold, the relay node is considered to be close enough to connect with the relay node.
The second distance threshold is a farthest distance preset between the relay node and the service node or the accounting node according to the communication management requirement of the blockchain network, for example, the second distance threshold may be 1 kilometer or 5 kilometers.
In one embodiment, the second positional relationship criteria comprises: and the relay node and the region block are co-located in the electronic map. And the relay node is located in the same region block as the relay node, and the relay node is considered to be close enough to the relay node and can be connected with the relay node.
The electronic map is an electronic map in which the positions of all nodes are recorded, and different management areas, namely regional blocks, for example, a city area in the electronic map are divided according to management needs.
As shown in fig. 5, according to an embodiment of the present disclosure, there is provided a method for a relay node to perform block chain communication with a service node and an accounting node, where the service node includes a synchronization node and a lightweight node, and the relay node performs block chain communication with the service node in the second neighboring service node list and the accounting node in the first neighboring accounting node list, including the following steps performed by the relay node:
step 610, receiving information to be uplink sent by a service node in the second adjacent service node list;
step 620, sending the information to be uplink linked to the billing node in the first neighbor billing node list for uplink linking;
step 630, in response to the uplink being completed, receiving uplink blocks from the accounting node;
step 640, broadcasting the uplink block to the synchronization node in the second neighboring service node list, and broadcasting the block header of the uplink block to the lightweight node in the second neighboring service node list.
The service node comprises a synchronous node and a lightweight node, wherein the synchronous node is a node which receives the whole block of the whole uplink as an accounting result. A lightweight node refers to a node that receives only the block headers of blocks of the uplink as accounting results.
After receiving information to be uplink transmitted by service nodes in the second adjacent service node list, the relay node transmits the information to be uplink transmitted to an accounting node in the first adjacent accounting node list connected with the relay node, and when an uplink block is formed by the accounting node, a plurality of information to be uplink transmitted are packaged into a block, and then an abstract algorithm is applied to the block to obtain an abstract of the block, and the abstract of the block is put on a block head uplink. When the uplink is completed, receiving uplink blocks from the accounting node. Then, the uplink block is broadcasted to the synchronous node in the second adjacent service node list, and the block head of the uplink block is broadcasted to the lightweight node in the second adjacent service node list. Due to the fact that the content of the block bodies is different, the abstracts obtained after abstract operation are different, and different blocks can be distinguished through the abstracts. Therefore, when the lightweight node needs to check the complete content of the block, the block head is used for querying the uplink block through the accounting node, and the content of the block corresponding to the block head can be obtained. And only the block head is stored in the lightweight node, so that the storage burden of the lightweight node is greatly reduced, and the safety of block information is improved. Meanwhile, when the synchronization node needs to inquire the block content afterwards, the synchronization node can easily search the content stored in the synchronization node.
In one embodiment, in step 610, the information to be uplink sent by the service node is sent after the service node receives the information to be uplink from the ue and performs a first verification on the information to be uplink according to a predetermined verification rule.
The ue is the node that actually generates the information to be uplink. For example, when the user reimburses the electronic invoice, the client end reports the event information of the reimbursed electronic invoice to the service node connected with the client end, and the service node requests the chain on the billing node. Before requesting to uplink, the service node checks the validity of the information to be uplink, such as whether the event information of the reimbursement electronic invoice includes an electronic invoice number, a reimburser, a reimbursement unit, a reimbursement amount, and the like. Verification fails and no uplink is performed. The predetermined validation rule may be a predetermined uplink information integrity validation table. The default ul integrity verification table specifies the contents that need to be uplinked for each ul event. For example, in the event of reimbursing an electronic invoice, it is necessary to link up an electronic invoice number, a reimburser, a reimbursement unit, a reimbursement amount, and the like. And the service node compares the information to be uplink with a preset uplink information integrity verification table to verify the integrity of the information to be uplink. Or may be sent to a dedicated information verification node (not shown), which verifies the uplink information to be transmitted. And after the first verification of the information to be uplink is passed, the information to be uplink is sent.
The embodiment discards illegal transactions through the first verification, and improves the reliability of the accounting information.
In one embodiment, the sending the information to be uplink transmitted to the billing node in the first neighbor billing node list for uplink transmission includes the following steps performed by the relay node:
performing second verification on the information to be uplink according to a preset verification rule;
and sending the information to be uplink which passes the second verification to the accounting nodes in the first adjacent accounting node list for uplink.
In this embodiment, the predetermined verification rule may be to verify the uplink information again according to the preset uplink information integrity verification table. To be distinguished from the first authentication, the second authentication may be an authentication of the service node that sent the information to be uplink. It may be specified that, when the service node transmits the information to be uplink to the relay node, the digest of the information to be uplink is generated through a predetermined digest algorithm, and then the digest is encrypted by the private key of the service node, so as to obtain the signature of the information to be uplink. And the service node sends the information to be uplink to the relay node together with the signature. After receiving the signature, the relay node may obtain the public key of the service node from an authentication center (not shown) of the blockchain network, and decrypt the signature with the public key to obtain a decrypted digest. Then, the information to be uplinked generates an abstract by using the same preset abstract algorithm, and the generated abstract is compared with the decrypted abstract. And if the first and second adjacent accounting nodes are consistent, the second verification is passed, and the information to be uplink which is passed by the second verification is sent to the accounting nodes in the first adjacent accounting node list for uplink. If not, discarding the information to be uplink and rejecting uplink. Through the second verification, the validity of the service node sending the information to be uplink is verified, and the uplink information safety is improved.
In one embodiment, the accounting nodes include consensus nodes and candidate nodes, and step 620 includes:
broadcasting the information to be uplink to the common node and the candidate node in the first adjacent accounting node list so that the common node and the candidate node which has been changed into the common node during common identification can perform common identification on the block of the information to be uplink.
The accounting node comprises a consensus node and a candidate node. Consensus refers to the co-supervision of the billed content within the billing sub-network before billing onto the blockchain. The content of the blocks to be linked up can be booked only when the content of the blocks to be linked up is agreed in the booked sub-network, so that the booked objectivity is ensured. At a certain moment, for a block to be uplinked, not all accounting nodes participate in consensus and accounting, but the consensus and accounting are performed by a selected part of accounting nodes, wherein the selected part of accounting nodes are called consensus nodes and are called candidate nodes. The portion of the accounting nodes selected at each time is changed, resulting in dynamic differentiation of the consensus node from the candidate nodes. An accounting node may be a consensus node at one time and become a candidate node at another time.
And broadcasting the information to be uplink to a common identification node and a candidate node in the first adjacent accounting node list, wherein the common identification node and the candidate node which is converted into the common identification node during common identification carry out common identification on the block of the information to be uplink, and further realizing uplink of the information to be uplink after the common identification.
In one embodiment, in addition to generating the blockchain network, the seed node itself also acts as an intermediate node in communication with the service node and the accounting node after the blockchain network is generated. Thus, in one embodiment, the method further comprises:
and allocating a second adjacent service node list and a first adjacent accounting node list, the position relationship of which with the seed node conforms to a second position relationship standard, to the seed node, so that the seed node can carry out block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
The process of allocating the second adjacent service node list and the first adjacent accounting node list whose position relationship with the seed node conforms to the second position relationship standard to the seed node itself is similar to the process of determining the second adjacent service node list and the first adjacent accounting node list whose position relationship with the relay node conforms to the second position relationship standard for the relay node in the foregoing embodiment, and is not repeated for saving the text. The process of block chain communication between the seed node and the service node in the second adjacent service node list and between the seed node and the accounting node in the first adjacent accounting node list is also similar to the process of block chain communication between the relay node and the service node in the second adjacent service node list and between the relay node and the accounting node in the first adjacent accounting node list in the foregoing embodiment, and is not described again for saving space.
According to an embodiment of the present disclosure, as shown in fig. 6, there is further provided a seed node, where the seed node is located in a blockchain network, the blockchain network includes a first sub-network of an accounting node and second sub-networks of service nodes, the first sub-network and the second sub-networks are connected by an intermediate node, the intermediate node includes the seed node and a relay node, and the seed node includes:
a node identity determining unit 710, configured to determine, in response to receiving a join request to join the blockchain network, an identity of a node that sends the join request;
a first returning unit 720, configured to, if it is determined that the node that sends the join request is a service node, return a first adjacent service node list to the service node, where a position relationship with the service node meets a first position relationship standard, so that the service node establishes a connection with a service node in the first adjacent service node list to form a second sub-network;
a second returning unit 730, configured to, if it is determined that the node sending the join request is the accounting node, return an accounting node list connected to the seed node to the accounting node, so that the accounting node establishes a connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network;
a third returning unit 740, configured to, if it is determined that the node sending the join request is the relay node, return a second adjacent service node list and a first adjacent accounting node list, of which the position relationship with the relay node meets a second position relationship standard, to the relay node, so that the relay node performs block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
In one embodiment, the service nodes include a synchronization node and a lightweight node, and the relay node is in block-chain communication with the service nodes in the second list of adjacent service nodes and with the accounting nodes in the first list of adjacent accounting nodes, including the following steps performed by the relay node:
receiving information to be uplink sent by the service node in the second adjacent service node list;
sending the information to be uplink transmitted to the accounting node in the first adjacent accounting node list for uplink transmission;
receiving blocks of uplink from the accounting node in response to uplink completion;
broadcasting the uplink block to a synchronization node in the second adjacent service node list, and broadcasting the block head of the uplink block to a lightweight node in the second adjacent service node list.
In one embodiment, the accounting node includes a consensus node and a candidate node, and the sending the information to be uplink transmitted to the accounting node in the first neighbor accounting node list for uplink transmission includes:
broadcasting the information to be uplink to the common node and the candidate node in the first adjacent accounting node list so that the common node and the candidate node which has been changed into the common node during common identification can perform common identification on the block of the information to be uplink.
In one embodiment, the node identity determining unit 710 is further configured to:
determining the node identification sending the joining request;
according to the node identification, referring to a preset blacklist, filtering the joining request;
and determining the identity of the node sending the joining request according to the specific field in the filtered joining request.
In one embodiment, the first positional relationship criteria comprises: the distance from the service node is less than a first distance threshold.
In one embodiment, the first positional relationship criteria comprises: and a territorial block co-located with the service node in the electronic map.
In one embodiment, the accounting node establishes a connection with an accounting node in said accounting node list and exchanges information in the accounting node list, comprising the following steps performed by the accounting node:
the accounting node establishes connection with the accounting nodes in the accounting node list and sends an accounting node list exchange request to the accounting nodes in the accounting node list;
the accounting node list of the accounting node is sent to each accounting node in the accounting node list, and accounting node lists sent by other accounting nodes are received;
and integrating the received accounting node list into the accounting node list of the accounting node.
In one embodiment, the connection between the accounting node and the accounting node in the accounting node list is established, and an accounting node list exchange request is sent to the accounting node in the accounting node list, including:
according to a legal accounting node list, carrying out validity check on accounting nodes in the accounting node list;
and establishing connection with a legal accounting node, and sending an accounting node list exchange request to the legal accounting node.
In one embodiment, the second positional relationship criteria comprises: the distance to the relay node is less than a second distance threshold.
In one embodiment, the second positional relationship criteria comprises: and the relay node and the region block are co-located in the electronic map.
In an embodiment, the information to be uplink sent by the service node is sent after the service node receives the information to be uplink from the client and performs a first verification on the information to be uplink according to a predetermined verification rule.
In one embodiment, the sending the information to be uplink transmitted to the billing nodes in the first neighbor billing node list for uplink transmission includes:
performing second verification on the information to be uplink according to a preset verification rule;
and sending the information to be uplink which passes the second verification to the accounting nodes in the first adjacent accounting node list for uplink.
A method of generating a blockchain network according to an embodiment of the present disclosure may be implemented by the seed node 301 of fig. 7. A seed node 301 generating a blockchain network according to an embodiment of the present disclosure is described below with reference to fig. 7. The seed node 301 generating the blockchain network shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, the seed node 301 generating the blockchain network is in the form of a general purpose computing device. The components of the seed node 301 that generate the blockchain network may include, but are not limited to: the at least one processing unit 810, the at least one memory unit 820, and a bus 830 that couples the various system components including the memory unit 820 and the processing unit 810.
Wherein the storage unit stores program code that can be executed by the processing unit 810, such that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the description part of the above exemplary methods of the present specification. For example, the processing unit 810 may perform the various steps as shown in fig. 3.
The storage unit 820 may include readable media in the form of volatile memory units such as a random access memory unit (RAM)8201 and/or a cache memory unit 8202, and may further include a read only memory unit (ROM) 8203.
The storage unit 820 may also include a program/utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Bus 830 may be any of several types of bus structures including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
The seed node 301 generating the blockchain network may also communicate with one or more external devices 700 (e.g., keyboard, pointing device, bluetooth device, etc.), with one or more devices that enable a user to interact with the seed node 301 generating the blockchain network that queries the blockchain network for transaction information in data blocks, and/or with any device (e.g., router, modem, etc.) that enables the seed node 301 generating the blockchain network to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 850. Also, the seed node 301 generating the blockchain network may also communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) through a network adapter 860. As shown, the network adapter 860 communicates with the other modules of the seed node 301 generating the blockchain network over a bus 830. It should be appreciated that although not shown in the figures, other hardware and/or software modules may be used in conjunction with the seed node 301 generating the blockchain network, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
In an exemplary embodiment of the present disclosure, there is also provided a computer program medium having stored thereon computer readable instructions which, when executed by a processor of a computer, cause the computer to perform the method described in the above method embodiment section.
According to an embodiment of the present disclosure, there is also provided a program product for implementing the method in the above method embodiment, which may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited in this regard and, in the present document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
A computer readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
It should be noted that although in the above detailed description several modules or units of the device for action execution are mentioned, such a division is not mandatory. Indeed, the features and functionality of two or more modules or units described above may be embodied in one module or unit, according to embodiments of the present disclosure. Conversely, the features and functions of one module or unit described above may be further divided into embodiments by a plurality of modules or units.
Moreover, although the steps of the methods of the present disclosure are depicted in the drawings in a particular order, this does not require or imply that the steps must be performed in this particular order, or that all of the depicted steps must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions, etc.
Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein may be implemented by software, or by software in combination with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure may be embodied in the form of a software product, which may be stored in a non-volatile storage medium (which may be a CD-ROM, a usb disk, a removable hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which may be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.

Claims (26)

1. A method of generating a blockchain network comprising a first sub-network of accounting nodes and second sub-networks of service nodes, the first and second sub-networks and the second sub-networks being connected by intermediate nodes, the intermediate nodes comprising a seed node and a relay node, the method being performed by the seed node, the method comprising:
in response to receiving a join request to join a blockchain network, determining the identity of a node sending the join request;
if the node sending the joining request is determined to be a service node, returning a first adjacent service node list, the position relationship of which with the service node accords with a first position relationship standard, to the service node so that the service node establishes connection with the service node of the first adjacent service node list to form a second sub-network, wherein the service node in the second sub-network adopts a peer-to-peer connection mode;
if the node sending the join request is determined to be an accounting node, returning an accounting node list connected with the seed node to the accounting node so that the accounting node establishes connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network, wherein the accounting node in the first sub-network adopts a full connection mode;
and if the node sending the joining request is determined to be the relay node, returning a second adjacent service node list and a first adjacent accounting node list to the relay node, wherein the position relationship between the second adjacent service node list and the relay node conforms to a second position relationship standard, so that the relay node can perform block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
2. The method of claim 1, wherein the service nodes comprise a synchronization node and a lightweight node, and wherein the relay node is in block-chain communication with the service nodes in the second list of contiguous service nodes and with the accounting nodes in the first list of contiguous accounting nodes, comprising the following steps performed by the relay node:
receiving information to be uplink sent by the service node in the second adjacent service node list;
sending the information to be uplink transmitted to the accounting node in the first adjacent accounting node list for uplink transmission;
receiving blocks of uplink from the accounting node in response to uplink completion;
broadcasting the uplink block to a synchronization node in the second adjacent service node list, and broadcasting the block head of the uplink block to a lightweight node in the second adjacent service node list.
3. The method of claim 2, wherein the accounting nodes comprise a consensus node and a candidate node, and wherein the sending the information to be uplink transmitted to the accounting node in the first neighbor accounting node list for uplink transmission comprises:
broadcasting the information to be uplink to the common node and the candidate node in the first adjacent accounting node list so that the common node and the candidate node which has been changed into the common node during common identification can perform common identification on the block of the information to be uplink.
4. The method of claim 1, wherein determining the identity of the node that issued the join request comprises:
determining the node identification sending the joining request;
according to the node identification, referring to a preset blacklist, filtering the joining request;
and determining the identity of the node sending the joining request according to the specific field in the filtered joining request.
5. The method of claim 1, wherein the first location relationship criteria comprises: the distance from the service node is less than a first distance threshold.
6. The method of claim 1, wherein the first location relationship criteria comprises: and a territorial block co-located with the service node in the electronic map.
7. Method according to claim 1, wherein the accounting node establishes a connection with an accounting node in said list of accounting nodes and exchanges information in the list of accounting nodes, comprising the following steps performed by the accounting node:
the accounting node establishes connection with the accounting nodes in the accounting node list and sends an accounting node list exchange request to the accounting nodes in the accounting node list;
the accounting node list of the accounting node is sent to each accounting node in the accounting node list, and accounting node lists sent by other accounting nodes are received;
and integrating the received accounting node list into the accounting node list of the accounting node.
8. The method of claim 7, wherein said billing node establishing a connection with a billing node in said list of billing nodes and issuing a billing node list exchange request to a billing node in said list of billing nodes comprises:
according to a legal accounting node list, carrying out validity check on accounting nodes in the accounting node list;
and establishing connection with a legal accounting node, and sending an accounting node list exchange request to the legal accounting node.
9. The method of claim 1, wherein the second positional relationship criteria comprises: the distance to the relay node is less than a second distance threshold.
10. The method of claim 9, wherein the second positional relationship criteria comprises: and the relay node and the region block are co-located in the electronic map.
11. The method of claim 2, wherein the information to be uplink sent by the service node is sent after the service node receives the information to be uplink from the ue and performs a first verification on the information to be uplink according to a predetermined verification rule.
12. The method of claim 2 wherein the sending the information to be uplink to the billing nodes in the first neighbor billing node list for uplink comprises:
performing second verification on the information to be uplink according to a preset verification rule;
and sending the information to be uplink which passes the second verification to the accounting nodes in the first adjacent accounting node list for uplink.
13. A seed node, characterized in that the seed node is located in a blockchain network comprising a first sub-network of accounting nodes and second sub-networks of service nodes, which are connected between the first and second sub-networks and between the second sub-networks by intermediate nodes, which intermediate nodes comprise the seed node and a relay node, the seed node comprising:
a node identity determining unit, configured to determine, in response to receiving a join request to join a blockchain network, an identity of a node that issued the join request;
a first returning unit, configured to, if it is determined that a node that sends a join request is a service node, return a first adjacent service node list to the service node, where a position relationship with the service node meets a first position relationship standard, so that the service node establishes a connection with a service node of the first adjacent service node list to form a second sub-network, where service nodes in the second sub-network are in a peer-to-peer connection manner;
a second returning unit, configured to, if it is determined that the node sending the join request is an accounting node, return an accounting node list connected to the seed node to the accounting node, so that the accounting node establishes a connection with the accounting node in the accounting node list and exchanges information in the accounting node list to form a first sub-network, where the accounting node in the first sub-network is in a full connection mode;
and a third returning unit, configured to, if it is determined that the node that sends the join request is the relay node, return a second adjacent service node list and a first adjacent accounting node list, of which the position relationship with the relay node meets a second position relationship standard, to the relay node, so that the relay node performs block chain communication with the service nodes in the second adjacent service node list and the accounting nodes in the first adjacent accounting node list.
14. The seed node of claim 13, wherein the service nodes comprise a synchronization node and a lightweight node, and wherein the relay node is in block-chain communication with the service nodes in the second list of contiguous service nodes and with the accounting nodes in the first list of contiguous accounting nodes, comprising the steps performed by the relay node of:
receiving information to be uplink sent by the service node in the second adjacent service node list;
sending the information to be uplink transmitted to the accounting node in the first adjacent accounting node list for uplink transmission;
receiving blocks of uplink from the accounting node in response to uplink completion;
broadcasting the uplink block to a synchronization node in the second adjacent service node list, and broadcasting the block head of the uplink block to a lightweight node in the second adjacent service node list.
15. The seed node according to claim 14, wherein the accounting nodes comprise a consensus node and a candidate node, and the sending the information to be uplink transmitted to the accounting node in the first neighbor accounting node list for uplink comprises:
broadcasting the information to be uplink to the common node and the candidate node in the first adjacent accounting node list so that the common node and the candidate node which has been changed into the common node during common identification can perform common identification on the block of the information to be uplink.
16. The seed node of claim 13, wherein determining the identity of the node that issued the join request comprises:
determining the node identification sending the joining request;
according to the node identification, referring to a preset blacklist, filtering the joining request;
and determining the identity of the node sending the joining request according to the specific field in the filtered joining request.
17. The seed node of claim 13, wherein the first location relationship criteria comprises: the distance from the service node is less than a first distance threshold.
18. The seed node of claim 13, wherein the first location relationship criteria comprises: and a territorial block co-located with the service node in the electronic map.
19. The seed node of claim 13, wherein the accounting node establishes a connection with an accounting node in the list of accounting nodes and exchanges information in the list of accounting nodes, comprising the following steps performed by an accounting node:
the accounting node establishes connection with the accounting nodes in the accounting node list and sends an accounting node list exchange request to the accounting nodes in the accounting node list;
the accounting node list of the accounting node is sent to each accounting node in the accounting node list, and accounting node lists sent by other accounting nodes are received;
and integrating the received accounting node list into the accounting node list of the accounting node.
20. The seed node of claim 19, wherein the accounting node establishes a connection with an accounting node in the accounting node list and issues an accounting node list exchange request to an accounting node in the accounting node list, comprising:
according to a legal accounting node list, carrying out validity check on accounting nodes in the accounting node list;
and establishing connection with a legal accounting node, and sending an accounting node list exchange request to the legal accounting node.
21. The seed node of claim 13, wherein the second location relationship criteria comprises: the distance to the relay node is less than a second distance threshold.
22. The seed node of claim 21, wherein the second location relationship criteria comprises: and the relay node and the region block are co-located in the electronic map.
23. The seed node of claim 14, wherein the to-be-uplink information sent by the service node is sent after the service node receives the to-be-uplink information from the ue and performs a first verification on the to-be-uplink information according to a predetermined verification rule.
24. The seed node of claim 14, wherein the sending the information to be uplink to the billing nodes in the first neighbor billing node list for uplink comprises:
performing second verification on the information to be uplink according to a preset verification rule;
and sending the information to be uplink which passes the second verification to the accounting nodes in the first adjacent accounting node list for uplink.
25. A seed node, comprising:
a memory storing computer readable instructions;
a processor reading computer readable instructions stored by the memory to perform the method of any of claims 1-12.
26. A computer program medium having computer readable instructions stored thereon which, when executed by a processor of a computer, cause the computer to perform the method of any one of claims 1-12.
CN201910713240.9A 2019-08-02 2019-08-02 Method, seed node and medium for generating block chain network Active CN110489486B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910713240.9A CN110489486B (en) 2019-08-02 2019-08-02 Method, seed node and medium for generating block chain network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910713240.9A CN110489486B (en) 2019-08-02 2019-08-02 Method, seed node and medium for generating block chain network

Publications (2)

Publication Number Publication Date
CN110489486A CN110489486A (en) 2019-11-22
CN110489486B true CN110489486B (en) 2020-12-18

Family

ID=68549204

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910713240.9A Active CN110489486B (en) 2019-08-02 2019-08-02 Method, seed node and medium for generating block chain network

Country Status (1)

Country Link
CN (1) CN110489486B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110944058B (en) * 2019-12-04 2022-03-04 杭州复杂美科技有限公司 Block chain intranet node relay connection method
CN110943869B (en) * 2019-12-16 2022-03-04 杭州复杂美科技有限公司 Block consensus and broadcast method, equipment and storage medium
CN111125255B (en) * 2019-12-24 2024-01-23 腾讯科技(深圳)有限公司 Block data processing method and device, terminal and readable storage medium
CN111277635B (en) * 2020-01-14 2022-11-08 深圳市迅雷网络技术有限公司 Method, equipment, device and computer medium for accessing external node to block chain
CN111738779B (en) * 2020-07-24 2020-12-08 江苏荣泽信息科技股份有限公司 Intelligent contract system based on standard SQL grammar
CN112055077B (en) * 2020-09-02 2023-04-18 杭州复杂美科技有限公司 Block link access method, device and storage medium
CN112235420B (en) * 2020-12-10 2021-04-02 腾讯科技(深圳)有限公司 Data synchronization method, system and related equipment based on block chain
CN112231415B (en) * 2020-12-16 2021-03-12 腾讯科技(深圳)有限公司 Data synchronization method and system of block chain network, electronic device and readable medium
CN112287033B (en) * 2020-12-24 2021-03-19 腾讯科技(深圳)有限公司 Data synchronization method, equipment and computer readable storage medium
CN113965326B (en) * 2021-09-26 2022-05-17 北京岸思信息科技有限公司 Lightweight block chain system for resisting parallel attack

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018135766A1 (en) * 2017-01-19 2018-07-26 주식회사 케이티 Device and method for managing data by using block chain
CN109002527A (en) * 2018-07-13 2018-12-14 江苏开放大学(江苏城市职业学院) A method of its management online exam of network test system and utilization based on block chain
CN109523385A (en) * 2018-12-07 2019-03-26 深圳市智税链科技有限公司 Method, accounting nodes and the medium of Transaction Information are inquired in block chain network
CN109544177A (en) * 2018-11-01 2019-03-29 广东黾车新能源汽车产业有限公司 A kind of accessory method for tracing based on block chain technology
CN109684375A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Method, accounting nodes and the medium of Transaction Information are inquired in block chain network
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2018135766A1 (en) * 2017-01-19 2018-07-26 주식회사 케이티 Device and method for managing data by using block chain
CN109002527A (en) * 2018-07-13 2018-12-14 江苏开放大学(江苏城市职业学院) A method of its management online exam of network test system and utilization based on block chain
CN109544177A (en) * 2018-11-01 2019-03-29 广东黾车新能源汽车产业有限公司 A kind of accessory method for tracing based on block chain technology
CN109523385A (en) * 2018-12-07 2019-03-26 深圳市智税链科技有限公司 Method, accounting nodes and the medium of Transaction Information are inquired in block chain network
CN109684375A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Method, accounting nodes and the medium of Transaction Information are inquired in block chain network
CN109684408A (en) * 2018-12-07 2019-04-26 深圳市智税链科技有限公司 Data managing method, device, medium and the electronic equipment of block catenary system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
区块链技术发展现状与展望;袁勇等;《自动化学报》;20160329;第481-494页 *

Also Published As

Publication number Publication date
CN110489486A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
CN110489486B (en) Method, seed node and medium for generating block chain network
CN111865598B (en) Identity verification method and related device for network function service
US11823141B2 (en) Blockchain network interaction controller
CN103339901B (en) Terminal in content guiding network environment and the communication means of intermediate node and terminal and intermediate node
US11716207B1 (en) System and method for a dynamic-PKI for a social certificate authority
CN113421097B (en) Data processing method and device, computer equipment and storage medium
CN110866823A (en) Public link-based transaction method and block chain system
CN111934996B (en) Message transmission method and device
EP4191498A1 (en) Data communication method and apparatus, computer device, and storage medium
US11336660B2 (en) Methods and apparatuses for identifying replay transaction based on blockchain integrated station
EP3937052B1 (en) Methods and apparatuses for synchronizing data based on blockchain integrated station
CN101895535B (en) Network authentication method, device and system for identifying separate mapping network
CN112152996A (en) Data transmission method, device, equipment and storage medium based on gateway cascade
Mershad et al. A blockchain model for secure communications in internet of vehicles
US20220182243A1 (en) Method and Apparatus for Distributed Ledger
CN111866993B (en) Wireless local area network connection management method, device, software program and storage medium
CN113472668A (en) Routing method and system in multi-party security computing
US20160157000A1 (en) Method and apparatus for establishing trail network
US8036218B2 (en) Technique for achieving connectivity between telecommunication stations
CN115669209A (en) Access authentication method, device, equipment and storage medium
Raj et al. [Retracted] A Mathematical Queuing Model Analysis Using Secure Data Authentication Framework for Modern Healthcare Applications
Bermbach et al. Towards grassroots peering at the edge
CN112241888B (en) Address management system based on public chain
WO2023227067A1 (en) Quantum network communication method and apparatus, electronic device and storage medium
Cebe et al. Utilizing advanced metering infrastructure to build a public key infrastructure for electric vehicles

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