[go: up one dir, main page]

CN120658803A - Efficient block propagation relay protocol fly-chain protocol construction method - Google Patents

Efficient block propagation relay protocol fly-chain protocol construction method

Info

Publication number
CN120658803A
CN120658803A CN202510784676.2A CN202510784676A CN120658803A CN 120658803 A CN120658803 A CN 120658803A CN 202510784676 A CN202510784676 A CN 202510784676A CN 120658803 A CN120658803 A CN 120658803A
Authority
CN
China
Prior art keywords
data
block
protocol
flsketch
bucket
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
CN202510784676.2A
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.)
Hunan University Of Science And Technology Sanya Research Institute
Original Assignee
Hunan University Of Science And Technology Sanya Research Institute
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 Hunan University Of Science And Technology Sanya Research Institute filed Critical Hunan University Of Science And Technology Sanya Research Institute
Priority to CN202510784676.2A priority Critical patent/CN120658803A/en
Publication of CN120658803A publication Critical patent/CN120658803A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a high-efficiency block propagation relay protocol fly-chain protocol construction method, which ensures the success of block propagation and effectively reduces the bandwidth consumption by carrying out high-efficiency compression on block data. And an improved data filter is adopted to realize efficient data compression, so that the data transmission process is optimized. The block data is converted into an optimal propagation format by utilizing a difference set calculation and a unique decoding method, so that a receiving party can accurately restore the required data, and the propagation efficiency is improved. Meanwhile, an intelligent optimization algorithm and a dynamic adjustment strategy are fused, and the system can adaptively adjust the propagation strategy aiming at different network environments through sharing computing resources, so that the robustness and stability of the protocol are further improved. The block propagation process is accurately modeled, and an optimal transmission path of data is calculated based on an efficient coding method.

Description

