CN116016552A - Data transmission method and device of block chain network, electronic equipment and storage medium - Google Patents

Data transmission method and device of block chain network, electronic equipment and storage medium Download PDF

Info

Publication number
CN116016552A
CN116016552A CN202211734560.0A CN202211734560A CN116016552A CN 116016552 A CN116016552 A CN 116016552A CN 202211734560 A CN202211734560 A CN 202211734560A CN 116016552 A CN116016552 A CN 116016552A
Authority
CN
China
Prior art keywords
blockchain
node
block chain
data
blockchain node
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
CN202211734560.0A
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 CN202211734560.0A priority Critical patent/CN116016552A/en
Publication of CN116016552A publication Critical patent/CN116016552A/en
Pending legal-status Critical Current

Links

Images

Abstract

The present disclosure provides a data transmission method, apparatus, electronic device and storage medium for a blockchain network, applied to a first blockchain node in the blockchain network, where the first blockchain node maintains a shortest path tree that is built for all blockchain nodes in the blockchain network with itself as a root node, and the method includes: determining all paths taking a first block chain node as one side end point and any other block chain node as the other side end point according to the shortest path tree; splitting data to be transmitted into a plurality of data fragments; and respectively sending the plurality of data fragments to the next-hop blockchain nodes in the determined at least two paths, wherein the next-hop blockchain nodes on each path only acquire part of the data fragments in the plurality of data fragments.

Description

