CN115865673B - Block chain data distribution acceleration method, device, equipment and readable storage medium - Google Patents
Block chain data distribution acceleration method, device, equipment and readable storage medium Download PDFInfo
- Publication number
- CN115865673B CN115865673B CN202211520984.7A CN202211520984A CN115865673B CN 115865673 B CN115865673 B CN 115865673B CN 202211520984 A CN202211520984 A CN 202211520984A CN 115865673 B CN115865673 B CN 115865673B
- Authority
- CN
- China
- Prior art keywords
- block
- written
- cross
- height
- transmission link
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 69
- 230000001133 acceleration Effects 0.000 title claims abstract description 27
- 230000005540 biological transmission Effects 0.000 claims abstract description 130
- 238000012795 verification Methods 0.000 claims abstract description 81
- 230000002618 waking effect Effects 0.000 claims abstract description 11
- 238000002790 cross-validation Methods 0.000 claims description 53
- 230000002159 abnormal effect Effects 0.000 claims description 6
- 238000004590 computer program Methods 0.000 claims description 6
- 238000004891 communication Methods 0.000 abstract description 13
- 230000000694 effects Effects 0.000 abstract description 3
- 238000012545 processing Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 4
- 230000007246 mechanism Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000003491 array Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000006870 function Effects 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 1
- 230000004888 barrier function Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 1
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000037361 pathway Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application relates to a block chain data distribution acceleration method, a device, equipment and a readable storage medium, which relate to the field of communication, and the method comprises the following steps: receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link; sequentially verifying the block file of at least one block to be written according to a preset verification sequence; if the block file verification is successful and the block height of the block to be written is the next block height of the highest block height of the account book, accounting is carried out on the block to be written, which is successfully verified, of the block file, and the accounting is carried out on the block to be written as a written block; if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block to be written is distributed through the data broadcast transmission link, discarding the block to be written and waking up the block chain Pull engine, and pulling the block to be written from other block chain nodes. The application has the effect of reducing the block chain transaction accounting time delay.
Description
Technical Field
The present application relates to the field of communications technologies, and in particular, to a blockchain data distribution acceleration method, apparatus, device, and readable storage medium.
Background
The regional chain is essentially an accounting method, is formed by combining block links of recorded transaction data generated according to time sequence, and forms a transaction database shared by all nodes in the system, so that the database is maintained in a centralized manner in a decentralization mode, and the regional chain has the characteristics of 'non-falsifiability', 'whole trace', 'traceability', 'disclosure transparency', 'collective maintenance', and the like.
Blockchain billing typically distributes a block of one node to all nodes in a blockchain network using P2P (Peer to Peer) rumor dissemination, where there are generally two ways of inter-node communication: push and Pull, the Push is that after the node receives the new block, select other nodes to Push the block; pull, i.e., node timing or awakened, randomly selects other nodes to Pull the block. In general, the Push method does not need to consider other nodes and network conditions except the bandwidth, and can be used for eager Push. Although the Push method converges fast theoretically, the Push method has a lot of communication interactions with other nodes, needs to consider other nodes and network conditions, and is not likely to be dense when actually called, so that the Push method is often lazy.
In P2P rumor dissemination, because the blockchain cannot continue with a Push without stop, there is generally a mechanism like "immune barrier" in the blockchain to stop the Push, but such a mechanism also causes "long tail nodes" in the blockchain to not receive pushed blocks late. Meanwhile, in order to avoid bandwidth competition with Push, a generally adopted Lazy Push mechanism is adopted in the Pull mode in the system, and as the nodes cannot learn the newly transmitted block information and lack a good and accurate Pull triggering mode, the synchronous efficiency of rumor broadcasting is low, and the block chain transaction accounting time delay is increased.
Disclosure of Invention
To reduce blockchain transaction billing latency, the present application provides a blockchain data distribution acceleration method, apparatus, device and readable storage medium.
In a first aspect, the present application provides a blockchain data distribution acceleration method, which adopts the following technical scheme:
A blockchain data distribution acceleration method applied to blockchain nodes, the method comprising:
receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
sequentially verifying the block file of the at least one block to be written according to a preset verification sequence;
for any block to be written, if the block file verification is successful and the block height of the block to be written is the next block height of the highest block height of the account book, accounting is carried out on the block to be written, which is successfully verified, of the block file, and the accounting is carried out on the block to be written, which is successfully verified, as a written block;
if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block to be written is distributed through a data broadcast transmission link, discarding the block to be written and waking up a block chain Pull engine, and pulling the block to be written from other block chain nodes;
And if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book, and the block to be written is distributed through a P2P rumor dissemination transmission link, discarding the block to be written.
By adopting the technical scheme, the blockchain data distribution acceleration method of the application distributes the blocks to be written by using the traditional P2P rumor dissemination, and one or more data broadcast transmission links are distributed on the basis of distributing the blocks to be written, which blocks to be written of the transmission links arrive first, the block file verification is performed first, and for the blocks to be written which fail to verify the block file and are distributed through the data broadcast transmission links, the blockchain node wakes up the blockchain Pull engine to Pull the blocks to be written in a distributed way by other blockchain nodes, thereby reducing the time delay caused by retransmission of the data broadcast transmission links, not only improving the block distribution efficiency, but also improving the success rate of block distribution. In addition, a centralized content retransmission server required by retransmission of a traditional data broadcast transmission link is eliminated, and the cost is reduced.
Optionally, if the block file verification fails and the block height of the block to be written is the next block height of the highest block height of the ledger, the method further includes:
and carrying out statistics updating on link quality parameters of the data broadcast transmission link or the P2P rumor dissemination transmission link corresponding to the block to be written.
By adopting the technical scheme, although the distribution of the blocks can be added in a parallel mode of a plurality of transmission links, the possibility of error rate and packet loss rate of the transmission links still exists, so that the block file verification of the block to be written fails, the block chain node carries out statistics update on the link quality of the transmission link corresponding to the block to be written, which fails in the block file verification, timely reminds the upper layer application, and the block chain can conveniently switch and close the data broadcast transmission link according to a preset strategy.
Optionally, after the statistical updating is performed on the link quality parameters of the data broadcast transmission link or the P2P rumor dissemination transmission link corresponding to the block to be written, the method further includes:
And if the link quality of the data broadcast transmission link is good and the time interval of the last wake-up time of the blockchain Pull engine reaches a first preset time interval, executing the step of waking up the blockchain Pull engine.
By adopting the technical scheme, the link quality of the data broadcast transmission link is good, the wake-up blockchain Pull engine goes to surrounding blockchain nodes to Pull blocks to be written in a distributed manner, at the moment, a certain proportion of blockchain nodes in the blockchain account for the blocks to be written and serve as the blocks to be written, so that the blockchain Pull engine is woken up at a good time, the efficiency of successful block transmission is improved, wherein a first preset time interval is set to prevent the blockchain from being attacked, the extremely frequent continuous Pull of the blockchain nodes can be reduced to influence network service, stability and the like of other blockchain links, and the blockchain nodes are protected.
Optionally, after accounting the block to be written that is successfully verified by the block file as a written block, the method further includes:
Setting the state of the written block to wait for cross-validation, and setting the state of the written block to not wait for cross-validation when a second preset time interval is reached;
if the block file verification is successful and the block height of the block to be written is not greater than the highest block height of the ledger, the method further comprises:
judging whether the block heights of the block to be written and the block waiting for cross verification in the account book are the same or not;
If yes, cross-verifying the block to be written and the block with the state waiting for cross-verification in the account book based on a cross-verifying rule; if the cross verification is successful, marking cross verification success information for the block waiting for the cross verification in the account book, and discarding the block waiting for writing; if the cross-validation fails, marking cross-validation failure information for the block waiting for cross-validation in the account book, and discarding the block waiting for writing.
By adopting the technical scheme, as the written blocks which are partially verified by the block files can have the situation of man-in-the-middle camouflage attack, the attack not only affects the safety of the blocks, but also seriously damages the data broadcast transmission link. On the basis that the blocks to be written are distributed simultaneously through the P2P transmission link and one or more data broadcast transmission links, cross verification is additionally carried out, the written blocks with the same block height in the account book are cross verified by the blocks to be written which arrive after the cross verification, so that abnormal blocks are found in time, the safety of the blocks is improved, in addition, after the blocks waiting for cross verification in the account book reach a second preset time interval, the state of the written blocks is set to be not waiting for cross verification, and the state of the written blocks is reduced to be waiting for cross verification all the time, so that the performance of block chain nodes is affected.
Optionally, if the state of the written block is set to be not waiting for cross-validation, the method further comprises:
the block in the ledger that is not waiting for cross-validation marks non-cross-validation information.
Optionally, if the cross-validation fails, the method further includes:
and carrying out statistics updating on the block waiting for cross verification in the account book and the link quality parameters of the transmission link corresponding to the block waiting for writing.
By adopting the technical scheme, the link quality of the transmission link corresponding to the block with the block link point cross verification failure and the link quality parameter of the transmission link corresponding to the block to be written are both statistically updated, and the upper layer application is timely reminded, so that the block chain can conveniently switch and close the data broadcast transmission link according to a preset strategy.
Optionally, after the statistics update is performed on the link quality parameters of the transmission link corresponding to the block waiting for cross-validation and the block waiting for writing in the ledger, the method further includes:
And sending alarm information to an upper layer application, wherein the alarm information is used for reminding the upper layer application that the block waiting for cross validation and the transmission link corresponding to the block waiting for writing are abnormal transmission links.
By adopting the technical scheme, the transmission link corresponding to the block with failed cross-validation and the transmission link corresponding to the block to be written are generally attacked, the block link point sends the alarm information to the upper layer application, and the upper layer application can defend according to a preset strategy, so that the safety of the block chain is improved.
In a second aspect, the present application provides a blockchain data distribution acceleration device, which adopts the following technical scheme:
a blockchain data distribution acceleration device applied to blockchain nodes, the device comprising:
The receiving module is used for receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
The verification module is used for sequentially verifying the block file of the at least one block to be written according to a preset verification sequence;
The accounting module is used for accounting the block to be written which is successfully verified by the block file if the block file is successfully verified and the block height of the block to be written is the next block height of the highest block height of the account book;
The pulling module is used for discarding the block to be written and waking up a block chain Pull engine if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block to be written is distributed through a data broadcast transmission link, and pulling the block to be written from other block chain nodes;
And the recording module is used for discarding any block to be written if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book, and the block to be written is distributed through a P2P rumor dissemination transmission link.
By adopting the technical scheme, the blockchain data distribution acceleration method of the application distributes the blocks to be written by using the traditional P2P rumor dissemination, and one or more data broadcast transmission links are distributed on the basis of distributing the blocks to be written, which blocks to be written of the transmission links arrive first, the block file verification is performed first, and for the blocks to be written which fail to verify the block file and are distributed through the data broadcast transmission links, the blockchain node wakes up the blockchain Pull engine to Pull the blocks to be written in a distributed way by other blockchain nodes, thereby reducing the time delay caused by retransmission of the data broadcast transmission links, not only improving the block distribution efficiency, but also improving the success rate of block distribution. In addition, a centralized content retransmission server required by retransmission of a traditional data broadcast transmission link is eliminated, and the cost is reduced.
In a third aspect, the present application provides a blockchain node device, which adopts the following technical scheme:
a blockchain link point device comprising a memory and a processor, the memory having stored thereon a computer program capable of being loaded by the processor and performing the blockchain data distribution acceleration method of any of the first aspects.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing the blockchain data distribution acceleration method of any of the first aspects.
In summary, the present application includes at least one of the following beneficial technical effects:
1. according to the method for accelerating the block chain data distribution, on the basis of distributing the blocks to be written by using the traditional P2P rumor, one or more data broadcast transmission links are distributed, which blocks to be written of the transmission links arrive first, block file verification is performed first, for the blocks to be written which fail to verify the block file and are distributed through the data broadcast transmission links, the block chain node wakes up the block chain Pull engine to Pull the blocks to be written to other block chain nodes in a distributed mode, time delay caused by retransmission of the data broadcast transmission links is reduced, block distribution efficiency is improved, and success rate of block distribution is improved. In addition, a centralized content retransmission server required by retransmission of a traditional data broadcast transmission link is removed, so that the cost is reduced;
2. Since a written block partially verified by a block file may have a man-in-the-middle masquerading attack, such an attack not only affects the security of the block, but also seriously harms the data broadcast transmission link. On the basis that the blocks to be written are distributed simultaneously through the P2P transmission link and one or more data broadcast transmission links, cross verification is additionally carried out, the written blocks with the same block height in the account book are cross verified by the blocks to be written which arrive after the cross verification, so that abnormal blocks are found in time, the safety of the blocks is improved, in addition, after the blocks waiting for cross verification in the account book reach a preset waiting cross time interval, the state of the written blocks is set to be not waiting for cross verification, and the influence on the performance of block chain nodes due to the fact that the written block states are always waiting for cross verification is reduced.
Drawings
FIG. 1 is a flowchart of a block chain data distribution acceleration method according to an embodiment of the present application.
Fig. 2 is a block diagram of a blockchain data distribution device according to an embodiment of the present application.
FIG. 3 is a block diagram of a blockchain node device in accordance with an embodiment of the application.
Detailed Description
The present application will be described in further detail with reference to the accompanying drawings.
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the technical solutions of the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
In addition, the term "and/or" herein is merely an association relationship describing an association object, and means that three relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist together, and B exists alone. In this context, unless otherwise specified, the term "/" generally indicates that the associated object is an "or" relationship.
The embodiment of the application provides a block chain data distribution acceleration method which can be realized by block chain link points in a block chain network. Blockchains are essentially a ledger that maintains common data, which can be understood as a specially designed database or distributed database that is decentralised or multicentric in such a way that the ledger data of blockchain nodes are agreed upon by consensus algorithms. Data in the ledger is commonly distributed in blocks by one-pass ten-pass hundred-pass among the blockchain nodes in a rumor dissemination mode through a P2P (Peer to Peer) network. The block chain data distribution acceleration method takes block chain link point equipment as an execution main body, wherein the block chain link point equipment can be a server or terminal equipment, the server can be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, a cloud server for providing cloud computing service, the terminal equipment can be a smart phone, a tablet computer, a desktop computer and the like, but the method is not limited to the method.
Embodiments of the application are described in further detail below with reference to the drawings. As shown in fig. 1, the main flow of the method is described as follows (steps S101 to S102):
step S101, receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
In this embodiment, the network layer of the blockchain may be a parallel P2P rumor dissemination transmission link of one data broadcast transmission link, and of course, may also be a parallel P2P rumor dissemination transmission link of a plurality of data broadcast transmission links. The data broadcast transmission link may be any one of a satellite data broadcast transmission link, a terrestrial data broadcast transmission link, a cable television data broadcast transmission link, an EMBMS data broadcast transmission link, an IP multicast transmission link, a CDN transmission link, and the like.
The data broadcast transmission link and the P2P rumor dissemination transmission link form competition to perform block distribution, and the block chain node receives a block to be written distributed through the data broadcast transmission link or the P2P rumor dissemination transmission link, where the block to be written may be in the form of a data file or a data block, and the embodiment is not limited specifically.
Step S102, sequentially verifying the block file of at least one block to be written according to a preset verification sequence;
in this embodiment, the preset verification sequence may be set according to the requirement of the blockchain, and may be arranged in the queues of the blockchain nodes according to the heights of the blocks to be written, or may be arranged in the queues of the blockchain nodes according to the arrival time of the blocks to be written, where the heights of the blocks represent the positions of the blocks in the ledger.
It should be noted that, for the block height arrangement mode, if more than two blocks to be written with the same height exist in the queue, the blocks can be arranged according to the sequence of arrival time; for the blocks to be written with the same arrival time in the queue according to the block arrival time arrangement mode, the blocks can be arranged according to the size sequence of the height of the blocks.
The blockchain node sequentially performs blockfile verification on the blocks to be written in the queue, wherein the blockfile verification comprises, but is not limited to, the format, the integrity and the signature verification of the blocks.
It should be noted that the queue of the blockchain node may store a certain number of blocks to be written, and may discard the blocks to be written having a block height far greater than and/or less than the highest block height of the ledger. For example, if the block link point receives a block with a block height of 300, the block chain node does not perform block file verification on the block to be written, and directly discards the block to be written.
For any block to be written, the block file verification may be performed in the following cases:
(1) If the block file verification is successful and the block height of the block to be written is the next block height of the highest block height of the account book, accounting is carried out on the block to be written which is successful in the block verification, and the accounting is carried out on the block to be written as a written block;
In this embodiment, the highest block height of the ledger is the highest block height of the updated ledger after accounting for the blocks to be written as the written blocks. For example, after the block file verification is passed, accounting is performed on the block to be written with the block height of 101 as the written block, and the block height of the ledger is updated to be 101 according to the block height of the written block, so that the block file verification is performed on the next block height of the ledger with the highest block height, that is, after the block verification with the block height of 101 is successfully performed, the block with the block height of 102 is verified.
(2) If the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block is distributed through the data broadcast transmission link, discarding the block to be written and waking up the block chain Pull engine, and pulling the block from other block chain nodes;
In this embodiment, after the block file fails to verify, the blockchain node needs to determine that the link quality of the data broadcast transmission link is good, and the time interval between the last wake-up time of the blockchain node and the Pull engine reaches the first preset time interval, if yes, the step of waking up the blockchain Pull engine is performed, and the blockchain node pulls the blocks to be written to other blockchain nodes distributed around. Otherwise, the processing is not performed. In this embodiment, the first preset time interval may be preset according to the requirement of the blockchain application.
For poor link quality datacasting transmission links, because the datacasting transmission link quality is degraded, the blocks to be written may not be billed in other surrounding distributed blockchain nodes, so the step of waking up the blockchain Pull engine is not selected to reduce the impact on the network bandwidth, network service and stability of the blockchain link points.
It should be noted that when the blockchain Pull engine is awakened, the link quality of the data broadcast transmission link can be judged to be good when the block to be written is pulled from other blockchain nodes, then the time interval of the last awakening time of the blockchain Pull engine can be judged to reach the first preset time interval, then the link quality of the data broadcast transmission link can be judged to be good, the link quality of the data broadcast transmission link can be judged to be good at the same time, the time interval of the last awakening time of the blockchain Pull engine can reach the first preset time interval, and measures with self-protection properties of other blockchain Pull engines can be added, such as the number of Pull threads, the occupation ratio of the resources of the Pull engine and the like, and the method is not particularly limited in the embodiment.
(3) If the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book, and the block to be written is distributed through the P2P rumor dissemination transmission link, discarding the block to be written.
In this embodiment, if the block file fails to verify, the link quality parameters of the data broadcast transmission link or the P2P rumor broadcast transmission link corresponding to the block to be written need to be statistically updated, so that the upper layer application is reminded in time, and the block chain is convenient to switch or close the transmission link according to a preset policy, so as to ensure the block distribution quality.
For example, the transmission links of the block chain are two transmission links, one is a P2P rumor broadcasting transmission link, and the other is a satellite data broadcasting transmission link, and the satellite data broadcasting transmission link may fail to verify the block file due to the degradation of quality caused by solar storm, so that the upper layer application can switch the satellite data broadcasting transmission link off and switch the other data broadcasting transmission link, such as a CDN transmission link, so that the satellite data broadcasting transmission link is not affected by the solar storm.
According to the block chain data distribution acceleration method, on the basis of distributing blocks to be written by using traditional P2P rumors, one or more data broadcast transmission links are used for distributing the blocks to be written, the blocks to be written of which link arrives first, block file verification is performed first, for the blocks to be written which fail to verify the block file and are distributed through the data broadcast transmission links, a block chain node wakes a block chain Pull engine to Pull the blocks to be written to other block chain nodes in a distributed mode, time delay caused by waiting for block distribution retransmission is reduced, block distribution efficiency is improved, and block distribution success rate is improved. In addition, a centralized content retransmission server required by data broadcast retransmission is eliminated, and the cost is reduced.
Since a written block partially verified by a block file may have a man-in-the-middle masquerading attack, such an attack not only affects the security of the block, but also seriously harms the data broadcast transmission link. Therefore, in order to supervise the quality of the transmission link, prevent the transmission link from being attacked maliciously, and prompt the upper layer application of the blockchain to defend according to a preset defending strategy, the application further optimizes the blockchain data distribution acceleration method.
After accounting the block to be written which is successfully verified by the block, the block chain data distribution acceleration method further comprises the following steps:
Setting the state of the written block to be waiting for cross-validation, and setting the state of the written block to be not waiting for cross-validation when a second preset time interval is reached;
In this embodiment, the waiting cross-validation status of the written block may be configured, and the configuration may be selected to need waiting cross-validation or not according to different applications of the blockchain; the second preset time interval waiting for cross-validation may be preset, and by setting the second preset time interval, the block state of accounting in the ledger is reduced to be always the waiting cross-validation state, which affects the block link point performance.
For cross-verifying any block to be written with a written block, there may be the following cases:
① If the status of the written block is set to wait for cross-validation, the block file is validated successfully and the block height of the block to be written is not greater than the highest block height of the ledger, the method further comprises:
Judging whether the block to be written is identical to the block waiting for cross verification in the state of the account book;
If yes, cross-verifying is carried out on the basis of the cross-verifying rule and the block waiting for cross-verifying in the account book; if the cross-validation is successful, marking the cross-validation success information for the block waiting for the cross-validation in the state of the account book, and discarding the block waiting for writing; if the cross-validation fails, marking the block waiting for the cross-validation as the cross-validation failure information in the account book, and discarding the block waiting for writing.
② If the written block is set to be not waiting for cross-validation, the block in the account book, which is not waiting for cross-validation, is marked as non-cross-validation information.
It should be noted that, the blockchain node may send the written blockmark cross-validation success information and/or the marked cross-validation failure information and/or the unchecked validation information to the upper layer application, where the upper layer application performs further processing.
By receiving the blocks to be written with different heights of the same block and the written blocks with the same height of the same block in the account book for cross verification, the written blocks and the contents of the blocks to be written are verified, so that the situation that the blocks to be written possibly have camouflage is avoided, and the safety of the blocks is improved.
As a further embodiment of blockchain data distribution, if the cross-validation fails, the method includes:
And carrying out statistics updating on link quality parameters of the transmission links corresponding to the blocks waiting for cross verification and the blocks waiting for writing in the account book.
And then, sending alarm information to the upper layer application, wherein the alarm information is used for reminding the upper layer application account book that the block waiting for cross validation and the transmission link corresponding to the block waiting for writing are abnormal transmission links.
The transmission link corresponding to the written block and the transmission link corresponding to the block to be written which fail to cross-verify are generally attacked, the block link point sends alarm information to the upper application, and the upper application can defend according to a preset strategy, so that the safety of the block chain is improved, and the harm to the transmission link is reduced.
Fig. 2 is a block diagram of a blockchain data distribution acceleration device 200 according to an embodiment of the present application.
As shown in fig. 2, the blockchain data distribution acceleration device 200 mainly includes:
A receiving module 201, configured to receive at least one block to be written, where each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
the verification module 202 is configured to sequentially perform block file verification on at least one block to be written according to a preset verification sequence;
The accounting module 203 is configured to, for any block to be written, account for the block to be written that is successfully verified as a written block if the block file is successfully verified and the block height of the block to be written is the next block height of the highest block height of the ledger;
The pulling module 204 is configured to discard the block to be written and wake up the blockchain Pull engine to Pull the block from other blockchain nodes if the block file verification fails, the block height of the block is the next block height of the highest block height of the ledger and the block is distributed through the data broadcast transmission link;
The recording module 205 is configured to discard the block to be written if the block file verification fails, the block height of the block to be written is the block height next to the highest block height of the ledger wall, and the block is distributed through the P2P rumor broadcast transmission link.
As an alternative implementation of the present embodiment, the pulling module 204 includes:
The first statistics sub-module is used for carrying out statistics update on link quality parameters of a data broadcast transmission link or a P2P rumor dissemination transmission link corresponding to the block to be written.
In this optional embodiment, the pulling module 204 further includes a wake-up sub-module, configured to execute a step of waking up the blockchain Pull engine if the link quality of the data broadcast transmission link is good and the time interval of the last wake-up time with the blockchain Pull engine reaches a first preset time interval after the link quality parameter of the data broadcast transmission link or the P2P rumor broadcast transmission link corresponding to the block to be written is statistically updated.
As an alternative implementation of the present embodiment, the blockchain data distribution acceleration device 200 further includes:
The cross verification module is used for counting the blocks to be written which are successfully verified by the blocks, setting the state of the written blocks to be waiting for cross verification after the blocks to be written are used as the written blocks, and setting the state of the written blocks to be not waiting for cross verification when a second preset time interval is reached;
If the block file verification is successful and the block height of the block to be written is not greater than the highest block height of the ledger, the method further comprises:
Judging whether the block to be written is identical with the block in the account book in the block waiting for cross verification in height;
If yes, cross-verifying the block to be written and the block with the state waiting for cross-verification in the account book based on the cross-verifying rule; if the cross-validation is successful, marking cross-validation success information for the block waiting for cross-validation in the account book, and discarding the block waiting for writing; if the cross-validation fails, marking the cross-validation failure information for the block waiting for the cross-validation in the account book, and discarding the block waiting for writing.
In this alternative embodiment, the cross-validation module includes a marking sub-module configured to mark the blocks in the ledger that are not waiting for cross-validation with non-cross-validation information if the status of the written blocks is set to not waiting for cross-validation.
In this optional embodiment, the cross-checking module further includes a second statistics sub-module, configured to perform statistics update on link quality parameters of the transmission link corresponding to the block waiting for cross-checking and the block waiting for writing in the account book if the cross-checking fails.
In this optional embodiment, the cross-checking module further includes an alarm sub-module, configured to send alarm information to an upper layer application after the link quality parameters of the transmission link corresponding to the block waiting for cross-checking and the block waiting for writing in the account book are both statistically updated, where the alarm information is used to remind the upper layer application that the block waiting for cross-checking and the transmission link corresponding to the block waiting for writing in the account book are both abnormal transmission links.
In one example, a module in any of the above apparatuses may be one or more integrated circuits configured to implement the above methods, for example: one or more application specific integrated circuits (application specific integratedcircuit, ASIC), or one or more digital signal processors (DIGITAL SIGNAL processor, DSP), or one or more field programmable gate arrays (field programmable GATE ARRAY, FPGA), or a combination of at least two of these integrated circuit forms.
For another example, when a module in an apparatus may be implemented in the form of a scheduler of processing elements, the processing elements may be general-purpose processors, such as a central processing unit (central processing unit, CPU) or other processor that may invoke a program. For another example, the modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
Various objects such as various messages/information/devices/network elements/systems/devices/actions/operations/processes/concepts may be named in the present application, and it should be understood that these specific names do not constitute limitations on related objects, and that the named names may be changed according to the scenario, context, or usage habit, etc., and understanding of technical meaning of technical terms in the present application should be mainly determined from functions and technical effects that are embodied/performed in the technical solution.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described system, apparatus and module may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
Those of ordinary skill in the art will appreciate that the various illustrative modules and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
Fig. 3 is a block diagram of a blockchain node device 300 according to an embodiment of the present application.
As shown in fig. 3, the block link point device includes a processor 301 and a memory 302, and may further include one or more of an information input/information output (I/O) interface 303 and a communication component 304.
Wherein the processor 301 is configured to control the overall operation of the blockchain link point device 300 to complete all or part of the steps of the blockchain data distribution acceleration method described above; memory 302 is used to store various types of data to support operation at blockchain node device 300, which may include, for example, instructions for any application or method operating on the blockchain node device 300, as well as application-related data. The Memory 302 may be implemented by any type or combination of volatile or non-volatile Memory devices, such as one or more of static random access Memory (Static Random Access Memory, SRAM), electrically erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), read-Only Memory (ROM), magnetic Memory, flash Memory, magnetic disk, or optical disk.
The I/O interface 303 provides an interface between the processor 301 and other interface modules, which may be a keyboard, mouse, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 304 is used for wired or wireless communication between the blockchain node device 300 and other devices. Wireless Communication, such as Wi-Fi, bluetooth, near field Communication (NFC for short), 2G, 3G, or 4G, or a combination of one or more thereof, and accordingly the Communication component 104 can include: wi-Fi part, bluetooth part, NFC part.
Communication bus 305 may include a pathway to transfer information between the aforementioned components. The communication bus 305 may be a PCI (PERIPHERAL COMPONENT INTERCONNECT, peripheral component interconnect standard) bus or an EISA (Extended Industry Standard Architecture ) bus, or the like. The communication bus 305 may be divided into an address bus, a data bus, a control bus, and the like.
The blockchain point device 300 may be implemented by one or more application specific integrated circuits (Application SpecificIntegrated Circuit, abbreviated ASIC), digital signal processors (DIGITAL SIGNAL Processor, abbreviated DSP), digital signal processing devices (DIGITAL SIGNAL Processing Device, abbreviated DSPD), programmable logic devices (Programmable Logic Device, abbreviated PLD), field programmable gate arrays (Field Programmable GATE ARRAY, abbreviated FPGA), controllers, microcontrollers, microprocessors, or other electronic components for performing the blockchain data distribution acceleration method as set forth in the above embodiments.
The block link point device 300 may include, but is not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), car terminals (e.g., car navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like, and may also be a server, and the like.
The application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the steps of the block chain data distribution acceleration method when being executed by a processor.
The computer readable storage medium may include: a usb disk, a removable hard disk, a read-only memory (ROM), a random access memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
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.
The above description is only illustrative of the preferred embodiments of the present application and of the principles of the technology employed. It will be appreciated by persons skilled in the art that the scope of the application is not limited to the specific combinations of the features described above, but also covers other embodiments which may be formed by any combination of the features described above or their equivalents without departing from the spirit of the application. Such as the above-mentioned features and the technical features having similar functions (but not limited to) applied for in the present application are replaced with each other.
Claims (10)
1. A blockchain data distribution acceleration method, applied to blockchain nodes, the method comprising:
receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
sequentially verifying the block file of the at least one block to be written according to a preset verification sequence;
for any block to be written, if the block file verification is successful and the block height of the block to be written is the next block height of the highest block height of the account book, accounting is carried out on the block to be written, which is successfully verified, of the block file, and the accounting is carried out on the block to be written, which is successfully verified, as a written block;
if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block to be written is distributed through a data broadcast transmission link, discarding the block to be written and waking up a block chain Pull engine, and pulling the block to be written from other block chain nodes;
And if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book, and the block to be written is distributed through a P2P rumor dissemination transmission link, discarding the block to be written.
2. The method of claim 1, wherein if the block file verification fails and the block height of the block to be written is the next block height of the highest block height of the ledger, the method further comprises:
and carrying out statistics updating on link quality parameters of the data broadcast transmission link or the P2P rumor dissemination transmission link corresponding to the block to be written.
3. The method according to claim 2, wherein after the statistical updating of the link quality parameters of the data broadcast transmission link or the P2P rumor dissemination transmission link corresponding to the block to be written, the method further comprises:
And if the link quality of the data broadcast transmission link is good and the time interval of the last wake-up time of the blockchain Pull engine reaches a first preset time interval, executing the step of waking up the blockchain Pull engine.
4. The method of claim 1, wherein after accounting for the block to be written for successful verification of the block file as a written block, the method further comprises:
Setting the state of the written block to wait for cross-validation, and setting the state of the written block to not wait for cross-validation when a second preset time interval is reached;
if the block file verification is successful and the block height of the block to be written is not greater than the highest block height of the ledger, the method further comprises:
judging whether the block heights of the block to be written and the block waiting for cross verification in the account book are the same or not;
If yes, cross-verifying the block to be written and the block with the state waiting for cross-verification in the account book based on a cross-verifying rule; if the cross verification is successful, marking cross verification success information for the block waiting for the cross verification in the account book, and discarding the block waiting for writing; if the cross-validation fails, marking cross-validation failure information for the block waiting for cross-validation in the account book, and discarding the block waiting for writing.
5. The method of claim 4, wherein if the status of the written block is set to not waiting for cross-validation, the method further comprises:
the block in the ledger that is not waiting for cross-validation marks non-cross-validation information.
6. The method of claim 4 or 5, wherein if the cross-validation fails, the method further comprises:
and carrying out statistics updating on the block waiting for cross verification in the account book and the link quality parameters of the transmission link corresponding to the block waiting for writing.
7. The method of claim 6, wherein after the statistical updating is performed on the link quality parameters of the transmission link corresponding to the block waiting for cross-validation and the block waiting for writing in the ledger, the method further comprises:
And sending alarm information to an upper layer application, wherein the alarm information is used for reminding the upper layer application that the block waiting for cross validation and the transmission link corresponding to the block waiting for writing are abnormal transmission links.
8. A blockchain data distribution acceleration device for a blockchain node, the device comprising:
The receiving module is used for receiving at least one block to be written, wherein each block to be written is distributed through a data broadcast transmission link or a P2P rumor dissemination transmission link;
The verification module is used for sequentially verifying the block file of the at least one block to be written according to a preset verification sequence;
the accounting module is used for accounting the successfully verified block serving as the written block if the block file is verified successfully and the block height of the block to be written is the next block height of the highest block height of the account book;
The pulling module is used for discarding the block to be written and waking up a block chain Pull engine if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book and the block to be written is distributed through a data broadcast transmission link, and pulling the block to be written from other block chain nodes;
And the recording module is used for discarding any block to be written if the block file verification fails, the block height of the block to be written is the next block height of the highest block height of the account book, and the block to be written is distributed through a P2P rumor dissemination transmission link.
9. A block link point device comprising a memory and a processor, the memory having stored thereon a computer program capable of being loaded by the processor and performing the method of any of claims 1 to 7.
10. A computer readable storage medium, characterized in that a computer program is stored which can be loaded by a processor and which performs the method according to any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211520984.7A CN115865673B (en) | 2022-11-30 | 2022-11-30 | Block chain data distribution acceleration method, device, equipment and readable storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211520984.7A CN115865673B (en) | 2022-11-30 | 2022-11-30 | Block chain data distribution acceleration method, device, equipment and readable storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN115865673A CN115865673A (en) | 2023-03-28 |
CN115865673B true CN115865673B (en) | 2024-05-24 |
Family
ID=85668375
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211520984.7A Active CN115865673B (en) | 2022-11-30 | 2022-11-30 | Block chain data distribution acceleration method, device, equipment and readable storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115865673B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102316165A (en) * | 2011-09-22 | 2012-01-11 | 中兴通讯股份有限公司 | Content delivery method, device and system |
CN108055138A (en) * | 2018-02-01 | 2018-05-18 | 国家计算机网络与信息安全管理中心 | Distributed recorder method and system is applied based on block chain |
WO2018201798A1 (en) * | 2017-05-03 | 2018-11-08 | 上海点融信息科技有限责任公司 | Blockchain multicast network, blockchain device and communication method therefor under mobile broadband network |
CN109189751A (en) * | 2018-09-18 | 2019-01-11 | 平安科技(深圳)有限公司 | Method of data synchronization and terminal device based on block chain |
CN109246122A (en) * | 2018-09-29 | 2019-01-18 | 上海海事大学 | A kind of Byzantine failure tolerance block chain generation method based on gossip propagation agreement |
CN113965572A (en) * | 2021-11-02 | 2022-01-21 | 上海佰贝网络工程技术有限公司 | Block distribution method and system of block chain, computer equipment and computer readable storage medium |
WO2022105498A1 (en) * | 2020-11-23 | 2022-05-27 | 腾讯科技(深圳)有限公司 | Data processing method and apparatus based on blockchain network, computer device and computer readable storage medium |
CN114915404A (en) * | 2022-05-13 | 2022-08-16 | 北京邮电大学 | Block chain data storage extension model construction method for Internet of things |
-
2022
- 2022-11-30 CN CN202211520984.7A patent/CN115865673B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102316165A (en) * | 2011-09-22 | 2012-01-11 | 中兴通讯股份有限公司 | Content delivery method, device and system |
WO2018201798A1 (en) * | 2017-05-03 | 2018-11-08 | 上海点融信息科技有限责任公司 | Blockchain multicast network, blockchain device and communication method therefor under mobile broadband network |
CN108055138A (en) * | 2018-02-01 | 2018-05-18 | 国家计算机网络与信息安全管理中心 | Distributed recorder method and system is applied based on block chain |
CN109189751A (en) * | 2018-09-18 | 2019-01-11 | 平安科技(深圳)有限公司 | Method of data synchronization and terminal device based on block chain |
CN109246122A (en) * | 2018-09-29 | 2019-01-18 | 上海海事大学 | A kind of Byzantine failure tolerance block chain generation method based on gossip propagation agreement |
WO2022105498A1 (en) * | 2020-11-23 | 2022-05-27 | 腾讯科技(深圳)有限公司 | Data processing method and apparatus based on blockchain network, computer device and computer readable storage medium |
CN113965572A (en) * | 2021-11-02 | 2022-01-21 | 上海佰贝网络工程技术有限公司 | Block distribution method and system of block chain, computer equipment and computer readable storage medium |
CN114915404A (en) * | 2022-05-13 | 2022-08-16 | 北京邮电大学 | Block chain data storage extension model construction method for Internet of things |
Non-Patent Citations (1)
Title |
---|
王群 ; 李馥娟 ; 王振力 ; 梁广俊 ; 徐杰 ; .区块链原理及关键技术.计算机科学与探索.(10),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN115865673A (en) | 2023-03-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP2783490B1 (en) | Time-sensitive data delivery | |
Chlebus et al. | Adversarial queuing on the multiple access channel | |
CN112118315A (en) | Data processing system, method, device, electronic equipment and storage medium | |
TWI691190B (en) | Voice control method and device and electronic equipment | |
CN105812287A (en) | Effective circuits in packet-switched networks | |
KR101231857B1 (en) | Social-community based DTN routing method | |
CN104145459A (en) | Reducing interarrival delays in network traffic | |
CN110266514A (en) | Journal obtaining method, device, terminal and storage medium | |
Yao et al. | Opportunistic offloading of deadline-constrained bulk cellular traffic in vehicular DTNs | |
Hwang et al. | Modification of mosquitto broker for delivery of urgent MQTT message | |
CN105991588B (en) | A kind of method and device for defending message attack | |
WO2017097117A1 (en) | Message scheduling method and apparatus | |
KR20140063690A (en) | Distributing events to large numbers of devices | |
CN115865673B (en) | Block chain data distribution acceleration method, device, equipment and readable storage medium | |
Maatouk et al. | Timely updates with priorities: Lexicographic age optimality | |
Marandi et al. | Practical Bloom filter based epidemic forwarding and congestion control in DTNs: A comparative analysis | |
CN106603723B (en) | A kind of request message processing method and processing device | |
Liang et al. | Queue‐based congestion detection and multistage rate control in event‐driven wireless sensor networks | |
Huang et al. | A buffer management algorithm for improving up/down transmission congestion protocol fairness in IEEE 802.11 wireless local area networks | |
CN112399470B (en) | LoRa communication method, loRa gateway, loRa system and computer readable storage medium | |
CN116560809A (en) | Data processing method and device, equipment and medium | |
CN110247808B (en) | Information transmission method, device, equipment and readable storage medium | |
Daneshtalab et al. | Input-output selection based router for networks-on-chip | |
WO2010081365A1 (en) | Processing method and system for preventing congestion | |
Ghamkhari et al. | A convex optimization framework for service rate allocation in finite communications buffers |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |