A data integrity verification method based on blockchain

Through a hybrid architecture database and multi-dimensional hash algorithm, combined with a dynamic adaptive consensus mechanism, the problems of precise positioning and efficient processing of blockchain data integrity verification are solved, and efficient and secure data integrity verification is achieved in complex network environments.

CN120492467BActive Publication Date: 2025-09-30BEIJING GEER GUOXIN TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510691578.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-27
Publication Date
2025-09-30
Estimated Expiration
2045-05-27

AI Technical Summary

Technical Problem

Existing blockchain-based data integrity verification methods have difficulty accurately locating data tampering when faced with complex structured data, cannot dynamically adjust algorithms according to the network environment, have limited single-chain processing capabilities and insufficient security, and are particularly inefficient under high load or node instability.

Method used

A hybrid architecture database is used to segment data, combined with a multi-dimensional hash algorithm and a dynamic adaptive consensus mechanism. Multiple blockchains are built through a consortium chain architecture to store and verify different types of data respectively, and the consensus algorithm is dynamically adjusted to adapt to network load and node performance.

Benefits of technology

It achieves accurate positioning and rapid verification of complex structured data, improves verification efficiency and security, avoids single-chain congestion and attack impacts, and enhances data isolation and protection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120492467B_ABST
    Figure CN120492467B_ABST
Patent Text Reader

Abstract

The present invention discloses a data integrity verification method based on blockchain, which specifically relates to the field of data verification. The method first constructs a hybrid architecture of relational and non-relational databases to store various types of data and statistical information, then performs multi-dimensional segmentation on image and text data, respectively calculates data unit hash values ​​using specific algorithms, and obtains data block hash values ​​and top-level hash values ​​through hash aggregation. The method utilizes a consortium chain architecture and smart contracts to achieve data upload and storage, sets access rights for different blockchains, and dynamically adjusts the consensus algorithm through real-time monitoring of network load and node performance status to ensure stable operation of the blockchain network. In the data integrity verification link, after preliminary and detailed verification, hash values ​​at all levels are compared to accurately judge data integrity. The method can effectively process complex data, quickly locate tampering locations, and improve verification efficiency and security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data verification technology, and more specifically, to a data integrity verification method based on blockchain. Background Art

[0002] In the digital age, data has become a core asset for business and social development, making data integrity crucial. Traditional data integrity verification methods rely primarily on centralized servers or third-party organizations. For example, in the financial sector, transaction data verification is typically performed by a bank's central server; in the healthcare industry, the integrity verification of patient medical records relies on the hospital's centralized database management system. However, this centralized verification approach has numerous drawbacks. Centralized servers are vulnerable to hacker attacks, and once attacked, data can be maliciously tampered with in ways that are difficult to detect quickly. The involvement of third-party organizations increases the cost of trust, and their own credibility is difficult to guarantee. If a third-party organization experiences credit issues, this will directly impact the reliability of data integrity verification.

[0003] With the rise of blockchain technology, its decentralization, distributed storage, and immutability have provided new ways to verify data integrity.

[0004] However, it still has some shortcomings in actual use. For example, the existing data integrity verification method based on blockchain often adopts simple data segmentation and hash calculation methods. When faced with complex structured data, a single processing method cannot fully extract data features, resulting in difficulty in accurately identifying specific data blocks or units when data is tampered, and unable to achieve precise positioning. In addition, the existing technology uses a fixed consensus algorithm. When the network environment changes dynamically, the algorithm and parameters cannot be adjusted according to actual conditions. This causes a significant drop in verification efficiency under high load or node instability, and security is also difficult to guarantee. At the same time, the existing technology is mostly based on a single chain for data storage and verification. When processing large-scale data, the processing capacity of a single chain is limited, and congestion is prone to occur, resulting in low verification efficiency. Once a single chain is attacked, the integrity of all data on the chain is threatened, and there is a lack of data isolation and protection mechanisms. Summary of the Invention