Data transmission method and device of block chain network, electronic equipment and storage medium
Technical Field
The embodiment of the specification belongs to the technical field of blockchain, and particularly relates to a data transmission method, a device, electronic equipment and a storage medium of a blockchain network.
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, when transmission synchronization of data is involved, the first blockchain point needs to send the data to be transmitted to each blockchain node in its entirety. For example, when there are a blockchain node a, a blockchain node B, a blockchain node C and a blockchain node D in the blockchain network, the data size of the data to be transmitted corresponding to the blockchain node a is 9M, the blockchain node a needs to send the 9M data to the blockchain node B, the blockchain node C and the blockchain node D, that is, it can be approximately considered that the blockchain node a co-sends the data with the data size of 27M. In the case of a large number of blockchain nodes in a blockchain network, the blockchain node a is definitely heavy in burden, low in distribution efficiency, and large in bandwidth consumption, and even affects the performance of the blockchain node a.
Disclosure of Invention
The invention aims to provide a data transmission method, a data transmission device, electronic equipment and a storage medium of a blockchain network.
According to a first 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 in the blockchain network, where the first blockchain node maintains a shortest path tree that takes itself as a root node and is established for all blockchain nodes in the blockchain network, and the method includes:
determining all paths taking a first block chain node as one side end point and any other block chain node as the other side end point according to the shortest path tree;
splitting data to be transmitted into a plurality of data fragments;
and respectively sending the plurality of data fragments to the next-hop blockchain nodes in the determined at least two paths, wherein the next-hop blockchain nodes on each path only acquire part of the data fragments in the plurality of data fragments.
According to a second 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 in the blockchain network, the first blockchain node maintaining a shortest path tree that is self-rooted and established for all blockchain nodes in the blockchain network, comprising:
The determining unit is used for determining all paths taking the first block chain node as one side endpoint and any other block chain node as the other side endpoint according to the shortest path tree;
the splitting unit is used for splitting the data to be transmitted into a plurality of data fragments;
and the sending unit is used for respectively sending the plurality of data fragments to the next-hop blockchain nodes in the determined at least two paths, and the next-hop blockchain nodes on each path only acquire part of the data fragments in the plurality of data fragments.
According to a third 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 is configured to implement the steps of the method of the first aspect described above.
According to a fourth aspect of one or more embodiments of the present description, there is provided a computer-readable storage medium having stored thereon executable instructions; wherein the instructions, when executed by a processor, implement the steps of the method of the first aspect described above.
In the embodiment of the present disclosure, the first blockchain node may send the plurality of data fragments to the next-hop blockchain node in at least two paths by splitting the data to be transmitted into the plurality of data fragments. The first block chain node does not need to send the complete data for many times, and only needs to send a plurality of data fragments once, so that the burden of the first block chain node is reduced, and the bandwidth consumption of the block chain node is reduced.
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 data transmission of a blockchain network in accordance with an exemplary embodiment of the present disclosure;
FIG. 3 is a flow chart of constructing a shortest path tree provided by an exemplary embodiment of the present description;
FIG. 4 is a response delay diagram provided by an exemplary embodiment of the present disclosure;
FIG. 5 is a schematic diagram of a shortest path tree provided by an exemplary embodiment of the present description;
FIG. 6 is a schematic diagram of a shortest path tree provided by an exemplary embodiment of the present description;
FIG. 7 is a schematic diagram of average distribution data slicing provided in an exemplary embodiment of the present disclosure;
FIG. 8 is a schematic block diagram of an electronic device according to an exemplary embodiment of the present disclosure;
fig. 9 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 a point-to-point (P2P) network between any two nodes to implement communication connection at an application layer, for example, any two nodes from Node n1 to Node n5 included in the blockchain system may implement communication connection at the application layer through the 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, when transmission synchronization of data is involved, the first blockchain node needs to send the number to be transmitted to each blockchain node in its entirety. As illustrated in the embodiment of fig. 1, the blockchain node n1 needs to send its own generated data (9M) to be transmitted to each blockchain node for blockchain data consistency; that is, the blockchain node n1 needs to send the 9M data to the blockchain node n2, the blockchain node n3, the blockchain node n4 and the blockchain node n5, so that it can be approximately considered that the blockchain node n1 cumulatively sends 36M data, which definitely results in heavy burden, low distribution efficiency, high bandwidth consumption and even influences on the performance of the blockchain node n 1.
Accordingly, to solve the above-mentioned problems, the present specification proposes an improved data transmission scheme of a blockchain network, and the following detailed description will be made with reference to the embodiments.
Fig. 2 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 202, determining all paths using the first blockchain node as one side endpoint and any other blockchain node as another side endpoint according to the shortest path tree.
The shortest path tree (Shortest Path Tree, SPT) is a data structure tree generated using a shortest path algorithm. The following description describes in detail how the shortest path tree is constructed in conjunction with the accompanying drawings. FIG. 3 is a flowchart of a method for constructing a shortest path tree according to an exemplary embodiment of the present disclosure, which may include the steps of:
step 302, 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. 4, fig. 4 is a response delay diagram provided by an exemplary embodiment of the present disclosure, where blockchain node 41 may be considered as the first blockchain node as described above, so that the response delay between blockchain node 41 and blockchain node 42 is 10ms, the response delay between blockchain node 41 and blockchain node 43 is 20ms, and the response delay between blockchain node 41 and blockchain node 44 is not directly connected, so that the response delay between blockchain node 41 and 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
42 10
Blockchain node 43 20
Blockchain node 44 max
It should be noted that the path state information shown in table 1 characterizes a response delay between the first blockchain node, i.e., the blockchain node 41, 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 BDA0004032047450000051
Figure BDA0004032047450000061
Referring to table 2, in which the historic response delays of the blockchain node 41 and the blockchain node 42 are recorded with 10ms and 12ms, and the corresponding recording moments thereof 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, the average value 11ms corresponding to 10ms and 12ms as the response delay, or 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, and 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 41 may send corresponding probe messages to the blockchain nodes 42, 43, and the blockchain nodes 42, 43 may send corresponding response messages to the blockchain node 41 after receiving the probe messages. The blockchain node 41 may determine the corresponding response delay based on the sending time of the probe 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 41, may carry a timestamp of the corresponding sending time in the sent probe packet, and after the blockchain node 42 and the blockchain node 43 receive the probe packet, the blockchain node may calculate a time interval according to the timestamp and the corresponding receiving time, so as to determine path state information, and feed back the calculated time interval to the first blockchain node, such as the blockchain node 41, so that a calculation task of the calculated time interval may be shared to each blockchain node directly connected to the blockchain node 41, thereby reducing a workload of the blockchain node 41.
And 304, 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 BDA0004032047450000071
Thus, any blockchain node may obtain global-based path state information as shown in table 3. And the blockchain node 41, after obtaining the global path state information as shown in table 3, may construct a shortest path tree with the blockchain node 41 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 41 to the blockchain node 44 are not directly connected, the response delay is infinite, and the blockchain node 42 can be added as a transit node, so that the response delay from the corresponding blockchain node 41 to the blockchain node 44 is 10ms to 30ms, namely 40ms, and the blockchain node 42 can be reserved as a transit node because the response delay is reduced; further, if the blockchain node 43 is replaced with the blockchain node 42, so that the blockchain node 43 is used as a transit node, the corresponding response delay is: 20ms plus 10ms, 30ms, further reduces the response delay compared to 40ms, so the blockchain node 43 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 minimum value of the paths from all points to all other points can be obtained based on the shortest path calculated by Floyd algorithm. 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. 5, fig. 5 is a schematic diagram of a shortest path tree according to an exemplary embodiment of the present disclosure. That is, the shortest path tree shown in fig. 5 is constructed with the connection relationship between the blockchain nodes shown in fig. 4. Any node can construct a shortest path tree with itself as the root node.
The following describes the data transmission method shown in this specification with the connection relationship of the blockchain nodes shown in fig. 6 as a shortest path tree with the blockchain node 21 as the root node.
As described above, any blockchain node may obtain global path state information, so as to construct a shortest path tree with its own node as a root node, and the shortest path tree shown in FIG. 6 is a shortest path tree with blockchain node 21 as a root node, which may be maintained in blockchain node 21, blockchain node 22 may also maintain a shortest path tree with blockchain node 22 as a root node, and blockchain node 23 may also maintain a shortest path tree with blockchain node 23 as a root node. That is, any blockchain node can maintain the shortest path tree corresponding to itself.
Then the first block chain node can determine all paths taking the first block chain sister node as one side endpoint and any other block chain node as the other side endpoint according to the shortest path tree maintained by the first block chain node; as shown in FIG. 6, a first blockchain node (i.e., blockchain node 21) may determine 3 paths, one path from blockchain node 21 to blockchain node 22, one path from blockchain node 21 to blockchain node 23, and one path from blockchain node 21 to blockchain node 24, respectively.
Step 204, splitting the data to be transmitted into a plurality of data slices.
The data to be transmitted may be generated by a first blockchain node; or, forwarding to the first blockchain node by a last hop blockchain node. The data to be transmitted in this specification may refer to block data, finger state data, transaction data, etc. in the embodiment shown in fig. 1, which is not limited in this specification. As will be appreciated in connection with step 204, assuming that the data to be transmitted is generated by the blockchain node 21, the blockchain node may segment the data to be transmitted into a plurality of data slices; of course, it is assumed that the blockchain node 21 receives the data to be transmitted forwarded by the previous-hop blockchain node, and the data to be transmitted may be split, which is not limited to only allowing the blockchain node of the data producer to perform the data splitting operation.
Specifically, how to perform the segmentation of the data may be determined according to the actual situation. For example, with 3 paths shown in fig. 6, the corresponding number of data cuts can be controlled to 3 pieces, 6 pieces, etc.; of course, the number of data cuts may be controlled to 4 pieces, 7 pieces, or the like, which may be determined according to actual situations, and this is not limited in this specification.
Step 206, the plurality of data fragments are respectively sent to the next-hop blockchain nodes in the determined at least two paths, and the next-hop blockchain nodes on each path only obtain part of the data fragments in the plurality of data fragments.
After the data is segmented, the plurality of data segments can be respectively sent 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 3, the 3 slices of data may be sent to the next-hop blockchain node in the determined at least two paths on average, such as sending 1 slice of data to blockchain node 22, 1 slice of data to blockchain node 23, and 1 slice of data to blockchain node 24, as shown in fig. 7, fig. 7 is a schematic diagram of an average distribution of data slices provided by an exemplary embodiment of the present disclosure. Assuming that the blockchain node 21 has generated 9M data, it needs to send it to all blockchain nodes in the blockchain network, it can send 3M data slices to the blockchain node 22, 3M data slices to the blockchain node 23, and 3M data slices to the blockchain node 24. After receiving the data fragments, the blockchain node 22, the blockchain node 23 and the blockchain node 24 can forward the data fragments 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 3-fragment data fragments, so that the corresponding 9M data can be spliced, the corresponding blockchain nodes can also store hash values corresponding to the data fragments, and the same data fragments are determined to be received according to the hash values, and the same data fragments can be directly discarded. The burden of the blockchain node 21 is reduced, and the data distribution efficiency is improved. Of course, the blockchain node 22 may also segment the received data slice again, which is not limited in this specification. In addition to the above average distribution manner, in an embodiment, according to the actual load condition in each path, the plurality of data fragments may be sent to the next hop blockchain node in the determined at least two paths based on the load balancing policy. For example, after splitting 6 pieces of data, the blockchain node 21 finds that the loading condition of the blockchain node 23 is not optimistic, i.e. there is a high loading condition of the blockchain node 23, then the blockchain node 21 may send 2 pieces of data to the blockchain node 22, the remaining 1 piece of data to the blockchain node 23, and 3 pieces of data to the blockchain node 24, thereby alleviating the high loading condition of the blockchain node 23. Of course, the specific load balancing strategy can be determined according to practical situations, and the specification does not limit the specific load balancing strategy.
When the blockchain node 22, the blockchain node 23 and the blockchain node 24 forward the data fragments, there may be a possibility of downtime, for example, only the blockchain node 23 and the blockchain node 24 forward the data fragments normally, but the blockchain node 22 is abnormal, which may cause that any blockchain node can only obtain 2 pieces of data fragments, and cannot splice the data into complete data. In this regard, the sum of the data amounts corresponding to the plurality of data fragments may be made larger than the data amount corresponding to the data to be transmitted, except that the sum of the data amounts corresponding to the plurality of data fragments is equal to the data amount corresponding to the data to be transmitted. I.e. adding a corresponding amount of redundancy for each data slice. For example: the blockchain node 21 generates data to be transmitted with a data size of 3M, and divides the data into 3 pieces of data slices, so that the data size of each piece can be 1.5M (i.e. the redundancy is increased) instead of 1M, and therefore, even if the blockchain node 22 is down, any blockchain node can recover the original 3M data when receiving any 2 pieces 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.
Based on the above embodiments, the present disclosure divides the data to be transmitted into a plurality of data slices, so that the first blockchain node may send the plurality of data slices to the next-hop blockchain node in at least two paths. The first block chain node does not need to complete data for multiple times, and only needs to send multiple data fragments once, so that the burden of the first block chain node is reduced, and the bandwidth consumption of the block chain node is reduced.
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. 8 is a schematic structural diagram of an electronic device according to an exemplary embodiment. Referring to fig. 8, at the hardware level, the device includes a processor 801, a network interface 802, a memory 803, a nonvolatile memory 804, and an internal bus 805, and may include hardware required by other services. One or more embodiments of the present description may be implemented in a software-based manner, such as by the processor 801 reading a corresponding computer program from the non-volatile memory 804 into the memory 803 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. 9 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 be applied to a first blockchain node in the blockchain network, where the first blockchain node maintains a shortest path tree that is self-rooted and is established for all blockchain nodes in the blockchain network, and the apparatus may include:
a determining unit 902, configured to determine, according to the shortest path tree, all paths using the first blockchain node as one side endpoint and any other blockchain node as another side endpoint;
a splitting unit 904, configured to split data to be transmitted into a plurality of data slices;
and a sending unit 906, configured to send the multiple data slices to the next-hop blockchain nodes in the determined at least two paths, where the next-hop blockchain nodes on each path only obtain part of the multiple data slices.
Optionally, the data to be transmitted is generated by a first blockchain node; or, forwarding to the first blockchain node by a last hop blockchain node.
Optionally, the sending unit 906 is specifically configured to: the data fragments are respectively and averagely sent to the next hop blockchain node in the determined at least two paths according to the number; or alternatively, the first and second heat exchangers may be,
And respectively transmitting the plurality of data fragments to the next hop blockchain nodes in the determined at least two paths based on a load balancing strategy according to the actual load conditions in the paths.
Optionally, the sum of the data amounts corresponding to the plurality of data fragments is greater than or equal to the data amount corresponding to the data to be transmitted.
Optionally, the shortest path tree is constructed by the first blockchain node according to the path state information of the first blockchain node and the received path state information broadcast by other blockchain nodes, and the path state information of any blockchain node is used for representing the transmission delay between any blockchain node and all blockchain nodes directly connected with the blockchain node.
Optionally, the shortest path tree is constructed by:
each block chain link point is respectively used as a target block chain node, and the shortest path between the first block chain node and the target block chain node is respectively determined according to the path state information of the block chain node and the transmission state information broadcast to the first block chain node by 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 tree 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.
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 (11)

