A Blockchain-Based Distributed Network Data Integrity Verification Method and Device

By chunking data and combining step-by-step strategies of preliminary verification and final verification, using trine tree structure and hash value analysis, the problems of low efficiency and insufficient accuracy of data integrity verification in the existing technology are solved, and efficient and accurate data integrity verification is achieved.

CN119903559BActive Publication Date: 2025-07-11ANHUI BUSINESS VOCATIONAL COLLEGE
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411987979.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-07-11
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The existing blockchain-based data integrity verification methods have shortcomings in efficiency, accuracy and response to large-scale data, especially when large-scale data verification is too expensive and it is difficult to ensure accuracy.

Method used

The data blocking technology is used to divide the data into multiple data blocks, and the data blocks are analyzed in detail through a step-by-step strategy of preliminary verification and final verification, and the data blocks are analyzed in detail with the trine tree structure, and hash value and RSA encryption algorithms are used to ensure data integrity.

Benefits of technology

Improve the efficiency and accuracy of data integrity verification, especially in the case of massive data, tampered data units can be quickly positioned to ensure the security and integrity of the data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903559B_ABST
    Figure CN119903559B_ABST
Patent Text Reader

Abstract

The present invention provides a method and apparatus for verifying the integrity of distributed network data based on blockchain. The method includes: dividing the original data into m data blocks, each data block containing n data units, calculating the initial hash value of each data block, and uploading the initial hash value to the blockchain network; uploading the data block to be verified to the blockchain network and recalculating the data block hash value; preliminarily verifying the integrity of each data block according to the determined verification parameters and a preset threshold to determine whether the data block meets the preliminary integrity condition; for the data blocks that meet the preliminary integrity condition, constructing a ternary tree based on the hash values of each data unit; and determining whether the data in the data block meets the complete integrity condition; when all the divided data blocks meet the complete integrity condition, it is determined that the original data is complete. The present invention effectively solves the problems of low efficiency and vulnerability to attacks in traditional data integrity verification methods.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of computing networks, and more particularly to a method and device for verifying the integrity of distributed network data based on blockchain. Background Art

[0002] In today's digital age, the integrity of data is crucial in various fields. Traditional data storage and transmission methods face many challenges, such as data being easily tampered with and the integrity being difficult to guarantee during transmission. Therefore, it is particularly important to verify the integrity of data after transmission.

[0003] Currently, blockchain technology has advantages such as decentralization and immutability, and can be used for data integrity verification. However, existing blockchain-based data integrity verification methods still have deficiencies in terms of efficiency, accuracy, and handling large-scale data. For example, for the verification of massive data, existing methods may be slow in verification speed due to excessive consumption of computing resources, and the accuracy is difficult to guarantee in complex data environments.

[0004] Therefore, how to solve the problems of low efficiency and vulnerability to attacks in existing data integrity verification methods is an urgent need for those skilled in the art. Summary of the Invention

[0005] In view of this, the present invention provides a method for verifying the integrity of distributed network data based on blockchain, which is used to solve at least some of the technical problems in the background art.

[0006] To achieve the above object, the present invention adopts the following technical solutions:

[0007] A method for verifying the integrity of distributed network data based on blockchain, comprising:

[0008] Dividing the original data M into m data blocks D j , (j = 1, 2,..., m), each data block D j contains n data units d ij , (i = 1, 2,..., n) and each data unit d ij has a fixed length l;

[0009] Calculating the initial hash value H j of each data block D 0j = H(D j ) = H(d 1j ) ⊕ H(d 2j ) ⊕... ⊕ H(d nj ), and uploading the initial hash value H 0j to the blockchain network, and the initial hash value is stored in the blockchain network in the form of a hash chain;

[0010] Initial verification steps for data integrity:

[0011] Upload the data block D to be verified j to the blockchain network and recalculate the hash value H j of the data block D 1j ;