Efficient block propagation relay protocol fly-chain protocol construction method
Technical Field
The invention relates to the technical field of block chains, in particular to a high-efficiency block propagation relay protocol fly-chain protocol construction method.
Background
The block propagation protocol plays a vital role, and different protocols optimize network performance by balancing transmission efficiency, security and delay. For example, the Erl ay protocol, by low latency and low bandwidth design, keeps the bandwidth almost unchanged as the number of node connections is increased, but its batch propagation approach results in higher transaction latency. The Shrec protocol balances propagation delay and computational cost while improving transmission efficiency by combining hybrid hash coding with low fan-out flooding. However, these protocols still have certain limitations in terms of implementation complexity, computing resource consumption, dynamic adaptation, and network load balancing. The perigee protocol designs an adaptive topology for heterogeneous nodes, optimizes the network structure, but frequent topology adjustments may lead to a decrease in system stability. The XTh i n protocol compresses block space through bloom filters and transaction round trip mechanisms, improving propagation efficiency, but may increase transmission delay in poor network environments. The CompactB l ock protocol reduces network costs by high and low bandwidth modes, but missing requests for transactions can affect performance. The Txilm protocol compresses the bandwidth requirements by short transaction hashing, but may introduce additional delay and computational overhead. The graph protocol achieves efficient reconciliation by using bloom filters and reversible bloom look-up tables (iblt), reducing bandwidth requirements, but in some cases decoding failure may increase transmission overhead.
Therefore, there is a need for an efficient and reliable protocol that optimizes bandwidth utilization while guaranteeing low false positive rates, reduces redundant data transmissions, and thereby speeds up data synchronization. The protocol has accurate data checking capability, avoids extra communication overhead, improves transmission stability, and ensures that a quick and accurate synchronization process can be realized under a complex network environment.
Disclosure of Invention
The invention aims to solve the problems and designs an efficient block propagation relay protocol fly-chain protocol construction method.
The technical scheme of the invention for achieving the purpose is that in the efficient block propagation relay protocol fly-chain protocol construction method, the block propagation relay protocol fly-chain protocol construction method comprises the following steps:
The sender sends all transaction IDs contained in the block to the receiver as an i nv message, which includes the transaction summary contained in the block;
After receiving the i nv message, the receiver sends getdata message to the sender and requests the transaction data in the block;
the sender compresses the transaction data through FLsketch algorithm to obtain compressed transaction data, and sends the compressed transaction data to the receiver;
the receiver receives the compressed transaction data, calculates the difference between the own memory pool data and the compressed transaction data by utilizing a FLsketch aggregate difference analysis algorithm, identifies the existing transaction in the memory pool of the receiver and the newly added transaction in the block, and determines the actual difference;
The receiver decodes the newly added transaction data, checks Merkle root in the block header, and integrates the analyzed transaction data into the self block to complete block synchronization.
Further, in the above method for constructing a high-efficiency block propagation relay protocol fly-chain protocol, the FLsketch algorithm includes:
FLsketch consists of m buckets, each containing b slots, each slot including three fields, a CARRY field, a G field and an F lag field;
The CARRY field is used for storing a part of fingerprints, comprising a remainder and a quotient, the G field is used for recording the divisor of the transaction and storing metadata, and the flag field is used for identifying whether the remainder or the quotient is stored in the slot;
in the initial state, the values of the CARRY field and the G field are initialized to-1 and the F lag field is initialized to 0, which indicates that the slot is empty.
Further, in the above method for constructing a high-efficiency block propagation relay protocol fly-chain protocol, the FLsketch algorithm further includes:
for an element x to be inserted, FLsketch determining candidate storage positions through remainder calculation of hash values, and generating two candidate bucket positions;
if the remainder of an element can be stored in the quotient index bucket, or its quotient can be stored in the remainder index bucket, then the element can be successfully inserted;
FLsketch employs a kick-out and reassignment strategy, when both candidate buckets are full, the system randomly kick out an existing quotient or remainder and move it to the spare bucket;
if a conflict occurs with the standby bucket, the system continues to perform kick-out operations until an available location is found or a preset limit of insertion attempts is reached.
Further, in the above method for constructing a block propagation relay protocol fly chain protocol, the calculating the difference between the own memory pool data and the compressed transaction data by using FLsketch's aggregate difference analysis algorithm includes:
for both transaction sets a and B, transaction synchronization is accomplished using FLsketch provide union, difference, and intersection operations, FLsketch also includes compression, difference, and decoding operations.
Further, in the above method for constructing a block propagation relay protocol fly chain protocol, the calculating the difference between the own memory pool data and the compressed transaction data by using FLsketch aggregate difference analysis algorithm further includes:
Carrying out consistency verification on two input FLsketch data structures DX A and DX B, if the capacity parameters DX A, the capacity and DX B, the capacity are inconsistent, or the bucket size parameters DX A, the bucket_size and DX B, the bucket_size are inconsistent, immediately stopping algorithm execution, and throwing out abnormal information;
setting a mapping structure named other_elements for temporarily storing all valid data elements from the reference DX B and corresponding bucket indexes thereof;
traversing each bucket in the references FLsketch, further processing the element pairs (carryb, flag b) in each slot for each bucket i e [0, m-1 ];
when the card_b is not equal to-1, the visual slot is valid data, and the corresponding element and the bucket number iii thereof are stored in the other_elements mapping structure.
Further, in the above method for constructing a block propagation relay protocol fly chain protocol, the calculating the difference between the own memory pool data and the compressed transaction data by using FLsketch aggregate difference analysis algorithm further includes:
Performing traversal operation on the target DX A, and reading the element pair (carr_a, flag_a) in the slot for each bucket i E [0, m-1] and each slot j E [0, b-1] in the bucket;
when the carria-1 is satisfied and the element pair has a matching entry in the other_elements mapping structure, it is indicated that the element appears in both FLsketch, considered redundant data;
The corresponding slot is left empty, i.e., let DX A. Buckets [ i ] [ j ] = (-1, -1), and the DX A. Siz value is decremented by 1;
Processing of all buckets and slots is completed, returning to updated FLsketchDX A, which has excluded the portion that is repeated with DX B, resulting in a sanitized data set.
Further, in the above-mentioned efficient method for constructing a block propagation relay protocol fly-chain protocol, the method for constructing a block propagation relay protocol fly-chain protocol further includes the following steps:
When the memory pool data of the receiver is incomplete, the receiver detects the intersection of the memory pool data of the receiver and the block data of the sender, and inserts the intersection into a FLsketch data structure and then sends the intersection to the sender;
After receiving the RC, the sender performs aggregate difference analysis based on the self block data and the RC, and calculates missing transaction data of the receiver;
the sender compresses the missing transaction data by utilizing FLsketch data structures and transmits the compressed data to the receiver;
the receiver decodes and extracts the missing transaction data, verifies Merkle root consistency, and integrates the missing transaction data into the local block data.
Further, in a system for implementing the above-mentioned efficient block propagation relay protocol fly-chain protocol construction method, the system includes the following modules:
The data sending module is used for sending all the transaction IDs contained in the block to a receiver as an inv message by the sender, wherein the inv message comprises a transaction summary contained in the block;
the data receiving module is used for sending getdata information to a sender after the receiver receives the inv information and requesting transaction data in the block;
The data compression module is used for compressing the transaction data by a sender through FLsketch algorithm to obtain compressed transaction data and sending the compressed transaction data to a receiver;
The data decompression module is used for receiving compressed transaction data by a receiver, calculating the difference between the data of the memory pool of the receiver and the compressed transaction data by utilizing a FLsketch aggregate difference analysis algorithm, identifying the existing transaction in the memory pool of the receiver and the newly added transaction in the block, and determining the actual difference;
And the data verification module is used for decoding the newly added transaction data by a receiver, verifying Merkle roots in the block head, integrating the analyzed transaction data into the self block and completing block synchronization.
Further, in a system for implementing the above-mentioned efficient block propagation relay protocol fly-chain protocol construction method, the system includes the following submodules:
The verification sub-module is used for carrying out consistency verification on two input FLsketch data structures DX A and DX B, and if the capacity parameters DX A, the capacity parameters DX B, the capacity parameters DX A, the socket_size and DX B, the socket_size are inconsistent, the algorithm execution is immediately terminated, and abnormal information is thrown;
The setting sub-module is used for setting a mapping structure named other_elements and temporarily storing all valid data elements from the reference DX B and corresponding bucket indexes thereof;
A traversing sub-module for traversing each bucket in the references FLsketch, further processing the element pair (carryb, flag b) in each slot for each bucket i e [0, m-1 ];
And the storing submodule is used for taking the visual slot as effective data when the card_b is not equal to-1, and storing the corresponding element and the barrel number iii thereof into the other_elements mapping structure.
Further, in a system for implementing the above-mentioned efficient block propagation relay protocol fly-chain protocol construction method, the system includes the following submodules:
a reading submodule, configured to perform a traversal operation on the target DX A, and also read, for each bucket i e [0, m-1] and each slot j e [0, b-1] in the bucket, an element pair (carry_a, flag_a) in the slot;
A judging sub-module, configured to, when the carria is not equal to-1 and the element pair has a matching entry in the other_elements mapping structure, indicate that the element appears in both FLsketch, and regard as redundant data;
Setting a sub-module for setting the corresponding slot position to be empty, namely letting DX A. Buckets [ i ] [ j ] = (-1, -1), and subtracting 1 from the DX A. Siz value;
an exclude sub-module for completing the processing of all buckets and slots, returning updated FLsketch DX A that has excluded the portion that is repeated with DX B, resulting in a cleaned data set.
The method has the advantages that the protocol ensures the success of block propagation by efficiently compressing the block data, and effectively reduces the bandwidth consumption. And an improved data filter is adopted to realize efficient data compression, so that the data transmission process is optimized. The block data is converted into an optimal propagation format by utilizing a difference set calculation and a unique decoding method, so that a receiving party can accurately restore the required data, and the propagation efficiency is improved. Meanwhile, the intelligent optimization algorithm and the dynamic adjustment strategy are fused, and the system can adaptively adjust the propagation strategy aiming at different network environments through sharing computing resources, so that the robustness and the stability of the protocol are further improved. In addition, according to the scheme, the idea of checking the data set is adopted, the block propagation process is accurately modeled, and the optimal transmission path of the data is calculated based on the efficient coding method. Through series comparison experiments and performance evaluation under a large-scale blockchain network environment, the feasibility and effectiveness of the invention are verified, the block propagation efficiency is obviously improved, and the system resource consumption is reduced, so that the blockchain network can keep stable and high-efficiency operation under a high concurrency environment.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention.
Fig. 1 is a schematic diagram of a first embodiment of a method for constructing a high-efficiency block propagation relay protocol fly-chain protocol according to an embodiment of the present invention;
Fig. 2 is a block propagation relay protocol chain protocol 1 in a method for constructing a block propagation relay protocol chain protocol with high efficiency according to an embodiment of the present invention;
Fig. 3 is a block propagation relay protocol chain protocol 2 in a method for constructing a block propagation relay protocol chain protocol according to an embodiment of the present invention;
fig. 4 is a schematic diagram illustrating comparison of propagation overhead in a method for constructing a high-efficiency block propagation relay protocol fly-chain protocol according to an embodiment of the present invention;
FIG. 5 is a schematic diagram showing propagation overhead in case of transaction missing in a method for constructing a high-efficiency block propagation relay protocol fly-chain protocol according to an embodiment of the present invention;
FIG. 6 is a schematic diagram illustrating comparison of fast propagation delays in a method for constructing a high-efficiency block propagation relay protocol fly-chain protocol according to an embodiment of the present invention;
FIG. 7 is a schematic diagram showing a comparison of fast propagation delays for a transaction missing situation in a method for constructing a flight chain protocol of a high-efficiency block propagation relay protocol according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating a comparison of transaction misinformation numbers in a method for constructing a high-efficiency block propagation relay protocol fly-chain protocol according to an embodiment of the present invention;
fig. 9 is a schematic diagram of comparing the number of missing transaction false positives in a highly efficient block propagation relay protocol fly-chain protocol construction method according to an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present invention more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
As used herein, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, unless expressly stated otherwise, as understood by those skilled in the art. It will be further understood that the terms "comprises" and/or "comprising," when used in this specification, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
Example 1
The present invention is specifically described below with reference to the accompanying drawings, as shown in fig. 1, a method for constructing a block propagation relay protocol fly-chain protocol with high efficiency, the method for constructing a block propagation relay protocol fly-chain protocol includes the following steps:
Step 101, the sender sends all transaction IDs contained in the block as i nv messages to the receiver, wherein the iv messages comprise transaction summaries contained in the block;
step 102, after receiving the i nv message, the receiver sends getdata message to the sender and requests the transaction data in the block;
Step 103, the sender compresses the transaction data through FLsketch algorithm to obtain compressed transaction data, and sends the compressed transaction data to the receiver;
Specifically, FLsketch in this embodiment is composed of m barrels, each barrel contains b slots, and each slot includes three fields, namely a CARRY field, a G field and a flag field;
The CARRY field is used for storing a part of the fingerprint, comprising a remainder and a quotient, the G field is used for recording the divisor of the transaction and storing metadata, and the flag field is used for identifying whether the remainder or the quotient is stored in the slot;
in the initial state, the values of the CARRY field and the G field are initialized to-1 and the F lag field is initialized to 0, which indicates that the slot is empty.
For an element x to be inserted, FLsketch determining candidate storage positions through remainder calculation of hash values, and generating two candidate bucket positions;
if the remainder of an element can be stored in the quotient index bucket, or its quotient can be stored in the remainder index bucket, then the element can be successfully inserted;
FLsketch employs a kick-out and reassignment strategy, when both candidate buckets are full, the system randomly kick out an existing quotient or remainder and move it to the spare bucket;
if a conflict occurs with the standby bucket, the system continues to perform kick-out operations until an available location is found or a preset limit of insertion attempts is reached.
104, The receiver receives the compressed transaction data, calculates the difference between the own memory pool data and the compressed transaction data by utilizing a FLsketch aggregate difference analysis algorithm, identifies the existing transaction in the memory pool of the receiver and the newly added transaction in the block, and determines the actual difference;
specifically, for the two transaction sets a and B in this embodiment, the operations of providing union, difference and intersection are used FLsketch to complete transaction synchronization, FLsketch further includes operations of compression, difference and decoding.
Carrying out consistency verification on two input FLsketch data structures DX A and DX B, if the capacity parameters DX A, the capacity and DX B, the capacity are inconsistent, or the bucket size parameters DX A, the bucket_size and DX B, the bucket_size are inconsistent, immediately stopping algorithm execution, and throwing out abnormal information;
setting a mapping structure named other_elements for temporarily storing all valid data elements from the reference DX B and corresponding bucket indexes thereof;
traversing each bucket in the references FLsketch, further processing the element pairs (carryb, flag b) in each slot for each bucket i e [0, m-1 ];
when the card_b is not equal to-1, the visual slot is valid data, and the corresponding element and the bucket number iii thereof are stored in the other_elements mapping structure.
Performing traversal operation on the target DX A, and reading the element pair (carr_a, flag_a) in the slot for each bucket i E [0, m-1] and each slot j E [0, b-1] in the bucket;
When the carria is not equal to-1 and the element pair has a matching item in the other_elements mapping structure, the element pair is indicated to appear in both FLsketch and is regarded as redundant data;
The corresponding slot is left empty, i.e., let DX A. Buckets [ i ] [ j ] = (-1, -1), and the DX A. Siz value is decremented by 1;
Processing of all buckets and slots is completed, returning to updated FLsketchDX A, which has excluded the portion that is repeated with DX B, resulting in a sanitized data set.
Step 105, the receiver decodes the newly added transaction data, checks Merkle root in the block header, and integrates the parsed transaction data into the own block to complete block synchronization.
Specifically, when the memory pool data of the receiver is incomplete, the receiver detects the intersection of the own memory pool data and the block data of the sender, and inserts the intersection into a FLsketch data structure and then sends the intersection to the sender;
After receiving the RC, the sender performs aggregate difference analysis based on the self block data and the RC, and calculates missing transaction data of the receiver;
the sender compresses the missing transaction data by utilizing FLsketch data structures and transmits the compressed data to the receiver;
the receiver decodes and extracts the missing transaction data, verifies Merkle root consistency, and integrates the missing transaction data into the local block data.
The method has the advantages that the protocol ensures the success of block propagation by efficiently compressing the block data, and effectively reduces the bandwidth consumption. And an improved data filter is adopted to realize efficient data compression, so that the data transmission process is optimized. The block data is converted into an optimal propagation format by utilizing a difference set calculation and a unique decoding method, so that a receiving party can accurately restore the required data, and the propagation efficiency is improved. Meanwhile, the intelligent optimization algorithm and the dynamic adjustment strategy are fused, and the system can adaptively adjust the propagation strategy aiming at different network environments through sharing computing resources, so that the robustness and the stability of the protocol are further improved. In addition, according to the scheme, the idea of checking the data set is adopted, the block propagation process is accurately modeled, and the optimal transmission path of the data is calculated based on the efficient coding method. Through series comparison experiments and performance evaluation under a large-scale blockchain network environment, the feasibility and effectiveness of the invention are verified, the block propagation efficiency is obviously improved, and the system resource consumption is reduced, so that the blockchain network can keep stable and high-efficiency operation under a high concurrency environment.
EXAMPLE 2,
FLsketch optimized blockchain fast synchronization scheme
The method solves the data synchronization and transmission problems in the block chain fast synchronization through the following technical scheme, and comprises the following modules of (1) an improved data structure FLsketch based on a Cuckoo filter, (2) a difference set calculation and decoding algorithm supporting isomorphic data structures, and (3) a FL protocol optimization fast synchronization protocol based on FLsketch.
The first part FLsketch adopts a specific hash operation mechanism to realize efficient data transmission and decoding functions. Compared with the traditional bloom filter, FLsketch has lower false alarm rate, improves the accuracy of data transmission without depending on additional data transmission, and reduces the error decoding probability in the fast synchronization process. FLsketch, in combination with the structural characteristics of the Cuckoo filter, can dynamically adjust the data storage mode, and reduce the storage overhead while ensuring the query efficiency. In addition, the efficient hash mapping mechanism can optimize the data deduplication problem in the fast synchronization scene of the block chain, so that the data matching and transmission efficiency is accelerated.
In a second part FLsketch supports the difference computation and decoding algorithms of isomorphic data structures to reduce reliance on complex data structures (e.g., iblt). By the method, the difference of data at two ends can be calculated efficiently, transmission redundancy is reduced, and meanwhile, the high efficiency and accuracy of a synchronization process are ensured, so that the calculation and transmission cost of data synchronization is reduced. In the difference set calculation process, FLsketch is combined with an efficient bitmap index technology, so that a data difference part can be rapidly positioned, and data decoding is performed by using an efficient hash coding method, so that the account checking efficiency of synchronous data is greatly improved.
Third, the fly-chain protocol designed based on FLsketch optimizes the fast synchronization process of the blockchain. The fly-chain protocol reduces the transmission burden of fast synchronization while reducing data retransmission and synchronization collisions. The efficient data reconciliation capability effectively improves the verification efficiency of the blockchain and enhances the expansibility of the network. In a specific implementation, the fly chain protocol adopts a hierarchical data synchronization strategy, firstly, the global data structure is rapidly checked, and then the data difference range is gradually narrowed, so that high-efficiency synchronization is realized with minimum calculation and communication expenditure. Meanwhile, the fly chain protocol utilizes FLsketch high-precision filtering capability to reduce redundant data transmission, so that the overall network performance and expandability are improved.
Firstly, FLsketch improves the data storage and query efficiency by optimizing the hash storage structure, reduces the false alarm rate of the data, and ensures that the data has better adaptability in a block chain fast synchronization scene. FLsketch adopts a dynamic Cuckoo hash table to enable data storage distribution to be more uniform, so that accuracy of data matching is improved. The hierarchical hash strategy can adapt to block chain networks with different data scales, and ensures the stability and high efficiency of the synchronization process.
In the data synchronization process, FLsketch realizes quick data reconciliation by constructing a hash-based difference set calculation method. FLsketch can accomplish data decoding with lower computational complexity and reduce additional data storage requirements than conventional iblt schemes. FLsketch adopts a high-efficiency bit array coding mode, so that the data difference calculation process is more expandable, and the method is suitable for block chain networks with different scales.
Aiming at the problem of data synchronization conflict in a block chain network, the fly chain protocol is combined with FLsketch structure to optimize the fast synchronization flow, reduce redundant transmission of repeated data and improve synchronization efficiency. In the protocol design, the fly chain protocol adopts a hierarchical data filtering mechanism, global data structure matching is carried out at the initial stage of synchronization, then the data difference part is calculated step by step and accurately, and high-efficiency verification is carried out through FLsketch, so that the whole fast synchronization process is more accurate and efficient.
Through the optimization scheme, FLsketch is combined with the fly chain protocol, so that the fast synchronization performance of the block chain can be remarkably improved, the data transmission overhead is reduced, the data consistency verification efficiency is improved, the expandability of the block chain network is enhanced, and the system is suitable for a large-scale decentralization application scene.
As shown in fig. 2, the block propagation relay protocol scheme provided by the embodiment of the present invention includes the following steps:
Step 1, sender initiates transaction ID synchronization
The sender sends all transaction IDs contained in the block to the receiver as an "inv" message. The message indicates the transaction summary contained in the block, helping the recipient to learn about the upcoming transaction information.
Step 2, the receiver requests transaction data
After receiving the "i nv" message, the receiver sends a "getdata" message to the sender, specifically requesting the transaction data in the block. This request informs the sender that the recipient is ready to receive the actual transaction data.
Step 3, sender data compression and transmission
The sender compresses the transaction data by FLsketch algorithm. The compressed transaction data is inserted FLsketch into a data structure through which the sender sends the compressed transaction information to the recipient.
Step 4, the receiver performs data decompression and difference analysis
The receiver receives the compressed FLsketch data and decompresses and reconstructs the transaction data using a built-in decoding and difference analysis algorithm (shown as algorithm 1). The recipient determines the actual discrepancy by comparing the existing transactions in the memory pool with the newly added transactions received.
The algorithm one specific calculation process is as follows:
To achieve the difference analysis between the two FLsketch data structures, the following algorithm steps are proposed, which aim to clear the elements in the target FLsketch that repeat with the reference FLsketch, thus completing the difference extraction operation.
Step one, checking the consistency of the capacity and the structure
Firstly, consistency verification is carried out on two input FLsketch data structures DX A and DX B, and if the capacity parameters DX A, the capacity and DX B, or the bucket size parameters DX A, the bucket_size and DX B, the bucket_size are inconsistent, algorithm execution is immediately terminated, and exception information is thrown out so as to ensure that subsequent operations are carried out on the premise of structural matching.
Initializing a reference element index structure
A mapping structure (which may be implemented as a hash dictionary) named other_elements is set to temporarily store all valid data elements from the reference FLsketch (i.e., DX B) and their corresponding bucket indices. The structure is used as an auxiliary basis for subsequent comparison.
Step three, extracting the information of the reference element
Each bucket (total m) in the reference FLsketch is traversed, and for each bucket i e0, m-1, the element pair (carryb, flag b) in each slot is further processed. When the card_b is not equal to-1, the corresponding element and the bucket number iii thereof are stored in the other_elements mapping structure according to the slot as valid data.
Fourth, performing difference contrast and cleaning of target data
The target DX A is traversed and the pairs of elements in slots (carr_a, flag_a) are read for each bucket i ε [0, m-1] and each slot j ε [0, b-1] in the bucket as well. When the carria +.1 is satisfied and the element pair has a match in the other_elements mapping structure, it is stated that the element appears in both FLsketch, treated as redundant data. At this point, the corresponding slot is left empty, i.e., DX A. Buckets [ i ] [ j ] = (-1, -1), and DX A. Siz is decremented by 1 to reflect the update of the number of active elements.
Outputting the differentiated target FLsketch
After processing of all buckets and slots is completed, updated FLsketchDX A is returned, which has excluded the portion that is repeated with DX B, resulting in a sanitized data set.
Parameter description
M FLsketch number of buckets in the data structure.
B number of slots in each barrel.
Carr_a, carr_b, the quotient representing the slot in destination FLsketch and reference FLsketch, respectively, represents the stored data identification.
Flag_a, flag_b, and additional flag information bound with the corresponding quotient.
DX A. Buckets [ i ] [ j ]: the j slot of the i-th bucket in the target FLsketch.
DX A size represents the total number of currently active elements in target FLsketch.
Other_elements a temporary built auxiliary index mapping structure for storing valid element data from the reference FLsketch and its corresponding bucket number.
Step 5, completing the block synchronization
The recipient extracts the newly added transaction by a decoding algorithm (shown as algorithm 2) and verifies the Merkle root in the block header. The receiver integrates these newly added transactions into its own block, and to achieve this verification, the receiver first reconstructs the complete Merkle tree using the decoded transaction data. Specifically, the receiver performs hash computation on all the decoded transactions according to a given sequence, and builds the transactions layer by layer from bottom to top by adopting a binary hash tree structure until a root node hash value is generated. The receiver then compares the calculated root hash value with the Merkle root contained in the block header to confirm the integrity and correctness of the data transmission.
If the generated Merkle root is inconsistent with the given value in the block head, the transaction data may be wrong or lost in the transmission or decoding process. At this point, the receiver will trigger a retransmission policy that initiates a retransmission request to the sender indicating the transaction data identity or index location of the bucket where it is located to be retransmitted. After receiving the retransmission request, the sender only needs to recode and transmit the appointed part, so as to improve the bandwidth utilization rate and avoid the total retransmission, thereby enhancing the robustness and the transmission efficiency of the system.
The specific calculation process of the algorithm II is as follows:
The present embodiment provides a processing method for decoding data stored in FLsketch structures, which is suitable for restoring original data encoded values from compressed stored structures. The method takes FLsketch data structures containing m barrels and n slots in each barrel as input and outputs a group of original data identification values X.
Step one, calculating an intermediate value eta_t
First, for each slot unit in FLsketch, if the quotient (carry) in that slot is not-1, then the intermediate value η_t is calculated based on its position index i, flag bit, and carry value in the following manner:
wherein i represents the number of barrels to which the current slot belongs, m represents the total number of barrels in FLsketch, and flag is a flag bit for indicating the information of the current slot coding. When the flag does not belong to {0,1}, indicating that the data is illegal, the system should terminate operation and return an error hint.
Step two, restoring the original coding value X
The calculation of the intermediate value eta_t is completed, and the coding value X of the original data is calculated according to the following formula, wherein X=eta_t+FLsktch.packets [ i ] [ j ]. G.m (m-1)
Wherein G is element information and is used for recording integer divisor of mapping range of original codes and distinguishing elements in different batches or mapping ranges, and m (m-1) represents span of single disturbance group in total coding space.
And writing each X value obtained by reduction into a result array result in sequence for subsequent operations such as difference identification, synchronous reconstruction or storage reduction.
Parameter description
Number of buckets (bucket) in m FLsketch
N number of slots (slots) in each bucket
I index of bucket where current slot is located
J is the jth slot of the ith bucket in the destination FLsketch.
Carry, quotient value stored in a slot, representing a portion of the encoded element
Flag: coding direction flag bit, 0 or 1
G element information
Eta _t fingerprint
X, restored original data coding value
Results, output array for storing all restored code values
Protocol 2 is performed when the memory pool is missing for transaction synchronization, as shown in fig. 3, comprising the steps of:
Step 1, detecting the condition that the memory pool is incomplete, and when the protocol 1 can not complete synchronization, the receiver detects that part of transaction is absent in the memory pool. In this case, protocol 2 is enabled for identifying and synchronizing missing transaction data, ensuring that the recipient is able to obtain complete tile information.
Step 2, generating intersection data and transmitting
The receiver compares the transaction data in the memory pool with the transaction data in the sender block to generate intersection data between the two. The intersection data contains transactions already held by the recipient, who sends the intersection data to the sender. This data helps the sender identify the particular transaction portion missing from the recipient.
And 3, performing difference calculation by the sender, transmitting the intersection data received by the missing transaction sender, performing difference calculation based on the data, and identifying the transaction part missing by the receiver. The sender then compresses FLsketch only the missing transaction data and transmits it to the recipient over the network. This process ensures efficient use of network bandwidth, transmitting only the transaction data that is actually needed by the recipient.
Step 4, the receiver decodes and integrates the missing transaction
After receiving the missing transaction data, the receiver obtains FLskecth of the missing transaction, decodes and calculates the information in the missing transaction barrel obtained in the search, calculates the fingerprint value of the actual transaction from the value in the barrel, finishes x decoding through the fingerprint value and the element information G, and accurately extracts the missing transaction. The recipient integrates these transactions with its own block data. The recipient will also verify the Merkle root in the block header to ensure consistency and integrity of the data.
Step 5, confirming the synchronous completion
Once all missing transactions are successfully integrated, the recipient confirms that block synchronization has been completed. The receiver may choose to inform the sender that the synchronization has been successful by sending an acknowledgement message. The receiver can trigger additional verification steps if necessary to ensure the correctness and integrity of the data
Analysis of experimental results:
the method of the scheme is quantitatively compared with the other two block relay protocols. To verify the overall performance of the proposed method, we refer to the evaluation criteria in the middle. The method adopts indexes such as fast propagation delay, total propagation overhead, false alarm transaction quantity and the like to measure.
As shown in FIG. 4, the propagation costs (in units of per KB) for three blockchain protocols-Graphene, compact and the flychain protocol-under different blocksize and memory pool transaction numbers are illustrated. When the block transaction size is 200, the propagation cost of the fly-chain protocol is significantly lower than the other two protocols, on average about 5 times lower than the Compact protocol and about 60% lower than the graph protocol, when the block transaction size is 2000, the propagation cost of the fly-chain protocol is still lower than the Compact protocol and about 40% lower than the graph protocol, and when the block transaction size is 10000, the propagation cost of the fly-chain protocol is still the lowest and about 50% lower than the graph protocol. This cost advantage results from the efficient FLsketch data structure in the fly-chain protocol, which supports both the difference operation and the decoding operation, avoiding the extra propagation IBLT, thereby greatly reducing the propagation cost.
As shown in FIG. 5, the propagation costs (units: per KB) of three blockchain protocols-Graphene, compact and the flychain protocol are shown under different transaction loss rate conditions. When the block transaction number is 200, the propagation cost of the fly chain protocol is always kept to be the lowest as the transaction loss rate is increased from 0 to 1, and is about 5.5 times lower than that of the Compact protocol and about 3 times lower than that of the graph protocol, when the block transaction number is 2000, the fly chain protocol is kept to be the lowest cost, about 5.2 times lower than that of the Compact protocol and about 1.9 times lower than that of the graph protocol despite the increase of the propagation cost, and when the block transaction number is 10000, the propagation cost of the fly chain protocol is still the lowest, about 6 times lower than that of the Compact protocol and about 2 times lower than that of the graph protocol. The advantage is derived from the fact that the fly chain protocol only needs one propagation process when processing lost transactions, propagation overhead is obviously reduced, and the advantage of low overhead in a fast propagation scene is further verified.
As shown in fig. 6, the block propagation delay (in ms) of the fechain protocol and the graph protocol is shown under different memory pool sizes. When the block size is 200, the average propagation delay of the fly-chain protocol is 3ms, the propagation speed is improved by about 10 times compared with the propagation speed of the Graphene protocol of 37ms, when the block size is 2000, the propagation delay of the fly-chain protocol is 15ms, the propagation speed of the Graphene protocol is improved by more than 4 times, when the block size is 10000, the propagation delay of the fly-chain protocol is about half of the propagation speed of the Graphene protocol, and the speed advantage is kept at about 2 times. This performance improvement results from the more efficient algorithm design of FLsketch, which queries faster than the traditional B l oom algorithm, thereby significantly reducing propagation delay.
As shown in fig. 7, we measure the block propagation average delay in this scenario and comprehensively compare three different block sizes and transaction loss rates, when the block size is 200, the fly-chain protocol can complete fast block synchronization within 10ms, while the graph protocol takes 33ms, the delay of the fly-chain protocol is about 3 times faster than the graph protocol, when the block size is increased to 2000, the propagation delay of the fly-chain protocol is 40ms, the propagation speed of the fly-chain protocol is increased by about 2 times compared to 90ms of the graph, when the block size is increased to 10000, the delay of the fly-chain protocol is still significantly lower than the graph even when the transaction loss rate is 10%, and when the transaction loss rate is increased to 90%, the propagation delay of the fly-chain protocol is even about 6 times faster than the graph. This significant delay advantage results from the efficient algorithm design of FLsketch, such that the data only needs one round trip to complete propagation, thus exhibiting lower propagation delay under different transaction loss rate conditions.
When a set reconciliation mode is used in quick propagation, false alarm is one of main challenges of a probabilistic data structure, and reducing false alarm rate is always the key point of set reconciliation optimization, and meanwhile, the accuracy of block propagation is also directly affected. To solve this problem, the graphic protocol performs a lot of optimization work.
As shown in FIG. 8, when the memory pool size is 200 and the block size is 200, the number of false positives of the fly-chain protocol and the graphic protocol is similar, both are in a single digit level, as the block size increases to 2000, the false positive rates of the two protocols are kept the same overall, when the block size further increases to 10000, the fly-chain protocol shows lower number of false positives under the condition that the memory pool size is 20000 and 35000, but the overall false positive rate is still similar to the graphic.
As shown in fig. 9, with the increase of the transaction missing rate, the number of false positives of the fechain protocol is always lower than that of graphics and is stable between 1 and 3 false positives, when the block size is 2000, the range of the number of false positives of the fechain protocol is 7 to 400, and when the block size reaches 10000, the maximum number of false positives of the fechain protocol is 1300, and the requirement of block propagation can still be met. This shows that the fly chain protocol maintains better false alarm control capability when dealing with transaction missing, and is always lower than the graphic protocol, which proves that our protocol can effectively meet the requirement of block propagation.
In summary, the scheme provides an efficient blockchain relay protocol, namely a fly chain protocol, and the performance of the efficient blockchain relay protocol is verified through a series of experiments. Experimental results show that the fly chain protocol is superior to the traditional graph and Compact protocols in a plurality of key indexes, particularly in the aspects of propagation cost, propagation delay, performance under transaction loss rate and false alarm control capability. Particularly under the conditions of processing large-scale blocks and high transaction loss rate, the fly chain protocol shows remarkable performance advantages, the propagation cost is lowest, the propagation delay is remarkably reduced, and the false alarm number is kept at a low level. In addition, the flight chain protocol optimizes the propagation process through an efficient FLsketch data structure, avoids extra IBLT propagation, and remarkably reduces propagation overhead.
Experiments performed under different hardware configurations verify the real-time detection capability of the protocol, which shows that the protocol has strong competitiveness. The specific test equipment was configured as Intel (R) Xeon (R) Silver4314CPU@2.40GHz and NVID IAGeForceRTX4090,4090, further ensuring the reliability of the experiment.
In general, the fly chain protocol of the scheme is excellent in performance of block propagation, can effectively improve block synchronization efficiency in practical application, reduces propagation cost, has good expansibility and false alarm control capability, and proves great potential in a fast propagation scene.
The foregoing has shown and described the basic principles, principal features and advantages of the invention. It will be understood by those skilled in the art that the present invention is not limited to the above-described embodiments, and that the above-described embodiments and descriptions are only preferred embodiments of the present invention, and are not intended to limit the invention, and that various changes and modifications may be made therein without departing from the spirit and scope of the invention as claimed. The scope of the invention is defined by the appended claims and equivalents thereof.

