CN112995211B - Data processing method, device and equipment based on block chain network and storage medium - Google Patents

Data processing method, device and equipment based on block chain network and storage medium Download PDF

Info

Publication number
CN112995211B
CN112995211B CN202110430699.5A CN202110430699A CN112995211B CN 112995211 B CN112995211 B CN 112995211B CN 202110430699 A CN202110430699 A CN 202110430699A CN 112995211 B CN112995211 B CN 112995211B
Authority
CN
China
Prior art keywords
service node
network
node
service
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110430699.5A
Other languages
Chinese (zh)
Other versions
CN112995211A (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 CN202110430699.5A priority Critical patent/CN112995211B/en
Publication of CN112995211A publication Critical patent/CN112995211A/en
Application granted granted Critical
Publication of CN112995211B publication Critical patent/CN112995211B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/04Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks
    • H04L63/0428Network architectures or network communication protocols for network security for providing a confidential data exchange among entities communicating through data packet networks wherein the data content is protected, e.g. by encrypting or encapsulating the payload
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/50Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols using hash chains, e.g. blockchains or hash trees

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a data processing method, a data processing device, data processing equipment and a computer readable storage medium. The method comprises the following steps: acquiring a connection authority set; receiving an access request sent by a first service node, wherein the access request carries an identifier of the first service node, and the first service node is any service node in a witness sub-network; if the identifier of the first service node does not belong to the connection authority set, acquiring a communication address table; and sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access. The connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network, the throughput of the block chain network is improved, and the stability of data transmission is enhanced.

Description

Data processing method, device and equipment based on block chain network and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a data processing method based on a blockchain network, a data processing apparatus based on a blockchain network, a data processing device based on a blockchain network, and a computer-readable storage medium.
Background
With the continuous development of computer technology, the blockchain is widely applied to the fields of internet transaction, bill storage and the like due to the decentralization characteristic of the blockchain. In practical applications, the service node and the common node in the blockchain network are usually directly connected to each other. Practice shows that one consensus node is usually connected with a plurality of service nodes, and when the plurality of service nodes upload the evidence storing bill to the consensus node at the same time, congestion may occur, which causes performance degradation of the consensus node and adversely affects the throughput of the block chain network.
Disclosure of Invention
Embodiments of the present invention provide a data processing method, apparatus, device, and storage medium, which can improve throughput of a block chain network and enhance stability of data transmission.
On one hand, the embodiment of the application provides a data processing method based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node, and the data processing method is executed by any proxy node and comprises the following steps:
acquiring a connection authority set, wherein the connection authority set comprises identifications of N service nodes with connection authority in a witness sub-network and communication addresses of the N service nodes, and N is a positive integer;
receiving an access request sent by a first service node, wherein the access request carries an identifier of the first service node, and the first service node is any service node in a witness sub-network;
if the identifier of the first service node does not belong to the connection authority set, acquiring a communication address table, wherein the communication address table comprises communication addresses of P service nodes with connection authorities, the P service nodes are selected from N service nodes in the connection authority set, and P is a positive integer;
and sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
On one hand, the embodiment of the application provides a data processing method based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing method is executed by any one consensus node and comprises the following steps:
counting the historical evidence storage records of each service node in the witness sub-network;
screening N service nodes meeting direct connection conditions according to the historical evidence storage records of each service node, wherein N is a positive integer;
distributing connection authority for the N service nodes, and adding the identifications of the N service nodes and the communication addresses of the N service nodes into a connection authority set; and the number of the first and second groups,
the set of connection permissions is sent to at least one proxy node in the access stratum.
On one hand, the embodiment of the application provides a data processing method based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method is executed by a first service node, the first service node is any one service node in a witness sub-network, and the method comprises the following steps:
sending an access request to an access layer, wherein the access request carries an identifier of a first service node;
if a communication address table returned by the access layer is received, the communication address table comprises communication addresses of P service nodes with connection authority, and the P service nodes are selected from N service nodes with connection authority in a connection authority set; n, P are all positive integers;
and selecting any service node from the communication address table as a relay node, and sending an access request to the relay node so as to access to the core sub-network through the relay node.
On one hand, the embodiment of the application provides a data processing device based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing device is carried on the agent node; the data processing apparatus includes:
the acquisition unit is used for acquiring a connection authority set, the connection authority set comprises identifications of N service nodes with connection authority in a witness sub-network and communication addresses of the N service nodes, and N is a positive integer; the access request is used for receiving the access request sent by the first service node, the access request carries the identifier of the first service node, and the first service node is any service node in the witness sub-network;
the processing unit is used for acquiring a communication address table if the identifier of the first service node does not belong to the connection authority set, wherein the communication address table comprises communication addresses of P service nodes with connection authority, the P service nodes are selected from N service nodes in the connection authority set, and P is a positive integer; and the first service node is used for sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
In one embodiment, the processing unit is further configured to:
and if the identifier of the first service node belongs to the connection authority set, establishing direct connection communication connection with the first service node.
In one embodiment, the processing unit is further configured to:
receiving a direct connection request sent by a second service node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the second service node and the communication address of the second service node; the second service node is any one service node in the witness sub-network;
acquiring a historical communication record of the second service node according to the identifier of the second service node;
if the historical communication record of the second service node meets the direct connection condition, allocating a connection authority for the second service node, and adding the identifier of the second service node and the communication address of the second service node to a connection authority set; and the number of the first and second groups,
and sending response information of the direct connection request to the second service node.
In one embodiment, the historical communication record of the second service node includes at least one of: data uploading amount of the second service node in the historical time period and network delay of the second service node in the historical time period;
the historical communication record of the second service node meets the direct connection condition, and the method comprises the following steps: the data uploading amount of the second service node in unit time does not exceed the quantity threshold, and the network delay of the second service node is smaller than the delay threshold.
In one embodiment, the processing unit is further configured to:
when detecting that a third service node in the connection permission set meets the removal condition, revoking the connection permission of the third service node, and deleting the identifier of the third service node and the communication address of the third service node from the connection permission set;
wherein the third service node satisfying the removal condition includes at least one of: the third service node is off-line; the network delay of the third service node is greater than or equal to the delay threshold; the data uploading frequency of the third service node in unit time is lower than or equal to the frequency threshold; the third service node requests to revoke the connection right.
On one hand, the embodiment of the application provides a data processing device based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access stratum comprises at least one agent node, the data processing device is mounted on the consensus node, and the data processing device comprises:
the processing unit is used for counting the historical evidence storage records of each service node in the witness sub-network; the system comprises a plurality of service nodes, a server and a server, wherein the service nodes are used for selecting N service nodes meeting direct connection conditions according to historical evidence storage records of the service nodes, and N is a positive integer; the system comprises a connection authority set, a service node set and a service node management system, wherein the connection authority set is used for allocating connection authorities for N service nodes and adding identifications of the N service nodes and communication addresses of the N service nodes to the connection authority set; and for sending the set of connection permissions to at least one proxy node in the access stratum.
In one embodiment, the processing unit is further configured to:
when the updating event is triggered, counting the evidence storage records of each service node in the witness sub-network in the target time period;
screening M service nodes meeting direct connection conditions according to the evidence storage records of each service node in a target time period, wherein M is a positive integer;
updating the connection authority of a fourth service node which does not belong to the intersection of the M service nodes and the N service nodes in the M service nodes and the N service nodes;
and updating the connection permission set according to the identifier of the fourth service node and the communication address of the fourth service node.
On one hand, the embodiment of the application provides a data processing device based on a block chain network, wherein the block chain network comprises a witness sub-network and a core sub-network, at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing device is mounted on a first service node, the first service node being any one of the service nodes in the witness sub-network, and the data processing device includes:
the processing unit is used for sending an access request to the access layer, wherein the access request carries the identifier of the first service node;
if the obtaining unit receives a communication address table returned by the access layer, the communication address table comprises communication addresses of P service nodes with connection authority, and the P service nodes are selected from N service nodes with connection authority in a connection authority set; n, P are all positive integers;
and the processing unit is also used for selecting any service node from the communication address table as the relay node and sending an access request to the relay node so as to access the core sub-network through the relay node.
In an embodiment, the processing unit is configured to send an access request to the relay node for accessing to the core subnetwork through the relay node, and specifically is configured to:
acquiring synchronous information from the relay node, wherein the synchronous information comprises state information of a block chain network;
and generating encrypted data according to the state information of the block chain network and the to-be-processed certificate-storing bill, and sending an access request to the relay node, wherein the access request contains the encrypted data so as to transmit the encrypted data to the core sub-network through the relay node to execute consensus processing.
In one embodiment, the processing unit is further configured to:
sending a direct connection request to an access layer through a relay node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the first service node and the communication address of the first service node;
acquiring response information of the direct connection request;
and if the response information of the direct connection request indicates that the first service node successfully obtains the connection authority, establishing direct connection communication connection with the access layer.
In one aspect, the present application provides a data processing device based on a blockchain network, where the device includes:
a processor for loading and executing a computer program;
a computer-readable storage medium, in which a computer program is stored, which, when executed by a processor, implements the above data processing method based on a blockchain network.
In one aspect, the present application provides a computer-readable storage medium storing a computer program adapted to be loaded by a processor and to execute the above data processing method based on a blockchain network.
In one aspect, the present application provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method based on the blockchain network.
In the embodiment of the application, a connection authority set is obtained, the connection authority set comprises node information (node identifiers and node communication addresses) of N service nodes with connection authorities in a witness sub-network, N is a positive integer, an access request sent by a first service node is received, if the identifier of the first service node does not belong to the connection authority set, a communication address table is obtained, the communication address table comprises communication addresses of P service nodes with connection authorities, P is a positive integer, and the communication address table is sent to the first service node, so that the first service node selects one service node from the communication address table to perform relay access. Therefore, the embodiment of the application proves that part of the service nodes in the sub-network have the connection authority and can be directly connected to the access layer; and partial service nodes do not have connection authority, relay access is carried out to the access layer through the service nodes with the connection authority, and the connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1a illustrates an architecture diagram of a data sharing system provided by an exemplary embodiment of the present application;
fig. 1b is a schematic diagram illustrating a block chain according to an exemplary embodiment of the present application;
FIG. 1c is a block generation flow diagram provided by an exemplary embodiment of the present application;
FIG. 1d illustrates an architecture diagram of a blockchain network provided by an exemplary embodiment of the present application;
FIG. 1e illustrates an architecture diagram of a two-layer network provided by an exemplary embodiment of the present application;
FIG. 1f is a diagram illustrating a scene architecture based on a two-tier network according to an exemplary embodiment of the present application;
FIG. 1g illustrates a network connection architecture diagram for a blockchain network provided by an exemplary embodiment of the present application;
fig. 2 is a flowchart illustrating a data processing method based on a blockchain network according to an exemplary embodiment of the present application;
fig. 3 is a flowchart illustrating another data processing method based on a blockchain network according to an exemplary embodiment of the present application;
fig. 4 is a flowchart illustrating a data processing method based on a blockchain network according to an exemplary embodiment of the present application;
fig. 5 is an interaction flowchart of a data processing method based on a blockchain network according to an exemplary embodiment of the present application;
fig. 6 is an interaction flowchart of another data processing method based on a blockchain network according to an exemplary embodiment of the present application;
fig. 7 is a schematic structural diagram illustrating a data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application;
fig. 8 is a schematic structural diagram of another data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application;
fig. 9 is a schematic structural diagram of another data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application;
fig. 10 shows a schematic structural diagram of a data processing device based on a blockchain network according to an exemplary embodiment of the present application.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The following describes various terms related to the embodiments of the present application:
the blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism and an encryption algorithm. It is essentially a decentralized database, a string of data blocks associated by cryptography, each data block containing information of a batch of network transactions for verifying the validity (anti-counterfeiting) of the information and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, and an application services layer.
Referring to the data sharing system shown in fig. 1a, the data sharing system 100 refers to a system for performing data sharing between nodes, the data sharing system may include a plurality of nodes 101, and the plurality of nodes 101 may refer to respective clients in the data sharing system. Each node 101 may receive input information while operating normally and maintain shared data within the data sharing system based on the received input information. In order to ensure information intercommunication in the data sharing system, information connection can exist between each node in the data sharing system, and information transmission can be carried out between the nodes through the information connection. For example, when an arbitrary node in the data sharing system receives input information, other nodes in the data sharing system acquire the input information according to a consensus algorithm, and store the input information as data in shared data, so that the data stored on all the nodes in the data sharing system are consistent.
Each node in the data sharing system has a node identifier corresponding thereto, and each node in the data sharing system may store a node identifier of another node in the data sharing system, so that the generated block is broadcast to the other node in the data sharing system according to the node identifier of the other node in the following. Each node may maintain a node identifier list as shown in the following table, and store the node name and the node identifier in the node identifier list correspondingly. The node identifier may be an IP (Internet Protocol ) address and any other information that can be used to identify the node; for example, the node identifier may also be a binary sequence code (e.g. 110001110), and table 1 only illustrates the IP address as an example:
TABLE 1
Node name Node identification
Node
1 117.114.151.174
Node 2 117.116.189.145
Node N 119.123.789.258
Each node in the data sharing system stores one identical blockchain. The block chain is composed of a plurality of blocks, referring to fig. 1b, the block chain is composed of a plurality of blocks, the starting block comprises a block head and a block main body, the block head stores an input information characteristic value, a version number, a timestamp and a difficulty value, and the block main body stores input information; the next block of the starting block takes the starting block as a parent block, the next block also comprises a block head and a block main body, the block head stores the input information characteristic value of the current block, the block head characteristic value of the parent block, the version number, the timestamp and the difficulty value, and the like, so that the block data stored in each block in the block chain is associated with the block data stored in the parent block, and the safety of the input information in the block is ensured.
When each block in the block chain is generated, referring to fig. 1c, when the node where the block chain is located receives the input information, the input information is verified, after the verification is completed, the input information is stored in the memory pool, and the hash tree for recording the input information is updated; and then, updating the updating time stamp to the time when the input information is received, trying different random numbers, and calculating the characteristic value for multiple times, so that the calculated characteristic value can meet the following formula:
SHA256(SHA256(version+prev_hash+merkle_root+ntime+nbits+x))<TARGET
wherein, SHA256 is a characteristic value algorithm used for calculating a characteristic value; version is version information of the relevant block protocol in the block chain; prev _ hash is a block head characteristic value of a parent block of the current block; merkle _ root is a characteristic value of the input information; ntime is the update time of the update timestamp; nbits is the current difficulty, is a fixed value within a period of time, and is determined again after exceeding a fixed time period; x is a random number; TARGET is a feature threshold, which can be determined from nbits.
Therefore, when the random number meeting the formula is obtained through calculation, the information can be correspondingly stored, and the block head and the block main body are generated to obtain the current block. And then, the node where the block chain is located respectively sends the newly generated blocks to other nodes in the data sharing system where the newly generated blocks are located according to the node identifications of the other nodes in the data sharing system, the newly generated blocks are verified by the other nodes, and the newly generated blocks are added to the block chain stored in the newly generated blocks after the verification is completed. Practical applications of blockchains include, but are not limited to:
1) bit money network:
the nodes in the bitcoin network have four main functions: wallet, mine digging, block chain database, network routing. Each node in the bitcoin network has a network routing function, and a wallet function, an ore mining function and a block chain database function except the network routing function are optional functions of each node, and usually, a core node in the bitcoin network can include all the four functions. The nodes comprising the above four functions are also called full nodes. Except that the core node in the bitcoin network is a full node, most other nodes are light nodes (i.e., nodes containing partial functions of the above four functions). A user may view his own account balance, manage wallet address and private key, initiate a transaction, etc. through a lightweight wallet (SPV) node. A node having a mining function is also called a mining node, and if the mining node stores data of all blocks in a block chain, the mining node is also a full node, and generally, each mining node is an independent miner (i.e., an independent mining node). If a certain ore digging node is not an independent miner, and the ore digging node and other ore digging nodes are connected with the ore pool together for collective ore digging, the ore digging node is a collective miner; this would also form a mine network, which is a centralized network, with the central node being a mine server to which other miners (i.e., collective miners) are connected, with the communication between the miners and the mine server typically using the mine (Stratum) protocol. In addition, after a miner creates a new block, the new block needs to be broadcast to all nodes in the bitcoin network, and after the bitcoin network receives the block, the reward for the miner is valid; miners in the bitcoin network will start the next block hash calculation. Miners try to shorten the broadcast time of a new block and the calculation time of the next block. Therefore, a special broadcast NetWork is needed to speed up the propagation of the blocks, and this propagation NetWork is also called Bitcoin Relay NetWork (Bitcoin Relay NetWork). In bitcoin networks, a node may send its own maintained peer list (peer list) to neighboring nodes. So after initial node discovery, a list of nodes needs to be copied from the neighboring nodes.
2) Ethernet workshop:
like the bitcoin network, the nodes in the ether house network mainly have four functions of wallet, mine digging, block chain database and block routing, and the nodes in the ether house network can be divided into light nodes, full nodes and the like according to the division of the functions of the nodes. The difference between the ethernet factory network and the bitcoin network lies in that the network structure is different, and the network in the ethernet factory network can be constructed by using a kademlia (kad) algorithm, and based on the algorithm, the ethernet factory network can perform routing and data positioning quickly and accurately. Kad, the routing table is constructed by data called K buckets, which record node identification, node distance, end node, node communication address, etc. The K buckets are sorted according to the distances between other nodes except the target node and the target node in the Ethernet network, and the total number of the K buckets is 256, and each K bucket comprises 16 nodes. The target node herein may refer to any one of the nodes in the ethernet network.
Kad the nodes in the network communicate with each other via User Datagram Protocol (UDP), and if the ping-pong between the two nodes passes, the opposite node is determined to be on-line. Specifically, whether the node is online or not can be detected through the ping command, the ping command is responded through the pong command, the node which is closest to the identification distance of the target node in the core sub-network can be inquired through the FindNODE command, and the FindNODE command is responded through the neighbor commands.
The detection process of the adjacent nodes is as follows: when the system is started for the first time, the identifier (NodeId) of the local node (target consensus node) is randomly generated and is recorded as LocalId, and the identifier of the target consensus node is fixed after being generated. And the target consensus node reads the information of the nodes in the core sub-network, and writes the information into the K bucket after the ping-pong handshake is completed. The target consensus node refreshes the K-bucket once every period of time (e.g., 7200 ms). The specific process of refreshing the K bucket is as follows:
(1) and randomly generating an identifier of the target consensus node, recording the identifier as targetId, and recording the discovery times and the refreshing time from 1.
(2) The distance between targetId and LocalId is calculated and is noted as Dlt.
(3) The identity of the consensus node (NodeId) in the core subnetwork is denoted as KadId, and the distance between KadId and TargetId is calculated and denoted as Dkt.
(4) And finding out nodes with Dlt larger than Dkt in the core sub-network, marking as k bucket nodes (consensus nodes or storage nodes), and sending a FindNODE command to the k bucket nodes, wherein the FindNODE command comprises a TargetId.
(5) And (4) after the K bucket node receives the FindNODE command, the processes of (2) to (4) are executed, and the nodes found from the K bucket are sent back to the target consensus node by using a Neighbours command.
And after the target consensus node receives the Neighbours, writing the received node into the K bucket.
And (3) if the number of searching times does not exceed 8 and the refreshing time does not exceed the searching threshold (such as 600 ms), returning to the step (2) to execute circularly.
3) Alliance chain (e.g., Fabric, Terdermint) network:
the alliance chain network is a data distribution network based on a Gossip protocol, information (Gossip) is propagated by a seed node, when the state of the seed node needs to be updated to other nodes in the alliance chain network, the seed node randomly selects a plurality of surrounding nodes to disseminate messages, and the nodes receiving the messages repeat the process (namely randomly selecting a plurality of surrounding nodes to disseminate the messages) until all the nodes in the alliance chain network receive the messages. Although a certain amount of time may be required for this process, theoretically, all nodes receive messages eventually, the Gossip protocol is a final consistency protocol because it cannot be guaranteed that all nodes in the alliance-link network receive messages at a certain time. The Gossip protocol includes:
propagation Protocol/gossip Protocol (separation Protocol/Rumor-monitoring Protocol): the nodes work through a flooding agent in the network, and the nodes directly transmit the broadcasted data to all the neighbor nodes after receiving the broadcasted data. This approach may improve the robustness of the network but is prone to broadcast storms.
Inverse Entropy Protocol (Anti-Entropy Protocol): the method is used for repairing the copied data and operates by comparing the copying difference with the coordination difference. Data synchronization in Hyperfolder Fabric (a ledger platform) is realized by using the method.
Protocol for computing the aggregation: sampling information of nodes in a network, and combining the values to obtain a value in a system range, thereby calculating a set in the network range; a comprehensive information flow pattern will then be established.
The Gossip protocol includes two data transmission modes, one of which is a Push-based (Push-based) mode: a certain node in the network randomly selects N nodes as data receiving objects; the node transmits corresponding information to the selected N nodes; processing the received data by the node receiving the information; and fourthly, the node receiving the data transmits the received data according to the first step and the second step. Another data transmission method is a Pull-based method: a node periodically randomly selects N nodes to inquire whether the information is up-to-date (within a preset time range), and the node receiving the request replies the information newly received by the requesting node.
Taking hyperhedger Fabric as an example, in the transaction flow of hyperhedger Fabric, Peer nodes (Peer) are used as main bodies participating in transaction and are mainly responsible for storing complete block chain data and executing intelligent contracts, and the Peer nodes can complete block distribution, state synchronization and other problems through Gossip protocol.
The information of other Peer nodes is maintained on each Peer node, and the information is exchanged (SignedGossipMessage is sent) through random communication with other Peer nodes, so that the final consistency is achieved. The main process is to communicate via gossispstream bi-directional flow through gossispparent client. The Peer nodes form a P2P network, the P2P network is a point-to-point connection network, the P2P network is based on a specific network protocol, a central node is not needed among the network nodes to maintain the network state, and each node maintains the node state of the whole network or the connection state of the adjacent nodes through broadcast interaction with the adjacent nodes. The client side submits a request to the Peer node, the Peer node submits a Transaction Proposal (Transaction Proposal) to the Endorsement node (Endorser) after processing, then carries out Endorsement signature (Endorsement), and finally broadcasts to the Peer node after reaching consensus through the sequencing service. Fig. 1d shows an architecture diagram of a blockchain network according to an exemplary embodiment of the present application. As shown in fig. 1 d. Gossip is responsible for connecting sequencing services and Peer nodes, realizing efficient data distribution from a single source node to all nodes, realizing state synchronization among different nodes in a background, and being capable of processing the problem of Byzantine, dynamic node addition and network partitioning.
In practice, it has been found that when blockchains are used in some scenarios (e.g., invoicing scenarios) in a government or commercial establishment, not all blockchain participating nodes have sufficient resources and the necessity to become nodes participating in the blockchain consensus. For the safety of data, when related data of personal privacy or national safety is involved in the blockchain system, the common data peer-to-peer blockchain deployment mode is not applicable. In order to adapt to service requirements (such as internal and external networks, service networks, office network separation and the like) and further improve the security and confidentiality of data, the embodiment of the application provides a double-layer chain, and a double-layer network architecture of a witness sub-network-core sub-network is formed through a P2P network. Fig. 1e shows an architecture diagram of a two-layer network provided by an exemplary embodiment of the present application. As shown in fig. 1e, the service node is deployed in the witness sub-network in the public network, and the accounting node (i.e. consensus node) running the blockchain consensus protocol is deployed in the private core sub-network, and the two nodes interact with each other through the routing boundary. That is, the nodes in the witness sub-network mainly perform service execution, do not participate in accounting consensus, and obtain the block header data and the partial authorization visible block data from the core sub-network by means of identity authentication. The witness subnetwork and the core subnetwork are in different network environments, usually the witness subnetwork is in a public network and the core subnetwork is in a private network.
Since the core sub-networks are in the relatively safe private networks, mutual access of the core sub-networks is guaranteed by a consensus mechanism, and identity management and network control do not need to be added additionally. The service node is in the public network and may be accessed by other uncertain network terminals, so the access behavior of the service node and other possible nodes to the core sub-network needs to be strictly controlled.
Taking an electronic invoice service as an example, fig. 1f shows a scene architecture diagram based on a two-tier network according to an exemplary embodiment of the present application. As shown in fig. 1f, the service layer, the routing agent layer, and the core consensus network layer constitute a whole complete blockchain service system. The business layer is positioned in the witness sub-network and comprises at least one business node, and the business node can process (local tax bureau) tax, bill (enterprise invoicing), payment (enterprise fund flow) and other businesses. The core consensus network layer is located in the core sub-network layer, and the consensus node may be a trusted (computing) node, and each consensus node stores therein an authority contract and a block in a block chain. The service layer submits service operation interaction to the core consensus network layer through the routing agent layer, namely the routing agent layer plays a role in isolating the service layer from the core consensus network layer, the agent layer comprises at least one agent node, and the agent node can provide routing service, authentication service, certificate caching service, point-to-point (P2P) service and the like.
Fig. 1g illustrates a network connection architecture diagram of a blockchain network according to an exemplary embodiment of the present application. As shown in fig. 1g, the service nodes are connected to the access layer in a tree-shaped multi-level cascade manner. The network connection architecture is obtained by the access layer by adopting different connection modes for different service nodes based on connection authority, and the specific processing flow comprises the following steps: a proxy node in an access layer acquires a connection authority set, wherein the connection authority set is obtained by a common node in a core sub-network based on the historical evidence storage record of each service node in an witness sub-network; for example, the consensus node counts the frequency of uploading the evidence-storing bill of each service node in a target time period according to the historical evidence-storing record of each service node, adds the service node with the frequency higher than the frequency threshold value into the connection authority set, and updates the connection authority set according to the preset frequency. After the connection permission set is obtained, when an access request of a service node is received, whether the service node has the connection permission or not is judged according to the connection permission set. If the service node does not have the connection authority (such as a service node 4-a service node 7), the proxy node sends a communication address table to the service node, wherein the communication address table comprises node information (such as a node identifier, a node communication address and the like) of at least one service node with the connection authority in the connection authority set, so that the service node without the connection authority is accessed through the service node with the connection authority in a relay manner; specifically, after the service node acquires the communication address table, one service node is selected from the communication address table as a relay node, and the core sub-network is accessed through the relay node. Correspondingly, if the service node has the connection authority, the proxy node directly establishes connection with the service node (such as service node 1-service node 3).
In the embodiment of the application, a connection authority set is obtained, the connection authority set comprises node information (node identifiers and node communication addresses) of N service nodes with connection authorities in a witness sub-network, N is a positive integer, an access request sent by a first service node is received, if the identifier of the first service node does not belong to the connection authority set, a communication address table is obtained, the communication address table comprises communication addresses of P service nodes with connection authorities, P is a positive integer, and the communication address table is sent to the first service node, so that the first service node selects one service node from the communication address table to perform relay access. Therefore, the embodiment of the application proves that part of the service nodes in the sub-network have the connection authority and can be directly connected to the access layer; and partial service nodes do not have connection authority, relay access is carried out to the access layer through the service nodes with the connection authority, and the connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network.
Based on the above description, the data processing method based on the blockchain network proposed by the embodiment of the present application will be described in detail below with reference to the accompanying drawings.
Fig. 2 is a flowchart illustrating a data processing method based on a blockchain network according to an exemplary embodiment of the present application. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method based on the block chain network provided by the embodiment of the application can be executed by any proxy node; as shown in fig. 2, the data processing method includes, but is not limited to, the following steps S201 to S204:
s201: and acquiring a connection authority set.
The connection authority set comprises the identifications of the N service nodes with the connection authority in the witness sub-network and the communication addresses of the N service nodes. In one embodiment, the connection right set is obtained by a common node in the core sub-network based on the historical evidence records of each service node in the witness sub-network.
In one embodiment, the consensus node counts the frequency of uploading the evidence-storing bill of each service node in a target time period (such as one day, one week and the like) according to the historical evidence-storing record of each service node, and determines the service node with the frequency higher than the frequency threshold value as a candidate service node; and detecting the network delay of the candidate service nodes, and adding the candidate service nodes with the network delay smaller than the delay threshold value into the connection permission set.
S202: and receiving an access request sent by the first service node.
The first service node can be any service node in the witness sub-network, and the access request carries the identifier of the first service node; for example, the agent node receives an access request 1 sent by a service node 1, where the access request 1 carries an identifier of the service node 1: 1100100101.
s203: and if the identifier of the first service node does not belong to the connection authority set, acquiring a communication address table.
The communication address table comprises communication addresses of P service nodes with connection authority, the P service nodes are selected from N service nodes in a connection authority set, and P is a positive integer; for example, if N =10 and P =3 are set, the communication address table 1 includes communication addresses of 3 service nodes, and the 3 service nodes are selected from 10 service nodes in the connection right set.
In one embodiment, the proxy node determines whether the identifier of the first service node belongs to the connection right set, and if the identifier of the first service node does not belong to the connection right set (i.e., the first service node does not have the connection right), acquires the communication address table, and continues to execute step S204; if the first service node belongs to the connection authority set (i.e. the first service node has the connection authority), establishing direct communication connection with the first service node, and ending the process.
S204: and sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
In one embodiment, the proxy node sends a communication address table to the first service node, and the first service node selects one service node from the communication address table as a relay node after receiving the communication address table, and accesses the core sub-network through the relay node.
In the embodiment of the application, a connection authority set is obtained, the connection authority set comprises node information (node identifiers and node communication addresses) of N service nodes with connection authorities in a witness sub-network, N is a positive integer, an access request sent by a first service node is received, if the identifier of the first service node does not belong to the connection authority set, a communication address table is obtained, the communication address table comprises communication addresses of P service nodes with connection authorities, P is a positive integer, and the communication address table is sent to the first service node, so that the first service node selects one service node from the communication address table to perform relay access. Therefore, the embodiment of the application proves that part of the service nodes in the sub-network have the connection authority and can be directly connected to the access layer; and partial service nodes do not have connection authority, relay access is carried out to the access layer through the service nodes with the connection authority, and the connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network.
Fig. 3 is a flowchart illustrating another data processing method based on a blockchain network according to an exemplary embodiment of the present application. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method based on the block chain network provided by the embodiment of the application can be executed by any consensus node; as shown in fig. 3, the data processing method includes, but is not limited to, the following steps S301 to S305:
s301: and counting the historical evidence storage records of each service node in the witness sub-network.
The historical evidence storing record of each service node comprises an evidence storing bill uploaded by the service node in a historical time period; in addition, the history certificate-storing record may further include the time when the service node uploads the certificate-storing ticket, and the network delay when the service node uploads the certificate-storing ticket. In one embodiment, the consensus node records the history record of the target service node through the history record table, and the target service node may be any service node in the witness sub-network. In one embodiment, the history record table is shown in table 2 below:
TABLE 2
Deposit certificate bill sign Content of certificate-storing bill Time of storing certificate Network latency
Deposit receipt
1 XXX 2020.5.21 34ms
Deposit certificate bill 2 YYY 2020.6.12 125ms
As can be seen from table 2, the identifier of the certificate-depositing ticket has an indexing function, and each certificate-depositing record records the content of the certificate-depositing ticket, the certificate-depositing time, and the network delay of the target service node during certificate-depositing. For example, the content of the certificate of existence ticket 1 is "XXX", the time of the certificate of existence is "2020.5.21", and the network delay is "34 ms".
S302: and screening N service nodes meeting the direct connection condition according to the historical evidence storage records of each service node.
The direct connection conditions include: the data uploading amount of the service nodes in unit time exceeds a quantity threshold, and the network delay (the current network delay or the historical average network delay) of the service nodes is smaller than a delay threshold; or the data uploading frequency of the service node in unit time exceeds the frequency threshold, and the network delay (the current network delay or the historical average network delay) of the service node is smaller than the delay threshold. Furthermore, the direct connection condition may further include: and the service node has no malicious behavior records and the like (such as illegal data uploading, invalid data repeatedly uploading and the like).
In one embodiment, the consensus node selects N service nodes meeting the direct connection condition from the service nodes of the witness sub-network according to the statistical result of the historical evidence storage records of each service node, wherein N is a positive integer.
S303: and distributing connection authority for the N service nodes, and adding the identifications of the N service nodes and the communication addresses of the N service nodes into a connection authority set.
In one embodiment, the consensus node sends (broadcasts) authorization information to other consensus nodes in the core subnetwork except the consensus node, where the authorization information is used to notify the other consensus nodes to allocate connection permissions to the N service nodes satisfying the direct connection condition (for example, the N service nodes satisfying the direct connection condition are marked as direct connection service nodes). Further, the identifiers of the N service nodes and the communication addresses of the N service nodes are added to the connection permission set.
S304: the set of connection permissions is sent to at least one proxy node in the access stratum.
In an embodiment, after generating the connection right set, the common node sends the connection right set to at least one proxy node in the access stratum, so that each proxy node in the access stratum establishes a connection with a service node in the witness sub-network according to the connection right set, and a specific embodiment may refer to the embodiment in fig. 2, which is not described herein again.
S305: the set of connection permissions is periodically updated.
In one embodiment, when an update event is triggered, the consensus node counts the evidence storage records of each service node in the witness sub-network in a target time period; update events include, but are not limited to: and matching the current time with the preset updating time, wherein the number of the service nodes in the current connection permission set exceeds a number threshold. And screening M service nodes meeting direct connection conditions by the consensus node according to the evidence storage records of each service node in a target time period (such as the previous week, the previous month and the like of the current time), wherein M is a positive integer. Furthermore, the consensus node updates the connection authority of a fourth service node, which does not belong to the intersection of the M service nodes and the N service nodes, in the M service nodes and the N service nodes, and updates the connection authority set according to the identifier of the fourth service node and the communication address of the fourth service node; for example, let service node 1 belong to M service nodes and not to N service nodes (i.e., service node 1 is newly added); the service node 2 belongs to M service nodes and belongs to N service nodes (i.e. the service node 2 is kept unchanged); the service node 3 does not belong to M service nodes and belongs to N service nodes (i.e., the service node 3 needs to be removed from the set of connection permissions); the consensus node updates the connection authority of the service node 1 and the service node 3 (i.e. the service node 1 is marked as a directly connectable node, and the service node 3 is marked as a directly unconnected node), and updates the connection authority set according to the identifier of the service node 1 and the identifier of the service node 3 (i.e. the identifier of the service node 1 and the communication address of the service node 1 are added to the connection authority set, and the identifier of the service node 3 and the communication address of the service node 3 are removed from the connection authority set).
In the embodiment of the application, the consensus node counts the historical evidence storage records of each service node in the witness sub-network, selects N service nodes meeting direct connection conditions according to the historical evidence storage records of each service node, wherein N is a positive integer, allocates connection permission for the N service nodes, adds the identifications of the N service nodes and the communication addresses of the N service nodes to the connection permission set, and sends the connection permission set to at least one proxy node in the access layer. Therefore, the connection authority of each service node in the witness sub-network can be dynamically adjusted by maintaining the authority set, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network, the connection safety and the network safety of the core sub-network can be effectively guaranteed through the design, the whole network bandwidth of the block chain network can be fully utilized for data synchronization and distribution, the throughput of the block chain network is improved, and the stability of data transmission is enhanced.
Fig. 4 is a flowchart illustrating a data processing method based on a blockchain network according to an exemplary embodiment of the present application. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method based on the blockchain network provided by the embodiment of the application can be executed by a first service node, wherein the first service node can be any service node in a witness sub-network; as shown in fig. 4, the data processing method includes, but is not limited to, the following steps S401 to S404:
s401: an access request is sent to the access stratum.
The access request carries the identifier of the first service node. After receiving the access request, the proxy node in the access layer may determine whether the first service node has the connection right according to the obtained right set, and the specific implementation manner may refer to the embodiment in fig. 2, which is not described herein again. If the agent node judges that the first service node has the connection authority, the agent node establishes direct communication connection with the first service node; if the proxy node determines that the first service node does not have the connection right, the proxy node returns the communication address table to the first service node, and continues to execute step S402.
S402: and if the communication address table returned by the access layer is received, selecting any service node from the communication address table as the relay node.
The communication address table comprises communication addresses of P service nodes with connection authority, and the P service nodes are selected from N service nodes with connection authority in a connection authority set; n, P are all positive integers.
In one embodiment, after receiving the communication address table returned by the access stratum, the first service node randomly selects one service node from the communication address table as the relay node. In another embodiment, after receiving the communication address table returned by the access stratum, the first service node obtains status information of P service nodes, where the status information may include, but is not limited to, network delay of the service node, and the number of service nodes currently relayed by the service node. The first service node selects one service node as a relay node according to the state information of the P service nodes; for example, a service node whose network delay is less than a first threshold and the number of service nodes currently relayed by the service node is less than a second threshold is selected as a relay node.
S403: and sending an access request to the relay node to access the core sub-network through the relay node.
In one embodiment, the first service node obtains synchronization information from the relay node, where the synchronization information includes state information of the blockchain network (e.g., block header information of the latest block in the blockchain). After the synchronization information is obtained, the first service node generates encrypted data according to the state information of the block chain network and the certificate storing bill to be processed (for example, the encrypted data is obtained by signing the certificate storing bill to be processed through a private key of the first service node), and sends an access request to the relay node (for example, the first service node sends the access request to the relay node through a P2P channel), where the access request includes the encrypted data, so that the relay node transmits the encrypted data to the core sub-network to perform consensus processing. In one embodiment, after sending the access request to the relay node, the first service node subscribes to a message notification channel (e.g., pubsub notification channel) for receiving response information of the access request.
S404: and sending a direct connection request to the access layer through the relay node, and if response information of the direct connection request indicates that the first service node successfully obtains the connection authority, establishing direct connection communication connection with the access layer.
The direct connection request is used for requesting to obtain a connection permission, and the direct connection request carries the identifier of the first service node and the communication address of the first service node. In an embodiment, after receiving the direct connection request, the proxy node may obtain a historical evidence-storing record of the first service node, and perform qualification verification on the first service node according to the historical evidence-storing record of the first service node, and a specific embodiment may refer to the embodiment in fig. 6, which is not described herein again. And after the audit is completed, the proxy node returns response information of the direct connection request to the first service node through a message notification channel. The first service node acquires the response information through a message notification channel, if the response information of the direct connection request indicates that the first service node successfully acquires the connection authority, the first service node establishes direct communication connection with the access layer and opens a relay channel to other service nodes, so that the other service nodes can access the core sub-network through the relay channel.
In the embodiment of the application, an access request is sent to an access layer, if a communication address table returned by the access layer is received, any service node is selected from the communication address table to serve as a relay node, and the access request is sent to the relay node so as to be accessed to a core sub-network through the relay node. It can be seen that when the first service node needs to communicate with the core sub-network, the relay node can be determined through the communication address table, and the first service node is accessed to the core sub-network through the relay node. The situation that communication connection is established between all service nodes and a core sub-network to cause network congestion with overlarge block chain concurrency is improved, the sub-network can dynamically adapt to the data transmission requirement of a block chain network, the connection safety and the network safety of the core sub-network can be effectively guaranteed through the design, the whole network bandwidth of the block chain network can be fully utilized to carry out data synchronization and distribution, the throughput of the block chain network is further improved, and the stability of data transmission is enhanced.
Fig. 5 shows an interaction flowchart of a data processing method based on a blockchain network according to an exemplary embodiment of the present application. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method based on the blockchain network provided by the embodiment of the application can be cooperatively executed by the agent node and the first service node, wherein the first service node can be any service node in the witness sub-network; as shown in fig. 5, the data processing method includes, but is not limited to, the following steps S501 to S505:
s501: and acquiring a connection authority set.
The specific implementation of step S501 may refer to the implementation of step S201 in fig. 2, and is not described herein again.
S502: an access request is sent to the access stratum.
The specific implementation of step S502 can refer to the implementation of step S401 in fig. 4, and is not described herein again.
S503: a communication address table is obtained.
S504: the communication address table is sent to the first service node.
For specific implementation of step S503 and step S504, reference may be made to the implementation of step S203 and step S204 in fig. 2, which is not described herein again.
S505: and selecting a service node from the communication address table for relay access.
The specific implementation of step S505 can refer to the implementation of step S402 in fig. 4, which is not described herein again.
Illustrated in connection with FIG. 1 g: and the agent node in the access layer acquires a connection authority set, wherein the connection authority set is generated by counting the transaction heat of the service node in the block information by the common node in the core sub-network according to the counting result. At least one proxy node in the access stratum maintains a connection right set through a centralized database, and determines which service nodes to accept connection requests (i.e. establish direct communication connections) according to the connection right set (such as service node 1-service node 3 in fig. 1 g). When the proxy node receives a connection request of a service node which is not currently in the connection permission set (such as the service node 4 in fig. 1 g), returning a communication address table to the service node 4, wherein the communication address table is obtained according to the connection permission set, and the communication address table comprises a communication address of at least one service node in the service nodes 1-3; after receiving the communication address table returned by the proxy node, the service node 4 selects a service node from the communication address table as its own relay node (the example in fig. 1g is the service node 1), and sends an access request to the service node 1, and the service node 1 provides current state data (such as the current latest block header data) of the blockchain network and provides a relay service for the service node 4. That is to say, the block header of the service node 4 is obtained from the service node 1, and the service node 4 generates encrypted data according to the block header and data that needs to be uplinked, and sends a forwarding request to the service node 1, where the forwarding request carries the encrypted data. After receiving the forwarding request, the service node 1 forwards the encrypted data to the access stratum (e.g., forwards the encrypted data at the TCP protocol layer). In addition, the service node 4 may also send a data clearing and distributing request to the access Layer through the service node 1, where the data clearing and distributing request is communicated through a Transport Layer Security (TLS) protocol, and thus although the service node 1 provides a relay for the forwarding request and the data clearing and distributing request, specific contents of data (encrypted data and clearing and distributing data) related to the service node 4 cannot be obtained.
In the embodiment of the application, a connection authority set is obtained, the connection authority set comprises node information (node identifiers and node communication addresses) of N service nodes with connection authorities in a witness sub-network, N is a positive integer, an access request sent by a first service node is received, if the identifier of the first service node does not belong to the connection authority set, a communication address table is obtained, the communication address table comprises communication addresses of P service nodes with connection authorities, P is a positive integer, and the communication address table is sent to the first service node, so that the first service node selects one service node from the communication address table to perform relay access. Therefore, the embodiment of the application proves that part of the service nodes in the sub-network have the connection authority and can be directly connected to the access layer; and partial service nodes do not have connection authority, relay access is carried out to the access layer through the service nodes with the connection authority, and the connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network.
Fig. 6 shows an interaction flowchart of another data processing method based on a blockchain network according to an exemplary embodiment of the present application. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing method based on the blockchain network provided by the embodiment of the application can be cooperatively executed by a consensus node, a proxy node, a first service node and a second service node, wherein the first service node and the second service node can be any service node in a witness sub-network; as shown in fig. 6, the data processing method includes, but is not limited to, the following steps S601 to S613:
s601: and the consensus node generates a connection authority set.
S602: the consensus node sends a set of connection permissions to at least one proxy node in the access stratum.
The specific implementation of step S601 and step S602 can refer to the implementation of step S301 to step S304 in fig. 3, and is not described herein again.
S603: and the proxy node receives the access request sent by the first service node.
S604: the proxy node obtains a communication address table.
For the specific implementation of step S603 and step S604, reference may be made to step S202 and step S203 in fig. 2, which are not described herein again.
S605: the first service node receives a communication address table.
S606: and the first service node selects one service node from the communication address table for relay access.
The specific implementation of step S605 and step S606 can refer to step S402 and step S403 in fig. 4, and will not be described herein again.
S607: and the proxy node receives the direct connection request sent by the second service node.
The second service node is any one of the service nodes in the witness sub-network, and the second service node and the first service node may be the same (without connection authority) service node. The direct connection request is used for requesting to obtain a connection permission (namely, a permission for establishing direct communication connection with the proxy node), and the direct connection request carries the identifier of the second service node and the communication address of the second service node.
S608: the proxy node determines whether the second service node satisfies a direct connection condition.
And the proxy node acquires the historical evidence storage record of the second service node according to the identifier of the second service node. The historical evidence record of the second service node comprises at least one of the following: the amount of data uploaded by the second service node (and the time of data upload) during the historical period, and the network delay (e.g., average network delay) of the second service node during the historical period.
In one embodiment, the proxy node sends an acquisition request to a consensus node in the core subnetwork, where the acquisition request carries an identifier of the second service node. After receiving the acquisition request, the consensus node extracts the historical evidence-storing record of the second service node according to the identifier of the second service node, and sends the historical evidence-storing record of the second service node to the proxy node as the response information of the acquisition request. If the history evidence storage record of the second service node meets the direct connection condition, the step S609 is continuously executed.
S609: the proxy node allocates a connection right to the second service node.
And the proxy node distributes connection authority for the second service node and adds the identifier of the second service node and the communication address of the second service node to the connection authority set. The direct connection conditions include: the data uploading amount of the second service node in unit time does not exceed the quantity threshold, and the network delay (the current network delay or the historical average network delay) of the second service node is smaller than the delay threshold. Furthermore, the direct connection condition may further include: the second service node has no malicious behavior record (such as illegal data uploading, invalid data repeatedly uploading and the like), and the data uploading frequency of the second service node in a certain historical time period exceeds a frequency threshold and the like.
In an embodiment, if the proxy node determines that the second service node satisfies the direct connection condition according to the history evidence record of the second service node, the proxy node allocates a connection right to the second service node (for example, the second service node is marked as a direct connection service node), and updates the connection right set (i.e., the identifier of the second service node and the communication address of the second service node are added to the connection right set).
S610: and the proxy node sends response information of the direct connection request to the second service node.
In an embodiment, the proxy node may send response information of the direct connection request to the second service node through a message notification channel (e.g., pubsub notification channel), where the response information is used to notify the second service node that the connection right is successfully obtained. Correspondingly, if the agent node judges that the second service node does not meet the direct connection condition according to the historical evidence record of the second service node, prompt information is returned to the second service node, the prompt information is used for prompting that the second service node does not meet the direct connection condition, and the prompt information can also carry a communication address list.
S611: the second service node establishes a direct communication connection with the proxy node.
In an embodiment, if the response information of the direct connection request indicates that the second service node successfully acquires the connection right, the second service node establishes a direct communication connection with the proxy node in the access layer, and opens a relay channel to other service nodes, so that the other service nodes can access the core subnetwork through the relay channel. Specifically, the second service node obtains a relay request, where the relay request includes an identifier of a sender of the relay request, and sends synchronization information to the sender of the relay request, where the synchronization information includes current network state information of the blockchain network. Acquiring data to be forwarded and forwarding the data to be forwarded to an access layer; the data to be forwarded is generated by the sender of the relay request according to the current network state information of the blockchain network and the bill needing to be linked up.
S612: and when detecting that a third service node in the connection permission set meets the removal condition, the proxy node updates the connection permission set.
In one embodiment, when detecting that the third service node in the connection authority set meets the removal condition, the proxy node cancels the connection authority of the third service node, and deletes the identifier of the third service node and the communication address of the third service node from the connection authority set. The third service node is any one of the N service nodes having the connection right. The third service node satisfying the removal condition includes at least one of: the third service node is off-line; the network delay of the third service node is greater than or equal to the delay threshold; the data uploading frequency of the third service node in unit time is lower than or equal to the frequency threshold; the third service node requests to revoke the connection right.
In one embodiment, the proxy node periodically detects whether each service node in the set of permissions satisfies the removal condition. And when detecting that the third service node in the connection permission set meets the removal condition, revoking the connection permission of the third service node (for example, marking the third service node as a non-direct connection service node), and deleting the identifier of the third service node and the communication address of the third service node from the connection permission set.
S613: and the consensus node updates the connection authority set.
The specific implementation of step S613 can refer to the implementation of step S305 in fig. 3, and is not described herein again. It should be noted that, steps S603 to S606, steps S607 to S611, and steps S612 and S613 may be executed in an alternative order or synchronously, which is not limited in this application; for example, step S613 may be performed before step S607, and step S612 and step S608 may be performed in synchronization.
Illustrated in connection with FIG. 1 g: the connection authority set (service node 1-service node 3) is counted by the consensus node according to the frequency of the last (such as a week and a month) uplink transaction (such as uploading a certificate of credit) of the service node 1-service node 7; in addition, the service nodes in the connection right set also need to meet certain network delay conditions; for example, the return speed of the ping is less than a delay threshold (e.g., 10 ms). The connection authority set is regularly updated and maintained by the consensus node. The connection permission set aims to enable the service node which needs to uplink recently to establish a connection with the connection access layer directly so as to acquire a faster (faster compared with the relay access) to uplink the bill which needs to uplink, and acquire a smaller time delay. The speed of data synchronization of the service node (e.g., service node 4) can be relatively slowed down (e.g., the service node does not have a need to upload a certificate of existence ticket, and the data to be synchronously cleared back is not much), so that the throughput of the block chain network is increased, and the access layer is protected from receiving a large amount of direct connections.
Further, when the service node 5 in fig. 1g needs to start batch uploading of the storage certificate tickets (centralized invoicing), the service node 1 may send a direct connection request through a point-to-point channel, request for establishing a direct connection communication link to the access layer through the service node 1, and may subscribe to a corresponding message notification (e.g., pubsub) channel. After receiving the access request, the agent node of the access layer performs qualification audit on the service node 5, for example, whether the number of the certificate-storing tickets uploaded by the service node 5 exceeds a number threshold, whether the current network delay is smaller than a delay threshold, and the like, after the service node 5 passes the qualification audit, the agent node sends a notification message to the service node 5 through a message notification channel, and updates a connection permission set (the identifier of the service node 5 and the communication address of the service node 5 are added to the connection permission set). After receiving the notification message from the message notification channel, the service node 5 may establish a direct communication connection with the access layer, upload the certificate-storing ticket to be uploaded, and provide a relay service for other service nodes in the block chain (i.e., allow other service nodes to perform relay access through the service node 5). After the service node finishes uploading the evidence storing bill, the service node can continue to maintain direct communication connection with the access layer, or actively quit the direct communication connection with the access layer, and relay access is carried out through other service nodes (such as the service node 1) which establish direct communication connection with the access layer.
When detecting that a service node establishing the direct communication connection is disconnected or a connection state is faulty, the proxy node in the access layer updates the connection permission set, and notifies a channel through a message to notify service nodes (such as the service node 6 and the service node 7 in fig. 1 g) in the blockchain network as new direct connection nodes (i.e., nodes with connection permission), so that the direct communication connection is directly established with the access layer.
In the embodiment of the application, a connection authority set is obtained, the connection authority set comprises node information (node identifiers and node communication addresses) of N service nodes with connection authorities in a witness sub-network, N is a positive integer, an access request sent by a first service node is received, if the identifier of the first service node does not belong to the connection authority set, a communication address table is obtained, the communication address table comprises communication addresses of P service nodes with connection authorities, P is a positive integer, and the communication address table is sent to the first service node, so that the first service node selects one service node from the communication address table to perform relay access. Therefore, the embodiment of the application proves that part of the service nodes in the sub-network have the connection authority and can be directly connected to the access layer; and partial service nodes do not have connection authority, relay access is carried out to the access layer through the service nodes with the connection authority, and the connection authority of each service node in the witness sub-network is dynamically adjusted, so that the witness sub-network can dynamically adapt to the data transmission requirement of the block chain network.
While the method of the embodiments of the present application has been described in detail above, to facilitate better implementation of the above-described aspects of the embodiments of the present application, the apparatus of the embodiments of the present application is provided below accordingly.
Referring to fig. 7, fig. 7 is a schematic structural diagram illustrating a data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application. The data processing apparatus based on the blockchain network shown in fig. 7 may be used to perform some or all of the functions in the method embodiments described in fig. 2, 5 and 6 above. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing device is carried on each agent node; the respective units of the data processing apparatus are described in detail as follows:
an obtaining unit 701, configured to obtain a connection permission set, where the connection permission set includes identifiers of N service nodes having connection permissions in a witness sub-network and communication addresses of the N service nodes, and N is a positive integer; the access request is used for receiving the access request sent by the first service node, the access request carries the identifier of the first service node, and the first service node is any service node in the witness sub-network;
a processing unit 702, configured to obtain a communication address table if the identifier of the first service node does not belong to the connection permission set, where the communication address table includes communication addresses of P service nodes with connection permission, the P service nodes are selected from N service nodes in the connection permission set, and P is a positive integer; and the first service node is used for sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
In one embodiment, the processing unit 702 is further configured to:
and if the identifier of the first service node belongs to the connection authority set, establishing direct connection communication connection with the first service node.
In one embodiment, the processing unit 702 is further configured to:
receiving a direct connection request sent by a second service node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the second service node and the communication address of the second service node; the second service node is any one service node in the witness sub-network;
acquiring a historical communication record of the second service node according to the identifier of the second service node;
if the historical communication record of the second service node meets the direct connection condition, allocating a connection authority for the second service node, and adding the identifier of the second service node and the communication address of the second service node to a connection authority set; and the number of the first and second groups,
and sending response information of the direct connection request to the second service node.
In one embodiment, the historical communication record of the second service node includes at least one of: data uploading amount of the second service node in the historical time period and network delay of the second service node in the historical time period;
the historical communication record of the second service node meets the direct connection condition, and the method comprises the following steps: the data uploading amount of the second service node in unit time does not exceed the quantity threshold, and the network delay of the second service node is smaller than the delay threshold.
In one embodiment, the processing unit 702 is further configured to:
when detecting that a third service node in the connection permission set meets the removal condition, revoking the connection permission of the third service node, and deleting the identifier of the third service node and the communication address of the third service node from the connection permission set;
wherein the third service node satisfying the removal condition includes at least one of: the third service node is off-line; the network delay of the third service node is greater than or equal to the delay threshold; the data uploading frequency of the third service node in unit time is lower than or equal to the frequency threshold; the third service node requests to revoke the connection right.
According to an embodiment of the present application, some steps involved in the data processing method based on the blockchain network shown in fig. 2, fig. 5 and fig. 6 may be performed by each unit in the data processing apparatus based on the blockchain network shown in fig. 7. For example, steps S201 and S202 shown in fig. 2 may be executed by the acquisition unit 701 shown in fig. 7, and steps S203 and S204 may be executed by the processing unit 702 shown in fig. 7. Steps S501 to S503 shown in fig. 5 may be executed by the acquisition unit 701 shown in fig. 7, and step S504 may be executed by the processing unit 702 shown in fig. 7. Steps S602 to S604 and S607 shown in fig. 6 may be executed by the acquisition unit 701 shown in fig. 7, and steps S605, S608 to S610 and S612 may be executed by the processing unit 702 shown in fig. 7. The units in the data processing apparatus based on the blockchain network shown in fig. 7 may be respectively or entirely combined into one or several other units to form the data processing apparatus, or some unit(s) therein may be further split into multiple units with smaller functions to form the data processing apparatus, which may achieve the same operation without affecting the implementation of the technical effect of the embodiments of the present application. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present application, the data processing apparatus based on the blockchain network may also include other units, and in practical applications, these functions may also be implemented by assistance of other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present application, the data processing apparatus based on the blockchain network as shown in fig. 7 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods as shown in fig. 2, fig. 5 and fig. 6 on a general-purpose computing apparatus such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM) and the like, and the data processing method based on the blockchain network of the embodiment of the present application may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
Based on the same inventive concept, the principle and the beneficial effect of the data processing apparatus based on the blockchain network provided in the embodiment of the present application for solving the problem are similar to the principle and the beneficial effect of the data processing method based on the blockchain network in the embodiment of the present application for solving the problem, and reference may be made to the principle and the beneficial effect of the implementation of the method, which is not described herein again for brevity.
Referring to fig. 8, fig. 8 is a schematic structural diagram illustrating another data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application. The data processing apparatus based on the blockchain network shown in fig. 8 may be used to perform some or all of the functions in the method embodiments described in fig. 3 and 6 above. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing device is carried on each consensus node; the respective units of the data processing apparatus are described in detail as follows:
the processing unit 801 is configured to count historical evidence storage records of each service node in the witness sub-network; the system comprises a plurality of service nodes, a server and a server, wherein the service nodes are used for selecting N service nodes meeting direct connection conditions according to historical evidence storage records of the service nodes, and N is a positive integer; the system comprises a connection authority set, a service node set and a service node management system, wherein the connection authority set is used for allocating connection authorities for N service nodes and adding identifications of the N service nodes and communication addresses of the N service nodes to the connection authority set; and for sending the set of connection permissions to at least one proxy node in the access stratum.
In one embodiment, the processing unit 801 is further configured to:
when the updating event is triggered, counting the evidence storage records of each service node in the witness sub-network in the target time period;
screening M service nodes meeting direct connection conditions according to the evidence storage records of each service node in a target time period, wherein M is a positive integer;
updating the connection authority of a fourth service node which does not belong to the intersection of the M service nodes and the N service nodes in the M service nodes and the N service nodes;
and updating the connection permission set according to the identifier of the fourth service node and the communication address of the fourth service node.
According to an embodiment of the present application, some steps involved in the data processing method based on the blockchain network shown in fig. 3 and 6 may be performed by each unit in the data processing apparatus based on the blockchain network shown in fig. 8. For example, steps S301 to S305 shown in fig. 3 can be executed by the processing unit 801 shown in fig. 8. Steps S601 and S613 illustrated in fig. 6 can be executed by the processing unit 801 illustrated in fig. 8. The units in the data processing apparatus based on the blockchain network shown in fig. 8 may be respectively or entirely combined into one or several other units to form the data processing apparatus, or some unit(s) may be further split into multiple units with smaller functions to form the data processing apparatus, which may achieve the same operation without affecting the implementation of the technical effect of the embodiments of the present application. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present application, the data processing apparatus based on the blockchain network may also include other units, and in practical applications, these functions may also be implemented by assistance of other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present application, the data processing apparatus based on the blockchain network as shown in fig. 8 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods as shown in fig. 3 and fig. 6 on a general-purpose computing apparatus such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM), and the like, and the data processing method based on the blockchain network of the embodiment of the present application may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
Based on the same inventive concept, the principle and the beneficial effect of the data processing apparatus based on the blockchain network provided in the embodiment of the present application for solving the problem are similar to the principle and the beneficial effect of the data processing method based on the blockchain network in the embodiment of the present application for solving the problem, and reference may be made to the principle and the beneficial effect of the implementation of the method, which is not described herein again for brevity.
Referring to fig. 9, fig. 9 is a schematic structural diagram illustrating a data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application. The data processing apparatus based on the blockchain network shown in fig. 9 may be used to perform some or all of the functions in the method embodiments described in fig. 4, 5 and 6 above. The block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node, and the data processing device is carried on the first service node; the first service node is any one service node in the witness sub-network; the respective units of the data processing apparatus are described in detail as follows:
a processing unit 901, configured to send an access request to an access layer, where the access request carries an identifier of a first service node;
if the obtaining unit 902 receives a communication address table returned by the access layer, the communication address table includes communication addresses of P service nodes having connection permissions, and the P service nodes are selected from N service nodes having connection permissions in a connection permission set; n, P are all positive integers;
the processing unit 901 is further configured to select any service node from the communication address table as a relay node, and send an access request to the relay node, so as to access the core sub-network through the relay node.
In an embodiment, the processing unit 901 is configured to send an access request to the relay node to access the core subnetwork through the relay node, and specifically configured to:
acquiring synchronous information from the relay node, wherein the synchronous information comprises state information of a block chain network;
and generating encrypted data according to the state information of the block chain network and the to-be-processed certificate-storing bill, and sending an access request to the relay node, wherein the access request contains the encrypted data so as to transmit the encrypted data to the core sub-network through the relay node to execute consensus processing.
In one embodiment, the processing unit 901 is further configured to:
sending a direct connection request to an access layer through a relay node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the first service node and the communication address of the first service node;
acquiring response information of the direct connection request;
and if the response information of the direct connection request indicates that the first service node successfully obtains the connection authority, establishing direct connection communication connection with the access layer.
According to an embodiment of the present application, some steps involved in the data processing method based on the blockchain network shown in fig. 4, fig. 5 and fig. 6 may be performed by each unit in the data processing apparatus based on the blockchain network shown in fig. 9. For example, step S401, step S403, and step S404 shown in fig. 4 may be executed by the processing unit 901 shown in fig. 9, and step S402 may be executed by the processing unit 901 and the acquisition unit 902 shown in fig. 9 in cooperation. Step S504 shown in fig. 5 may be executed by the acquisition unit 902 shown in fig. 9, and step S505 may be executed by the processing unit 901 shown in fig. 9. Steps S605 and S610 shown in fig. 6 may be executed by the acquisition unit 902 shown in fig. 9, and steps S606 and S611 may be executed by the processing unit 901 shown in fig. 9. The units in the data processing apparatus based on the blockchain network shown in fig. 9 may be respectively or entirely combined into one or several other units to form the data processing apparatus, or some unit(s) therein may be further split into multiple units with smaller functions to form the data processing apparatus, which may achieve the same operation without affecting the implementation of the technical effect of the embodiments of the present application. The units are divided based on logic functions, and in practical application, the functions of one unit can be realized by a plurality of units, or the functions of a plurality of units can be realized by one unit. In other embodiments of the present application, the data processing apparatus based on the blockchain network may also include other units, and in practical applications, these functions may also be implemented by assistance of other units, and may be implemented by cooperation of a plurality of units.
According to another embodiment of the present application, the data processing apparatus based on the blockchain network as shown in fig. 9 may be constructed by running a computer program (including program codes) capable of executing the steps involved in the respective methods as shown in fig. 4, fig. 5 and fig. 6 on a general-purpose computing apparatus such as a computer including a processing element and a storage element such as a Central Processing Unit (CPU), a random access storage medium (RAM), a read-only storage medium (ROM) and the like, and the data processing method based on the blockchain network of the embodiment of the present application may be implemented. The computer program may be recorded on a computer-readable recording medium, for example, and loaded and executed in the above-described computing apparatus via the computer-readable recording medium.
Based on the same inventive concept, the principle and the beneficial effect of the data processing apparatus based on the blockchain network provided in the embodiment of the present application for solving the problem are similar to the principle and the beneficial effect of the data processing method based on the blockchain network in the embodiment of the present application for solving the problem, and reference may be made to the principle and the beneficial effect of the implementation of the method, which is not described herein again for brevity.
Referring to fig. 10, fig. 10 is a schematic structural diagram illustrating a data processing apparatus based on a blockchain network according to an exemplary embodiment of the present application, where the data processing apparatus based on a blockchain network at least includes a processor 1001, a communication interface 1002, and a memory 1003. The processor 1001, the communication interface 1002, and the memory 1003 may be connected by a bus or in other manners, and in the embodiment of the present application, the connection by the bus is taken as an example. The processor 1001 (or Central Processing Unit (CPU)) is a computing core and a control core of the data Processing device based on the blockchain network, and can analyze various instructions in the data Processing device based on the blockchain network and process various data of the data Processing device, for example: the CPU can be used for analyzing a power-on and power-off instruction sent by a user to the data processing equipment based on the block chain network and controlling the data processing equipment to carry out power-on and power-off operation; the following steps are repeated: the CPU may transmit various types of interactive data between internal structures of the data processing apparatus, and the like. The communication interface 1002 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI, mobile communication interface, etc.), which may be controlled by the processor 1001 for transceiving data; the communication interface 1002 may also be used for transmission and interaction of data within the data processing apparatus based on the blockchain network. The Memory 1003 (Memory) is a Memory device in the data processing device based on the block chain network, and is used for storing programs and data. It is understood that the memory 1003 herein may include a built-in memory of the data processing apparatus based on the blockchain network, and may also include an extended memory supported by the data processing apparatus based on the blockchain network. Memory 1003 provides storage space that stores the operating system of the data processing apparatus, which may include, but is not limited to: android system, iOS system, Windows Phone system, etc., which are not limited in this application.
In one embodiment, the blockchain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access stratum contains at least one proxy node, and the data processing device can be any proxy node.
In the embodiment of the present application, the processor 1001 executes the executable program code in the memory 1003 to perform the following operations:
acquiring a connection authority set through a communication interface 1002, wherein the connection authority set comprises identifications of N service nodes with connection authorities in a witness sub-network and communication addresses of the N service nodes, and N is a positive integer; the access request is used for receiving the access request sent by the first service node, the access request carries the identifier of the first service node, and the first service node is any service node in the witness sub-network;
if the identifier of the first service node does not belong to the connection authority set, acquiring a communication address table, wherein the communication address table comprises communication addresses of P service nodes with connection authorities, the P service nodes are selected from N service nodes in the connection authority set, and P is a positive integer; and the first service node is used for sending the communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
As an alternative embodiment, the processor 1001, by running the executable program code in the memory 1003, further performs the following operations:
and if the identifier of the first service node belongs to the connection authority set, establishing direct connection communication connection with the first service node.
As an alternative embodiment, the processor 1001, by running the executable program code in the memory 1003, further performs the following operations:
receiving a direct connection request sent by a second service node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the second service node and the communication address of the second service node; the second service node is any one service node in the witness sub-network;
acquiring a historical communication record of the second service node according to the identifier of the second service node;
if the historical communication record of the second service node meets the direct connection condition, allocating a connection authority for the second service node, and adding the identifier of the second service node and the communication address of the second service node to a connection authority set; and the number of the first and second groups,
and sending response information of the direct connection request to the second service node.
As an optional implementation, the historical communication record of the second service node includes at least one of: data uploading amount of the second service node in the historical time period and network delay of the second service node in the historical time period;
the historical communication record of the second service node meets the direct connection condition, and the method comprises the following steps: the data uploading amount of the second service node in unit time does not exceed the quantity threshold, and the network delay of the second service node is smaller than the delay threshold.
As an alternative embodiment, the processor 1001, by running the executable program code in the memory 1003, further performs the following operations:
when detecting that a third service node in the connection permission set meets the removal condition, revoking the connection permission of the third service node, and deleting the identifier of the third service node and the communication address of the third service node from the connection permission set;
wherein the third service node satisfying the removal condition includes at least one of: the third service node is off-line; the network delay of the third service node is greater than or equal to the delay threshold; the data uploading frequency of the third service node in unit time is lower than or equal to the frequency threshold; the third service node requests to revoke the connection right.
In another embodiment, the blockchain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access stratum comprises at least one proxy node, and the data processing device can be any one of the consensus nodes.
In the embodiment of the present application, the processor 1101 executes the executable program code in the memory 1103 to perform the following operations:
counting the historical evidence storage records of each service node in the witness sub-network; the system comprises a plurality of service nodes, a server and a server, wherein the service nodes are used for selecting N service nodes meeting direct connection conditions according to historical evidence storage records of the service nodes, and N is a positive integer; the system comprises a connection authority set, a service node set and a service node management system, wherein the connection authority set is used for allocating connection authorities for N service nodes and adding identifications of the N service nodes and communication addresses of the N service nodes to the connection authority set; and for sending the set of connection permissions to at least one proxy node in the access stratum.
As an alternative embodiment, the processor 1101, by executing the executable program code in the memory 1103, also performs the following operations:
when the updating event is triggered, counting the evidence storage records of each service node in the witness sub-network in the target time period;
screening M service nodes meeting direct connection conditions according to the evidence storage records of each service node in a target time period, wherein M is a positive integer;
updating the connection authority of a fourth service node which does not belong to the intersection of the M service nodes and the N service nodes in the M service nodes and the N service nodes;
and updating the connection permission set according to the identifier of the fourth service node and the communication address of the fourth service node.
In yet another embodiment, the blockchain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the data processing device may be a first service node, the first service node being any one of the service nodes in the witness sub-network;
in this embodiment, the processor 1201 executes the executable program code in the memory 1203 to perform the following operations:
as an optional implementation, the specific implementation that the processor 1201 sends the access request to the relay node to access to the core subnetwork through the relay node is as follows:
acquiring synchronous information from the relay node, wherein the synchronous information comprises state information of a block chain network;
and generating encrypted data according to the state information of the block chain network and the to-be-processed certificate-storing bill, and sending an access request to the relay node, wherein the access request contains the encrypted data so as to transmit the encrypted data to the core sub-network through the relay node to execute consensus processing.
As an alternative embodiment, the processor 1201, by executing the executable program code in the memory 1203, also performs the following operations:
sending a direct connection request to an access layer through a relay node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the first service node and the communication address of the first service node;
acquiring response information of the direct connection request;
and if the response information of the direct connection request indicates that the first service node successfully obtains the connection authority, establishing direct connection communication connection with the access layer.
Based on the same inventive concept, the principle and the beneficial effect of the problem solving of the data processing device based on the blockchain network provided in the embodiment of the present application are similar to the principle and the beneficial effect of the problem solving of the data processing method based on the blockchain network in the embodiment of the present application, and reference may be made to the principle and the beneficial effect of the implementation of the method, which are not described herein again for brevity.
The embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, where the computer program is adapted to be loaded by a processor and to execute the data processing method based on the blockchain network according to the above-mentioned method embodiment.
Embodiments of the present application also provide a computer program product or a computer program comprising computer instructions stored in a computer-readable storage medium. The processor of the computer device reads the computer instructions from the computer readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data processing method based on the blockchain network.
It should be noted that, for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the order of acts described, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
The steps in the method of the embodiment of the application can be sequentially adjusted, combined and deleted according to actual needs.
The modules in the device can be merged, divided and deleted according to actual needs.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, which may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
While the foregoing is directed to embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow.

