CN116170388A - Forwarding table generation method of block chain network and data transmission method thereof - Google Patents

Forwarding table generation method of block chain network and data transmission method thereof Download PDF

Info

Publication number
CN116170388A
CN116170388A CN202211738295.3A CN202211738295A CN116170388A CN 116170388 A CN116170388 A CN 116170388A CN 202211738295 A CN202211738295 A CN 202211738295A CN 116170388 A CN116170388 A CN 116170388A
Authority
CN
China
Prior art keywords
block chain
node
blockchain
state information
path state
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211738295.3A
Other languages
Chinese (zh)
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.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai 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 Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202211738295.3A priority Critical patent/CN116170388A/en
Publication of CN116170388A publication Critical patent/CN116170388A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/25Routing or path finding in a switch fabric
    • H04L49/252Store and forward routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/12Shortest path evaluation
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/14Routing performance; Theoretical aspects
    • 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/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/16Implementation or adaptation of Internet protocol [IP], of transmission control protocol [TCP] or of user datagram protocol [UDP]

Landscapes

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

Abstract

The present disclosure provides a method for generating a forwarding table of a blockchain network and a data transmission method thereof, which are applied to a first blockchain node among a plurality of blockchain nodes of the blockchain network, wherein the method includes: acquiring path state information of a first block chain node and broadcasting the path state information to other block chain nodes, wherein the path state information is used for representing response time delay between the first block chain node and all block chain nodes directly connected with the first block chain node; and constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the first block chain node and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to the other block chain nodes so that the first block chain node forwards data based on the forwarding table.

Description