Claims (10)

1.一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述区块传播中继协议飞链协议构建方法包括以下步骤:1. An efficient block propagation relay protocol Feilian protocol construction method, characterized in that the block propagation relay protocol Feilian protocol construction method comprises the following steps: 发送者将区块中包含的所有交易ID作为i nv消息发送给接收者,所述i nv消息包括区块中包含的交易概要;The sender sends all transaction IDs contained in the block to the receiver as an inv message, where the inv message includes a summary of the transactions contained in the block. 接收者收到所述i nv消息后,向发送者发送getdata消息,并请求区块中的交易数据;After receiving the i nv message, the receiver sends a getdata message to the sender and requests the transaction data in the block; 发送者将交易数据通过FLsketch算法将所述交易数据进行压缩处理,得到压缩交易数据,将所述压缩交易数据发送给接受者;The sender compresses the transaction data using the FLsketch algorithm to obtain compressed transaction data, and sends the compressed transaction data to the recipient; 接收者接收压缩交易数据,利用FLsketch的集合差异分析算法计算自身内存池数据与所述压缩交易数据的差异,识别接收者内存池中已有的交易和区块中新增的交易,确定实际差异;The recipient receives the compressed transaction data and uses FLsketch's set difference analysis algorithm to calculate the difference between its own memory pool data and the compressed transaction data, identify the existing transactions in the recipient's memory pool and the new transactions in the block, and determine the actual difference; 接收者对新增的交易数据进行解码,校验区块头中的Merkle根,并将解析出的交易数据整合至自身区块中,完成区块同步。The receiver decodes the newly added transaction data, verifies the Merkle root in the block header, and integrates the parsed transaction data into its own block to complete block synchronization. 2.如权利要求1所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述FLsketch算法包括:2. The method for constructing an efficient block propagation relay protocol Flychain protocol according to claim 1, wherein the FLsketch algorithm includes: FLsketch由m个个桶组成,每个桶包含b个槽,每个槽包括三个字段:CARRY字段、G字段和F lag字段;FLsketch consists of m buckets, each bucket contains b slots, and each slot includes three fields: CARRY field, G field, and Flag field; 所述CARRY字段用于存储指纹的一部分,包括余数、商;所述G字段用于记录交易的除数,存储元数据;所述Fl ag字段用于标识槽存储的是余数还是商;The CARRY field is used to store part of the fingerprint, including the remainder and quotient; the G field is used to record the divisor of the transaction and store metadata; the Fl ag field is used to identify whether the slot stores the remainder or the quotient; 在初始状态下,CARRY字段和G字段的值都初始化为-1,F lag字段;则初始化为0,表示槽为空。In the initial state, the values of the CARRY field and the G field are initialized to -1, and the Flag field is initialized to 0, indicating that the slot is empty. 3.如权利要求1所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述FLsketch算法还包括:3. The method for constructing an efficient block propagation relay protocol Flychain protocol according to claim 1, wherein the FLsketch algorithm further comprises: 对于待插入的元素x,FLsketch通过哈希值的余数计算来确定候选存储位置,生成两个候选桶位置;For the element x to be inserted, FLsketch determines the candidate storage location by calculating the remainder of the hash value and generates two candidate bucket locations; 若元素的余数可以存储在商索引桶中,或者其商可以存储在余数索引桶中,则该元素可以成功插入;If the remainder of the element can be stored in the quotient index bucket, or its quotient can be stored in the remainder index bucket, then the element can be successfully inserted; FLsketch采用踢出并重新分配策略,当两个候选桶均已满时,系统随机踢出一个现有的商或余数并将其移动到备用桶;FLsketch adopts a kick-and-redistribute strategy. When both candidate buckets are full, the system randomly kicks out an existing quotient or remainder and moves it to the spare bucket; 如果备用桶发生冲突,系统继续执行踢出操作,直到找到可用位置或达到预设的插入尝试次数限制为止。If a backup bucket conflicts, the system continues to perform the kickout operation until a free position is found or the preset insertion attempt limit is reached. 4.如权利要求1所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述利用FLsketch的集合差异分析算法计算自身内存池数据与所述压缩交易数据的差异,包括:4. The method for constructing an efficient block propagation relay protocol Flychain protocol according to claim 1, wherein the step of calculating the difference between the self-memory pool data and the compressed transaction data using the FLsketch set difference analysis algorithm comprises: 对于两个交易集合A和B,利用FLsketch提供并集、差集和交集操作完成交易同步,FLsketch还包括压缩、差集和解码操作。For two transaction sets A and B, FLsketch provides union, difference, and intersection operations to complete transaction synchronization. FLsketch also includes compression, difference, and decoding operations. 5.如权利要求1所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述利用FLsketch的集合差异分析算法计算自身内存池数据与所述压缩交易数据的差异,还包括:5. The method for constructing an efficient block propagation relay protocol Flychain protocol according to claim 1, wherein the method further comprises: calculating the difference between the self-memory pool data and the compressed transaction data using the FLsketch set difference analysis algorithm; 对两个输入的FLsketch数据结构DXA与DXB进行一致性验证,若其容量参数DXA.capacity与DXB.capacity不一致,或其桶大小参数DXA.bucket_size与DXB.bucket_size不一致,则立即终止算法执行,并抛出异常信息;Verify the consistency of the two input FLsketch data structures DX A and DX B. If their capacity parameters DX A .capacity and DX B .capacity are inconsistent, or their bucket size parameters DX A .bucket_size and DX B .bucket_size are inconsistent, the algorithm execution is immediately terminated and an exception is thrown; 设定一个名为other_elements的映射结构,用于暂存来自参考DXB中所有有效数据元素及其对应桶索引;Set up a mapping structure named other_elements to temporarily store all valid data elements from the reference DX B and their corresponding bucket indexes; 对参考FLsketch中的每一个桶进行遍历,对于每一个桶i∈[0,m-1],进一步对其中每一个槽位中的元素对(carry_b,flag_b)进行处理;Traverse each bucket in the reference FLsketch, and for each bucket i∈[0,m-1], further process the element pair (carry_b, flag_b) in each slot; 当满足carry_b≠-1时,视槽为有效数据,并将对应的元素及其桶编号iii存入other_elements映射结构中。When carry_b≠-1 is satisfied, the slot is considered as valid data, and the corresponding element and its bucket number iii are stored in the other_elements mapping structure. 6.如权利要求5所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述利用FLsketch的集合差异分析算法计算自身内存池数据与所述压缩交易数据的差异,还包括:6. The method for constructing an efficient block propagation relay protocol Flychain protocol according to claim 5, wherein the method further comprises: calculating the difference between the self-memory pool data and the compressed transaction data using the FLsketch set difference analysis algorithm; 对目标DXA进行遍历操作,同样针对每一个桶i∈[0,m-1]以及桶中每一个槽位j∈[0,b-1],读取槽位中的元素对(carry_a,flag_a);Traverse the target DX A , and for each bucket i∈[0,m-1] and each slot j∈[0,b-1] in the bucket, read the element pair (carry_a,flag_a) in the slot; 当满足carry_a≠-1且所述元素对在other_elements映射结构中存在匹配项时,说明该元素在两个FLsketch中均出现,视为冗余数据;When carry_a≠-1 is satisfied and the element pair has a match in the other_elements mapping structure, it means that the element appears in both FLsketches and is considered redundant data; 将对应槽位内容置空,即令DXA.buckets[i][j]=(-1,-1),并将DXA.siz值减1;Empty the corresponding slot, i.e. set DX A .buckets[i][j] = (-1, -1), and reduce the value of DX A .siz by 1; 完成所有桶和槽的处理,返回更新后的FLsketchDXA,其已排除与DXB重复的部分,得到净化后的数据集合。After all buckets and slots are processed, the updated FLsketchDX A is returned, which excludes the parts repeated with DX B , and a purified data set is obtained. 7.如权利要求1所述的一种高效的区块传播中继协议飞链协议构建方法,其特征在于,所述所述区块传播中继协议飞链协议构建方法还包括以下步骤:7. The method for constructing an efficient block propagation relay protocol Feilian protocol according to claim 1, wherein the method further comprises the following steps: 当接收者的内存池数据不完整时,接收者检测自身内存池数据与发送方区块数据的交集,并将所述交集插入FLsketch数据结构中后发送给发送者;When the receiver's memory pool data is incomplete, the receiver detects the intersection of its own memory pool data and the sender's block data, inserts the intersection into the FLsketch data structure, and sends it to the sender; 发送者接收到RC后基于自身区块数据与RC进行集合差异分析,计算接收者的缺失交易数据;After receiving the RC, the sender performs a set difference analysis based on its own block data and the RC to calculate the receiver's missing transaction data; 发送者利用FLsketch数据结构对所述缺失交易数据进行压缩处理,并将压缩后的数据传输至接收者;The sender compresses the missing transaction data using the FLsketch data structure and transmits the compressed data to the receiver; 接收者解码并提取所述缺失交易数据,验证Merkle根一致性,并将缺失交易数据整合至本地区块数据中。The recipient decodes and extracts the missing transaction data, verifies the Merkle root consistency, and integrates the missing transaction data into the local block data. 8.实现如权利要求1所述一种高效的区块传播中继协议飞链协议构建方法的系统,其特征在于,所述系统包括以下模块:8. A system for implementing the method for constructing the efficient block propagation relay protocol Feilian protocol as claimed in claim 1, characterized in that the system includes the following modules: 数据发送模块,用于发送者将区块中包含的所有交易ID作为inv消息发送给接收者,所述inv消息包括区块中包含的交易概要;A data sending module, configured for the sender to send all transaction IDs contained in a block as an inv message to a receiver, wherein the inv message includes a summary of the transactions contained in the block; 数据接收模块,用于接收者收到所述inv消息后,向发送者发送getdata消息,并请求区块中的交易数据;The data receiving module is used for the receiver to send a getdata message to the sender after receiving the inv message and request the transaction data in the block; 数据压缩模块,用于发送者将交易数据通过FLsketch算法将所述交易数据进行压缩处理,得到压缩交易数据,将所述压缩交易数据发送给接受者;The data compression module is used by the sender to compress the transaction data using the FLsketch algorithm to obtain compressed transaction data, and then send the compressed transaction data to the recipient; 数据解压模块,用于接收者接收压缩交易数据,利用FLsketch的集合差异分析算法计算自身内存池数据与所述压缩交易数据的差异,识别接收者内存池中已有的交易和区块中新增的交易,确定实际差异;The data decompression module is used by the receiver to receive the compressed transaction data, calculate the difference between its own memory pool data and the compressed transaction data using FLsketch's set difference analysis algorithm, identify the existing transactions in the receiver's memory pool and the new transactions in the block, and determine the actual difference; 数据验证模块,用于接收者对新增的交易数据进行解码,校验区块头中的Merkle根,并将解析出的交易数据整合至自身区块中,完成区块同步。The data verification module is used by the receiver to decode the newly added transaction data, verify the Merkle root in the block header, and integrate the parsed transaction data into its own block to complete block synchronization. 9.实现如权利要求1所述一种高效的区块传播中继协议飞链协议构建方法的系统,其特征在于,所述系统包括以下子模块:9. A system for implementing the method for constructing the efficient block propagation relay protocol Feilian protocol as claimed in claim 1, characterized in that the system includes the following submodules: 验证子模块,用于对两个输入的FLsketch数据结构DXA与DXB进行一致性验证,若其容量参数DXA.capacity与DXB.capacity不一致,或其桶大小参数DXA.bucket_size与DXB.bucket_size不一致,则立即终止算法执行,并抛出异常信息;The verification submodule is used to verify the consistency of the two input FLsketch data structures DX A and DX B. If their capacity parameters DX A .capacity and DX B .capacity are inconsistent, or their bucket size parameters DX A .bucket_size and DX B .bucket_size are inconsistent, the algorithm execution is immediately terminated and an exception message is thrown; 设定子模块,用于设定一个名为other_elements的映射结构,用于暂存来自参考DXB中所有有效数据元素及其对应桶索引;The setting submodule is used to set a mapping structure named other_elements, which is used to temporarily store all valid data elements from the reference DX B and their corresponding bucket indexes; 遍历子模块,用于对参考FLsketch中的每一个桶进行遍历,对于每一个桶i∈[0,m-1],进一步对其中每一个槽位中的元素对(carry_b,flag_b)进行处理;The traversal submodule is used to traverse each bucket in the reference FLsketch. For each bucket i∈[0,m-1], the element pair (carry_b,flag_b) in each slot is further processed. 存入子模块,用于当满足carry_b≠-1时,视槽为有效数据,并将对应的元素及其桶编号iii存入other_elements映射结构中。The storage submodule is used to treat the slot as valid data when carry_b≠-1 is satisfied, and store the corresponding element and its bucket number iii in the other_elements mapping structure. 10.实现如权利要求1所述一种高效的区块传播中继协议飞链协议构建方法的系统,其特征在于,所述系统包括以下子模块:10. A system for implementing the method for constructing the efficient block propagation relay protocol Feilian protocol as claimed in claim 1, characterized in that the system includes the following submodules: 读取子模块,用于对目标DXA进行遍历操作,同样针对每一个桶i∈[0,m-1]以及桶中每一个槽位j∈[0,b-1],读取槽位中的元素对(carry_a,flag_a);The read submodule is used to traverse the target DX A. Similarly, for each bucket i∈[0,m-1] and each slot j∈[0,b-1] in the bucket, read the element pair (carry_a,flag_a) in the slot; 判断子模块,用于当满足carry_a≠-1且所述元素对在other_elements映射结构中存在匹配项时,说明该元素在两个FLsketch中均出现,视为冗余数据;The judgment submodule is used to determine that when carry_a≠-1 is satisfied and the element pair has a matching item in the other_elements mapping structure, it indicates that the element appears in both FLsketches and is considered redundant data; 设置子模块,用于将对应槽位内容置空,即令DXA.buckets[i][j]=(-1,-1),并将DXA.siz值减1;Set up a submodule to clear the corresponding slot content, that is, set DX A .buckets[i][j] = (-1, -1) and reduce the DX A .siz value by 1; 排除子模块,用于完成所有桶和槽的处理,返回更新后的FLsketch DXA,其已排除与DXB重复的部分,得到净化后的数据集合。The exclusion submodule is used to complete the processing of all buckets and slots, and return the updated FLsketch DX A , which has excluded the parts repeated with DX B , to obtain a purified data set.
CN202510784676.2A 2025-06-12 2025-06-12 Efficient block propagation relay protocol fly-chain protocol construction method Pending CN120658803A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202510784676.2A CN120658803A (en) 2025-06-12 2025-06-12 Efficient block propagation relay protocol fly-chain protocol construction method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202510784676.2A CN120658803A (en) 2025-06-12 2025-06-12 Efficient block propagation relay protocol fly-chain protocol construction method