1. A data transmission method of a blockchain network, applied to a first blockchain node in the blockchain network, the first blockchain node maintaining a shortest path tree that is self-rooted and established for all blockchain nodes in the blockchain network, the method comprising:
determining all paths taking a first block chain node as one side end point and any other block chain node as the other side end point according to the shortest path tree;
splitting data to be transmitted into a plurality of data fragments;
and respectively sending the plurality of data fragments to the next-hop blockchain nodes in the determined at least two paths, wherein the next-hop blockchain nodes on each path only acquire part of the data fragments in the plurality of data fragments.
2. The method of claim 1, the data to be transmitted being generated by a first blockchain node; or, forwarding to the first blockchain node by a last hop blockchain node.
3. The method of claim 1, the sending the plurality of data slices to a next hop blockchain node in the determined at least two paths, respectively, comprising:
the data fragments are respectively and averagely sent to the next hop blockchain node in the determined at least two paths according to the number; or alternatively, the first and second heat exchangers may be,
and respectively transmitting the plurality of data fragments to the next hop blockchain nodes in the determined at least two paths based on a load balancing strategy according to the actual load conditions in the paths.
4. The method of claim 1, wherein a sum of data amounts corresponding to the plurality of data slices is greater than or equal to a data amount corresponding to the data to be transmitted.
5. The method of claim 1, wherein the shortest path tree is constructed by a first blockchain node based on its own path state information and received path state information broadcast by other blockchain nodes, the path state information of any blockchain node being used to characterize the propagation delay between the any blockchain node and all blockchain nodes directly connected thereto.
6. The method of claim 5, the shortest path tree being constructed by:
each block chain link point is respectively used as a target block chain node, and the shortest path between the first block chain node and the target block chain node is respectively determined according to the path state information of the block chain node and the transmission state information broadcast to the first block chain node by 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.
7. The method of claim 6, the shortest path tree 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.
8. The method of claim 5, 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.
9. A data transmission apparatus of a blockchain network applied to a first blockchain node in the blockchain network, the first blockchain node maintaining a shortest path tree rooted at itself and established for all blockchain nodes in the blockchain network, the apparatus comprising:
the determining unit is used for determining all paths taking the first block chain node as one side endpoint and any other block chain node as the other side endpoint according to the shortest path tree;
the splitting unit is used for splitting the data to be transmitted into a plurality of data fragments;
And the sending unit is used for respectively sending the plurality of data fragments to the next-hop blockchain nodes in the determined at least two paths, and the next-hop blockchain nodes on each path only acquire part of the data fragments in the plurality of data fragments.
10. 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 8.
11. 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 8 when the program is executed.
CN202211734560.0A 2022-12-30 2022-12-30 Data transmission method and device of block chain network, electronic equipment and storage medium Pending CN116016552A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211734560.0A CN116016552A (en) 2022-12-30 2022-12-30 Data transmission method and device of block chain network, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211734560.0A CN116016552A (en) 2022-12-30 2022-12-30 Data transmission method and device of block chain network, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116016552A true CN116016552A (en) 2023-04-25