[0012] For each data block D j determine the verification parameter p j , where the verification parameter where P 同 represents the number of data units in each data block D j for which the recalculated hash value of the data unit is the same as the initial hash value of the data unit, and P 总 represents the total number n of data units in each data block D j ;

[0013] Based on the determined verification parameter p j and a preset threshold, perform an initial verification of the integrity of each data block D j to determine whether the data block meets the initial integrity condition;

[0014] Final verification steps for data integrity:

[0015] For the data block D that meets the initial integrity condition j , construct a trie based on the hash value H(d ij ) of each data unit d ij ;

[0016] Based on the constructed trie, determine whether the data in the data block D j that meets the initial integrity condition meets the complete integrity condition;

[0017] When all the divided data blocks D j meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D j does not meet the initial integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

[0018] Furthermore, in the initial verification steps for data integrity, based on the determined verification parameter p j and a preset threshold, perform an initial verification of the integrity of each data block D j to determine whether the data block meets the initial integrity condition, specifically including:

[0019] When the determined verification parameter p j satisfies p j ≥k, where k is a preset threshold, it is determined that the corresponding data block D jMeet the preliminary integrity condition; otherwise, judge the data block D i There is serious tampering, and it is marked.

[0020] Further, in the final data integrity verification step, judge whether the data in the data block D j that meets the preliminary integrity condition meets the complete integrity condition, specifically including:

[0021] Calculate the hash path value P j ' from the leaf node to the root node in the ternary tree;

[0022] Compare the hash path value P j ' with the pre-stored standard path value P 0j . If P j = P 0j , then the data in the data block D j that meets the preliminary integrity condition is completely intact.

[0023] Further, in the final data integrity verification step, the constructed ternary tree meets the following requirements:

[0024] Let the root node of the ternary tree be R, the left child node be L, the middle child node be M, and the right child node be R;

[0025] Represent the root node layer as the 0th layer. For the node N s :

[0026] If the layer number s of the node N s is a multiple of 3, then the left child node L s of the node N s+1 = H(d 3i,j ), the middle child node M s+1 = H(d 3i+1,j ), and the right child node R s+1 = H(d 3i+2 , j);

[0027] If the layer number s of the node N s has a remainder of 1 when divided by 3, then the left child node L s of the node N s+1 = H(d 3i+1,j ), the middle child node M s+1 = H(d 3i+2,j ), and the right child node R s+1 = H(d 3i,j );

[0028] If the layer number s of the node N s has a remainder of 2 when divided by 3, then the left child node L s of the node N s+1= H(d 3i+2,j ), the child node M s+1 = H(d 3i,j ), the right child node R s+1 = H(d 3i+1,j ).

[0029] Furthermore, in the data preprocessing step, it also includes adding a traceability label to each data unit.

[0030] Furthermore, in the data preprocessing step, before calculating the hash value of each data block D j , it also includes encrypting and encoding each data block D j using the RSA encryption algorithm E; in the corresponding preliminary data integrity verification step, the encoded data block E(D j ) is uploaded to the blockchain network, and the hash value of the encoded data block E(D j ) is recalculated.

[0031] Furthermore, the hash algorithm used to calculate the hash value in the present invention includes the SHA-256 algorithm.

[0032] On the other hand, the present invention also discloses a blockchain-based distributed network data integrity verification device, including:[[]]

[0033] Data preprocessing module:

[0034] For splitting the original data M into m data blocks D j , (j = 1, 2,..., m), each data block D j contains n data units d ij , (i = 1, 2,..., n) and each data unit d ij has a fixed length l;

[0035] And calculating the initial hash value H j of each data block D 0j = H(D j ) = H(d 1j ) ⊕ H(d 2j ) ⊕... ⊕

[0036] H(d nj ), and uploading the initial hash value H 0j to the blockchain network;

[0037] Data integrity preliminary verification module:

[0038] For uploading the data block D j to be verified to the blockchain network, and recalculating the hash value H j of the data block D 1j ;