Claims (15)

1. A data processing method based on a block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access stratum includes at least one proxy node, and the method is performed by any one of the proxy nodes, the method including:
acquiring a connection authority set, wherein the connection authority set comprises identifications of N service nodes with connection authorities in the witness sub-network and communication addresses of the N service nodes, and N is a positive integer;
receiving an access request sent by a first service node, wherein the access request carries an identifier of the first service node, and the first service node is any one service node in the witness sub-network;
if the identifier of the first service node does not belong to the connection authority set, acquiring a communication address table, wherein the communication address table comprises communication addresses of P service nodes with connection authority, the P service nodes are selected from N service nodes in the connection authority set, and P is a positive integer;
and sending a communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
2. The method of claim 1, wherein the method further comprises:
and if the identifier of the first service node belongs to the connection permission set, establishing direct connection communication connection with the first service node.
3. The method of claim 1, wherein the method further comprises:
receiving a direct connection request sent by a second service node, wherein the direct connection request is used for requesting to obtain a connection authority; the direct connection request carries the identifier of the second service node and the communication address of the second service node; the second service node is any one of the service nodes in the witness sub-network;
acquiring a historical evidence storage record of the second service node according to the identifier of the second service node;
if the historical evidence record of the second service node meets the direct connection condition, allocating a connection authority for the second service node, and adding the identifier of the second service node and the communication address of the second service node to the connection authority set; and the number of the first and second groups,
and sending response information of the direct connection request to the second service node.
4. The method of claim 3, wherein the historical credit record of the second service node comprises at least one of: data uploading amount of the second service node in a historical time period and network delay of the second service node in the historical time period;
the historical evidence storage record of the second service node meets the direct connection condition, and the method comprises the following steps: the data uploading amount of the second service node in unit time does not exceed the quantity threshold, and the network delay of the second service node is smaller than the delay threshold.
5. The method of claim 1, wherein the method further comprises:
when detecting that a third service node in the connection permission set meets a removal condition, revoking the connection permission of the third service node, and deleting the identifier of the third service node and the communication address of the third service node from the connection permission set;
wherein the third service node satisfying the removal condition comprises at least one of: the third service node is offline; the network delay of the third service node is greater than or equal to a delay threshold; the data uploading frequency of the third service node in unit time is lower than or equal to a frequency threshold; the third service node requests to revoke the connection right.
6. A data processing method based on a block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access stratum comprises at least one agent node, the method is executed by any one consensus node, and the method comprises the following steps:
and counting the historical evidence-storing records of each service node in the witness sub-network, wherein the historical evidence-storing records of each service node comprise at least one of the following items: the service node uploads the certificate of deposit bill in the historical time period, the time when the service node uploads the certificate of deposit bill, and the network delay when the service node uploads the certificate of deposit bill;
screening N service nodes meeting direct connection conditions according to the historical evidence storage records of all the service nodes, wherein N is a positive integer;
distributing connection authority for the N service nodes, and adding the identifications of the N service nodes and the communication addresses of the N service nodes to a connection authority set; and the number of the first and second groups,
sending the set of connection permissions to at least one proxy node in the access stratum.
7. The method of claim 6, wherein the method further comprises:
when an updating event is triggered, counting the evidence storage records of each service node in the witness sub-network in a target time period;
screening M service nodes meeting direct connection conditions according to the evidence storage records of the service nodes in a target time period, wherein M is a positive integer;
updating the connection authority of a fourth service node which does not belong to the intersection of the M service nodes and the N service nodes in the M service nodes and the N service nodes;
and updating the connection permission set according to the identifier of the fourth service node and the communication address of the fourth service node.
8. A data processing method based on a block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one proxy node; the method is performed by a first service node, the first service node being any one of the service nodes in the witness sub-network; the method comprises the following steps:
sending an access request to the access layer, wherein the access request carries the identifier of the first service node;
if a communication address table returned by the access layer is received, the communication address table comprises communication addresses of P service nodes with connection authority, and the P service nodes are selected from N service nodes with connection authority in a connection authority set; n, P are all positive integers;
and selecting any service node from the communication address table as a relay node, and sending an access request to the relay node so as to access the core sub-network through the relay node.
9. The method of claim 8, wherein the sending an access request to the relay node for access to the core subnetwork through the relay node comprises:
acquiring synchronization information from the relay node, wherein the synchronization information comprises state information of the block chain network;
and generating encrypted data according to the state information of the block chain network and the to-be-processed certificate-storing bill, and sending an access request to the relay node, wherein the access request contains the encrypted data, so that the relay node transmits the encrypted data to the core sub-network to execute consensus processing.
10. The method of claim 8 or 9, wherein the method further comprises:
sending a direct connection request to the access layer through the relay node, wherein the direct connection request is used for requesting to obtain a connection permission; the direct connection request carries the identifier of the first service node and the communication address of the first service node;
acquiring response information of the direct connection request;
and if the response information of the direct connection request indicates that the first service node successfully obtains the connection authority, establishing direct connection communication connection with the access layer.
11. The data processing device based on the block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing device is carried on each agent node; the data processing apparatus includes:
an obtaining unit, configured to obtain a connection permission set, where the connection permission set includes identifiers of N service nodes having connection permissions in the witness sub-network and communication addresses of the N service nodes, and N is a positive integer; the access request is used for receiving an access request sent by a first service node, the access request carries an identifier of the first service node, and the first service node is any one service node in the witness sub-network;
a processing unit, configured to obtain a communication address table if the identifier of the first service node does not belong to the connection permission set, where the communication address table includes communication addresses of P service nodes having connection permissions, the P service nodes are selected from N service nodes in the connection permission set, and P is a positive integer; and the first service node is used for sending a communication address table to the first service node, so that the first service node selects one service node from the communication address table for relay access.
12. The data processing device based on the block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, and the data processing device is carried on each consensus node; the data processing apparatus includes:
the processing unit is used for counting the historical evidence storage records of each service node in the witness sub-network, and the historical evidence storage record of each service node comprises at least one of the following items: the service node uploads the certificate of deposit bill in the historical time period, the time when the service node uploads the certificate of deposit bill, and the network delay when the service node uploads the certificate of deposit bill; the system comprises a plurality of service nodes, a server and a server, wherein the service nodes are used for selecting N service nodes meeting direct connection conditions according to historical evidence storage records of the service nodes, and N is a positive integer; the system comprises N service nodes and a connection authority set, wherein the N service nodes are used for allocating connection authorities to the N service nodes and adding the identifications of the N service nodes and the communication addresses of the N service nodes to the connection authority set; and for sending the set of connection permissions to at least one proxy node in the access stratum.
13. The data processing device based on the block chain network is characterized in that the block chain network comprises a witness sub-network and a core sub-network, wherein at least one service node is arranged in the witness sub-network, and at least one consensus node is arranged in the core sub-network; the at least one service node is accessed to the core sub-network through an access layer; the access layer comprises at least one agent node, the data processing device is carried on a first service node, and the first service node is any one service node in the witness sub-network; the data processing apparatus includes:
a processing unit, configured to send an access request to the access layer, where the access request carries an identifier of the first service node;
if the obtaining unit receives a communication address table returned by the access layer, the communication address table comprises communication addresses of P service nodes with connection authority, and the P service nodes are selected from N service nodes with connection authority in a connection authority set; n, P are all positive integers;
the processing unit is further configured to select any service node from the communication address table as a relay node, and send an access request to the relay node, so as to access the core subnetwork through the relay node.
14. A data processing apparatus based on a blockchain network, comprising: a storage device and a processor;
the storage device stores a computer program therein;
a processor for loading and executing the computer program to implement the method for data processing based on a blockchain network according to any one of claims 1 to 5, or to implement the method for data processing based on a blockchain network according to claim 6 or 7, or to implement the method for data processing based on a blockchain network according to any one of claims 8 to 10.
15. A computer-readable storage medium, characterized in that it stores a computer program adapted to be loaded by a processor and to perform the method for blockchain network based data processing according to any one of claims 1 to 5 or the method for blockchain network based data processing according to claim 6 or 7; or to perform a method of data processing based on a blockchain network according to any of claims 8 to 10.
CN202110430699.5A 2021-04-21 2021-04-21 Data processing method, device and equipment based on block chain network and storage medium Active CN112995211B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110430699.5A CN112995211B (en) 2021-04-21 2021-04-21 Data processing method, device and equipment based on block chain network and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110430699.5A CN112995211B (en) 2021-04-21 2021-04-21 Data processing method, device and equipment based on block chain network and storage medium