[0005] In order to overcome the above-mentioned defects of the prior art, an embodiment of the present invention provides a data integrity verification method based on blockchain, which solves the problems raised in the above-mentioned background technology through the following scheme.

[0006] To achieve the above-mentioned object, the present invention provides the following technical solution: a data integrity verification method based on blockchain, comprising: S1: database construction: constructing a hybrid architecture database of relational database and non-relational database based on a data importance configuration table, a data usage statistical information table, a text data set, and an image data set;

[0007] S2: Multidimensional data segmentation: Perform segmentation operations on the image data and text data in the database respectively, dividing the image data and text data into different data units;

[0008] S3: Hash calculation: Hash value calculation is performed based on the data units divided in step S2, hash aggregation is performed based on the hash value calculation results to obtain the data block hash value, and the hash values ​​of all data blocks are serially calculated to obtain the top-level hash value;

[0009] The hash value calculation includes text data unit hash value calculation and image data unit hash value calculation, the text data unit uses the FNV hash algorithm to calculate the hash value, and the image data unit uses the perceptual hash algorithm;

[0010] S4: Data storage: Use the alliance chain architecture to build multiple blockchains, and use blockchain smart contracts to realize data upload and storage functions;

[0011] S5: Dynamic adaptive consensus mechanism adjustment: Set a counter in the data processing module of the blockchain node to count the number of data processing tasks successfully completed per minute, determine the network load status, use the node discovery mechanism of the blockchain network to obtain a list of online nodes and count the number of nodes, determine the node performance status, and switch the consensus algorithm strategy in real time based on different statuses;

[0012] S6: Data integrity verification: After preliminary verification and detailed verification of the data to be verified, the results are determined to determine the integrity of the data to be verified.

[0013] Technical effects and advantages of the present invention:

[0014] 1. This invention segments data based on data type and importance. For text data, natural language processing techniques are used to perform operations such as word segmentation, part-of-speech tagging, and named entity recognition, combined with topic segmentation. For image data, the OpenCV library is used to perform a series of processing operations, including grayscale conversion, Gaussian blurring, and edge detection. Regional features are also calculated for similarity judgment and merging. This multi-dimensional processing approach fully exploits the characteristics of different data types, dividing them into reasonable data units. Specific hash algorithms are applied to different types of data units. Through this hierarchical calculation, if a hash value inconsistency is found during data integrity verification, the specific data unit or data block with the problem can be accurately and quickly located.

[0015] 2. The present invention sets a counter in the data processing module of the blockchain node to count the number of statistical processing tasks, judges the network load status, uses the node discovery mechanism to obtain the statistical number of online node lists, judges the node performance status, and adjusts the consensus algorithm in real time according to the monitored status. When the network load is low and the node performance is stable, it switches to the proof-of-stake algorithm and lowers the stake threshold for participating consensus nodes, thereby improving verification efficiency. When the network load is high or the node performance is unstable, it switches to the practical Byzantine fault-tolerant algorithm, screens qualified nodes to participate in the consensus process, and ensures the security and stability of verification;

[0016] 3. This invention uses a consortium chain architecture to construct multiple blockchains, including a privacy protection chain, a business data chain, and a main chain. The privacy protection chain stores sensitive data hash values ​​and sets strict access control policies. The business data chain allocates read and write permissions to different organizations and nodes based on business needs to store public business data hash values. The main chain stores top-level hash values ​​and coordinates sub-chain verification work. Multiple chains process data in parallel, and different types of data are stored and verified on their respective chains. This avoids the congestion problem when a single chain processes large-scale data and improves verification efficiency. At the same time, the functions and permissions of each chain are clear, and the data is isolated from each other. Even if a sub-chain is attacked, it will not affect the integrity of the data on other chains, thereby enhancing overall security. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 It is a schematic diagram of the overall structure of the present invention. DETAILED DESCRIPTION

