CN112667647A - Block chain transaction data transmission method and device - Google Patents

Block chain transaction data transmission method and device Download PDF

Info

Publication number
CN112667647A
CN112667647A CN202011456673.XA CN202011456673A CN112667647A CN 112667647 A CN112667647 A CN 112667647A CN 202011456673 A CN202011456673 A CN 202011456673A CN 112667647 A CN112667647 A CN 112667647A
Authority
CN
China
Prior art keywords
real
block
transaction data
bandwidth value
link point
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
CN202011456673.XA
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.)
WeBank Co Ltd
Original Assignee
WeBank 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 WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN202011456673.XA priority Critical patent/CN112667647A/en
Publication of CN112667647A publication Critical patent/CN112667647A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method and a device for transmitting transaction data of a block chain, wherein the method comprises the following steps: acquiring transaction data to be transmitted by a first block link point; the first block chain link point determines a real-time transmission bandwidth value of a transmission channel between the first block chain link point and a second block chain link point; if the transaction data to be transmitted is larger than the real-time transmission bandwidth value, the first block link point divides the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value; the first blockchain node transmits the plurality of transaction data segments to the second blockchain node one by one for a plurality of times. When the method is applied to financial technology (Fintech), transmission failure caused by overlarge transaction data to be transmitted can be avoided, and the transmission efficiency of the transaction data among the block link points is improved.

Description