[0039] For each data block D j Determine the verification parameter p j , where the verification parameter Among them, P 同 represents the number of data units in each data block D j where the recalculated hash value of the data unit is the same as the initial hash value of the data unit, and P 总 represents the total number n of data units in each data block D j ;

[0040] According to the determined verification parameter p j and the preset threshold, perform a preliminary verification on the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition;

[0041] Data integrity final verification module:

[0042] Used to receive the data block D that meets the preliminary integrity condition j , and construct a ternary tree according to the hash value H(d ij ) of each data unit d ij ; Determine whether the data in the data block D that meets the preliminary integrity condition j meets the complete integrity condition;

[0043] When all the divided data blocks D j meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D j does not meet the preliminary integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

[0044] Preferably, in the data integrity preliminary verification module of the present invention, according to the determined verification parameter p j and the preset threshold, perform a preliminary verification on the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition, specifically including:

[0045] When the determined verification parameter p j satisfies p j ≥k, where k is the preset threshold, it is determined that the corresponding data block D j meets the preliminary integrity condition; otherwise, it is determined that the data block D i has been seriously tampered with and is marked.

[0046] Preferably, in the data integrity final verification module of the present invention, according to the constructed ternary tree, determine whether the data in the data block D that meets the preliminary integrity condition j meets the complete integrity condition, specifically including:

[0047] Calculate the hash path value P from the leaf node to the root node in the ternary tree j ';

[0048] Compare the hash path value P j ' with the pre-stored standard path value P 0j If P j = P 0j , the data in the data block D j that meets the preliminary integrity condition is completely intact.

[0049] As can be seen from the above technical solutions, compared with the prior art, the present invention discloses a method for verifying the integrity of distributed network data based on a blockchain, which has the following beneficial effects:

[0050] Through the data chunking technology, the present invention divides and processes large-scale data, reducing the computational complexity of a single verification process. At the same time, a step-by-step verification strategy of preliminary verification + final verification is adopted. Through preliminary verification, it is roughly judged whether each data block is complete, and the integrity of the data block is finally judged through the final verification method. Through the above method and system, the present invention improves the efficiency of data integrity verification, especially suitable for the integrity verification of massive data.

[0051] The present invention uses a ternary tree to further verify the data blocks after preliminary verification, which can analyze the data in more detail and locate the tampered data units, further improving the efficiency and accuracy of verification.

[0052] The method and device for verifying the integrity of distributed network data based on a blockchain adopted by the present invention have broad application prospects. For example, in the fields of cloud computing data storage, financial transaction data transmission, etc., it can ensure the security of data. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings required for the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained according to the provided drawings.

[0054] Figure 1 It is a schematic diagram of the overall process of the network data integrity verification method provided by the present invention.

[0055] Figure 2 It is a schematic diagram of the step process of the preliminary verification of data integrity provided by the present invention.

[0056] Figure 3Schematic diagram of the step process for the final verification of data integrity provided by the present invention. Detailed implementation mode

[0057] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0058] The present invention provides a method and device for verifying the integrity of distributed network data based on blockchain. By combining the uploaded files and making innovations, greater breakthroughs have been achieved in terms of security, scalability, data privacy protection, etc., making it have higher application value and market competitiveness in the field of data integrity verification.

[0059] Embodiment 1:

[0060] Embodiment 1 discloses a method for verifying the integrity of distributed network data based on blockchain, which uses a step-by-step verification strategy of data block combination + preliminary verification + final verification to verify the integrity of massive data. The overall steps are as Figure 1 shown and include:

[0061] Data preprocessing step:

[0062] The data sender divides the original data M into m data blocks D j , (j = 1, 2,..., m), and each data block D j contains n data units d ij , (i = 1, 2,..., n) and each data unit d ij has a fixed length l;

[0063] Calculate the initial hash value H j of each data block D 0j = H(D j ) = H(d 1j ) ⊕ H(d 2j ) ⊕... ⊕ H(d nj ), and upload the initial hash value H 0j to the blockchain network, and the initial hash value is stored in the blockchain network in the form of a hash chain;