Forwarding table generation method of block chain network and data transmission method thereof
Technical Field
The embodiment of the specification belongs to the technical field of block chains, and particularly relates to a forwarding table generation method of a block chain network and a data transmission method thereof.
Background
Blockchain (Blockchain) is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. In the block chain system, the data blocks are combined into a chain data structure in a sequential connection mode according to the time sequence, and the distributed account book which is not tamperable and counterfeit and is ensured in a cryptographic mode is formed. Users can participate in realizing related transactions of the blockchain through the blockchain link points, for example, a plurality of blockchain nodes corresponding to different users in a blockchain system respectively can perform Secure multiparty computation (SMPC) on private data of a certain node based on privacy technologies such as homomorphic encryption, zero knowledge proof and the like. As another example, transfers may be effected between different user accounts based on a blockchain network; for another example, NFT (Non-homogeneous Token) corresponding to digital collections such as digital drawings, digital titles, GIFs, etc. may also be issued based on a blockchain network so that ownership of the digital collections carried by the NFT can be circulated among users of the blockchain network, thereby yielding a value corresponding to the digital collections.
However, in the related art, since the point-to-point transmission network is adopted, the nodes need to maintain a huge node connection relationship assuming that the number of blockchain nodes reaches a certain scale. For example, when the number of nodes reaches thousands, the corresponding node needs to maintain a connection relationship of millions. Thus, the burden of the node is greatly increased, and the consumption of system resources is increased.
Disclosure of Invention
The invention aims to provide a forwarding table generation method of a block chain network and a data transmission method thereof.
According to a first aspect of one or more embodiments of the present disclosure, a method for generating a forwarding table of a blockchain network is provided, which is applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, and includes:
acquiring path state information of a first block chain node and broadcasting the path state information to other block chain nodes, wherein the path state information is used for representing response time delay between the first block chain node and all block chain nodes directly connected with the first block chain node;
and constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the first block chain node and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to the other block chain nodes so that the first block chain node forwards data based on the forwarding table.
According to a second aspect of one or more embodiments of the present disclosure, a data transmission method of a blockchain network is provided, which is applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, and includes:
Receiving data sent by a last-hop blockchain node, wherein the data comprises corresponding target blockchain link point information;
determining a next-hop blockchain node corresponding to the data according to a forwarding table which is maintained by the self and is sent to other blockchain nodes by the first blockchain node and the target blockchain link point information; the forwarding table is generated by a first blockchain node under the condition of acquiring path state information of the first blockchain node and broadcasting the path state information to other blockchain nodes, and constructing a shortest path tree taking the first blockchain node as a root node according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node;
and sending the data to the determined next-hop blockchain node.
According to a third aspect of one or more embodiments of the present specification, there is provided a forwarding table generating device of a blockchain network, applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, including:
The system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring path state information of a first block chain node and broadcasting the path state information to other block chain nodes, and the path state information is used for representing response time delay between the first block chain node and all block chain nodes directly connected with the first block chain node;
and the generating unit is used for constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the generating unit and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to the other block chain nodes so that the first block chain node forwards data based on the forwarding table.
According to a fourth aspect of one or more embodiments of the present specification, there is provided a data transmission apparatus of a blockchain network, applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, comprising:
the receiving unit is used for receiving data sent by the last-hop blockchain node, wherein the data comprises corresponding target blockchain point information;
the determining unit is used for determining a next-hop blockchain node corresponding to the data according to a forwarding table which is maintained by the determining unit and is sent to other blockchain nodes by the first blockchain node and the target blockchain node information; the forwarding table is generated by a first blockchain node under the condition of acquiring path state information of the first blockchain node and broadcasting the path state information to other blockchain nodes, and constructing a shortest path tree taking the first blockchain node as a root node according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node;
And the sending unit is used for sending the data to the determined next-hop blockchain node.
According to a fifth aspect of one or more embodiments of the present specification, there is provided an electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any of the first or second aspects by executing the executable instructions.
According to a sixth aspect of one or more embodiments of the present description, there is provided a computer readable storage medium having stored thereon computer instructions which, when executed by a processor, implement the steps of the method according to any one of the first or second aspects.
In the embodiment of the specification, the shortest path tree is constructed, and the corresponding forwarding table is generated according to the shortest path tree, so that the node only needs to maintain the forwarding table corresponding to the shortest path tree, and huge connection relation as described above is not needed to be maintained, thereby greatly reducing the burden of the node and reducing the consumption of system resources; meanwhile, forwarding data based on the forwarding table generated by the shortest path tree also ensures the efficiency of data transmission.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a schematic diagram of a blockchain system provided by an exemplary embodiment of the present description;
FIG. 2 is a flowchart of a method for generating forwarding tables for a blockchain network in accordance with an exemplary embodiment of the present disclosure;
FIG. 3 is a response delay schematic diagram provided by an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a shortest path tree provided by an exemplary embodiment of the present description;
FIG. 5 is a flowchart of a method for data transmission of a blockchain network in accordance with an exemplary embodiment of the present disclosure;
FIG. 6 is a schematic block diagram of an electronic device according to an exemplary embodiment of the present disclosure;
FIG. 7 is a block diagram of a forwarding table generation device of a blockchain network provided in an exemplary embodiment of the present disclosure;
fig. 8 is a block diagram of a data transmission apparatus of a blockchain network according to an exemplary embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
User information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, presented data, etc.) referred to in this specification are both information and data authorized by the user or sufficiently authorized by the parties, and the collection, use and processing of relevant data requires compliance with relevant laws and regulations and standards of the relevant country and region, and is provided with corresponding operation portals for the user to choose authorization or denial.
FIG. 1 is a schematic diagram of a blockchain system provided by an exemplary embodiment. As shown in fig. 1, the blockchain system is a distributed network established by a plurality of nodes (nodes), which includes any two nodes that implement communication connection at an application layer through a Peer-to-Peer (P2P) network, for example, any two nodes from Node 21 to Node 25 that include any two nodes may implement communication connection at an application layer through a P2P network. The blockchain system uses the decentralized (or called multicentric) distributed ledger constructed by the chain type blockchain structure to be stored on each node (or on a large number of nodes, such as common nodes) in the distributed blockchain network, so that the blockchain system needs to solve the problem of consistency and correctness of the data of the respective ledger on a plurality of decentralised (or multicentric) nodes. In view of this, each node of the blockchain system is running a blockchain program, and under the design of a certain fault tolerance requirement, all the loyalty nodes are guaranteed to have the same transaction through a consensus (consensus) mechanism, so that the consistency of the execution results of all the loyalty nodes on the same transaction is guaranteed, the transactions are packed into blocks, and the world state is updated based on the execution results of the same transaction. Among the currently prevailing consensus mechanisms include, but are not limited to: proof of Work (POW), proof of stock (POS), practical bezels fault tolerance (Practical Byzantine Fault Tolerance, PBFT) algorithms, meles bezels fault tolerance (honeybadger bft) algorithms, and the like.
Accounts in blockchain systems are typically divided into two types, user accounts/external accounts (Externally owned account) and contract accounts (contract account); wherein the contract account is used to store the contract code and associated status values of the smart contract, which are typically only activated and invoked through an external account. The design of external accounts and contracted accounts is actually a mapping of account addresses to account states. The account status may typically include, but is not limited to, nonce, balance, storage _ Root, codeHash fields, where Nonce, balance exists in both external and contract accounts, while the CodeHash and storage_root attributes are typically valid only on contract accounts. In the foregoing fields, nonce characterizes a counter whose value for the external account represents the number of transactions sent from the account address; for a contract account, its value represents the number of smart contracts that the account creates. The value of Balance characterizes the number of digital resources owned by the corresponding external account. Storage_root characterizes the hash of one MPT (Merkle Patricia Tree) Root node, which is used to organize the Storage of the state variables of the contract account. CodeHash characterizes the hash value of the contract code, which is the hashed and stored code of the smart contract for the contract account, and which can be either an empty string or an all 0 string for external accounts because the smart contract is not included.
The contract account is used to store smart contract-related status. After the intelligent contracts are deployed in the blockchain system, a corresponding contract account is allocated. This contract account will typically have states defined by state variables in the smart contract and generating new state values during the creation and execution of the smart contract. Intelligent contracts, as used herein, generally refer to contracts that are defined in digital form in a blockchain environment that are capable of automatically enforcing terms. The code may be executed automatically once some event triggers a term in the contract (execution condition is met).
However, in the related art, since the communication connection at the application layer is implemented by using the P2P network as described above, the nodes need to maintain a huge node connection relationship assuming that the number of blockchain nodes reaches a certain scale. For example, when the number of nodes reaches thousands, the corresponding node needs to maintain a connection relationship of millions. Thus, the burden of the node is greatly increased, and the consumption of system resources is increased.
Therefore, in order to solve the above-mentioned problems, the present disclosure proposes an improved forwarding table generation method and a corresponding data transmission method of a blockchain network, and the detailed description is provided below with reference to the embodiments.
FIG. 2 is a flowchart of a method for generating a forwarding table of a blockchain network according to an exemplary embodiment of the present disclosure, where the method may be applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, and may specifically include the following steps:
step 202, path state information of a first blockchain node is obtained and broadcast to other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node.
The path state information may be used to characterize the response delay between a first blockchain node and all blockchain nodes directly connected to the first blockchain node, as shown in fig. 3, fig. 3 is a response delay diagram provided by an exemplary embodiment of the present disclosure, where the blockchain node 21 may be considered as the first blockchain node as described above, so that the response delay between the blockchain node 21 and the blockchain node 22 is 10ms, the response delay between the blockchain node 21 and the blockchain node 23 is 20ms, and the blockchain node 21 and the blockchain node 24 are not directly connected, so that the response delay between the blockchain node 21 and the blockchain node 24 may be considered as infinite. The path state information corresponding to the first blockchain node (blockchain node 21) as shown in table 1 can be obtained based on the response delay diagram shown in fig. 4.
TABLE 1
Target block link points Response delay/ms
Blockchain node
22 10
Blockchain node 23 20
Blockchain node 24 max
It should be noted that the path state information shown in table 1 characterizes a response delay between the first blockchain node, namely, the blockchain node 21 and all blockchain nodes directly connected thereto. Of course, any blockchain node may correspond to its own path status information, and the specific content may be similar to that shown in table 1, which is not described herein.
After the first block chain node determines the path state information of the first block chain node, the first block chain node can send the path state information to other block chain nodes in a flooding mode, and other block chain nodes can also send the path state information of the first block chain node to the first block chain node, so that all the block chain nodes can obtain the global path state information.
The path state information may be obtained in a plurality of ways, for example, historical path state information of the first blockchain node may be obtained, and the path state information of the first blockchain node is determined according to the historical path state information; or, in response to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result. That is, on the one hand, the path state information can be determined based on the historical data, and at the moment, active detection is not needed to acquire the path state information, so that system resources are saved; on the other hand, in order to acquire accurate path state information, the first blockchain node can also actively detect the response time delay between all the blockchain nodes directly connected with the first blockchain node. When determining path state information from historical path information, the path state information may be determined based on statistics, i.e., determining path state information for the first blockchain node from the historical path state information; or taking the latest path condition information in the historical path state information as the path state information of the first blockchain node. As shown in table 2, table 2 is a schematic representation of historical path status information provided in an exemplary embodiment of the present specification.
TABLE 2
Figure BDA0004029877180000061
Referring to table 2, in which the historic response delays of the blockchain node 21 and the blockchain node 22 are recorded with 10ms and 12ms, and the corresponding recording moments are 2022, 12, 21 and 2022, 12, 22 respectively, the statistical determination may refer to taking the average value corresponding to the historic response delay as the response delay, that is, taking the average value 11ms corresponding to 10ms and 12ms as the response delay, or taking the maximum value or the minimum value in the historic record as the response delay, that is, taking the maximum value 12ms as the response delay, taking the minimum value 10ms as the response delay, or the like, which is not limited in this specification. Alternatively, the latest response time delay in the history may be used as the corresponding response time delay, that is, 12ms corresponding to the year 2022, the month 12 and the day 22 may be used as the response time delay.
In addition to determining the historical path state information as the path state information of the first blockchain node, the path state information can be determined by an active detection mode, namely, the first blockchain node sends corresponding detection messages to all the block chain link points directly connected with the first blockchain node respectively, so that all the block chain link points directly connected respond to the detection messages and send response messages to the first block chain link points; the first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or the first blockchain node sends corresponding detection messages to all the blockchain nodes directly connected with the first blockchain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first blockchain node, so that all the directly connected blockchain nodes respond to the detection messages, the path state information is determined according to the time intervals between the time stamps and the receiving moments of the detection messages corresponding to the first blockchain node, and the determined path state information is fed back to the first blockchain node. For example: the blockchain node 21 may send corresponding probe messages to the blockchain nodes 22, 23, and the blockchain nodes 22, 23 may send corresponding response messages to the blockchain node 21 after receiving the probe messages. The blockchain node 21 may determine the corresponding response delay based on the sending time of the detection message and the receiving time of the response message, thereby determining the path state information of the first blockchain node. Alternatively, to reduce the workload of the first blockchain node, the blockchain node that receives the probe message may also perform the time-spaced computing task. That is, the first blockchain node, such as the blockchain node 21, may carry a timestamp of the corresponding sending time in the sent probe packet, so that after the blockchain node 22 and the blockchain node 23 receive the probe packet, a time interval may be calculated according to the timestamp and the corresponding receiving time, so as to determine path state information, and the calculated time interval is fed back to the first blockchain node, such as the blockchain node 21, so that a calculation task of the calculated time interval may be shared to each blockchain node directly connected to the blockchain node 21, thereby reducing a workload of the blockchain node 21.
And 204, constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the first block chain node and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to other block chain nodes so that the first block chain node forwards data based on the forwarding table.
As described above, the corresponding path state information can be broadcast between the blockchain nodes, so that each node can obtain the global path state information. Reference may be made to table 3 (units/ms), table 3 being a schematic representation of global path state information provided by an exemplary embodiment of the present specification.
TABLE 3 Table 3
Figure BDA0004029877180000071
Thus, any blockchain node may obtain global-based path state information as shown in table 3. And the blockchain node 21, after obtaining the global path state information as shown in table 3, can construct a shortest path tree with the blockchain node 21 as the root node. That is, the first blockchain node may use other blockchain nodes except itself as target blockchain nodes, and determine the shortest path between the first blockchain node and the target blockchain node according to the path state information of itself and the transmission state information broadcast to the first blockchain node by other blockchain nodes; and constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node. Wherein the determination of the shortest path may be implemented based on the Floyd algorithm. Because the global path state information shown in table 3 is actually the path between two blockchain nodes, in order to shorten the path between two points, only the third transit node can be introduced, and it is possible to shorten the path between the original two blockchain nodes through this transit node. Specifically, corresponding transit blockchain nodes can be cyclically added and/or replaced between the first blockchain node and the target blockchain node, and the change condition of response time delay between the first blockchain node and the target blockchain node is judged; removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged; under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle; and taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node. For example, the blockchain node 21 is not directly connected to the blockchain node 24, the response delay is infinite, and the blockchain node 22 can be added as a transit node, so that the response delay from the corresponding blockchain node 21 to the blockchain node 24 is 10ms plus 30ms, namely 40ms, and the blockchain node 22 can be reserved as a transit node because the response delay is reduced; further, if the blockchain node 23 is replaced with the blockchain node 22, so that the blockchain node 23 is used as a transit node, the corresponding response delay is: 20ms, 10ms, 30ms, further reduces the response delay compared to 40ms, so the blockchain node 23 can be reserved as a transit node. Therefore, after the circulation is finished, the response time delay of each path is the minimum value, and the response time delay can be used as the shortest path, so that the shortest path tree is constructed. And the shortest path calculated based on Floyd algorithm can find the minimum value of the paths from all points to all other points. Of course, the calculation may also be performed by using Dijkstra (Dijkstra) algorithm, but the calculation ideas of the two are similar, and the description is omitted here.
Based on the global path state information shown in table 3, a shortest path tree with the first blockchain node as the root node may be constructed. As shown in fig. 4, fig. 4 is a schematic diagram of a shortest path tree according to an exemplary embodiment of the present disclosure. Any node can construct a shortest path tree with itself as the root node. After the shortest path tree (as shown in fig. 4) is constructed, a corresponding forwarding table may be generated, as shown in table 4, where table 4 may be a forwarding table corresponding to blockchain node 21. The shortest path tree is constructed by other block link points, and the manner of generating the forwarding table is similar to that described above, and the description is omitted again.
TABLE 4 Table 4
Target block link points Block chain node of next hop
Blockchain node
22 Blockchain node 22
Blockchain node 23 Blockchain node 23
Blockchain node 24 Blockchain node 23
After the shortest path tree is built, a corresponding forwarding table may be generated to send and receive data, and fig. 5 is a flowchart of a data transmission method of a blockchain network according to an exemplary embodiment of the present disclosure, where the method may be applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, and specifically may include the following steps:
Step 502, receiving data sent by a last hop blockchain node, where the data includes corresponding target blockchain point information.
The blockchain node 21 may maintain a forwarding table as shown in table 4, and the data may include corresponding target blockchain link point information, so that the blockchain node 21 may determine a next-hop blockchain node according to the target blockchain link point information. For example, assuming that the target blockchain node information indicates that the target blockchain node is blockchain node 24, blockchain node 21 may send the data to the corresponding next-hop blockchain node, i.e., to blockchain node 23.
Note that, the data described in this specification may refer to the block data, the finger state data, the transaction data, or the like in the embodiment shown in fig. 1, which is not limited in this specification.
Step 504, determining a next-hop blockchain node corresponding to the data according to a forwarding table which is maintained by the self and is sent to other blockchain nodes by the first blockchain node and the target blockchain node information; the forwarding table is generated by a first blockchain node under the condition that path state information of the first blockchain node is acquired and broadcast to other blockchain nodes, and a shortest path tree taking the first blockchain node as a root node is constructed according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node.
In one embodiment, the shortest path tree may be constructed by: taking other block chain nodes except the block chain node as target block chain nodes, and respectively determining the shortest path between the first block chain node and the target block chain node according to the path state information of the block chain nodes and the transmission state information broadcast to the first block chain node by the other block chain nodes; and constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node.
In one embodiment, the shortest path may be determined by: cyclically adding and/or replacing corresponding transit blockchain nodes between the first blockchain node and the target blockchain node, and judging the change condition of response time delay between the first blockchain node and the target blockchain node; removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged; under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle; and taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node.
In one embodiment, the path state information may be determined by: acquiring historical path state information of a first block chain node, and determining the path state information of the first block chain node according to the historical path state information; or, in response to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result.
In an embodiment, the path state information may be specifically determined by: according to the historical path state information, path state information of the first block chain node is statistically determined; or, taking the latest path status information in the historical path status information as the path status information of the first blockchain node; or the first block chain node sends corresponding detection messages to all block chain link points directly connected with the first block chain node respectively, so that all the block chain link points directly connected respond to the detection messages and send response messages to the first block chain link points; the first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or the first blockchain node sends corresponding detection messages to all the blockchain nodes directly connected with the first blockchain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first blockchain node, so that all the directly connected blockchain nodes respond to the detection messages, the path state information is determined according to the time intervals between the time stamps and the receiving moments of the detection messages corresponding to the first blockchain node, and the determined path state information is fed back to the first blockchain node.
Step 506, transmitting the data to the determined next hop blockchain node.
In addition to directly sending the complete data to the next-hop blockchain node, the present disclosure also provides a method for transmitting the complete data in a sliced manner, thereby reducing the burden of the first blockchain node. For example: referring to fig. 4, there are a blockchain node 21, a blockchain node 22, a blockchain node 23 and a blockchain node 24 in the blockchain network, and the blockchain node 21 needs to send the received data (9M) forwarded by the previous-hop blockchain node to each blockchain node for the sake of blockchain data consistency; that is, the blockchain node 21 needs to send the 9M data to the blockchain node 22, the blockchain node 23, and then it can be approximately considered that the blockchain node 21 accumulates the 18M data, which clearly results in heavy burden, low distribution efficiency, and high bandwidth consumption of the blockchain node 21, and even affects the performance of the blockchain node 21.
In view of this, the blockchain node 21 may split the data to be transmitted into a plurality of data slices.
Specifically, how to perform the segmentation of the data may be determined according to the actual situation. For example, with 2 paths shown in fig. 4, the corresponding number of data cuts can be controlled to 2 pieces, 4 pieces, etc.; of course, the number of data cuts may be controlled to 3 pieces, 5 pieces, or the like, which may be determined according to actual situations, and this specification is not limited thereto.
Further, the blockchain node 21 may send the plurality of data slices to the next-hop blockchain node in the determined at least two paths, respectively, and the next-hop blockchain node on each path obtains only a part of the data slices in the plurality of data slices.
After the data slicing is completed, the blockchain node 21 may send the plurality of data slices to the next-hop blockchain node in the determined at least two paths, for example, average sending or load balancing sending. The first blockchain node can respectively and averagely send the plurality of data fragments to the next-hop blockchain node in the determined at least two paths according to the number; or, according to the actual load condition in each path, respectively transmitting the plurality of data fragments to the next hop blockchain node in the determined at least two paths based on a load balancing strategy. For example, in the case where the number of data slices is 2, the 2 data slices may be sent on average to the next hop blockchain node in the determined at least two paths, such as sending 1 data slice to blockchain node 22 and 1 data slice to blockchain node 23. Assuming that the amount of data that the blockchain node 21 needs to forward is 9M in size, it needs to send it to all blockchain nodes in the blockchain network, it can send 4.5M in size to the blockchain node 22 and 4.5M in size to the blockchain node 23. After receiving the data fragment, the blockchain node 22 and the blockchain node 23 can forward the data fragment to the next-hop blockchain node according to their own corresponding shortest path tree, and finally, all blockchain nodes in the blockchain network can obtain the 2 pieces of data fragments, so that the corresponding 9M data is spliced, the corresponding blockchain nodes can also store hash values corresponding to the data fragments, and if the same data fragment is determined to be received according to the hash values, the same data fragment is directly discarded. The burden of the blockchain node 21 is reduced (from 18M to 9M), and the efficiency of data distribution is improved. Of course, the blockchain node 22 may also segment the received data slice again, which is not limited in this specification.
Furthermore, an Erasure Coding mechanism can be introduced, that is, any slice carries redundant data quantity, so that even if any blockchain node is down, other blockchain nodes can recover original data under the condition of receiving a preset number of data slices. The stability of the block chain network is improved, and the integrity of data is ensured. Of course, the specific redundancy amount of each data slice may be determined according to the number of error-allowed nodes and the actual situation, which is not limited in this specification.
Corresponding to the embodiments of the aforementioned method, the present specification also provides embodiments of an apparatus, an electronic device, and a storage medium.
Fig. 6 is a schematic structural diagram of an electronic device according to an exemplary embodiment. Referring to fig. 6, at the hardware level, the device includes a processor 601, a network interface 602, a memory 603, a nonvolatile memory 604, and an internal bus 605, although other hardware required for other functions may be included. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 601 reading a corresponding computer program from the non-volatile memory 604 into the memory 603 and then running. Of course, in addition to software implementation, one or more embodiments of the present disclosure do not exclude other implementation manners, such as a logic device or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but may also be hardware or a logic device.
Fig. 7 is a block diagram of a forwarding table generation device of a blockchain network according to an exemplary embodiment. Referring to fig. 7, the apparatus may include:
an obtaining unit 702, configured to obtain path state information of a first blockchain node and broadcast the path state information to other blockchain nodes, where the path state information is used to characterize response delays between the first blockchain node and all blockchain nodes directly connected to the first blockchain node;
and the generating unit 704 is configured to construct a shortest path tree using the first blockchain node as a root node according to the path state information of the generating unit and the received path state information broadcast to the first blockchain node by other blockchain nodes, and generate a forwarding table from the first blockchain node to the other blockchain nodes, so that the first blockchain node forwards data based on the forwarding table.
Optionally, the generating unit 704 is specifically configured to: taking other block chain nodes except the block chain node as target block chain nodes, and respectively determining the shortest path between the first block chain node and the target block chain node according to the path state information of the block chain nodes and the transmission state information broadcast to the first block chain node by the other block chain nodes; and constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node.
Optionally, the generating unit 704 is specifically configured to: cyclically adding and/or replacing corresponding transit blockchain nodes between the first blockchain node and the target blockchain node, and judging the change condition of response time delay between the first blockchain node and the target blockchain node; removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged; under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle; and taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node.
Optionally, the acquiring unit 702 is specifically configured to: acquiring historical path state information of a first block chain node, and determining the path state information of the first block chain node according to the historical path state information; or, in response to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result.
Optionally, the acquiring unit 702 is specifically configured to: according to the historical path state information, path state information of the first block chain node is statistically determined; or taking the latest path condition information in the historical path state information as the path state information of the first blockchain node.
Optionally, the acquiring unit 702 is specifically configured to: the first block chain node transmits corresponding detection messages to all block chain link points directly connected with the first block chain node respectively, so that all the block chain link points directly connected respond to the detection messages and transmit response messages to the first block chain link points; the first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or the first blockchain node sends corresponding detection messages to all the blockchain nodes directly connected with the first blockchain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first blockchain node, so that all the directly connected blockchain nodes respond to the detection messages, the path state information is determined according to the time intervals between the time stamps and the receiving moments of the detection messages corresponding to the first blockchain node, and the determined path state information is fed back to the first blockchain node.
Fig. 8 is a block diagram of a data transmission apparatus of a blockchain network provided in an exemplary embodiment. Referring to fig. 8, the apparatus may include:
a receiving unit 802, configured to receive data sent by a last-hop blockchain node, where the data includes corresponding target blockchain link point information;
a determining unit 804, configured to determine a next-hop blockchain node corresponding to the data according to a forwarding table from the first blockchain node to other blockchain nodes and the target blockchain link point information, which are maintained by the determining unit; the forwarding table is generated by a first blockchain node under the condition of acquiring path state information of the first blockchain node and broadcasting the path state information to other blockchain nodes, and constructing a shortest path tree taking the first blockchain node as a root node according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node;
a sending unit 806, configured to send the data to the determined next-hop blockchain node.
Optionally, the shortest path tree is constructed by: taking other block chain nodes except the block chain node as target block chain nodes, and respectively determining the shortest path between the first block chain node and the target block chain node according to the path state information of the block chain nodes and the transmission state information broadcast to the first block chain node by the other block chain nodes;
and constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node.
Optionally, the shortest path is determined by:
cyclically adding and/or replacing corresponding transit blockchain nodes between the first blockchain node and the target blockchain node, and judging the change condition of response time delay between the first blockchain node and the target blockchain node;
removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged;
under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle;
And taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node.
Optionally, the path state information is determined by:
acquiring historical path state information of a first block chain node, and determining the path state information of the first block chain node according to the historical path state information; or alternatively, the first and second heat exchangers may be,
and responding to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result.
Optionally, the path state information is specifically determined by the following manner:
according to the historical path state information, path state information of the first block chain node is statistically determined; or, taking the latest path status information in the historical path status information as the path status information of the first blockchain node; or alternatively, the first and second heat exchangers may be,
the first block chain node transmits corresponding detection messages to all block chain link points directly connected with the first block chain node respectively, so that all the block chain link points directly connected respond to the detection messages and transmit response messages to the first block chain link points;
The first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or alternatively, the first and second heat exchangers may be,
the first block chain node sends corresponding detection messages to all block chain links directly connected with the first block chain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first block chain node, so that all the block chain links directly connected respond to the detection messages, the path state information is determined according to time intervals between the time stamps and receiving moments of the detection messages corresponding to the first block chain node, and the determined path state information is fed back to the first block chain node.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present description. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation device is a server system. Of course, the invention does not exclude that as future computer technology advances, the computer implementing the functions of the above-described embodiments may be, for example, a personal computer, a laptop computer, a car-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. For example, if first, second, etc. words are used to indicate a name, but not any particular order.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when one or more of the present description is implemented, the functions of each module may be implemented in the same piece or pieces of software and/or hardware, or a module that implements the same function may be implemented by a plurality of sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, read only compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
One skilled in the relevant art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the different embodiments or examples described in this specification and the features of the different embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of one or more embodiments of the present specification and is not intended to limit the one or more embodiments of the present specification. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the present specification, should be included in the scope of the claims.