Family

ID=86026443

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211734560.0A Pending CN116016552A (en) 2022-12-30 2022-12-30 Data transmission method and device of block chain network, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116016552A (en)

Similar Documents

Publication Publication Date Title
RU2724136C1 (en) Data processing method and device
KR102140414B1 (en) Blockchain consensus method and device
CN111756550B (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
EP3547170A1 (en) Blockchain-based consensus method and device
EP3565219B1 (en) Service execution method and device
US11563805B2 (en) Method, apparatus, client terminal, and server for data processing
CN113743942B (en) Transaction execution method, blockchain, master node and master storage device
CN110704438B (en) Method and device for generating bloom filter in blockchain
US11102284B2 (en) Service processing methods and systems based on a consortium blockchain network
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
CN116016552A (en) Data transmission method and device of block chain network, electronic equipment and storage medium
CN114422526B (en) Block synchronization method and device, electronic equipment and storage medium
CN116366666A (en) Chain state updating method and block link point in block chain system
CN116170388A (en) Forwarding table generation method of block chain network and data transmission method thereof
CN115361332A (en) Processing method and device for fault-tolerant routing, processor and electronic equipment
CN116366667A (en) Data transmission method and device of block chain network, electronic equipment and storage medium
EP3779691B1 (en) Data processing method and apparatus
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
CN116170453A (en) Data distribution method and device for block chain network
CN117808587A (en) Transaction deduplication method and nodes in blockchain system
CN115022305B (en) Data transmission system, method, device, equipment and medium
CN116204335A (en) Block generation method and device

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