Block chain transaction data transmission method and device
Technical Field
The invention relates to the field of block chains (blockchain) in the field of financial technology (Fintech), in particular to a transaction data transmission method and device of the block chains.
Background
With the development of computer technology, more and more technologies are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but due to the requirements of the financial industry on safety and real-time performance, higher requirements are also put forward on the technologies. Financial technology (Fintech) is currently associated with block chaining (blockchain) where transaction data is often transmitted between block link points for subsequent block generation and consensus.
Because the transaction data is transmitted between the blockchain nodes in many cases by a broadcasting mode, for example, the transaction data is directly broadcast by the blockchain nodes, or the transaction data broadcast by other blockchain nodes is forwarded. If the nodes are left to forward/broadcast the received transaction data, the bandwidth of the transmission channel between the blockchain nodes is occupied, and thus the large-area transaction data transmission fails. Moreover, the network condition of the transmission channel is not stable, and the nodes are supposed to forward/broadcast the received transaction data, which may cause a large amount of transaction data packet loss or transmission failure, which may result in low transmission efficiency of the transaction data among the blockchain nodes.
Disclosure of Invention
The invention provides a method and a device for transmitting transaction data of a block chain, which solve the problem of low transmission efficiency of the transaction data among block chain nodes in the prior art.
In a first aspect, the present invention provides a method for transmitting transaction data of a blockchain, including:
acquiring transaction data to be transmitted by a first block link point;
the first block chain link point determines a real-time transmission bandwidth value of a transmission channel between the first block chain link point and a second block chain link point;
if the transaction data to be transmitted is larger than the real-time transmission bandwidth value, the first block link point divides the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value;
the first blockchain node transmits the plurality of transaction data segments to the second blockchain node one by one for a plurality of times.
In the above manner, after the first block link point obtains the transaction data to be transmitted, the transaction data to be transmitted is not directly transmitted to the second block link node, but a real-time transmission bandwidth value of a transmission channel between the first block link point and the second block link node is determined, when the transaction data to be transmitted is greater than the real-time transmission bandwidth value, the transaction data to be transmitted is split into a plurality of transaction data fragments according to a first preset fragmentation strategy, the transaction data fragments are transmitted to the second block link node in batches, and any transaction data fragment is smaller than the real-time transmission bandwidth value, so that the transaction data to be transmitted which is greater than the real-time transmission bandwidth value is prevented from being directly transmitted, transmission failure due to the fact that the transaction data to be transmitted is too large is avoided, and the transmission efficiency of the transaction data between the block link points is improved.
Optionally, the determining, by the first block link point, a real-time transmission bandwidth value of a transmission channel between the first block link point and the second block link node includes:
the first block chain link point detects the transmission channel and determines a real-time detection bandwidth value of the transmission channel;
and the first block link point determines the real-time transmission bandwidth value at least according to the real-time detection bandwidth value.
In the method, the first block link point determines the real-time transmission bandwidth value by detecting the transmission channel in real time, so that the real-time transmission bandwidth value is real-time, and the upper limit for splitting a plurality of transaction data fragments is further dynamically determined, so that the transmission success rate of the transaction data fragments to be transmitted is higher, and the transmission efficiency of the transaction data among the block link points is improved.
Optionally, the detecting the transmission channel by the first block link point, and determining a real-time detection bandwidth value of the transmission channel includes:
if the target dynamic interval does not meet the detection termination condition, executing:
the first block chain node sends a detection message of a target length to the second block chain node; the target length is located in a target dynamic interval;
if the first block chain node does not receive the detection success response message of the detection message, updating the interval upper limit value of the target dynamic interval according to the target length, so that the interval upper limit value is not greater than the target length; returning to the step that the first block chain node sends a detection message of a target length to the second block chain node;
if the first block chain node receives a detection success response message of the detection message, updating an interval lower limit value of the target dynamic interval according to the target length, so that the interval lower limit value is not smaller than the target length; returning to the step that the first block chain node sends a detection message of a target length to the second block chain node;
and when the target dynamic interval meets the detection termination condition, the first block link node takes the target length as the real-time detection bandwidth value.
In the method, the first block chain node sends a detection message of a target length to the second block chain node, and the target dynamic interval is continuously adjusted, so that the target length is maximized, namely the real-time detection bandwidth value is maximized on the premise that detection is successful, and transaction data can be transmitted more on the basis of higher transmission success rate.
Optionally, the target length is a median of the target dynamic interval;
the updating the interval upper limit value of the target dynamic interval according to the target length so that the interval upper limit value is not greater than the target length comprises:
according to the target length, taking the target length as an updated interval upper limit value of the target dynamic interval;
the updating the lower limit value of the target dynamic interval according to the target length to enable the lower limit value of the interval not to be smaller than the target length includes:
and according to the target length, taking the target length as the updated lower limit value of the target dynamic interval.
In the above manner, the target length obtained each time is the median of the target dynamic interval, and the target length is used as the interval upper limit value or the interval lower limit value for adjustment according to the detection condition, so that the real-time detection bandwidth value is determined more quickly.
Optionally, the determining, by the first block link point, the real-time transmission bandwidth value according to at least the real-time detection bandwidth value includes:
and if at least one historical transmission bandwidth value of the transmission channel exists, determining the real-time transmission bandwidth value by the first block link point according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
In the above manner, if at least one historical transmission bandwidth value of the transmission channel exists, the historical transmission bandwidth value and the real-time detection bandwidth value can be jointly referred to, so that the inaccuracy of the real-time transmission bandwidth value caused by the detection error of the real-time detection bandwidth value is avoided.
Optionally, the determining, by the first block link point, the real-time transmission bandwidth value according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value includes:
the first block link point determining a first mean value of the at least one historical transmission bandwidth value; and the first block link point takes the first average value and a second average value of the real-time detection bandwidth values as the real-time transmission bandwidth values.
In the above manner, by using the first average value and the second average value of the real-time detection bandwidth value, the historical average transmission bandwidth value is referred to, so that the real-time transmission bandwidth value is more accurate.
Optionally, the first block link point determines a plurality of block data to be acquired from the second block link point;
the first block link point divides the plurality of block data into a plurality of sections of block data according to a second preset fragmentation strategy; any one section of block data in the plurality of sections of block data is smaller than the real-time transmission bandwidth value;
and the first block chain node acquires the multi-segment block data from the second block chain node segment by segment for multiple times.
In this way, when the first block link point needs to acquire a plurality of block data from the second block link point, the first block link point is also split into a plurality of segments of block data according to a second preset fragmentation strategy, so that the plurality of segments of block data are acquired from the second block link point in a plurality of times segment by segment without acquiring the block data singly, and the transmission efficiency is increased.
In a second aspect, the present invention provides a blockchain transaction data transmission device, including:
the acquisition module is used for acquiring transaction data to be transmitted;
the determining module is used for determining the real-time transmission bandwidth value of a transmission channel between the determining module and the second block link node;
the processing module is used for splitting the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy if the transaction data to be transmitted is larger than the real-time transmission bandwidth value; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value; transmitting the plurality of transaction data segments one by one to the second blockchain node in multiple times.
Optionally, the determining module is specifically configured to:
detecting the transmission channel, and determining a real-time detection bandwidth value of the transmission channel;
and determining the real-time transmission bandwidth value at least according to the real-time detection bandwidth value.
Optionally, the determining module is specifically configured to:
if the target dynamic interval does not meet the detection termination condition, executing:
sending a detection message of a target length to the second block link point; the target length is located in a target dynamic interval;
if the detection success response message of the detection message is not received, updating the interval upper limit value of the target dynamic interval according to the target length, so that the interval upper limit value is not larger than the target length; returning to the step of sending a probe message of a target length to the second block link point;
if the detection success response message of the detection message is received, updating the interval lower limit value of the target dynamic interval according to the target length, so that the interval lower limit value is not smaller than the target length; returning to the step of sending a probe message of a target length to the second block link point;
and when the target dynamic interval meets the detection termination condition, taking the target length as the real-time detection bandwidth value.
Optionally, the target length is a median of the target dynamic interval; the determining module is specifically configured to: according to the target length, taking the target length as an updated interval upper limit value of the target dynamic interval; and according to the target length, taking the target length as the updated lower limit value of the target dynamic interval.
Optionally, the determining module is specifically configured to: and if at least one historical transmission bandwidth value of the transmission channel exists, determining the real-time transmission bandwidth value according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
Optionally, the determining module is specifically configured to: determining a first average of the at least one historical transmission bandwidth value; and taking the first average value and a second average value of the real-time detection bandwidth value as the real-time transmission bandwidth value.
Optionally, the determining module is further configured to: determining a plurality of block data to be acquired from the second blockchain node;
the processing module is further configured to:
dividing the plurality of block data into a plurality of sections of block data according to a second preset slicing strategy; any one section of block data in the plurality of sections of block data is smaller than the real-time transmission bandwidth value; and acquiring the multi-segment block data from the second block link point segment by segment in multiple times.
The advantageous effects of the second aspect and the various optional apparatuses of the second aspect may refer to the advantageous effects of the first aspect and the various optional methods of the first aspect, and are not described herein again.
In a third aspect, the present invention provides a computer device comprising a program or instructions for performing the method of the first aspect and the alternatives of the first aspect when the program or instructions are executed.
In a fourth aspect, the present invention provides a storage medium comprising a program or instructions which, when executed, is adapted to perform the method of the first aspect and the alternatives of the first aspect.
These and other aspects of the invention are apparent from and will be elucidated with reference to the embodiments described hereinafter.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without inventive exercise.
Fig. 1 is a flowchart illustrating a method for transmitting transaction data of a block chain according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a block chain transaction data transmission device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the present invention will be described in further detail with reference to the accompanying drawings, and it is apparent that the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Transaction avalanche: if the bandwidth will be full if each node forwards/broadcasts the received transaction without restriction, then the forwarding/broadcasting transaction will fail extensively, a phenomenon known as transaction avalanche.
Service SDK: various transaction middleware code packages are developed, such as WeEvent and WeID. They cross the blockchain on the back end and the front end receives the user's call request.
Maximum bandwidth: a transmission path from a transmitting end to a receiving end is called a transmission channel. The maximum bandwidth mb (max bandwidth) of a transmission channel depends on the maximum uplink bandwidth mbsend at the sender and the maximum downlink bandwidth mbrevecer at the receiver. MB ═ Min (mbsend, MBReveicer). The theoretical maximum bandwidth of the node is the maximum bandwidth allocated by the cloud service provider or the ISP.
Block chain state synchronization: state synchronization is to keep the state of blockchain nodes up to date. The old-new state of the block chain refers to the old-new state of the data currently held by the node of the block chain, that is, the block height of the current block held by the node. If a node's block height is the highest block height of the blockchain, then the node has the latest state of the blockchain. Only the node with the latest state can participate in the consensus to perform the consensus of the next new block.
During the operation of financial institutions (banking, insurance or security), such as loan, deposit and the like of banks, transaction data is often transmitted between block link points for subsequent block generation and consensus. If the nodes are left to forward/broadcast the received transaction data, the bandwidth of the transmission channel between the blockchain nodes is occupied, and thus the large-area transaction data transmission fails. Resulting in inefficient transmission of transaction data between blockchain nodes. This situation does not meet the requirements of financial institutions such as banks, and the efficient operation of various services of the financial institutions cannot be ensured. To this end, as shown in fig. 1, the present application provides a method for transmitting transaction data of a blockchain.
Step 101: the first block link point obtains transaction data to be transmitted.
Step 102: and the first block chain link point determines the real-time transmission bandwidth value of a transmission channel between the first block chain link point and the second block chain link point.
Step 103: if the transaction data to be transmitted is larger than the real-time transmission bandwidth value, the first block link point divides the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy.
Any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value.
Step 104: the first blockchain node transmits the plurality of transaction data segments to the second blockchain node one by one for a plurality of times.
In the methods in steps 101 to 104, for example, the first blockchain node receives a broadcast message sent by the service SDK or another node, where the size of the broadcast message is Smsg, and a target blockchain node of the broadcast message, such as the second blockchain node, may be selected according to a preset broadcast policy.
For each target block chain node, taking the second block chain node as an example, the first block chain node needs to calculate the real-time dynamic bandwidth RDB of the second block chain node.
If the broadcast message (transaction data to be transmitted) is larger than the RDB, fragmenting the broadcast message according to a first preset fragmentation strategy, and then sending each fragmentation message to a second block chain node if the size of each fragmentation message is 0.8 RDB; if the size Smsg of the broadcast message (transaction data to be transmitted) is smaller than the RDB, the broadcast message is directly sent to the node to be broadcast.
And for each target block chain node, completing the broadcasting of all block chain link point messages according to the step of the second block chain node.
It should be noted that, in a specific implementation, the following manner may be adopted:
when each service participant of the block chain builds the block chain, a block chain bandwidth table can be built in the block chain, and the bandwidth size of a transmission channel between block chain nodes is recorded. The procedure for establishing the bandwidth table is as follows:
all service participants jointly build a block chain network and build and maintain a bandwidth table BWT shown in table 1.
Now, taking the block chain with four nodes Node1, Node2, Node3 and Node4 as an example, the uplink/downlink bandwidths of the four nodes Node1, Node2, Node3 and Node4 are 1M, 5M, 10M and 8M respectively. All the block link points in the block chain acquire the Node bandwidth information of the block chain, for example, the Node1 acquires the Node bandwidth information BW' Node1 of the block chain. Each block link point in the block chain queries the bandwidth table in the block chain.
If the corresponding transmission channel bandwidth data in the bandwidth table is empty, the transmission channel bandwidth data of Node1 and Node2 are empty. Node1 inquires bandwidth BWnode2 of Node2 at the opposite end of transmission channel, and updates Min (BW' Node1, BWnode2) to the bandwidth table.
If the transmission channel bandwidth is not empty, the BWT update procedure is executed.
The block chain node queries BWT in the block chain, and updates data of all transmission channels of the corresponding node by Min (BW' node1, BWnode1, BWnode).
Service SDKs connected to nodes in the blockchain network periodically update BWT locally.
An example of BWT is as follows:
Figure BDA0002829585260000091
TABLE 1
In the above example, a real-time bandwidth table of the blockchain network may be constructed and maintained at each blockchain link point during the blockchain establishment period, indicating the real-time bandwidth size of data transmission between the blockchain nodes.
In an alternative embodiment, step 102 may specifically be as follows:
step (1): and the first block chain link point detects the transmission channel and determines the real-time detection bandwidth value of the transmission channel.
Step (2): and the first block link point determines the real-time transmission bandwidth value at least according to the real-time detection bandwidth value.
For example, the manner of step (1) may be to randomly select k1 times of the preset transmission bandwidth value of the transmission channel, where k1 is a positive real number, and if the detection is successful, the real-time detection bandwidth value of the transmission channel is used as the real-time detection bandwidth value of the transmission channel.
The manner of step (2) may be that the first block link point uses the real-time detection bandwidth value as the real-time transmission bandwidth value, and may further process the real-time detection bandwidth value by multiplying the real-time detection bandwidth value by a coefficient k2, for example, to use the result as the real-time transmission bandwidth value.
Specifically, in an alternative embodiment, the step (1) may specifically be:
if the target dynamic interval does not meet the detection termination condition, executing:
step (a): and the first block chain node sends a detection message of a target length to the second block chain node.
The target length is located in a target dynamic interval.
Step (b): and if the first block chain node does not receive the detection success response message of the detection message, updating the interval upper limit value of the target dynamic interval according to the target length, so that the interval upper limit value is not greater than the target length.
And (c) returning to the step (a) after the step (b) is executed.
Step (c): and if the first block chain node receives a detection success response message of the detection message, updating the interval lower limit value of the target dynamic interval according to the target length, so that the interval lower limit value is not less than the target length.
And (c) returning to the step (a) after the step (c) is executed.
Step (d): and when the target dynamic interval meets the detection termination condition, the first block link node takes the target length as the real-time detection bandwidth value.
In the steps (a) to (d), the detection termination condition may be: the length of the target dynamic interval is greater than a predetermined length, such as 10 KB.
In an alternative embodiment, the target length is a median value of the target dynamic interval; the step of updating the interval upper limit value of the target dynamic interval in step (b) may specifically be:
and according to the target length, taking the target length as an updated interval upper limit value of the target dynamic interval.
The step of updating the interval lower limit value of the target dynamic interval in step (c) may specifically be:
and according to the target length, taking the target length as the updated lower limit value of the target dynamic interval.
Specifically, RTB (Real-time transmission bandwidth) is a Real-time bandwidth value of a block link point at a certain time. Factors affecting RTB may be: continuous or intermittent bandwidth occupancy effects of MBs and other applications may default to RTB < MB. The RTB of one transmission channel can be detected, the length of a target dynamic interval is determined to be 10KB, the size of the target dynamic interval can be adjusted according to the resource allocation condition of each block chain link point in a block chain, and the balance of the detection time length of the real-time transmission bandwidth value and the transmission rate is achieved.
The detection process for detecting the bandwidth value in real time can be as follows:
step (1-1): the first tile link point Node1 queries BWT to obtain the MB of the second tile link point Node 2.
Step (1-2): the first chunk link Node1 prepares a probe fragment message, where the target dynamic range is initially [0, MB ] and the predetermined length is 10 KB.
Step (1-3): the first block link Node1 first sends a probe message with size of CHUNK1 ═ 0+ (MB-0)/2 and including a probe identifier, to probe the network real-time bandwidth of the transmission channel between Node1 and Node 2.
Step (1-4): after receiving the message with the probe fragment, the second zone link Node2 sends a null fragment message containing a successful probe identifier to the first zone link Node 1.
Step (1-5): if the first block Node1 receives the null fragment message identified by successful probing, it uses the re-calculated probing fragment size of CHUNK2 ═ (CHUNK1+ (MB-CHUNK 1)/s), and sends the fragment message with size of CHUNK2 and containing the probing identifier to probe the network real-time bandwidth of the channel, where s is a positive real number, for example, s is 2.
Step (1-6): if the first block link Node1 does not receive the fragment message with the detection successful identifier, the size CHUNK2 of the detection message is calculated again as (0+ (CHUNK1-0)/s), and the fragment message with the size CHUNK2 and containing the detection identifier is sent to detect the network real-time bandwidth of the transmission channel.
And (4) repeating the processes from the step (1-3) to the step (1-6) for detection.
Step (1-7): when the length of the probe message is less than the preset length of 10KB, that is, when the value of ((chunk-chunk)/s) in the probe tile size calculated using the dichotomy is less than 10KB, the first tile link Node1 stops probing and acquires the final probe message size CHUNKx.
In the above manner, the real-time transmission bandwidth of one transmission channel is detected by sending a detection message with a size between zero and the maximum transmission bandwidth. And then calculating the real-time transmission bandwidth value of one transmission channel by combining the historical transmission bandwidth values of the transmission channels. When the information broadcasting or the block downloading synchronization of the block chain is required to be carried out on the block chain, the number of the fragments of the broadcasting information and the block to be downloaded is determined according to the real-time transmission bandwidth value, then the broadcasting information is sent in a circulating mode or the block data to be synchronized is downloaded, and the efficiency of the block chain information broadcasting and the block chain synchronization is improved.
One specific implementation manner of the step (2) may be:
and if at least one historical transmission bandwidth value of the transmission channel exists, determining the real-time transmission bandwidth value by the first block link point according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
For example, the first block link point determines the real-time transmission bandwidth value according to a weighted average of the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
More specifically, the above embodiment may be:
the first block link point determines a first average of the at least one historical transmission bandwidth value.
And the first block link point takes the first average value and a second average value of the real-time detection bandwidth values as the real-time transmission bandwidth values.
The specific implementation process can be as follows:
the real-time bandwidth of data transmission of each block link point in the block chain has a strong correlation with the bandwidth occupation of other applications of the block chain node, and a historical transmission bandwidth data HTB (historical transmission bandwidth) table can be locally established at the block link point, so that the actual bandwidth data of the block link point and each block link point during data transmission is recorded. And recording the transmission bandwidth data of nearly N times in the HTB, and updating the actual bandwidth corresponding to the current transmission rate into the HTB after the data is successfully transmitted for one time.
Table 2 is an example of the HTB table of Node 1. Node1 historical transmission bandwidth table:
Figure BDA0002829585260000131
TABLE 2
The specific way for determining the real-time transmission bandwidth value according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value by the first block link point may be:
a Real-time dynamic bandwidth RDB (Real-time dynamic bandwidth) is a bandwidth size determined in Real time when a node is to send a large file or data, and a sending end determines the size of a data fragment through the RDB when sending data, thereby obtaining optimal transmission efficiency.
The value of the RDB depends on the values of the RTB and the HTB, when the value of the HTB is zero, the data is sent for the first time, and the bandwidth data detected in real time is used as the value of the RDB; when HTB is not zero, we use the mean of the two numbers RTB and HTB means as RDB to improve bandwidth predictability and respond to network changes quickly. An example of RDB calculation is shown below:
when the first blockchain Node1 wants to send data to other blockchain nodes (e.g., the second blockchain Node), the RDB is calculated by the following formula:
Figure BDA0002829585260000132
Figure BDA0002829585260000133
and the sum of the real-time transmission bandwidth values representing the histories of the first block chain and the second block chain is zero, which indicates that the real-time transmission bandwidth value is not recorded in the histories.
In an alternative embodiment, when acquiring the block, a manner similar to steps 101 to 104 may also be adopted, specifically:
the first block link point determines a plurality of block data to be acquired from the second block link node.
The first block link point divides the plurality of block data into a plurality of sections of block data according to a second preset slicing strategy.
And any one of the plurality of sections of block data is smaller than the real-time transmission bandwidth value.
And the first block chain node acquires the multi-segment block data from the second block chain node segment by segment for multiple times.
Step (2-1): and when the first blockchain node (assuming that the block height of the first blockchain node is N) is a new node or a down node, broadcasting a message of the self state to the blockchain after the first blockchain node is connected to the blockchain again.
Step (2-2): and after receiving the states of other block chain nodes in the block chain, the first block chain link point acquires block height information (assuming that the block height is M) and compares the block height information with the block height N of the first block chain link point.
Step (2-3): if the first block chain node is a newly added block chain node, the height difference between the newly added block chain node and other block chain node blocks in the block chain is M; if the first block link node is a down block link node, the height difference between the first block link node and other block link nodes in the block link is M-N; if M or M-N is not zero, the process of acquiring block chain data in the block chain link point is started, and the specific acquiring mode may be downloading.
Step (2-4): and (c) calculating the real-time transmission bandwidth value RTB of the first block link point and each other block chain node in the block chain by the first block link point in the modes of the steps (a) to (d).
Step (2-5): and after the real-time transmission bandwidth value is obtained, calculating the block height range which needs to be read from each block chain node according to the real-time transmission bandwidth value.
Step (2-6): for each block link node, such as a second block link node, a first block link point needs to request a different amount of block data from a second block link point according to the block height range between the first block link point and the second block link point. (assume that the chunk data size that needs to be obtained from chunk link point Node2 is Snode 2).
Step (2-7): when the Snode2 is larger than the real-time transmission bandwidth value acquired in the step (2-4), segmenting a plurality of block data to be acquired, wherein each segmented block data is smaller than the real-time transmission bandwidth value, and acquiring segmented block data; and (3) when the Snode2 is smaller than the real-time transmission bandwidth value acquired in the step (2-4), directly requesting the node Snode2 data to complete the synchronization of the block data.
And (5) repeating the steps (2-6) and (2-7) to complete the synchronization of the multiple pieces of block data, so that the multiple pieces of block data are acquired from the second block link point segment by segment in multiple times, and the synchronization of the multiple pieces of block data is completed.
As shown in fig. 2, the present invention provides a block chain transaction data transmission device, including:
an obtaining module 201, configured to obtain transaction data to be transmitted;
a determining module 202, configured to determine a real-time transmission bandwidth value of a transmission channel between the node and a second blockchain node;
the processing module 203 is configured to split the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation policy if the transaction data to be transmitted is greater than the real-time transmission bandwidth value; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value; transmitting the plurality of transaction data segments one by one to the second blockchain node in multiple times.
Optionally, the determining module 202 is specifically configured to:
detecting the transmission channel, and determining a real-time detection bandwidth value of the transmission channel;
and determining the real-time transmission bandwidth value at least according to the real-time detection bandwidth value.
Optionally, the determining module 202 is specifically configured to:
if the target dynamic interval does not meet the detection termination condition, executing:
sending a detection message of a target length to the second block link point; the target length is located in a target dynamic interval;
if the detection success response message of the detection message is not received, updating the interval upper limit value of the target dynamic interval according to the target length, so that the interval upper limit value is not larger than the target length; returning to the step of sending a probe message of a target length to the second block link point;
if the detection success response message of the detection message is received, updating the interval lower limit value of the target dynamic interval according to the target length, so that the interval lower limit value is not smaller than the target length; returning to the step of sending a probe message of a target length to the second block link point;
and when the target dynamic interval meets the detection termination condition, taking the target length as the real-time detection bandwidth value.
Optionally, the target length is a median of the target dynamic interval; the determining module 202 is specifically configured to: according to the target length, taking the target length as an updated interval upper limit value of the target dynamic interval; and according to the target length, taking the target length as the updated lower limit value of the target dynamic interval.
Optionally, the determining module 202 is specifically configured to: and if at least one historical transmission bandwidth value of the transmission channel exists, determining the real-time transmission bandwidth value according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
Optionally, the determining module 202 is specifically configured to: determining a first average of the at least one historical transmission bandwidth value; and taking the first average value and a second average value of the real-time detection bandwidth value as the real-time transmission bandwidth value.
Optionally, the determining module 202 is further configured to: determining a plurality of block data to be acquired from the second blockchain node;
the processing module 203 is further configured to:
dividing the plurality of block data into a plurality of sections of block data according to a second preset slicing strategy; any one section of block data in the plurality of sections of block data is smaller than the real-time transmission bandwidth value; and acquiring the multi-segment block data from the second block link point segment by segment in multiple times.
Based on the same inventive concept, embodiments of the present invention also provide a computer device, which includes a program or instructions, and when the program or instructions are executed, the transaction data transmission method of the blockchain and any optional method provided by the embodiments of the present invention are executed.
Based on the same inventive concept, embodiments of the present invention also provide a computer-readable storage medium, which includes a program or instructions, and when the program or instructions are executed, the transaction data transmission method of the blockchain and any optional method provided by the embodiments of the present invention are executed.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. A method for transmitting transaction data of a block chain is characterized by comprising the following steps:
acquiring transaction data to be transmitted by a first block link point;
the first block chain link point determines a real-time transmission bandwidth value of a transmission channel between the first block chain link point and a second block chain link point;
if the transaction data to be transmitted is larger than the real-time transmission bandwidth value, the first block link point divides the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value;
the first blockchain node transmits the plurality of transaction data segments to the second blockchain node one by one for a plurality of times.
2. The method of claim 1, wherein the determining a real-time transmission bandwidth value for a transmission channel between the first block link point and the second block link point comprises:
the first block chain link point detects the transmission channel and determines a real-time detection bandwidth value of the transmission channel;
and the first block link point determines the real-time transmission bandwidth value at least according to the real-time detection bandwidth value.
3. The method of claim 2, wherein the first block link point probing the transport channel, determining a real-time probing bandwidth value for the transport channel, comprises:
if the target dynamic interval does not meet the detection termination condition, executing:
the first block chain node sends a detection message of a target length to the second block chain node; the target length is located in a target dynamic interval;
if the first block chain node does not receive the detection success response message of the detection message, updating the interval upper limit value of the target dynamic interval according to the target length, so that the interval upper limit value is not greater than the target length; returning to the step that the first block chain node sends a detection message of a target length to the second block chain node;
if the first block chain node receives a detection success response message of the detection message, updating an interval lower limit value of the target dynamic interval according to the target length, so that the interval lower limit value is not smaller than the target length; returning to the step that the first block chain node sends a detection message of a target length to the second block chain node;
and when the target dynamic interval meets the detection termination condition, the first block link node takes the target length as the real-time detection bandwidth value.
4. The method of claim 3, wherein the target length is a median value of the target dynamic interval;
the updating the interval upper limit value of the target dynamic interval according to the target length so that the interval upper limit value is not greater than the target length comprises:
according to the target length, taking the target length as an updated interval upper limit value of the target dynamic interval;
the updating the lower limit value of the target dynamic interval according to the target length to enable the lower limit value of the interval not to be smaller than the target length includes:
and according to the target length, taking the target length as the updated lower limit value of the target dynamic interval.
5. The method of claim 2, wherein determining the real-time transmission bandwidth value from at least the real-time probing bandwidth value by the first block link point comprises:
and if at least one historical transmission bandwidth value of the transmission channel exists, determining the real-time transmission bandwidth value by the first block link point according to the at least one historical transmission bandwidth value and the real-time detection bandwidth value.
6. The method of claim 5, wherein the determining the real-time transmission bandwidth value by the first block link point based on the at least one historical transmission bandwidth value and the real-time probing bandwidth value comprises:
the first block link point determining a first mean value of the at least one historical transmission bandwidth value;
and the first block link point takes the first average value and a second average value of the real-time detection bandwidth values as the real-time transmission bandwidth values.
7. The method of any of claims 1 to 6, further comprising:
the first block link point determines a plurality of block data to be acquired from the second block link point;
the first block link point divides the plurality of block data into a plurality of sections of block data according to a second preset fragmentation strategy; any one section of block data in the plurality of sections of block data is smaller than the real-time transmission bandwidth value;
and the first block chain node acquires the multi-segment block data from the second block chain node segment by segment for multiple times.
8. A blockchain transaction data transmission apparatus, comprising:
the acquisition module is used for acquiring transaction data to be transmitted;
the determining module is used for determining the real-time transmission bandwidth value of a transmission channel between the determining module and the second block link node;
the processing module is used for splitting the transaction data to be transmitted into a plurality of transaction data segments according to a first preset fragmentation strategy if the transaction data to be transmitted is larger than the real-time transmission bandwidth value; any transaction data segment in the plurality of transaction data segments is smaller than the real-time transmission bandwidth value; transmitting the plurality of transaction data segments one by one to the second blockchain node in multiple times.
9. A computer device comprising a program or instructions that, when executed, perform the method of any of claims 1 to 7.
10. A computer-readable storage medium comprising a program or instructions which, when executed, perform the method of any of claims 1 to 7.
CN202011456673.XA 2020-12-11 2020-12-11 Block chain transaction data transmission method and device Pending CN112667647A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011456673.XA CN112667647A (en) 2020-12-11 2020-12-11 Block chain transaction data transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011456673.XA CN112667647A (en) 2020-12-11 2020-12-11 Block chain transaction data transmission method and device

Publications (1)

Publication Number Publication Date
CN112667647A true CN112667647A (en) 2021-04-16

Family

ID=75402526

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011456673.XA Pending CN112667647A (en) 2020-12-11 2020-12-11 Block chain transaction data transmission method and device

Country Status (1)

Country Link
CN (1) CN112667647A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064764A (en) * 2021-04-19 2021-07-02 支付宝(杭州)信息技术有限公司 Method and apparatus for performing blocks in a blockchain system
CN114338770A (en) * 2021-12-27 2022-04-12 杭州趣链科技有限公司 Cross-block-chain data processing method and device, storage medium and terminal equipment
CN114564676A (en) * 2022-01-25 2022-05-31 浙江数秦科技有限公司 Method for improving data transmission efficiency of block chain network
CN114567596A (en) * 2022-01-24 2022-05-31 浙江数秦科技有限公司 Data fast exchange method for block chain
CN114745101A (en) * 2022-02-21 2022-07-12 北京航空航天大学 Hidden information transmission method and device based on multiple block chains

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113064764A (en) * 2021-04-19 2021-07-02 支付宝(杭州)信息技术有限公司 Method and apparatus for performing blocks in a blockchain system
CN113064764B (en) * 2021-04-19 2023-10-27 支付宝(杭州)信息技术有限公司 Method and apparatus for executing blocks in a blockchain system
CN114338770A (en) * 2021-12-27 2022-04-12 杭州趣链科技有限公司 Cross-block-chain data processing method and device, storage medium and terminal equipment
CN114567596A (en) * 2022-01-24 2022-05-31 浙江数秦科技有限公司 Data fast exchange method for block chain
CN114567596B (en) * 2022-01-24 2024-04-05 浙江数秦科技有限公司 Data quick exchange method for block chain
CN114564676A (en) * 2022-01-25 2022-05-31 浙江数秦科技有限公司 Method for improving data transmission efficiency of block chain network
CN114745101A (en) * 2022-02-21 2022-07-12 北京航空航天大学 Hidden information transmission method and device based on multiple block chains

Similar Documents

Publication Publication Date Title
CN112667647A (en) Block chain transaction data transmission method and device
CN111277502B (en) Method for transmitting data by multi-link aggregation and transmitting equipment
CN109195195B (en) LoRa network channel access method, terminal, gateway, server and system
CN109787868B (en) Method, system and server for selecting routing path
US9148477B2 (en) Methods and apparatus for communicating in a wireless system
CN109412677B (en) Communication broadcast self-adaptive fusion method in satellite-ground cooperative block chain system
CN103269260A (en) Data transmission method, data receiving terminal, data sending terminal and data transmission system
CN1240071A (en) Method and apparatus for synchronized communication over wireless backbone architecture
KR100273407B1 (en) Two tier adaptive random protocol
CN101582842A (en) Congestion control method and congestion control device
TWI603639B (en) Data transmission method, device and system
WO2019179157A1 (en) Data traffic processing method and related network device
CN113329413B (en) Multipath transmission data pre-scheduling method and system for high-speed rail scene
CN113783775B (en) Method and device for data transmission
CN114980199B (en) Data transmission control method for multi-communication link fusion and satellite communication system
CN109982439B (en) Channel resource allocation method of D2D communication system based on cellular network
EP3739815B1 (en) Method, system and device for determining transmission quality of node, and server
CN103595552B (en) Analysis method and analysis system for cluster storage network parallel load
CN110808917B (en) Multilink aggregation data retransmission method and transmitting equipment
US11258849B2 (en) Congestion notification to a node not yet joined to a network, resulting in a dynamic join time
CN117082054A (en) Data transmission method, device, system and medium
CN113765703B (en) Data transmission switching control method and system of intelligent gateway
CN110750486A (en) RDMA data stream control method, system, electronic device and readable storage medium
CN114501650A (en) Time slot resource allocation method, equipment and storage medium
CN106712874B (en) Management method and management device of wireless spectrum resources and data sending end

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