Publications (2)

Publication Number Publication Date
CN112995211A CN112995211A (en) 2021-06-18
CN112995211B true CN112995211B (en) 2021-07-23

Family

ID=76341525

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110430699.5A Active CN112995211B (en) 2021-04-21 2021-04-21 Data processing method, device and equipment based on block chain network and storage medium

Country Status (1)

Country Link
CN (1) CN112995211B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113342901B (en) * 2021-08-06 2021-11-02 支付宝(杭州)信息技术有限公司 Method and device for registering block chain node to node set
CN115314273B (en) * 2022-07-29 2024-03-26 蚂蚁区块链科技(上海)有限公司 Data transmission system, method, electronic device and readable storage medium
CN115225709B (en) * 2022-07-29 2024-03-26 蚂蚁区块链科技(上海)有限公司 Data transmission system, method, electronic device and readable storage medium
CN115396918A (en) * 2022-08-09 2022-11-25 中国联合网络通信集团有限公司 Block chain data transmission method, device and storage medium
CN116208624B (en) * 2023-05-05 2023-07-07 中航信移动科技有限公司 Cross-environment block link point communication method, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602096A (en) * 2019-09-12 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment in block chain network
CN110941679A (en) * 2019-12-05 2020-03-31 腾讯科技(深圳)有限公司 Contract data processing method, related equipment and medium
CN111092958A (en) * 2019-12-27 2020-05-01 深圳市网心科技有限公司 Node access method, device, system and storage medium
CN112104517A (en) * 2020-11-23 2020-12-18 腾讯科技(深圳)有限公司 Data processing method based on block chain network and related device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110166411B (en) * 2018-02-13 2022-05-06 华为技术有限公司 Data transmission method, device and network node
CN110290094B (en) * 2018-03-19 2022-03-11 华为技术有限公司 Method and device for controlling data access authority
US10528754B1 (en) * 2018-10-09 2020-01-07 Q-Net Security, Inc. Enhanced securing of data at rest
CN109741802A (en) * 2019-01-04 2019-05-10 深圳壹账通智能科技有限公司 Data managing method, device, computer equipment and storage medium
CN110245517A (en) * 2019-05-29 2019-09-17 杭州秘猿科技有限公司 A kind of across chain method, apparatus, system and the electronic equipment of block chain
CN111666553A (en) * 2020-07-17 2020-09-15 江苏荣泽信息科技股份有限公司 Block chain identity authority management method based on distributed PKI
CN113190622B (en) * 2021-03-16 2022-08-09 腾讯科技(深圳)有限公司 Data processing method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110602096A (en) * 2019-09-12 2019-12-20 腾讯科技(深圳)有限公司 Data processing method, device, storage medium and equipment in block chain network
CN110941679A (en) * 2019-12-05 2020-03-31 腾讯科技(深圳)有限公司 Contract data processing method, related equipment and medium
CN111092958A (en) * 2019-12-27 2020-05-01 深圳市网心科技有限公司 Node access method, device, system and storage medium
CN112104517A (en) * 2020-11-23 2020-12-18 腾讯科技(深圳)有限公司 Data processing method based on block chain network and related device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基于区块链的网络空间安全技术;刘永丹;《电子技术与软件工程》;20171026;全文 *