Publications (1)

Publication Number Publication Date
CN120658803A true CN120658803A (en) 2025-09-16

Family

ID=97003804

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202510784676.2A Pending CN120658803A (en) 2025-06-12 2025-06-12 Efficient block propagation relay protocol fly-chain protocol construction method

Country Status (1)

Country Link
CN (1) CN120658803A (en)

Similar Documents

Publication Publication Date Title
EP3693886B1 (en) Optimizations for verification of interactions system and method
CN112286963B (en) Block chain terminal data credible query system and implementation method thereof
CN109391645B (en) Blockchain lightweight processing method, blockchain node and storage medium
CN110599169B (en) Data processing method, device, terminal and medium
CN111026511A (en) Block chain parallel system and method based on transaction data partition-inter-chain fusion
US20040107346A1 (en) Efficient authenticated dictionaries with skip lists and commutative hashing
CN116628083B (en) Blockchain transaction data expansion storage method and system
CN114785805B (en) Data transmission method, device, electronic equipment and storage medium
CN115021945A (en) Block chain transaction processing method and system
CN118660047A (en) Ultra-large file uploading method and device, electronic equipment and storage medium
CN108494790B (en) A method for detecting persistent network attacks in distributed networks
CN113986853A (en) Block chain data storage and sharing method, system, equipment and terminal
CN111832661B (en) Classification model construction method, device, computer equipment and readable storage medium
CN120658803A (en) Efficient block propagation relay protocol fly-chain protocol construction method
CN112162973A (en) Fingerprint collision avoidance, deduplication and recovery method, storage medium and deduplication system
WO2013136584A1 (en) Data transfer system
CN115118737B (en) A consortium chain block storage method based on node grouping
CN110651262B (en) Hierarchical distributed storage system and techniques for edge computing systems
CN112286966A (en) Data stream processing method, data stream recovery method, data stream processing device, data stream recovery device and storage medium
CN114461730B (en) Self-adaptive block data compression method based on remainder system
JP3431136B2 (en) Transmission data loss detection system
CN113821549B (en) A blockchain data retrieval system and method based on cloud storage
CN120255826B (en) A blockchain data storage and reading method based on block aggregation coding
US20230421402A1 (en) Methods and systems for compressing transaction identifiers
CN119127871B (en) A storage and query method and system combining erasure coding and sharding technology

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