[0064] Data integrity preliminary verification step:

[0065] Upload the data block D j to be verified to the blockchain network, and recalculate the hash value H j of the data block D 1j ;

[0066] For each data block D j Determine the verification parameter p j , where the verification parameter Among them, P 同 represents the number of data unit hash values in each data block D j whose recalculated data unit hash value is the same as the initial hash value of the data unit, and P 总 represents the total number n of data units in each data block D j ;

[0067] According to the determined verification parameter p j and the preset threshold, preliminarily verify the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition;

[0068] Final verification step of data integrity:

[0069] For the data block D that meets the preliminary integrity condition j , construct a ternary tree according to the hash value H(d ij ) of each data unit d ij ;

[0070] According to the constructed ternary tree, determine whether the data in the data block D j that meets the preliminary integrity condition meets the complete integrity condition;

[0071] When all the divided data blocks D j meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D j does not meet the preliminary integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

[0072] Furthermore, in the preliminary verification step of data integrity, according to the determined verification parameter p j and the preset threshold, preliminarily verify the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition, specifically including:

[0073] When the determined verification parameter p j satisfies p j ≥k, where k is the preset threshold, it is determined that the corresponding data block D j meets the preliminary integrity condition; otherwise, it is determined that the data block D i has been seriously tampered with and is marked. The steps of the preliminary verification of data integrity are as Figure 2 shown.

[0074] Further, in the final data integrity verification step, it is determined whether the data in the data block D that meets the preliminary integrity condition satisfies the complete integrity condition according to the constructed ternary tree, specifically including: j The data in

[0075] Calculate the hash path value P j ' from the leaf node to the root node in the constructed ternary tree;

[0076] Compare the calculated hash path value P j ' with the pre-stored standard path value P 0j . If P j = P 0j , then the data in the data block D that meets the preliminary integrity condition is completely intact, and the steps of the preliminary data integrity verification are as j shown. Figure 3 shown.

[0077] Further, in the final data integrity verification step, the constructed ternary tree meets the following requirements:

[0078] Let the root node of the ternary tree be R, the left child node be L, the middle child node be M, and the right child node be R;

[0079] Represent the root node layer as the 0th layer. For the node N in the s-th layer of the ternary tree s :

[0080] If the layer number s of the node N s is a multiple of 3, then the left child node L s of the node N s+1 = H(d 3i,j ), the middle child node M s+1 = H(d 3i+1,j ), and the right child node R s+1 = H(d 3i+2,j );

[0081] If the layer number s of the node N s has a remainder of 1 when divided by 3, then the left child node L s of the node N s+1 = H(d 3i+1,j ), the middle child node M s+1 = H(d 3i+2,j ), and the right child node R s+1 = H(d 3i,j );

[0082] If the layer number s of the node N s has a remainder of 2 when divided by 3, then the left child node L s of the node N s+1 = H(d 3i+2,j ), the middle child node M s+1 = H(d3i,j ), the right child node R s+1 = H(d 3i+1,j ).

[0083] Furthermore, in the data preprocessing step, it also includes adding a traceability label to each data unit, which facilitates tracing of the data unit that has been tampered with in subsequent steps.

[0084] Furthermore, in the data preprocessing step, before calculating the hash value of each data block D j , it also includes encrypting and encoding each data block D j using the RSA encryption algorithm E. At this time, calculate the initial hash value H j of each encoded data block E(D 0j ) = H(E(D j )) = H(E(d 1j )) ⊕ H(E(d 2j )) ⊕ … ⊕ H(E(d nj )); In the corresponding preliminary data integrity verification step, upload the encoded data block E(D j ) to the blockchain network and recalculate the hash value of the encoded data block E(D j ).

[0085] If each data block D j is encrypted and encoded, in the final data integrity verification step, the constructed ternary tree meets the following requirements:

[0086] Let the root node of the ternary tree be R, the left child node be L, the middle child node be M, and the right child node be R;