Claims (14)

1. A forwarding table generation method of a blockchain network, applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, the method comprising:
acquiring path state information of a first block chain node and broadcasting the path state information to other block chain nodes, wherein the path state information is used for representing response time delay between the first block chain node and all block chain nodes directly connected with the first block chain node;
and constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the first block chain node and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to the other block chain nodes so that the first block chain node forwards data based on the forwarding table.
2. The method of claim 1, the constructing a shortest path tree having the first blockchain node as a root node based on the path state information of the shortest path tree itself and received path state information broadcast to the first blockchain node by other blockchain nodes, comprising:
taking other block chain nodes except the block chain node as target block chain nodes, and respectively determining the shortest path between the first block chain node and the target block chain node according to the path state information of the block chain nodes and the transmission state information broadcast to the first block chain node by the other block chain nodes;
and constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node.
3. The method of claim 2, the determining shortest paths between a first blockchain node to the target blockchain node, respectively, comprising:
cyclically adding and/or replacing corresponding transit blockchain nodes between the first blockchain node and the target blockchain node, and judging the change condition of response time delay between the first blockchain node and the target blockchain node;
Removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged;
under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle;
and taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node.
4. The method of claim 1, the obtaining path state information of a first blockchain node, comprising:
acquiring historical path state information of a first block chain node, and determining the path state information of the first block chain node according to the historical path state information; or alternatively, the first and second heat exchangers may be,
and responding to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result.
5. The method of claim 4, the determining path state information of a first blockchain node from the historical path state information comprising:
according to the historical path state information, path state information of the first block chain node is statistically determined; or, taking the latest path status information in the historical path status information as the path status information of the first blockchain node;
The method for actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result comprises the following steps:
the first block chain node transmits corresponding detection messages to all block chain link points directly connected with the first block chain node respectively, so that all the block chain link points directly connected respond to the detection messages and transmit response messages to the first block chain link points;
the first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or alternatively, the first and second heat exchangers may be,
the first block chain node sends corresponding detection messages to all block chain links directly connected with the first block chain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first block chain node, so that all the block chain links directly connected respond to the detection messages, the path state information is determined according to time intervals between the time stamps and receiving moments of the detection messages corresponding to the first block chain node, and the determined path state information is fed back to the first block chain node.
6. A data transmission method of a blockchain network, applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, the method comprising:
Receiving data sent by a last-hop blockchain node, wherein the data comprises corresponding target blockchain link point information;
determining a next-hop blockchain node corresponding to the data according to a forwarding table which is maintained by the self and is sent to other blockchain nodes by the first blockchain node and the target blockchain link point information; the forwarding table is generated by a first blockchain node under the condition of acquiring path state information of the first blockchain node and broadcasting the path state information to other blockchain nodes, and constructing a shortest path tree taking the first blockchain node as a root node according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node;
and sending the data to the determined next-hop blockchain node.
7. The method of claim 6, the shortest path tree being constructed by:
taking other block chain nodes except the block chain node as target block chain nodes, and respectively determining the shortest path between the first block chain node and the target block chain node according to the path state information of the block chain nodes and the transmission state information broadcast to the first block chain node by the other block chain nodes;
And constructing a shortest path tree taking the first blockchain node as a root node according to each shortest path from the first blockchain node to the target blockchain node.
8. The method of claim 7, the shortest path being determined by:
cyclically adding and/or replacing corresponding transit blockchain nodes between the first blockchain node and the target blockchain node, and judging the change condition of response time delay between the first blockchain node and the target blockchain node;
removing the added and/or replaced transit block chain nodes in the current cycle under the condition that the judging result shows that the response time delay is increased or unchanged;
under the condition that the judgment result shows that the response time delay is reduced, reserving the added and/or replaced transit block chain nodes in the current cycle;
and taking a path formed by each block chain node reserved at the end of the cycle as the shortest path between the first block chain node and the target block chain node.
9. The method of claim 6, the path state information is determined by:
acquiring historical path state information of a first block chain node, and determining the path state information of the first block chain node according to the historical path state information; or alternatively, the first and second heat exchangers may be,
And responding to the path information acquisition requirement, actively detecting the response time delay between the first block chain node and all the block chain nodes directly connected with the first block chain node, and determining the path state information of the first block chain node according to the detection result.
10. The method according to claim 9, the path state information being determined in particular by:
according to the historical path state information, path state information of the first block chain node is statistically determined; or, taking the latest path status information in the historical path status information as the path status information of the first blockchain node; or alternatively, the first and second heat exchangers may be,
the first block chain node transmits corresponding detection messages to all block chain link points directly connected with the first block chain node respectively, so that all the block chain link points directly connected respond to the detection messages and transmit response messages to the first block chain link points;
the first block chain node determines path state information of the first block chain node according to the time interval between the sending time of the detection message and the receiving time of the response message; or alternatively, the first and second heat exchangers may be,
the first block chain node sends corresponding detection messages to all block chain links directly connected with the first block chain node respectively, wherein the detection messages carry time stamps corresponding to the detection messages sent by the first block chain node, so that all the block chain links directly connected respond to the detection messages, the path state information is determined according to time intervals between the time stamps and receiving moments of the detection messages corresponding to the first block chain node, and the determined path state information is fed back to the first block chain node.
11. A forwarding table generation apparatus of a blockchain network, applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, the apparatus comprising:
the system comprises an acquisition unit, a processing unit and a processing unit, wherein the acquisition unit is used for acquiring path state information of a first block chain node and broadcasting the path state information to other block chain nodes, and the path state information is used for representing response time delay between the first block chain node and all block chain nodes directly connected with the first block chain node;
and the generating unit is used for constructing a shortest path tree taking the first block chain node as a root node according to the path state information of the generating unit and the received path state information broadcast to the first block chain node by other block chain nodes, and generating a forwarding table from the first block chain node to the other block chain nodes so that the first block chain node forwards data based on the forwarding table.
12. A data transmission apparatus of a blockchain network applied to a first blockchain node of a plurality of blockchain nodes of the blockchain network, the apparatus comprising:
the receiving unit is used for receiving data sent by the last-hop blockchain node, wherein the data comprises corresponding target blockchain point information;
the determining unit is used for determining a next-hop blockchain node corresponding to the data according to a forwarding table which is maintained by the determining unit and is sent to other blockchain nodes by the first blockchain node and the target blockchain node information; the forwarding table is generated by a first blockchain node under the condition of acquiring path state information of the first blockchain node and broadcasting the path state information to other blockchain nodes, and constructing a shortest path tree taking the first blockchain node as a root node according to the path state information of the forwarding table and the received path state information broadcast to the first blockchain node by the other blockchain nodes, wherein the path state information is used for representing response time delay between the first blockchain node and all blockchain nodes directly connected with the first blockchain node;
And the sending unit is used for sending the data to the determined next-hop blockchain node.
13. A computer readable storage medium having stored thereon a computer program which when executed by a processor performs the steps of the method according to any of claims 1 to 5 or 6 to 10.
14. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the method according to any one of claims 1 to 5 or 6 to 10 when the program is executed.
CN202211738295.3A 2022-12-30 2022-12-30 Forwarding table generation method of block chain network and data transmission method thereof Pending CN116170388A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211738295.3A CN116170388A (en) 2022-12-30 2022-12-30 Forwarding table generation method of block chain network and data transmission method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211738295.3A CN116170388A (en) 2022-12-30 2022-12-30 Forwarding table generation method of block chain network and data transmission method thereof