Also Published As

Publication number Publication date
CN112995211A (en) 2021-06-18

Similar Documents

Publication Publication Date Title
CN112104517B (en) Data processing method based on block chain network and related device
CN112995211B (en) Data processing method, device and equipment based on block chain network and storage medium
Prihodko et al. Flare: An approach to routing in lightning network
Tran et al. Optimal sybil-resilient node admission control
EP2380324B1 (en) Secure node identifier assignment in a distributed hash table for peer-to-peer networks
CN111801925B (en) Block chain based system and method for propagating data in a network
US20230316273A1 (en) Data processing method and apparatus, computer device, and storage medium
CN112200681B (en) Service processing method, information processing method and node equipment of block chain network
Alangot et al. Decentralized and lightweight approach to detect eclipse attacks on proof of work blockchains
JP2016521030A (en) Method and apparatus for forming a secure wireless network with resource constraints
CN112417001B (en) Data processing method based on block chain network and related equipment
CN116318735A (en) System and method for propagating data packets in a network of nodes
CN113765675B (en) Transaction data processing method, device, equipment and medium
CN112988903B (en) Data processing method, device and equipment based on block chain network and storage medium
Zhang et al. Dledger: An iot-friendly private distributed ledger system based on dag
CN111771390A (en) Self-organizing network
Kandi et al. A blockchain-based key management protocol for secure device-to-device communication in the Internet of Things
Chatzopoulos et al. Mneme: A mobile distributed ledger
WO2023082883A1 (en) Cross-blockchain transaction processing method and apparatus, and computer device, computer storage medium and computer program product
Pradhan et al. Blockchain based security framework for P2P filesharing system
Wang et al. The impact of propagation delay to different selfish miners in proof-of-work blockchains
Chatzopoulos et al. Toward Mobile Distributed Ledgers
Mamun et al. A Key Management Scheme for Establishing an Encryption-Based Trusted IoT System
Zichichi et al. DLT-based Data Mules for Smart Territories
Zichichi et al. InDaMul: Incentivized data mules for opportunistic networking through smart contracts and decentralized systems

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
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40046832

Country of ref document: HK