[0087] Represent the root node layer as the 0th layer. For the node N s in the s-th layer of the ternary tree:

[0088] If the layer s of the node N s is a multiple of 3, then the left child node L s of the node N s+1 = H(E(d 3i,j ), the middle child node M s+1 = H(E(d 3i+1,j ), and the right child node R s+1 = H(E(d 3i+2,j ));

[0089] If the layer s of the node N s has a remainder of 1 when divided by 3, then the left child node L s of the node N s+1 = H(E(d 3i+1,j ), the middle child node M s+1 = H(E(d 3i+2,j), the right child node R s+1 = H(E(d 3i,j ));

[0090] If the layer number s of node N s has a remainder of 2 when divided by 3, then the left child node L of node N s = H(E(d s+1 )), the middle child node M 3i+2,j = H(E(d s+1 )), and the right child node R 3i,j = H(E(d s+1 )); 3i+1,j ).

[0091] Furthermore, the hash algorithm used to calculate the hash value includes the SHA-256 algorithm.

[0092] In practical applications, for example, in the scenario of big data storage, the original data M can be a large amount of user behavior data. The original data can be divided into m data blocks D j . Each data block D j The data unit d ij in it can store user behavior information of different dimensions, such as login time, operation type, etc.

[0093] For the encryption encoding E, the RSA encryption algorithm can be used to encrypt and encode the data block D j . When calculating the hash value, taking the SHA-256 algorithm as an example, the length of the hash value output by the hash operation of this algorithm is 256 bits. When comparing the hash values H 0j and H 1j , the number of identical hash bits is obtained by comparing bit by bit, so as to calculate the verification parameter p j .

[0094] For the ternary tree structure constructed in the final verification step, the depth h of the ternary tree is determined according to the number n of data units in the data block, h = log3(2n + 1). Since the depth is an integer, the obtained h is rounded up to get the final depth of the ternary tree. When locating the tampered data unit, by comparing the hash value differences on different paths, the specific data unit can be quickly located according to the structural characteristics of the ternary tree.

[0095] After all the data blocks D j are verified, the integrity of the overall data M needs to be verified. When all the divided data blocks D j meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D jWhen the initial completeness condition or the complete completeness condition is not met, it is determined that the original data M is incomplete, and the result is fed back to the data sender.

[0096] Another aspect of the present invention also discloses a blockchain-based distributed network data integrity verification device, including:

[0097] Data preprocessing module:

[0098] For splitting the original data M into m data blocks D j , (j = 1, 2,..., m), each data block D j contains n data units d ij , (i = 1, 2,..., n) and each data unit d ij has a fixed length l;

[0099] And calculate the initial hash value H j of each data block D 0j = H(D j ) = H(d 1j ) ⊕ H(d 2j ) ⊕... ⊕

[0100] H(d nj ), and upload the initial hash value H 0j to the blockchain network;

[0101] Data integrity preliminary verification module:

[0102] For uploading the data block D j to be verified to the blockchain network, and recalculating the hash value H j of the data block D 1j ;

[0103] For each data block D j determine the check parameter p j , the check parameter wherein, P 同 represents the number of data units in each data block D j whose recalculated data unit hash value is the same as the initial hash value of the data unit, and P 总 represents the total number n of data units in each data block D j ;

[0104] According to the determined check parameter p j and the preset threshold, preliminarily verify the integrity of each data block D j , and determine whether the data block meets the initial completeness condition;

[0105] Data integrity final verification module:

[0106] For receiving a data block D that meets the preliminary integrity condition j , and constructing a ternary tree according to the hash value H(d ij ) of each data unit d ij ; Judging whether the data in the data block D j that meets the preliminary integrity condition meets the complete integrity condition;

[0107] When all the data blocks D j after splitting meet the complete integrity condition, it is determined that the original data M is complete; If any of the data blocks D j after splitting does not meet the preliminary integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

[0108] Furthermore, in the data integrity preliminary verification module, according to the determined verification parameter p j and a preset threshold, the integrity of each data block D j is preliminarily verified to determine whether the data block meets the preliminary integrity condition, specifically including:

[0109] When the determined verification parameter p j satisfies p j ≥k, where k is a preset threshold, it is determined that the corresponding data block D j meets the preliminary integrity condition; Otherwise, it is determined that the data block D i has been seriously tampered with and is marked.

[0110] Furthermore, in the data integrity final verification module, according to the constructed ternary tree, it is judged whether the data in the data block D j that meets the preliminary integrity condition meets the complete integrity condition, specifically including:

[0111] Calculating the hash path value P j ' from the leaf node to the root node in the ternary tree;

[0112] Comparing the calculated hash path value P j ' with the pre-stored standard path value P 0j . If P j = P 0j , then the data in the data block D j that meets the preliminary integrity condition is completely complete.

[0113] The foregoing description of the disclosed embodiments enables those skilled in the art to practice or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for verifying the integrity of distributed network data based on blockchain, characterized in that, Including: Data preprocessing step: Divide the original data M into m data blocks D j , j = 1, 2, …, m, each data block D j contains n data units d ij , i = 1, 2, …, n and each data unit d ij has a fixed length l ; Calculate each data block D j 's initial hash value H 0j =H(D j )=H(d 1j ) ⊕ H(d 2j ) ⊕ … ⊕ H(d nj ), and upload the initial hash value H 0j to the blockchain network, and the initial hash value is stored in the blockchain network in the form of a hash chain; Initial data integrity verification step: Upload the data block D to be verified j to the blockchain network and recalculate the hash value H j of the data block D 1j ; For each data block D j Determine the check parameter p j , where the check parameter p j= P 同 / P 总 , and P 同 represents the number of data units in each data block D j for which the recalculated hash value of the data unit is the same as the initial hash value of the data unit, and P 总 represents the total number n of data units in each data block D j ; According to the determined verification parameter p j and the preset threshold value, perform a preliminary verification on the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition; Final data integrity verification step: For the data block D that meets the preliminary integrity conditions j , according to each data unit d ij 's hash value H(d ij ), construct a ternary tree; Judge whether the data in the data block D that meets the preliminary integrity condition meets the complete integrity condition according to the constructed ternary tree j in it; When all the divided data blocks D j all meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D j does not meet the preliminary integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

2. The method for verifying the integrity of distributed network data based on blockchain according to claim 1, wherein, In the initial data integrity verification step, according to the determined verification parameter p j and the preset threshold, the integrity of each data block D j is initially verified to determine whether the data block meets the initial integrity condition, specifically including: When the determined verification parameter p j satisfies p j ≥ k, where k is a preset threshold, then it is determined that the corresponding data block D j meets the preliminary integrity condition; otherwise, it is determined that the data block D j has been seriously tampered with and is marked accordingly.

3. A method for verifying the integrity of distributed network data based on blockchain according to claim 1, characterized in that In the final data integrity verification step, it is determined whether the data in the data block D that meets the preliminary integrity condition meets the complete integrity condition according to the constructed ternary tree, specifically including: j whether the data in it meets the complete integrity condition, specifically including: Calculate the hash path value P from the leaf node to the root node in the ternary tree j '; Compare the hash path value P j ' with the pre-stored standard path value P 0j . If P j = P 0j , then the data in the data block D j that meets the preliminary integrity condition is completely intact.

4. A method for verifying the integrity of distributed network data based on blockchain according to claim 1, characterized in that, In the final data integrity verification step, the constructed ternary tree meets the following requirements: Let the root node of the ternary tree be R, the left child node be L, the middle child node be M, and the right child node be R; Denote the layer of the root node as the 0th layer. For a node N at the s-th layer in a ternary tree s :[[-END]] If node N s has a layer number s that is a multiple of 3, then for node N s its left child node L s+1 =H(d 3i,j ), its middle child node M s+1 =H(d 3i+1,j ), and its right child node R s+1 =H(d 3i+2 , j ); If node N s has a layer number s that leaves a remainder of 1 when divided by 3, then for node N s its left child node L s+1 =H(d 3i+1,j ), its middle child node M s+1 =H(d 3i+2,j ), and its right child node R s+1 =H(d 3i,j ); If the layer number s of node N s has a remainder of 2 when divided by 3, then for node N s its left child node L s+1 =H(d 3i+2,j ), the middle child node M s+1 =H(d 3i,j ), and the right child node R s+1 =H(d 3i+1,j ).

5. A method for verifying the integrity of distributed network data based on blockchain according to claim 1, characterized in that, In the data preprocessing step, it also includes adding a traceability label to each data unit.

6. A method for verifying the integrity of distributed network data based on blockchain according to claim 1, characterized in that, In the data preprocessing step, before calculating the hash value of each data block D j it also includes encrypting and encoding each data block D using the RSA encryption algorithm E j ; in the corresponding preliminary data integrity verification step, the encoded data block E(D j ) is uploaded to the blockchain network, and the hash value of the encoded data block E(D j ) is recalculated.

7. A method for verifying the integrity of distributed network data based on blockchain according to claim 1, characterized in that, The hash algorithm used to calculate the hash value includes the SHA-256 algorithm.

8. A blockchain-based distributed network data integrity verification device, characterized in that, Including: Data preprocessing module: For splitting the original data M into m data blocks D j , j = 1, 2, …, m, each data block D j contains n data units d ij , i = 1, 2, …, n and each data unit d ij has a fixed length l ; And calculate each data block D j The initial hash value H 0j =H(D j )=H(d 1j )⊕ H(d 2j )⊕…⊕ H(d nj ), and the initial hash value H 0j Upload to the blockchain network; Initial data integrity verification module: For uploading the data block D to be verified j to a blockchain network and recalculating the data block D j hash value H 1j ; For each data block D j Determine the check parameter p j , where the check parameter p j= P 同 / P 总 , where P 同 represents the number of data units in each data block D j for which the recalculated hash value of the data unit is the same as the initial hash value of the data unit, and P 总 represents the total number of data units n in each data block D j ; Based on the determined verification parameter p j and the preset threshold value, perform a preliminary verification on the integrity of each data block D j to determine whether the data block meets the preliminary integrity condition; Final data integrity verification module: For receiving a data block D that meets the preliminary completeness condition j , and constructing a ternary tree according to the hash value H(d ij ) of each data unit d ij ; judging whether the data in the data block D j that meets the preliminary completeness condition meets the complete completeness condition; When all the divided data blocks D j all meet the complete integrity condition, it is determined that the original data M is complete; if any of the divided data blocks D j does not meet the preliminary integrity condition or the complete integrity condition, it is determined that the original data M is incomplete.

9. The distributed network data integrity verification device based on blockchain according to claim 8, characterized in that, In the initial data integrity verification module, according to the determined verification parameter p j and the preset threshold value, the integrity of each data block D j is initially verified to determine whether the data block meets the initial integrity condition, which specifically includes: When the determined verification parameter p j satisfies p j ≥ k, where k is a preset threshold, it is determined that the corresponding data block D j meets the preliminary integrity condition; otherwise, it is determined that the data block D j has been seriously tampered with and is marked accordingly.

10. A distributed network data integrity verification device based on blockchain according to claim 8, characterized in that In the data integrity final verification module, it is determined whether the data in the data block D j satisfying the preliminary integrity condition meets the complete integrity condition according to the constructed ternary tree, specifically including: Calculate the hash path value P from the leaf node to the root node in the ternary tree j '; Compare the hash path value P j ′ with the pre-stored standard path value P 0j . If P j = P 0j , then the data in the data block D j that meets the preliminary integrity condition is completely intact.

Citation Information

Patent Citations

  • A public transport data processing method and apparatus based on a block chain

    CN109241778A

  • Data integrity verification method and system based on block chain technology

    CN115618428A