Publications (1)

Publication Number Publication Date
CN116170388A true CN116170388A (en) 2023-05-26

Family

ID=86412610

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211738295.3A Pending CN116170388A (en) 2022-12-30 2022-12-30 Forwarding table generation method of block chain network and data transmission method thereof

Country Status (1)

Country Link
CN (1) CN116170388A (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120124238A1 (en) * 2010-11-12 2012-05-17 Alcatel-Lucent Bell N.V. Prioritization of routing information updates
CN106209622A (en) * 2016-06-23 2016-12-07 广州海格通信集团股份有限公司 A kind of method of multicasting based on SDN
US20190373521A1 (en) * 2017-04-07 2019-12-05 Vapor IO Inc. Distributed processing for determining network paths
CN112104558A (en) * 2020-10-30 2020-12-18 上海交通大学 Method, system, terminal and medium for implementing block chain distribution network
US20210091957A1 (en) * 2019-09-25 2021-03-25 International Business Machines Corporation Consensus protocol for blockchain dag structure
US11206207B1 (en) * 2019-01-29 2021-12-21 Amazon Technologies, Inc. Managed multicast communications across isolated networks
CN113923155A (en) * 2021-12-06 2022-01-11 浙商银行股份有限公司 Shortest path algorithm-based alliance link communication method and system
CN114285755A (en) * 2021-12-31 2022-04-05 支付宝(杭州)信息技术有限公司 Cross-subnet interaction method and device, electronic equipment and storage medium
CN114390063A (en) * 2022-02-25 2022-04-22 蚂蚁区块链科技(上海)有限公司 Message broadcasting method for block chain network, block chain node and block chain system
US20220150220A1 (en) * 2019-08-30 2022-05-12 Henry Verheyen Secure data exchange network

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20120124238A1 (en) * 2010-11-12 2012-05-17 Alcatel-Lucent Bell N.V. Prioritization of routing information updates
CN106209622A (en) * 2016-06-23 2016-12-07 广州海格通信集团股份有限公司 A kind of method of multicasting based on SDN
US20190373521A1 (en) * 2017-04-07 2019-12-05 Vapor IO Inc. Distributed processing for determining network paths
US11206207B1 (en) * 2019-01-29 2021-12-21 Amazon Technologies, Inc. Managed multicast communications across isolated networks
US20220150220A1 (en) * 2019-08-30 2022-05-12 Henry Verheyen Secure data exchange network
US20210091957A1 (en) * 2019-09-25 2021-03-25 International Business Machines Corporation Consensus protocol for blockchain dag structure
CN114514732A (en) * 2019-09-25 2022-05-17 国际商业机器公司 Consensus protocol for blockchain DAG structures
CN112104558A (en) * 2020-10-30 2020-12-18 上海交通大学 Method, system, terminal and medium for implementing block chain distribution network
CN113923155A (en) * 2021-12-06 2022-01-11 浙商银行股份有限公司 Shortest path algorithm-based alliance link communication method and system
CN114285755A (en) * 2021-12-31 2022-04-05 支付宝(杭州)信息技术有限公司 Cross-subnet interaction method and device, electronic equipment and storage medium
CN114390063A (en) * 2022-02-25 2022-04-22 蚂蚁区块链科技(上海)有限公司 Message broadcasting method for block chain network, block chain node and block chain system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
J. YALLOUZ, ET AL.: "Minimum-Weight Link-Disjoint Node-"Somewhat Disjoint" Paths", 《IEEE/ACM TRANSACTIONS ON NETWORKING》, 15 May 2018 (2018-05-15) *
J. YE, M. YANAGISAWA AND Y. SHI: "A Bit-Segmented Adder Chain based Symmetric Transpose Two-Block FIR Design for High-Speed Signal Processing", 《2019 IEEE ASIA PACIFIC CONFERENCE ON CIRCUITS AND SYSTEMS (APCCAS)》, 9 January 2020 (2020-01-09) *

Similar Documents

Publication Publication Date Title
RU2724136C1 (en) Data processing method and device
CN107450979B (en) Block chain consensus method and device
CN113766035B (en) Service acceptance and consensus method and device
CN111767143B (en) Transaction data processing method, device, equipment and system
CN111767144B (en) Transaction route determination method, device, equipment and system for transaction data
CN113743942B (en) Transaction execution method, blockchain, master node and master storage device
CN114827165B (en) Method and block link point for grouping multiple transactions
CN115129728A (en) File checking method and device
CN111046004B (en) Data file storage method, device, equipment and storage medium
CN116996208A (en) Block editing method and block link point in block chain system
CN115361332B (en) Fault-tolerant route processing method and device, processor and electronic equipment
CN116170388A (en) Forwarding table generation method of block chain network and data transmission method thereof
CN116248594A (en) Message broadcasting method and device
CN116366666A (en) Chain state updating method and block link point in block chain system
CN116069792A (en) Database disaster recovery system, method and device, storage medium and electronic equipment
CN116016552A (en) Data transmission method and device of block chain network, electronic equipment and storage medium
CN116366667A (en) Data transmission method and device of block chain network, electronic equipment and storage medium
CN115098483A (en) Pre-execution cache data cleaning method and block link point
CN116055508A (en) Data synchronization method and device for block chain network
CN114697344B (en) Method for determining consensus node in blockchain system, node, storage medium and computing device
CN114422527B (en) Block synchronization method and device, electronic equipment and storage medium
CN115022305B (en) Data transmission system, method, device, equipment and medium
CN117808587A (en) Transaction deduplication method and nodes in blockchain system
CN115174572B (en) Data multicasting method in blockchain, blockchain node and storage medium
CN116170453A (en) Data distribution method and device for block chain network

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