[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of the present invention.

[0019] As attached Figure 1 A data integrity verification method based on blockchain is shown, comprising:

[0020] S1: Database construction: Based on the data importance configuration table, data usage statistics table, text data set, and image data set, a hybrid architecture database of relational and non-relational databases is constructed;

[0021] It should be specifically noted that the relational database is constructed based on a data importance configuration table and a data usage statistics information table, and the non-relational database is constructed based on a text data set and an image data set;

[0022] The data importance configuration table is used to store data importance level configuration information. The data importance levels are determined by industry experts and the enterprise data management team based on industry regulatory requirements, the core degree of business processes, and the data security level, with high priority and low priority levels. This embodiment does not impose specific restrictions. This configuration information will be used to determine data importance in the data preprocessing stage and guide data segmentation and weight allocation.

[0023] The data usage statistics table is used to store data usage frequency and modification frequency information;

[0024] The text data set refers to text data generated directly from the text generation scenario of the business system;

[0025] The image data set refers to various types of image data collected during the image generation phase of the business process;

[0026] It should be further explained that after the database installation and configuration is complete, the data initialization phase begins. For the "Data Management Library," the data administrator manually enters or imports configuration files to populate the "Data Importance Configuration Table" with the initial configuration information for industry data importance levels. After the system is up and running, it monitors data usage in real time and automatically records data access and modification events in the "Data Usage Statistics Table." After the "Unstructured Data Warehouse" is connected to the business system, it immediately begins receiving raw text and image data in real time. When the business system generates new order notes or uploads product images, the data is immediately stored in the corresponding "Text Data Set" and "Image Data Set." During the data preprocessing phase, the system reads raw text and image data from the "Unstructured Data Warehouse" and obtains structured data such as data importance configuration and usage frequency from the "Data Management Library." This provides a complete data foundation for subsequent operations such as data segmentation, importance division, and hash calculation, ensuring the smooth progress of the data integrity verification process.

[0027] S2: Multidimensional data segmentation: Perform segmentation operations on the image data and text data in the database respectively, dividing the image data and text data into different data units;

[0028] The segmentation processing operation of the image data is as follows:

[0029] The OpenCV library is used to process the image. The color image is first converted to a grayscale image, and then multi-scale Gaussian blur is performed. Gaussian filters with kernel sizes of (3,3), (5,5), and (7,7) are used to remove noise. Canny edge detection is performed on the blurred image, and the low threshold is set to 50 and the high threshold is set to 150 to obtain edge information. The edge information of the three scales is weighted fused with weights of 0.3, 0.4, and 0.3. Morphological processing is performed on the fused edge image, including two dilation and two erosion operations using a structuring element of size (3,3). Finally, the watershed algorithm is used for segmentation. The area, Hu rectangular features, color mean and variance parameters of each region are calculated, and the similarity is calculated using Euclidean distance. The similarity threshold is set to 0.7, and adjacent regions with similarity above the threshold are merged to form image data units.

[0030] The similarity is calculated as follows:

[0031] For two image regions R1 and R2, their feature vectors are f1=(a1,h1,c1,v1) and f2=(a2,h2,c2,v2), where a represents the area, h represents the Hu rectangular feature, c represents the color mean, and v represents the color variance. The Euclidean distance is calculated as:

[0032] ,The smaller the value of the Euclidean distance, the more similar the two image regions are. If the Euclidean distance is less than the threshold, the two regions are considered similar and merged into one region;

[0033] The segmentation processing operation of the text data is as follows:

[0034] Natural language processing technology is used, and the spaCy model is used to perform word segmentation, part-of-speech tagging, and named entity recognition on the text. By building a custom stop word list and merging it with the spaCy model's built-in stop word list, stop words are removed and words are restored to stem form. Dependency syntax analysis is used to determine the grammatical relationship between sentences. The BERTopic model is combined for topic division, and the text is divided into different data units.

[0035] The word segmentation refers to inputting the input text data, such as the e-commerce order note "Purchase mobile phone, 128GB, white, delivery time: tomorrow", into the loaded spaCy model. The model splits the text into independent words based on its internal word segmentation algorithm and rules, such as "purchase", "mobile phone", "128GB", "white", "delivery time", and "tomorrow", realizing the preliminary decomposition of the text from sentences to words, providing the basic unit for subsequent in-depth analysis.

[0036] The above-mentioned part-of-speech tagging means that, based on word segmentation, the spaCy model performs part-of-speech tagging on each word. By analyzing the grammatical functions and semantic roles of words in a sentence, corresponding part-of-speech tags are assigned to each word, such as nouns, verbs, adjectives, etc.;

[0037] The above-mentioned named entity recognition means using the named entity recognition function of the spaCy model to identify entities with specific meanings from the text, such as person names, place names, organization names, product names, etc.;

[0038] The above-mentioned construction of a custom stop word list means analyzing the characteristic words in the text of the business scenario. For example, in the text of e-commerce order remarks, Chinese words such as "的", "了", "在", etc., and English words such as "the", "and", "is", etc. usually do not contain key semantic information. These words are recorded one by one in the stop word set text and arranged in rows to form a stop word set that meets specific business requirements;

[0039] The above-mentioned dependency parsing means analyzing the dependency relationships between various components in a sentence, such as subject-predicate relationships, verb-object relationships, modifier-head relationships, etc. For example, in the sentence "购买手机" (Purchase a mobile phone), through dependency parsing, it can be determined that "购买" (Purchase) is the predicate verb and "手机" (mobile phone) is the object, and there is a verb-object relationship between them. By identifying these grammatical relationships, the closeness between sentences can be judged. If there are close grammatical connections such as attributive clause relationships, adverbial clause relationships or complement clause relationships in the sentence, the relevant sentences are grouped into the same group, providing a grammatical basis for the segmentation of text data units.

[0040] The above-mentioned topic division means inputting the text data processed above into the BERTopic model for topic division. The BERTopic model is based on the pre-trained BERT model, which can extract deep semantic features from the text and divide the text with similar semantics into different topics through a clustering algorithm. For example, for the text of e-commerce order remarks, the BERTopic model may divide it into topics such as commodity information topics and logistics information topics. According to the divided topics, the text is further segmented into different data units to achieve refined processing and structured organization of the text data.

[0041] S3: Hash calculation: Calculate the hash value based on the data units divided in step S2, perform hash aggregation based on the calculation result of the hash value to obtain the data block hash value, and calculate the concatenation of the hash values of all data blocks to obtain the top-level hash value;

[0042] It should be specifically noted that the hash value calculation includes the hash value calculation of text data units and the hash value calculation of image data units. For the text data units, the FNV hash algorithm is used to calculate the hash value, and for the image data units, the perceptual hash algorithm is adopted;

[0043] The FNV hash algorithm is a fast hash algorithm that calculates a hash value through a series of bitwise operations. Its basic principle is to use an initial value and then perform specific operations on each byte of the input data to continuously update the hash value. The specific calculation process is as follows: For each sentence in a text data block, the hash value is first initialized to a fixed prime number. For example, for a 32-bit FNV hash algorithm, the initial value can be 2166136261. Then, each character in the sentence is processed in turn. For each character, the current hash value is multiplied by a fixed prime number. For example, for a 32-bit FNV hash algorithm, this prime number can be 16777619. The result is then XORed with the ASCII code value of the character. This process is repeated until all characters in the sentence have been processed. The final hash value is the hash value of the text data unit.

[0044] The perceptual hash algorithm is a hash algorithm based on image perceptual features. It generates a hash value by extracting some key features of the image. These features usually include information such as brightness, contrast, and color of the image, and have a certain robustness to some minor changes in the image. The specific calculation process is as follows: for each pixel area in the image data block, the image of the area is first converted into a grayscale image. Then, the grayscale image is processed, such as scaling and blurring, to extract the main features of the image. Next, the discrete cosine transform of the image is calculated, and the coefficients of its low-frequency part are taken. Finally, a fixed-length hash value is generated based on these coefficients.

[0045] The hash aggregation method is as follows: for high-priority data, the SHA-3-512 algorithm is used to perform three iterative aggregations. The specific process is to first perform the first SHA-3-512 calculation on the data unit hash value, and then use the result as input for the second calculation, and so on for three iterative aggregations. For low-priority data, the data unit hash value is XORed to obtain the data block hash value.

[0046] The XOR operation is a logical operation that outputs 1 when the two input bits are different and 0 when the two input bits are the same. In hash calculations, the XOR operation can be used to combine the hash values ​​of multiple data units into a data block hash value. The specific calculation process is as follows: For low-priority data, the data unit hash values ​​are XORed. First, the hash value of the first data unit is XORed with the hash value of the second data unit to obtain an intermediate result. Then, this intermediate result is XORed with the hash value of the third data unit, and so on, until the hash values ​​of all data units are processed. The final data block hash value is the result of the XOR operation of the hash values ​​of all data units.

[0047] It should be further explained that high-priority data and low-priority data are divided based on the data importance configuration table.

[0048] The concatenation calculation refers to concatenating the hash values ​​of all data blocks and calculating using the SHA-256 algorithm to generate the top-level hash value of the original data.

[0049] S4: Data storage: Use the alliance chain architecture to build multiple blockchains, and use the blockchain's smart contracts to realize data upload and storage functions;

[0050] The blockchain construction method is as follows: Hyperledger Fabric is used as the underlying framework, access control policies are set for the privacy protection chain, and only authorized nodes can access it. The business data chain is set with different read and write permissions according to business needs.

[0051] Specifically, for the privacy-preserving chain, strict access control is implemented through the configuration of node access control lists and channel configuration policies. In the Application section of the channel configuration file, the Policies field is set to explicitly restrict access to specific nodes within a specific organization. Furthermore, Hyperledger Fabric's private data collection feature is leveraged to create corresponding collections for sensitive data such as user ID numbers, accessible only to authorized nodes, ensuring the security and privacy of sensitive information. The business data chain, on the other hand, assigns different read and write permissions to different organizations and nodes based on business needs. Different roles and permission policies are defined in the channel configuration. Specifically, the organization nodes participating in the consortium chain are divided into two roles: a data writer node set and a data reader node set. For public business data, organization nodes in the data writer node set are explicitly granted data write permissions, allowing them to perform data addition and modification operations. These operations must adhere to the blockchain system's consensus mechanism to ensure the consistency and legitimacy of data writes. Furthermore, organization nodes in the data reader node set are granted data read permissions, allowing them to query and retrieve public business data stored on the business data chain, but prohibiting them from performing data write operations.

[0052] S5: Dynamic adaptive consensus mechanism adjustment: Set a counter in the data processing module of the blockchain node to count the number of data processing tasks successfully completed per minute, determine the network load status, use the node discovery mechanism of the blockchain network to obtain a list of online nodes and count the number of nodes, determine the node performance status, and switch the consensus algorithm strategy in real time based on different statuses;

[0053] It should be specifically explained that the method for determining the network load status is as follows:

[0054] Use network monitoring tools, such as nload in Linux or ResourceMonitor in Windows, to obtain network bandwidth usage data and calculate bandwidth usage. Calculate the average number of data processing tasks and bandwidth usage every 10 minutes. When the average number of data processing tasks exceeds the set threshold and the bandwidth usage exceeds 80%, the network load is considered high. When the average number of data processing tasks falls below the set threshold and the bandwidth usage is below 50%, the network load is considered low.

[0055] The method for determining the node performance status is as follows:

[0056] Use performance testing tools to create a test plan that simulates data processing tasks, send test tasks to nodes, record the time it takes for the nodes to complete the tasks, calculate the node's data processing volume per second to evaluate the node's processing speed, record the startup time when the node starts, regularly check the node status, record the offline time, and calculate the online time. When the number of online nodes is less than 50, or the node processing speed is less than 100 transactions per second, and one of the following conditions is met at the same time, the node performance is determined to be unstable: in the past hour, the node has been offline three times or more, or the cumulative offline time of the node exceeds 20% of the time period.

[0057] The consensus algorithm switching strategy is as follows: When the network load is low and node performance is stable, the blockchain node consensus algorithm is switched to the Proof of Stake algorithm within a five-block interval. The node configuration file is modified to lower the stake threshold for participating nodes from 1,000 tokens to 100 tokens, and the node is restarted for the new setting to take effect. When the network load is high or node performance is unstable, the consensus algorithm is switched to the Practical Byzantine Fault Tolerance algorithm within a three-block interval. The node configuration file is modified to set parameters related to the PBFT algorithm, requiring participating nodes to have at least four CPU cores and at least 8GB of memory. Eligible nodes are screened for participation in the consensus process, and the node is restarted to complete the algorithm switch, ensuring the efficient and stable operation of the blockchain network under various conditions.

[0058] S6: Data integrity verification: After preliminary verification and detailed verification of the data to be verified, the results are judged to determine the integrity of the data to be verified;

[0059] The preliminary verification method is as follows:

[0060] By calling the query interface of the blockchain node, the top-level hash value and original state information of the data to be verified are obtained from the main chain. The data to be verified is subjected to layered hash calculation according to the same algorithm used to generate the top-level hash value in the hash calculation step, and a new top-level hash value is generated. The newly generated top-level hash value is compared bit by bit with the top-level hash value obtained from the blockchain. If the two are inconsistent, the data is immediately determined to be incomplete and the relevant error information is recorded. If the two are consistent, the detailed verification phase begins.

[0061] The detailed verification method is as follows:

[0062] Based on the data segmentation information from the data preprocessing phase, the corresponding data block and data unit hash values ​​are obtained from each subchain through the smart contract. The obtained hash values ​​are compared bit by bit with the recalculated hash values. For high-priority data, the data block hash value is calculated again according to the data block hash aggregation algorithm and compared with the hash value obtained from the subchain. If the hash values ​​are inconsistent, the identifiers of the data block and unit are recorded;

[0063] The result determination method is as follows:

[0064] When all data blocks and data units pass verification, a data integrity verification report is generated. The report content includes data identification, verification time, and verification result information. If there is any inconsistency, the data is judged to be incomplete, and a report containing detailed information of the tampered data is output, including the identification of the tampered data block, the original hash value, and the current hash value, to achieve accurate verification of the integrity of the data stored on the blockchain.

[0065] Specifically, a smart contract is a self-executing computer program running on a blockchain platform, with predefined rules and terms in code. In this solution, a smart contract is written based on the Hyperledger Fabric framework. Essentially, it is a piece of executable code deployed on the blockchain that automatically triggers execution when preset conditions are met, ensuring the accuracy and consistency of data operations. In this embodiment, after the smart contract code is deployed to nodes in the blockchain network, each node stores a copy of the contract and jointly maintains its execution environment. When an external party sends a transaction request related to a smart contract to the blockchain (for example, calling a contract to store data during data upload and storage, or calling a contract to obtain a hash value during data integrity verification), the nodes in the network verify the request. Once verification is successful, each node executes the smart contract code in a local sandbox environment, processing the data according to the logic written in the contract. Due to the distributed nature of blockchain, all nodes independently execute the contract. The execution results are recorded in the blockchain ledger only after consensus is reached through a consensus mechanism, ensuring operational consistency and immutability.

[0066] Secondly: The drawings of the embodiments disclosed in the present invention only involve structures related to the embodiments disclosed in the present invention. Other structures may refer to conventional designs. The same embodiment and different embodiments of the present invention may be combined with each other without conflict.

[0067] Finally: The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A data integrity verification method based on blockchain, characterized in that: include: S1: Database construction: Based on the data importance configuration table, data usage statistics table, text data set, and image data set, a hybrid architecture database of relational and non-relational databases is constructed; S2: Multidimensional data segmentation: Perform segmentation operations on the image data and text data in the database respectively, dividing the image data and text data into different data units; S3: Hash calculation: Hash value calculation is performed based on the data units divided in step S2, hash aggregation is performed based on the hash value calculation results to obtain the data block hash value, and the hash values ​​of all data blocks are serially calculated to obtain the top-level hash value; The hash value calculation includes text data unit hash value calculation and image data unit hash value calculation, the text data unit uses the FNV hash algorithm to calculate the hash value, and the image data unit uses the perceptual hash algorithm; S4: Data storage: Use the alliance chain architecture to build multiple blockchains, and use blockchain smart contracts to realize data upload and storage functions; S5: Dynamic adaptive consensus mechanism adjustment: Set a counter in the data processing module of the blockchain node to count the number of data processing tasks successfully completed per minute, determine the network load status, use the node discovery mechanism of the blockchain network to obtain a list of online nodes and count the number of nodes, determine the node performance status, and switch the consensus algorithm strategy in real time based on different statuses; S6: Data integrity verification: The data to be verified undergoes preliminary and detailed verification before determining the results.

2. A blockchain-based data integrity verification method according to claim 1, characterized in that: The relational database is constructed based on a data importance configuration table and a data usage statistical information table, and the non-relational database is constructed based on a text data set and an image data set; The data importance configuration table is used to store data importance level configuration information, the data usage statistics information table is used to store data usage frequency and modification frequency information, the text data set refers to text data generated directly from the text generation scenario of the business system, and the image data set refers to various types of image data collected in the image generation link in the business process.

3. The data integrity verification method based on blockchain according to claim 1, characterized in that: The segmentation processing operation of the image data is as follows: The OpenCV library is used to process the image. The color image is first converted to a grayscale image, and then multi-scale Gaussian blur is performed. Gaussian filters with kernel sizes of (3,3), (5,5), and (7,7) are used to remove noise. Canny edge detection is performed on the blurred image, and the low threshold is set to 50 and the high threshold is set to 150 to obtain edge information. The edge information of the three scales is weighted fused with weights of 0.3, 0.4, and 0.

3. Morphological processing is performed on the fused edge image, including two dilation and two erosion operations using a structuring element of size (3,3). Finally, the watershed algorithm is used for segmentation. The area, Hu rectangular features, color mean and variance parameters of each region are calculated, and the similarity is calculated using Euclidean distance. The similarity threshold is set to 0.7, and adjacent regions with similarity above the threshold are merged to form image data units. The similarity is calculated as follows: For two image regions R1 and R2, their feature vectors are f1=(a1,h1,c1,v1) and f2=(a2,h2,c2,v2), where a represents the area, h represents the Hu rectangular feature, c represents the color mean, and v represents the color variance. The Euclidean distance is calculated as follows: 。 4. The data integrity verification method based on blockchain according to claim 1, characterized in that: The segmentation processing operation of the text data is as follows: Using natural language processing technology and the spaCy model, we perform word segmentation, part-of-speech tagging, and named entity recognition on the text. We build a custom stop word list and merge it with the spaCy model's built-in stop word list to remove stop words and restore words to their stem form. We use dependency syntax analysis to determine the grammatical relationship between sentences and combine it with the BERTopic model for topic division, segmenting the text into different data units. The word segmentation refers to the input text data, the part-of-speech tagging refers to the part-of-speech tagging of each word by the spaCy model on the basis of completing the word segmentation, the named entity recognition refers to the use of the named entity recognition function of the spaCy model to identify entities with specific meanings from the text, the custom stop word list construction refers to the analysis of the characteristics of the text in the business scenario, and the vocabulary records these words one by one in the stop word set text, arranges them by row, and forms a stop word set that meets specific business needs, the dependency syntactic analysis refers to the analysis of the dependency relationship between the various components in the sentence. If the sentences are closely grammatically related, the related sentences are classified into the same group, and the topic division refers to the input of the text data processed as above into the BERTopic model for topic division, and the text is further divided into different data units according to the divided topics.

5. The data integrity verification method based on blockchain according to claim 1 is characterized in that: The method for determining the network load status is as follows: Use network monitoring tools to obtain network bandwidth usage data and calculate bandwidth usage. Calculate the average number of data processing tasks and bandwidth usage every 10 minutes. When the average number of data processing tasks exceeds the set threshold and the bandwidth usage exceeds 80%, the network load is determined to be high. When the average number of data processing tasks is lower than the set threshold and the bandwidth usage is lower than 50%, the network load is determined to be low.

6. The data integrity verification method based on blockchain according to claim 1, characterized in that: The method for determining the node performance status is as follows: Use performance testing tools to create a test plan that simulates data processing tasks, send test tasks to nodes, record the time it takes for the nodes to complete the tasks, calculate the node's data processing volume per second to evaluate the node's processing speed, record the startup time when the node starts, check the node status, record the offline time, and calculate the online time. When the number of online nodes is less than 50, or the node processing speed is less than 100 transactions per second, and one of the following conditions is met at the same time, the node performance is determined to be unstable: in the past hour, the node has been offline three times or more, or the cumulative offline time of the node exceeds 20% of the time period.

7. The data integrity verification method based on blockchain according to claim 1, characterized in that: The consensus algorithm switching strategy is as follows: when the network load is monitored to be low and the node performance is stable, the consensus algorithm of the blockchain node is switched to the proof-of-stake algorithm within an interval of 5 blocks, and the node configuration file is modified to reduce the stake threshold of the consensus node from 1,000 tokens to 100 tokens. The node is restarted to make the new setting effective. When the network load is high or the node performance is unstable, the consensus algorithm is switched to the practical byzantine fault tolerance algorithm within an interval of 3 blocks. The node configuration file is modified to set the relevant parameters of the PBFT algorithm, requiring the CPU core number of the nodes participating in the consensus to be no less than 4 cores and the memory to be no less than 8GB. The qualified nodes are screened to participate in the consensus process, and the node is restarted to complete the algorithm switching.

8. The data integrity verification method based on blockchain according to claim 1, characterized in that: The preliminary verification method is as follows: By calling the query interface of the blockchain node, the top-level hash value and original state information of the data to be verified are obtained from the main chain. The data to be verified is subjected to layered hash calculation according to the same algorithm used to generate the top-level hash value in the hash calculation step, and a new top-level hash value is generated. The newly generated top-level hash value is compared bit by bit with the top-level hash value obtained from the blockchain. If the two are inconsistent, the data is immediately determined to be incomplete and the relevant error information is recorded. If the two are consistent, the detailed verification phase begins. The detailed verification method is as follows: Based on the data segmentation information from the data preprocessing phase, the corresponding data block and data unit hash values ​​are obtained from each subchain through the smart contract. The obtained hash values ​​are compared bit by bit with the recalculated hash values. For high-priority data, the data block hash value is calculated again according to the data block hash aggregation algorithm and compared with the hash value obtained from the subchain. If the hash values ​​are inconsistent, the identifiers of the data block and unit are recorded. The result determination method is as follows: When all data blocks and data units pass verification, a data complete verification report is generated. The report content includes data identification, verification time and verification result information. If there is any inconsistency, the data is judged to be incomplete, and a report containing detailed information of the tampered data is output, including the identification of the tampered data block, the original hash value, and the current hash value.

Citation Information

Patent Citations

  • Block chain-based data management method and device, and medium

    CN112988852A

  • Block chain-based distributed network data integrity verification method and device

    CN119903559A