A digital archive system based on blockchain
Through the digital archive system based on the blockchain, using technologies such as IPFS and graph neural network, the problems of security and low utilization of traditional archive management systems are solved, and efficient and secure storage and intelligent management of archive data are achieved.
Patent Information
- Application Number
- CN202410582724.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-11
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-05-11
AI Technical Summary
Traditional archive management systems have problems such as low security, easy tampering, and low utilization. It is difficult to effectively manage massive archive data, and it is difficult to achieve frequently updated operational efficiency and compliance verification.
Adopting a digital archive system based on the blockchain, through IPFS distributed storage, SHA-256 hash calculation, graph neural network correlation analysis, Merkle tree structuring, proof-of-stake consensus mechanism and smart contract verification, the secure storage of archive data is achieved. Smart classification and security updates.
It improves the security and utilization of archive data, ensures the integrity and non-tamperability of data, and realizes intelligent correlation analysis and multi-level security update mechanism.
Smart Images

Figure CN118350047B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of archive storage technology, and in particular to a digital archive system based on blockchain. Background Art
[0002] The rapid development of the digital age has led to the generation, transmission and storage of a large amount of data, including a large amount of archival data. However, as the scale of data continues to increase, data security issues have become increasingly prominent. Traditional archive management systems have many problems, including low security and easy tampering, which poses a huge challenge to the protection and credibility of archival data. In this context, there is an urgent need for a more secure and reliable archive management system to ensure the integrity and credibility of archival data and meet the needs of data security in the digital age.
[0003] In addition, in the era of big data, massive amounts of archival data have also posed new challenges to archival management. Traditional archival management lacks effective data association analysis and intelligent processing methods, making it difficult to fully tap the associated information and value contained in archival data, and the utilization rate of archives is low. At the same time, archives are updated frequently, and traditional manual review methods are inefficient, and it is difficult to effectively verify the compliance and authenticity of update operations, which poses a major security risk.
[0004] In the related art, for example, Chinese patent document CN117744159A provides a method and system for preventing archival data from being tampered with based on blockchain security, which relates to the field of archival storage. The method includes the following steps: obtaining archival data, and constructing an original archival database based on the archival data; performing hash calculation on the archival data to obtain an archival hash value, performing correlation analysis, and constructing a hash block; performing connection relationship analysis based on the hash block construction result, and generating a blockchain; adding update verification rules to the blockchain, and setting a hash alarm threshold based on the update verification rules; performing comparative judgment on the updated data, and adjusting the original archival database; presetting archival emergency rules for the adjusted data, and constructing a backup archival database. However, in this scheme, if the hash alarm threshold is set too high or too low, it may lead to an inability to respond to abnormal changes in archival data in a timely manner or a false alarm, thereby affecting the security of the archival data. Summary of the invention
[0005] 1. Technical issues to be solved
[0006] In response to the problem of low security of archival data in the prior art, the present application provides a digital archive system based on blockchain, which improves the security of archival data through association analysis and anomaly detection.
[0007] 2. Technical solution
[0008] The purpose of this application is achieved through the following technical solutions.
[0009] The embodiment of the present specification provides a digital archive system based on blockchain, including: a data collection module, which collects archive data and converts it into digital archive data, uploads the digital archive data to the IPFS distributed storage network to obtain an IPFS hash value; constructs an original archive database, records the archive data including the archive name, archive type and creation time metadata; a block construction module, performs SHA-256 hash calculation on each archive data to obtain an archive hash value; uses a machine learning algorithm based on a graph neural network to perform correlation analysis on the archive hash value to obtain an association pattern between archives, and the association pattern includes an archive theme; merges archive hash values of the same theme into a hash block according to the association pattern and sets an upper limit on the block capacity; performs Merkle tree structuring on the hash block to generate a block header hash; a blockchain consensus module, obtains the logical relationship between hash blocks The system is built, and the hash blocks are linked into a linked list structure in the order of the generation time of the hash blocks; a consensus mechanism based on proof of stake POS is adopted, the weight of the node is calculated according to the number of tokens held by the blockchain node and the length of time the tokens are held, and the block generation node is selected according to the weight; the selected block generation node adds the newly generated block to the blockchain and broadcasts it to other nodes for verification; the update verification module is updated, the smart contract is deployed on the blockchain, and the archive update rules are set in the deployed smart contract; the abnormal score of the update operation is calculated, and the hash alarm is triggered when the abnormal score exceeds the threshold, and the abnormal operation is blocked by the smart contract; the data management module uses the version control system git to record the difference content of each modification when modifying the original archive data. After performing data adjustment, the metadata of the corresponding archive in the original archive database is updated, and a new block is generated and added to the blockchain.
[0010] Among them, IPFS (Inter Planetary File System) is a distributed file storage system. When digital archive data is uploaded to the IPFS network, IPFS will content-address the archive data and generate a unique hash value as the archive identifier. This hash value is called the IPFS hash value, which can be used to quickly locate and retrieve the corresponding archive data in the IPFS network.
[0011] Among them, SHA-256 is a secure hash algorithm that belongs to the SHA-2 hash function family. It can convert data of any length into a hash value of fixed length (256 bits). SHA-256 hash has the characteristics of one-way and avalanche effect. Even if the original data changes slightly, the hash value will produce a huge difference.
[0012] Among them, Graph Neural Network (GNN) is a deep learning model that specializes in processing graph structured data. It can learn the relationships and dependencies between nodes in the graph, and update the representation of the node based on the characteristics of the node and the information of the neighboring nodes. In this application, the archive hash value can be regarded as the node of the graph. Through GNN learning the association pattern between archives, archives with similar themes or related contents are found and classified into the same hash block.
[0013] Among them, the Merkle tree, also known as the hash tree, is a tree data structure built from the bottom up. Its leaf nodes store the hash value of the data block, and the non-leaf nodes store the hash value of the hash value of its child nodes. The root node hash (Merkle Root) of the Merkle tree represents the unique identifier of the entire data set. Among them, the linked list is a common data structure consisting of a series of nodes, each node contains data and a pointer to the next node. In the blockchain, blocks are connected by pointers in the order of generation to form a linked list structure. The header of each block contains the hash value of the previous block, so that the blockchain can ensure the integrity and immutability of the data. The linked list structure also facilitates the tracing and query of blocks.
[0014] Among them, Proof of Stake (PoS) is a blockchain consensus mechanism. Unlike Proof of Work (PoW), the right to generate blocks in PoS depends on the number of tokens held by the node and the length of time the node holds the tokens. The more tokens a node holds and the longer it holds the tokens, the greater the probability that it will be selected as a block generation node. Among them, a smart contract is a self-executing contract running on a blockchain. It defines the rights and obligations of the parties to the contract in the form of code and automatically performs corresponding operations according to preset conditions. Smart contracts have the characteristics of being tamper-proof and unstoppable. Once deployed on the blockchain, they cannot be modified or stopped. In this application, smart contracts can be used to define file update rules, verify the legality of update operations, detect abnormal behaviors, etc., which improves the automation and security of file management.
[0015] Among them, the hash alarm is an anomaly detection mechanism based on the change of hash value. In the archive update verification, if the abnormal score of the update operation exceeds the set threshold, the hash alarm will be triggered. The hash alarm automatically blocks abnormal operations through smart contracts to prevent illegal or malicious archive modifications. Among them, git is a distributed version control system used to track and manage the modification history of files. It generates a version library in the form of a timeline by recording every change to the file, which is convenient for users to view and trace back different versions of the file. In this application, git can be used to record the difference content of each archive modification in detail, including metadata such as the time of modification, author, content, etc. Through git's version control function, the change history of the archive can be easily tracked and audited, and it also provides the possibility of archive rollback and recovery.
[0016] Furthermore, the data collection module includes: an archive digitization unit, which collects archive data and pre-processes the collected archive data to obtain standardized digitized archive data; an archive chain unit, which uploads the standardized digitized archive data to the IPFS distributed storage network, and obtains the IPFS hash value of the archive data in the IPFS network through the IPFS protocol; a metadata extraction unit, which extracts the metadata of the archive data from the standardized digitized archive data; an original archive database, which establishes a structured archive directory and index based on the extracted metadata, and records the IPFS hash value, creation time and creator of each archive data.
[0017] Among them, standardized digital archive data refers to digital archive files that meet system specifications and requirements after preprocessing and format conversion. In the process of archive digitization, the original archive data may have problems such as inconsistent formats and non-standard content. In order to facilitate subsequent storage, management and analysis, the archive data needs to be standardized. It includes the following steps: Format conversion: Scan or take pictures of paper archives to obtain image files, and convert multimedia archives such as audio and video into specified digital formats, such as TIFF, PDF, MP3, etc. Content structuring: Segment, paging, directory extraction and other structured processing of the archive content to generate a standardized document structure. Metadata extraction: Automatically extract or manually enter key information from the archive content, such as title, author, date, keywords and other metadata. Quality inspection: Perform quality inspection on the digitized archive files to ensure that the image is clear, the content is complete, and the format is correct.
[0018] Metadata is structured information used to describe data attributes and characteristics. In this application, metadata is a description and explanation of the content, source, time, author and other attributes of archival data. In this application, the metadata extraction unit is responsible for automatically extracting various metadata from standardized digital archival data, organizing the metadata into a structured form, and storing it in the original archival database.
[0019] Furthermore, the archive chain unit uploads the standardized digital archive data to the IPFS distributed storage network, including: dividing the standardized digital archive data into data blocks; performing SHA-256 hash calculation on each data block to obtain a hash value of the data block; combining the data block with the corresponding hash value to generate an IPFS node object, and uploading the IPFS node object to the IPFS network through the IPFS protocol; wherein the IPFS node object represents a data node in the IPFS network; using a Merkledag-based data structure to associate the IPFS node objects to generate an IPFS object, the IPFS object being composed of all IPFS node objects, and outputting the root node hash value of the IPFS object; and using the root node hash value of the IPFS object as the IPFS hash value of the archive data in the IPFS network.
[0020] Among them, the IPFS node object is the basic data unit in the IPFS network, representing an independent data block and its related information. When the standardized digital archival data is divided into several data blocks, each data block will be converted into an IPFS node object. The IPFS node object contains the following information: Data block: the original data block after segmentation. Data block hash value: a unique identifier obtained by performing a SHA-256 hash calculation on the data block. Link information: a link to other related IPFS node objects, used to build a Merkledag structure. By packaging data blocks and their hash values into IPFS node objects, the IPFS network can store and retrieve data based on content addressing. The hash value of the data block is the unique identifier of the IPFS node object. No matter which node the data block is stored on, it can be quickly located and obtained through the hash value.
[0021] Merkledag (Directed Acyclic Graph) is a data structure used to organize and associate IPFS node objects in the IPFS network. It is a directed acyclic graph, where each node represents an IPFS node object, and links are established between nodes through hash references. In the Merkledag-based data structure: each IPFS node object has a unique hash value as the node identifier. Parent-child relationships are established between nodes through hash references to form a directed acyclic graph. The hash value of the child node is included in the hash calculation of the parent node, ensuring the integrity and immutability of the data.
[0022] Among them, the IPFS object is a complete data set consisting of all related IPFS node objects, representing a file or data structure uploaded to the IPFS network. When the standardized digital archive data is segmented, hashed and packaged into IPFS node objects, these node objects are interconnected through Merkledag to eventually form a complete IPFS object. The IPFS object contains all IPFS node objects and represents the complete original data. The relationship between node objects is organized through Merkledag to form a directed acyclic graph. The root node hash value of the object serves as the unique identifier of the entire IPFS object.
[0023] Among them, the root node hash value is the hash value of the top node of the IPFS object, which represents the unique identifier of the entire IPFS object. In the Merkledag-based data structure, the root node is the top-level node, and its hash value contains the hash information of all child nodes. The root node hash value is obtained by hash calculation, and for the same IPFS object, the root node hash value is unique. In the IPFS network, the root node hash value is used as the IPFS hash value of the archive data to identify and retrieve the complete archive data.
[0024] Furthermore, the block construction module includes: an archive hash calculation unit, which obtains the IPFS hash value corresponding to each archive data; performs SHA-256 hash calculation on the IPFS hash value to obtain the archive hash value as the unique fingerprint feature of the archive data; an association pattern mining unit, which uses a machine learning algorithm based on a graph neural network to extract features and measure similarity on the archive hash value, obtains the association pattern between archives through cluster analysis, and classifies the archive hash values with association patterns of the same archive subject into the same set to generate multiple archive hash value sets; a hash block generation unit, which constructs a corresponding hash block according to the association pattern between archives contained in each archive hash value set, and adds all archive hash values in the archive hash value set to the corresponding hash block; a Merkle tree construction unit, which constructs a Merkle tree according to all archive hash values contained in the hash block, and calculates the root hash value of the Merkle tree;
[0025] Among them, the fingerprint feature is a unique identifier obtained by hashing the data, which is used to identify and verify the identity of the data. In the blockchain, a secure hash algorithm (such as SHA-256) is usually used to hash the data to generate a fixed-length hash value as the fingerprint feature of the data. In this application, the archive hash value is obtained by performing a SHA-256 hash calculation on the IPFS hash value as the fingerprint feature of the archive data. The fingerprint feature is used to uniquely identify the archive data, which is convenient for quick retrieval and verification of the integrity of the archive.
[0026] Among them, feature extraction refers to the process of extracting features that can represent the essential features of the data from the raw data. In machine learning and pattern recognition, feature extraction is an important preprocessing step, the purpose of which is to convert high-dimensional, complex raw data into low-dimensional, structured feature representations. Feature extraction includes: Statistical features: extracting statistics of the data, such as mean, variance, correlation coefficient, etc. Frequency domain features: converting data from the time domain to the frequency domain, and extracting spectral features, such as Fourier transform coefficients. Spatial features: extracting the spatial structure and relationship of the data, such as the texture and edges of the image. Deep features: using deep learning models to automatically learn high-level feature representations of data. In this application, a machine learning algorithm based on graph neural networks is used to extract features from archive hash values, learn the association features between archives, and provide a basis for subsequent similarity measurement and clustering analysis.
[0027] Among them, similarity measurement refers to a method for calculating the degree of similarity between two objects. In pattern recognition and data mining, similarity measurement is used to measure the distance or similarity between data points, and is the basis for implementing tasks such as clustering, classification, and retrieval. Similarity measurement can be used: Euclidean distance: calculates the straight-line distance between two vectors. Cosine similarity: calculates the cosine value of the angle between two vectors. Jaccard similarity coefficient: calculates the ratio of the intersection and union of two sets. Pearson correlation coefficient: calculates the degree of linear correlation between two variables. In this application, by performing similarity measurement on the features extracted from the hash values of the archives, the degree of similarity between the archives is calculated, providing a basis for mining the association patterns between the archives.
[0028] Among them, the association pattern refers to the association relationship and regularity between data. In data mining, association pattern mining aims to discover frequent co-occurrence, dependency or causal relationship between data items, and reveal the hidden knowledge behind the data. The association pattern is usually expressed in the form of "if A then B", which means that when condition A is met, result B will occur. The strength of the association pattern can be measured by support and confidence. Support indicates the frequency of occurrence of the pattern in the data set, and confidence indicates the probability of result B occurring when condition A is met. In this application, by performing similarity measurement and cluster analysis on the archive hash values, the association patterns between archives are mined, and archive groups with the same theme or related content are found to provide guidance for subsequent block construction.
[0029] Among them, cluster analysis is an unsupervised learning method that aims to divide similar data points into the same cluster and dissimilar data points into different clusters. Cluster analysis can discover the intrinsic structure and distribution patterns of data and is an important means of exploratory data analysis. Clustering algorithms include: K-means, a distance-based partitioning clustering algorithm that divides data into K clusters. Hierarchical clustering: Constructing nested cluster hierarchies from bottom to top or top to bottom. Density-based clustering (DBSCAN): Clusters are divided according to the density connectivity of data points. Spectral clustering: Clustering is achieved using graph theory and matrix decomposition. In this application, cluster analysis is used to group archive hash values, and archive hash values with similar characteristics or association patterns are classified into the same set to form multiple archive hash value sets, providing a basis for the generation of hash blocks.
[0030] Among them, the archival theme refers to the main topic, event or field involved in the archival content. The archival theme reflects the core content and purpose of the archive, and is an important basis for organizing, retrieving and understanding archives. Archival themes can be divided from different perspectives, such as: Time theme: divided according to the time attributes of the archive, such as year, month, time of event, etc. Geographic theme: divided according to the geographical attributes of the archive, such as country, region, city, etc. Event theme: divided according to the events or topics recorded in the archive, such as meetings, contracts, projects, etc. Department theme: divided according to the source department or institution of the archive, such as the Finance Department, the Human Resources Department, etc. In this application, by mining the association patterns between archives, archive groups with the same theme are identified and classified into the same archive hash value set, which is convenient for subsequent block construction and subject retrieval. Among them, the archive hash value set refers to a set of archive hash values with the same theme or association pattern. In the block construction module, by performing feature extraction, similarity measurement and cluster analysis on the archive hash values, archive hash values with similar features or association patterns are classified into the same set to form multiple archive hash value sets.
[0031] Furthermore, the association pattern mining unit includes: a graph construction subunit, which uses the archive hash value as the node of the graph; calculates the co-occurrence frequency between nodes according to the metadata of the archive data recorded in the original archive database, uses the co-occurrence frequency as the weight of the edge between the nodes, and constructs an undirected weighted graph; a graph embedding subunit, which uses a graph convolutional neural network to update and propagate the feature vectors of the nodes in the undirected weighted graph, and obtains the low-dimensional representation vector of the archive hash value by aggregating the neighborhood information of the node; and uses the attention mechanism to obtain the node allocation weights of different neighborhoods; a community discovery subunit, which clusters the archive hash value in the low-dimensional representation vector space through the k-means clustering algorithm to obtain the community structure of the archive hash value; obtains the association pattern between the archive data according to the community structure; an output subunit, which outputs a set of archive hash values containing the association pattern, and each set corresponds to a subject community.
[0032] Among them, co-occurrence frequency refers to the frequency at which two or more things appear at the same time in the same context or environment. In text mining and natural language processing, co-occurrence frequency is often used to measure the correlation and association strength between words. In this application, co-occurrence frequency is used to measure the degree of association between archives. By analyzing the metadata recorded in the original archive database, such as the subject, keywords, time, etc. of the archive, the co-occurrence frequency between different archive hash values can be calculated. To calculate the co-occurrence frequency, you can use: the number of times two archive hash values appear simultaneously in the metadata. Mutual information: a measure of the correlation between two archive hash values, taking into account their probability of appearing in the metadata. Jaccard coefficient: the ratio of the number of times two archive hash values appear together in the metadata to the sum of the number of times they appear separately. By calculating the co-occurrence frequency, an undirected weighted graph reflecting the strength of association between archives can be constructed, providing a basis for subsequent graph embedding and community discovery.
[0033] Among them, an undirected weighted graph is a graph model used to represent a network structure in which there are bidirectional connections between nodes and the edges have weights. In an undirected weighted graph, the connection between nodes has no directionality, and the weight of the edge represents the strength or similarity of the association between the nodes. In this application, the archive hash value is used as the node of the undirected weighted graph, and the weight of the edge is calculated according to the co-occurrence frequency between the archives to construct a network structure reflecting the archive association relationship. By constructing an undirected weighted graph, the association relationship between archives can be abstracted into a graph structure, which is convenient for mining and analysis using graph theory and network analysis methods.
[0034] Among them, the low-dimensional representation vector refers to the vector representation that maps high-dimensional or complex data to a low-dimensional space. In machine learning and data mining, it is usually necessary to convert the original high-dimensional data into a low-dimensional representation to reduce the redundancy of the data and improve the computational efficiency and generalization ability of the model. In this application, a graph convolutional neural network is used to update and propagate the feature vectors of nodes in an undirected weighted graph, and a low-dimensional representation vector of the archive hash value is obtained by aggregating the neighborhood information of the node. The graph convolutional neural network can learn the position and relationship of the nodes in the graph structure, fuse the features of the node with the features of its neighboring nodes, and generate a low-dimensional representation of the node.
[0035] Among them, the K-means clustering algorithm is a classic partitioning clustering algorithm, which aims to divide data into K clusters, where the data points in each cluster are similar to each other, while the data points between different clusters are quite different. The K-means algorithm optimizes the clustering results by minimizing the sum of the squared distances between the data points in the cluster and the cluster center. In this application, the K-means algorithm is used to cluster the low-dimensional representation vectors of the archive hash values, and similar archive hash values are divided into the same cluster to form the community structure of the archives. The K-means algorithm is simple and efficient, and is suitable for clustering tasks of large-scale data.
[0036] Among them, community structure refers to the modular or grouped characteristics of the connections between nodes in a complex network, forming tightly connected subgroups. Within the community, the connections between nodes are dense, while the connections between different communities are relatively few. In this application, the community structure between archives can be found by clustering the low-dimensional representation vectors of archive hash values. Each community corresponds to a group of archives with related themes or similar contents.
[0037] Furthermore, an attention mechanism is used to obtain node allocation weights for different neighborhoods, including: for each central node in an undirected weighted graph, calculating the cosine similarity between the feature vectors of the central node and the neighborhood nodes; normalizing the calculated cosine similarity through a softmax function to obtain the attention weight corresponding to each neighborhood node; multiplying the feature vector of each neighborhood node by the corresponding attention weight to obtain a weighted neighborhood feature vector; adding the weighted neighborhood feature vectors to obtain an aggregated neighborhood feature vector; concatenating the central node feature vector and the aggregated neighborhood feature vector to form a concatenated feature vector; and performing nonlinear transformation of the concatenated feature vector through a fully connected neural network to obtain a node feature vector as a low-dimensional representation vector of the corresponding archive hash value.
[0038] Among them, in the graph neural network, the central node refers to the node that is currently undergoing feature update and propagation. For each node in the undirected weighted graph, when calculating its low-dimensional representation vector, it will be regarded as a central node, and the information of its neighboring nodes will be considered. The feature vector of the central node represents the feature information of the node itself, while the feature vector of the neighboring node contains the feature information of the nodes connected to the central node. By aggregating the features of the central node and the neighboring nodes, the contextual information of the node in the graph structure can be obtained to better represent the semantics and relationships of the nodes. In this application, the central node corresponds to the archive hash value for which the low-dimensional representation vector is currently being calculated, and its feature vector represents the features of the archive itself, while the neighboring nodes represent other archive hash values associated with the archive.
[0039] Among them, the Softmax function is a commonly used normalization function used to convert a set of real numbers into a set of probability distributions. The input of the Softmax function is a real number vector, and the output is a probability vector, in which the value range of each element is between (0, 1), and the sum of all elements is 1. Among them, the neighborhood feature vector refers to the feature vector of the neighborhood nodes connected to the central node. In the graph neural network, in order to better represent the contextual information of the node, the neighborhood information of the node is usually considered, that is, the characteristics of other nodes directly connected to the node. In this application, the neighborhood feature vector represents the feature vector of other archive hash values associated with the current archive hash value. By considering the characteristics of the neighborhood archives, the association relationship and subject relevance between archives can be better characterized.
[0040] Among them, nonlinear transformation refers to the nonlinear function mapping of input data to transform the input space into another feature space. In machine learning and deep learning, nonlinear transformation is often used to increase the expressive power of the model and capture complex patterns and relationships in the data. Nonlinear transformation functions include: Sigmoid function, Tanh function, ReLU function, LeakyReLU function. In this application, the central node feature vector and the aggregated neighborhood feature vector are spliced and then nonlinearly transformed through a fully connected neural network. The fully connected neural network contains one or more hidden layers, each hidden layer consists of multiple neurons, and the neurons are fully connected through weights and biases. Through nonlinear transformation, the spliced feature vector can be mapped to a new feature space to capture the nonlinear relationship between features and improve the expressive power of feature representation. Nonlinear transformation can help the model learn more complex patterns and laws, so as to better characterize the association between archives.
[0041] Furthermore, the hash block generation unit includes: a subject subunit, which merges the subject communities in the archive hash value set and the archive hash values of the same subject community into one hash block; a capacity strategy subunit, which uses the current blockchain network state indicator as the environmental state and the adjusted block capacity size as the action, and obtains the optimal block capacity adjustment strategy through the policy gradient method; wherein the state indicator includes the transaction throughput of the blockchain; a block generation subunit, which adjusts the size of the hash block according to the optimal block capacity adjustment strategy; when the number of archive hash values in a hash block reaches the capacity limit, a new block is generated through the blockchain consensus mechanism, and the current hash block is added to the new block.
[0042] Among them, in reinforcement learning, the environment state refers to the current condition or properties of the environment in which the agent is located. The environment state is usually represented by a set of variables or features, which describes important information about the environment and provides a basis for the agent to make decisions. In the hash block generation unit, the environment state refers to the state indicators of the current blockchain network, such as the transaction throughput of the blockchain. The transaction throughput reflects the ability and efficiency of the blockchain network to process transactions and is an important indicator for measuring the performance of the blockchain. The choice of environment state should be related to the agent's goals and provide enough information to guide the agent to make appropriate decisions. By observing the environment state, the agent can understand the current status of the blockchain network and adjust the block capacity accordingly to optimize the performance of the blockchain.
[0043] Among them, in reinforcement learning, action refers to the behavior or decision taken by the agent based on the current state of the environment. The agent interacts with the environment by choosing appropriate actions, with the goal of maximizing the long-term cumulative reward. In the hash block generation unit, the action refers to the adjusted block capacity size. Block capacity refers to the number of transactions or the amount of data that can be accommodated in a block. By adjusting the block capacity size, the performance and efficiency of the blockchain network can be affected. The agent chooses a suitable block capacity size as an action based on the current state of the environment (such as transaction throughput). The choice of action should take into account factors such as the performance, security, and scalability of the blockchain network to achieve the optimal balance.
[0044] Among them, the policy gradient method is a type of algorithm in reinforcement learning, which is used to directly optimize the decision-making strategy of the agent. The policy gradient method parameterizes the policy function of the agent and updates the parameters of the policy function by gradient ascent to maximize the expected cumulative reward. The policy gradient method includes: REINFORCE algorithm: estimates the policy gradient through Monte Carlo sampling, and then updates the parameters of the policy function. Actor-Critic algorithm: combines the policy function (Actor) and the value function (Critic), estimates the pros and cons of the action through Critic, and guides the Actor to update the policy function. PPO (Proximal Policy Optimization): By constraining the amplitude of policy updates, it improves sample efficiency while ensuring policy stability. In the hash block generation unit, the policy gradient method is used to obtain the optimal block capacity adjustment strategy. According to the current state of the environment, the agent generates an action (block capacity size) through the policy function, then obtains reward feedback through interaction with the environment, and uses the policy gradient method to update the parameters of the policy function in the hope of obtaining a higher cumulative reward.
[0045] Among them, the block capacity adjustment strategy refers to a strategy for dynamically adjusting the block capacity size according to the status indicators of the blockchain network. The adjustment of block capacity directly affects the performance and efficiency of the blockchain network, so it is necessary to make adaptive adjustments according to the network conditions. The goal of the block capacity adjustment strategy is to maximize the transaction throughput and processing efficiency of the network while ensuring the security and decentralization of the blockchain. Through the policy gradient method, the agent can learn an optimal block capacity adjustment strategy. The strategy generates a suitable block capacity size as an action based on the current environmental state (such as transaction throughput). By interacting with the environment and obtaining reward feedback, the agent continuously optimizes and adjusts the strategy in the hope of obtaining the maximum cumulative reward in the long run.
[0046] Furthermore, the Merkle tree construction unit includes: a Merkle tree generation subunit, which organizes all archive hash values in the hash block according to a binary tree structure; pairs the archive hash values at the bottom of the Merkle tree, and calculates the SHA-256 hash value of each pair of hash values as the corresponding parent node hash value; recursively pairs and hashes the parent node hash values until a root hash value is generated to form a bottom-up Merkle tree; a balancing subunit, which adjusts the Merkle tree structure using a rotation algorithm based on a red-black tree; a block header hash subunit, which combines the root hash value of the adjusted Merkle tree with the metadata of the hash block as the block header hash of the corresponding hash block;
[0047] Among them, a binary tree is a tree data structure in which each node has at most two child nodes, which are called left child nodes and right child nodes. The characteristic of a binary tree is that each node can have at most two child nodes, and the order of the child nodes is fixed. In the construction of a Merkle tree, a binary tree is used to organize the archive hash values in a hash block. The leaf nodes of a Merkle tree store the original archive hash values, and the non-leaf nodes store the combined hash of their child node hash values. By organizing the archive hash values according to the structure of a binary tree, the integrity and consistency of the data can be efficiently verified. In the process of building a Merkle tree, by organizing the archive hash values into a binary tree structure, the parent node hash value can be efficiently calculated, and finally a root hash value representing the entire hash block is generated.
[0048] Among them, in the Merkle tree, the parent node hash value refers to the hash value of the non-leaf node, which is obtained by performing a combined hash calculation on the hash values of its child nodes. In the process of building the Merkle tree, the archive hash values at the bottom layer are paired in pairs, and the SHA-256 hash value of each pair of hash values is calculated as the corresponding parent node hash value. The parent node hash value represents the combined hash of its child nodes and is used to verify the integrity and consistency of the child node data. Through the calculation of the parent node hash value, the Merkle tree can verify the integrity of the data in a recursive manner.
[0049] Among them, the red-black tree is a self-balancing binary search tree, which ensures the balance of the tree by introducing color attributes (red or black) and a series of balance conditions in the nodes. The rotation algorithm of the red-black tree is a key operation for maintaining the balance of the red-black tree. In the process of constructing the Merkle tree, in order to ensure the balance of the Merkle tree, the rotation algorithm based on the red-black tree is used to adjust the Merkle tree. The rotation algorithm maintains the balance of the tree by adjusting the local structure of the tree, thereby avoiding the tree from being too high and improving the search and verification efficiency of the Merkle tree. The rotation algorithm of the red-black tree includes two operations: left rotation and right rotation: left rotation: rotate a node to the left so that its right child node becomes the new parent node, and the original parent node becomes the left child node of the new parent node. Right rotation: rotate a node to the right so that its left child node becomes the new parent node, and the original parent node becomes the right child node of the new parent node.
[0050] Among them, the block header hash refers to the unique identifier of each block in the blockchain, which is obtained by hashing the block header information. The block header contains the metadata of the block and the root hash value of the Merkle tree, which is used to verify the integrity and consistency of the block. In the Merkle tree construction unit, the adjusted root hash value of the Merkle tree is combined with the metadata of the hash block as the block header hash of the corresponding hash block. The calculation process of the block header hash is as follows: the metadata of the hash block (such as block height, timestamp, hash value of the previous block, etc.) is serialized. The root hash value of the Merkle tree is spliced with the serialized metadata. The SHA-256 hash calculation is performed on the spliced data to obtain the block header hash.
[0051] Further, the update verification module includes: an abnormality score calculation unit, which is used to calculate the abnormality score of the update operation, including: a permission abnormality calculation subunit, which obtains the initiating account information in the update operation request; obtains the permission level of the initiating account, calculates the difference between the obtained permission level and the preset minimum permission level, and compares the calculated difference with the preset permission level threshold to obtain the permission abnormality score; a content abnormality calculation subunit, which obtains the modified content and the corresponding original content in the update operation request; uses a natural language processing algorithm to calculate the edit distance between the modified content and the original content to obtain the content abnormality score; a time abnormality calculation subunit, which obtains the timestamp of the update operation request, determines whether the timestamp is within the preset normal working time interval, and if so, the time abnormality score is 0; otherwise, the deviation degree between the timestamp and the preset normal working time interval boundary is calculated to obtain the time abnormality score; the abnormality score calculation subunit, which uses a weighted average method to weighted sum the permission abnormality score, the content abnormality score and the time abnormality score to obtain the abnormality score;
[0052] Furthermore, the update verification module also includes: an alarm triggering unit, which compares the abnormal score of the update operation with the abnormal threshold preset in the smart contract. When the abnormal score exceeds the abnormal threshold, the corresponding update operation is marked as suspicious and a hash alarm is generated; an alarm broadcasting unit, which broadcasts the marked update operation to other nodes in the blockchain network in the form of an event, and writes the hash alarm and the relevant information of the corresponding update operation into the blockchain. The relevant information includes the operation initiating account address, operation timestamp and operation content hash value; a blocking unit, which calls the function in the smart contract to block the marked update operation; wherein the blocking includes: The update request of the marked update operation returns an error code for execution rejection, terminating the execution of the update operation; the initiating account address of the marked update operation is added to the temporary blacklist of the smart contract, and all update requests initiated by the corresponding account address are rejected within the preset ban time; the consensus verification unit receives the abnormal detection results of the marked update operation from other nodes, counts the node votes, and when the number of nodes identified as abnormal operations reaches the preset consensus threshold, the marked update operation is confirmed as an abnormal operation; the blacklist recording unit writes the confirmed abnormal operation into the blacklist of the smart contract for monitoring, and synchronously updates the blacklist to each node.
[0053] Among them, the hash alarm is a warning message generated by the alarm trigger unit in the update verification module. When the abnormal score of the update operation exceeds the abnormal threshold preset in the smart contract, the alarm trigger unit will mark the corresponding update operation as suspicious and generate a hash alarm. By generating hash alarms, the update verification module can promptly discover and mark suspicious update operations and notify other nodes for verification and processing, thereby improving the security and reliability of the blockchain network.
[0054] Among them, node voting is a mechanism used in the consensus verification unit of the update verification module to confirm whether the marked update operation is an abnormal operation. When a node marks an update operation as suspicious and generates a hash alert, other nodes will perform abnormal detection on the update operation after receiving the hash alert. The process of node voting is as follows: the consensus verification unit receives the abnormal detection results of the marked update operation by other nodes. Each node analyzes and judges the update operation according to its own anomaly detection algorithm and rules. The node sends its own judgment result (whether it considers the update operation to be abnormal) as a vote to the consensus verification unit. The consensus verification unit counts the voting results of all nodes and calculates the number of nodes identified as abnormal operations. When the number of nodes identified as abnormal operations reaches the preset consensus threshold, the marked update operation is confirmed as an abnormal operation.
[0055] Among them, anomaly detection is a mechanism used in the update verification module to identify and mark suspicious update operations. The purpose of anomaly detection is to discover possible malicious, illegal or erroneous update operations by analyzing the characteristics and behaviors of update operations. Anomaly detection can use a variety of different algorithms and rules, such as statistical methods, machine learning algorithms, heuristic rules, etc. The effectiveness of anomaly detection depends on the rationality and effectiveness of the selected algorithms and rules. Through anomaly detection, the update verification module can effectively identify and mark suspicious update operations, improve the security and reliability of the blockchain network, and prevent malicious, illegal or erroneous update operations from destroying and tampering with blockchain data.
[0056] 3. Beneficial effects
[0057] Compared with the prior art, the advantages of this application are:
[0058] By using the IPFS distributed storage network to store archival data and using technologies such as data slicing, hash calculation and Merkle dag to generate on-chain fingerprint features of archival data, the problem of archival data being easily tampered with and forged in the traditional centralized storage model is solved;
[0059] A machine learning algorithm based on graph neural network is introduced to perform association analysis and community discovery on archive hash values. By mining the semantic association patterns between archives, intelligent classification, clustering and association recommendation of archives are realized, which greatly improves the intelligence level and efficiency of archive association analysis.
[0060] In the process of block construction, Merkle tree technology is used to structure the block data, and a consensus mechanism based on proof of stake is introduced to perform distributed verification of the blockchain ledger, ensuring the consistency and tamper-proofness of the blockchain network. At the same time, the reinforcement learning method is used to dynamically adjust the block capacity, which can achieve adaptive optimization of the block size according to the network status, improving the performance and efficiency of the blockchain;
[0061] The update verification module calculates the abnormal scores of update operations in dimensions such as permissions, content, and time, and uses mechanisms such as alarm triggering, event broadcasting, smart contract blocking, and node consensus to achieve real-time discovery, active warning, automatic blocking, and trusted records on the chain for abnormal update operations, thus building a multi-layer protection archive security update mechanism.
[0062] The data management module uses the version control system git to record the differences in archive modification, and through metadata updates and new block generation, it realizes the traceability management of the entire life cycle of archives. Combined with the tamper-proof and auditable characteristics of blockchain, it ensures the complete record and credible reproduction of the archive modification process. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 is an exemplary module diagram of a blockchain-based digital archive system according to some embodiments of this specification;
[0064] Figure 2 is an exemplary module diagram of a data acquisition module according to some embodiments of this specification;
[0065] Figure 3 is an exemplary module diagram of a block building module according to some embodiments of the present specification;
[0066] Figure 4 is an exemplary module diagram of an update verification module according to some embodiments of the present specification. DETAILED DESCRIPTION
[0067] The method and system provided by the embodiments of this specification are described in detail below with reference to the accompanying drawings.
[0068] Figure 1It is an exemplary module diagram of a digital archive system based on blockchain shown in some embodiments of this specification. The digital archive system of the present application includes: a data acquisition module, a block construction module, a blockchain consensus module, a data management module and an update verification module. The data acquisition module is responsible for collecting and receiving digital archive data from various sources. It can be integrated with external systems, such as file systems, databases, etc., to obtain digital archives that need to be stored on the blockchain. The data acquisition module also pre-processes the received digital archive data, such as format conversion, data cleaning, etc., to meet the input requirements of the system. The block construction module is responsible for packaging the digital archive data into blocks and adding the blocks to the blockchain. It includes the following sub-modules: Data hash unit: hash the digital archive data to generate a unique hash value for verifying the integrity of the data. Merkle tree construction unit: organize the hash value of the digital archive into a Merkle tree structure, and calculate the root hash value of the Merkle tree for efficiently verifying the existence and integrity of the data. Block generation unit: package the digital archive data, Merkle tree root hash value and other information into blocks, and add the blocks to the blockchain. The blockchain consensus module is responsible for reaching consensus in the blockchain network and ensuring the consistency and security of the blockchain. It can adopt various consensus algorithms, such as proof of work (PoW), proof of stake (PoS), etc., and choose according to the needs and performance requirements of the system. The consensus module collaborates with other nodes in the blockchain network to verify the newly generated blocks and add the legal blocks to the blockchain. The data management module is responsible for managing and maintaining the digital archive data stored on the blockchain. It includes the following submodules: Data query unit: provides the query function of digital archives, allowing users to retrieve digital archives according to keywords, time ranges and other conditions. Version control unit: manages the version history of digital archives, records each update operation, and allows users to view and trace back to a specific version of digital archives. Access control unit: manages the access rights of digital archives to ensure that only authorized users can access and operate the corresponding digital archives. The update verification module is responsible for verifying the update operation of the digital archive to ensure the legitimacy and integrity of the update. It includes the following submodules: Operation verification unit: verifies the identity of the initiator of the update operation, checks the legitimacy and integrity of the operation, and prevents unauthorized and malicious update operations. Data verification unit: Verify the integrity of the updated digital archive data to ensure that the data has not been tampered with or damaged. Abnormal detection unit: Monitor abnormal behavior of update operations, such as frequent updates, large-scale modifications, etc., and trigger an alarm mechanism to notify the system administrator to handle it.
[0069] Figure 2It is an exemplary module diagram of the data acquisition module shown in some embodiments of this specification. The data acquisition module is used to collect and digitize the archive data, and the archive is converted into standardized digital archive data through the archive digitization unit. Then, the archive chain unit uploads the digitized archive data to the IPFS distributed storage network and obtains the IPFS hash value of the archive data. At the same time, the metadata extraction unit extracts the metadata information of the archive (such as archive name, archive type, creation time, etc.) from the digitized archive data, and stores the metadata and the corresponding IPFS hash value in the original archive database of the blockchain.
[0070] Archives digitization unit: Scan or take photos of paper archives through digital devices such as scanners and digital cameras, and convert them into digital image files, such as TIFF, JPG and other formats. Use OCR (optical character recognition) technology to recognize text in digitized image files, extract archive content and convert it into editable text formats, such as TXT, DOC, etc. For multimedia archives such as audio and video, digitize them through audio and video acquisition equipment and transcode them into standard digital media formats, such as MP3, MP4, etc. Pre-process the digitized archive data, including format conversion, noise removal, compression, etc., to improve data quality and storage efficiency, and finally obtain standardized digitized archive data.
[0071] The archive chain unit uploads the standardized digital archive data to the IPFS distributed storage network: the chunker module in the IPFS protocol is used to chunk the digital archive data according to the set chunk size (such as 256KB). The selection of chunk size needs to comprehensively consider factors such as the transmission efficiency and storage cost of the IPFS network. Too large a chunk size will reduce storage utilization, while too small a chunk size will increase transmission overhead. Generally, 256KB or 512KB is selected. The chunking process uses a dynamic chunking algorithm based on Rabin fingerprints to adaptively adjust the chunk boundaries according to the content to ensure the consistency and integrity of the data block. A SHA-256 hash calculation is performed on each chunked data block to obtain a unique hash value for the data block. SHA-256 is a secure one-way hash algorithm that can map data of any length to a hash value of a fixed length (256 bits) and has strong anti-collision properties. The data block hash value can be used as the unique identifier of the data block for data integrity verification and content addressing.
[0072] The segmented data block content and the corresponding hash value are packaged to build an IPFS node object. The IPFS node object is serialized in the protocol buffer (Protobuf) format, which contains information such as data block content, data block hash, and link. Each IPFS node object represents a data storage node in the IPFS network, which can be addressed and accessed by hash value. Each IPFS node object is uploaded to the IPFS network through the add command provided by the IPFS protocol. The upload process stores IPFS node objects in different IPFS nodes through the DHT (distributed hash table) routing mechanism inside IPFS. The storage node stores the node object in the local object warehouse according to its hash value, and establishes a content addressing index through the hash value. By distributing and storing data in multiple IPFS nodes, redundant backup and load balancing of data are achieved, which improves data availability and access efficiency.
[0073] Build the Merkledag structure and generate IPFS objects: Pair all IPFS node objects in pairs, perform a combined hash operation on the hash values of each pair of node objects, and generate a new IPFS node object. Repeat the above process until a root node object is finally generated, forming a bottom-up hash tree (Merkle tree) structure. Each layer of the hash tree node represents the data summary of the lower layer node, and the root node represents the unique summary of the entire data set. The root node hash value of the Merkle tree is used as the IPFS hash value of the entire archive data, that is, the IPFS object hash. The IPFS object hash uniquely identifies the storage location of the archive data in the IPFS network and can be used for data retrieval, verification and authentication. Based on the Merkledag structure, each lower layer node can be recursively addressed and verified through the IPFS object hash, ensuring the integrity and immutability of the data. The generated IPFS object hash value is output as the result of the archive data being uploaded to the chain. The IPFS hash value can be embedded in the blockchain transaction, binding the archive data to the blockchain ledger to realize blockchain evidence storage. IPFS hash values can be used to retrieve and access complete archive data in the IPFS network, ensuring the availability and immutability of archive data. IPFS hash values can also be used as digital fingerprints of archives for scenarios such as version control, data deduplication, and integrity verification.
[0074] Metadata extraction unit: Use metadata extraction algorithms to automatically extract key metadata information of archives from standardized digital archive data, including: Archive name: the title or name of the archive. Archive type: such as text, picture, audio, video, etc. Archive format: the file format used by the digital archive. Archive size: the storage size of the archive data. Creation time: the date and time the archive was created. Creator: the creator of the archive or the department to which it belongs. Keywords: the keywords contained in the archive content. Organize the extracted archive metadata into structured metadata records.
[0075] Create a blockchain original archive database: deploy a dedicated smart contract in the blockchain network to create and manage the original archive database. The smart contract is written in a contract programming language such as Solidity to define the structure, fields, access control and other rules of the database. Through the constructor or initialization function of the smart contract, an empty original archive database instance is created on the blockchain. The original archive database adopts a key-value storage model, with the archive ID as the primary key and the archive metadata and IPFS hash as the value.
[0076] Construct archive directory and index: According to the structured archive metadata obtained by the metadata extraction unit, establish archive directory and index in the original archive database. The archive directory is organized in a tree structure, and the directory level is divided according to the archive category, date and other dimensions to facilitate the classification management and retrieval of archives. For each archive data, a unique archive index record is generated, which contains the following fields: Archive ID: A globally unique identification number automatically generated by the smart contract, which is used to uniquely identify an archive. Archive hash: The archive data hash value returned by the IPFS network is used for content addressing and integrity verification of the archive. Archive metadata: Including descriptive information such as archive name, type, format, size, etc., used for archive retrieval and management. Creation time: The creation timestamp of the archive on the blockchain, which is automatically generated by the blockchain network to ensure the objectivity and immutability of time. Creator: The blockchain address of the creator of the archive, which is used to record the ownership and responsible person information of the archive. The archive index is organized using a suitable data structure (such as B+ tree, hash table, etc.) to improve the efficiency of index query and update.
[0077] When a new archive data is added to the original archive database, the system automatically extracts the archive metadata information, such as archive ID, IPFS hash, archive name, type, format, size, creation time, etc., and packages these metadata fields into a structured archive index information. Then, the system serializes the index information into a blockchain transaction, and the transaction data contains all the fields and metadata of the index. In order to ensure the authenticity and non-repudiation of the archive index transaction, the transaction needs to be digitally signed by the creator of the archive. The creator signs the transaction data with his own private key, generates a digital signature, and attaches the signature to the transaction data. In this way, anyone can verify the transaction signature through the creator's public key to ensure that the transaction is indeed initiated by the designated creator, preventing others from impersonating or tampering with the index information. The signed archive index transaction is broadcast to all nodes in the network through the P2P communication protocol of the blockchain network. Usually, the transaction is first sent to the node to which the creator is connected, and then the node forwards the transaction to other adjacent nodes until the transaction is propagated to the entire network. This P2P communication mechanism ensures efficient propagation and redundant storage of transactions, and even if some nodes fail, it will not affect the propagation and storage of transactions. After receiving the archive index transaction, the nodes in the blockchain network will independently verify the transaction. The verification process is completed through a consensus mechanism (such as proof of work PoW, proof of stake PoS, etc.) to ensure the legitimacy and validity of the transaction. For example, in the PoW consensus, the node needs to solve a difficult cryptographic problem to prove its legitimacy; in the PoS consensus, the node needs to pledge a certain amount of tokens as collateral, and violations will result in the loss of tokens. Through the consensus mechanism, honest nodes in the network can reach a consistent confirmation of transactions.
[0078] The archive index transaction verified by the consensus mechanism will be packaged into a new block. A block is a collection of transactions, containing a batch of verified transaction data. The block header contains the metadata of the block, such as the Merkle tree root hash of the transaction, timestamp, previous block hash, etc., which is used to ensure the integrity and link relationship of the block. The process of packaging blocks is also completed through the consensus mechanism to ensure the legitimacy and consistency of the blocks. The newly generated blocks are added to the original blockchain through hash links to form an unalterable chain structure. Each block header contains the hash value of the previous block, so any modification to the block will cause the hash of all subsequent blocks to change, which can be easily discovered. This chain structure of the blockchain ensures the integrity and immutability of the data. Once the data is written to the blockchain, it cannot be modified or deleted. Each node in the blockchain network independently maintains a complete copy of the blockchain, which contains all blocks and transaction data. This means that the archive index data and metadata are distributed and stored on all nodes of the network, realizing multi-point backup and fault tolerance of data. Even if some nodes fail or go offline, the entire blockchain network can still maintain data integrity and availability. Blockchain uses cryptography and consensus mechanisms to ensure data consistency and tamper-proof. Both transaction and block data are hashed to form a unique digital fingerprint, and any minor modification will result in a huge change in the hash value. At the same time, the consensus mechanism ensures the consistency of honest nodes in the network, and it is difficult for malicious nodes to tamper with data without being discovered. In addition, the chain structure and distributed storage of blockchain also provide additional tamper-proof protection.
[0079] Read IPFS hash values from the original archive database: The archive hash calculation unit is connected to the original archive database, which stores the metadata information of each archive data and the corresponding IPFS hash value. Through database query statements (such as SQL) or database API interfaces, the archive hash calculation unit reads each archive record in the database. For each archive record, extract the IPFS hash value field, which represents the unique identifier of the archive data in the IPFS distributed file system. Store the read IPFS hash value in a data structure (such as an array or list) in memory to facilitate subsequent hash calculation and processing.
[0080] Perform SHA-256 hash calculation on IPFS hash value: For each IPFS hash value stored in memory, the archive hash calculation unit calls the SHA-256 hash function for calculation. SHA-256 is a secure one-way hash function that maps input data of arbitrary length to a fixed-length output of 256 bits, and is collision-resistant and irreversible. The archive hash calculation unit uses the IPFS hash value as the input of the SHA-256 function and generates a 256-bit hash value through a series of bit operations, modulo operations, and compression operations. The generated 256-bit hash value is called the archive hash value, which is the on-chain fingerprint feature of the archive data and is used to uniquely identify and verify the archive data. The archive hash calculation unit stores the generated archive hash value in another memory data structure, associated with the corresponding IPFS hash value.
[0081] Storing the mapping relationship between archive hash values and metadata: In addition to the IPFS hash value, the original archive database also stores metadata information for each piece of archive data, such as archive ID, name, type, creation time, etc. The archive hash calculation unit reads these metadata fields from the database and associates them with the corresponding archive hash values. The mapping relationship between archive hash values and metadata can be stored using a key-value pair data structure (such as a hash table or dictionary), where the archive hash value is the key and the metadata is the value. Through this mapping relationship, it is convenient to quickly find and retrieve the metadata information of the archive through the archive hash value, realizing efficient management and retrieval of archive data.
[0082] In a specific embodiment of the present application, archive ID1: IPFS hash value:
[0083] "QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco", Name: "Contract.pdf", Type: "PDF". Archive ID2: IPFS hash value:
[0084] "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG", name: "invoice.jpg", type: "IMAGE". The archive hash calculation unit reads the IPFS hash values of the two records, performs SHA-256 hash calculations on each, and obtains the following archive hash values:
[0085] “QmXoypizjW3WknFiJnKLwHCnL72vedxjQkDDP1mXWo6uco” →
[0086] "a7f5f2f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0".
[0087] “QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG”→
[0088] Then, the archive hash calculation unit associates the archive hash value with the corresponding metadata, and the storage mapping relationship is as follows:
[0089] "a7f5f2f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0e8f1c1f0" → (file ID1: name: "contract.pdf", type: "PDF"),
[0090] “b8f6f3f1e9f2c2f1e9f2c2f1e9f2c2f1e9f2c2f1e9f2c2f1e9f2c2f1e9f2c2f1e9f2c2f1” → (archive ID2: name: “invoice.jpg”, type: “IMAGE”). In this way, the archive hash calculation unit completes the conversion from the original archive data to the on-chain fingerprint feature, and establishes the mapping relationship between the archive hash value and the metadata, providing a basis for subsequent block construction and data retrieval.
[0091] Figure 3 It is an exemplary module diagram of the block construction module shown in some embodiments of this specification. Graph construction: The graph construction subunit uses all archive hash values as nodes of the graph, and each node represents a unique archive. By analyzing the co-occurrence relationship in the archive metadata, the edge weights between the nodes are calculated. For example, if two archives have the same keywords, authors, or timestamps, the edge weight between them will be higher. Edge weights can be calculated based on indicators such as co-occurrence frequency and similarity. Common methods include cosine similarity, Jaccard coefficient, etc. By connecting nodes with edge weights, the graph construction subunit generates an undirected weighted graph that reflects the strength of association between archives.
[0092] Graph Embedding: The graph embedding subunit uses a graph convolutional neural network (GCN) to perform feature learning and embedding on the constructed undirected weighted graph. GCN propagates and aggregates feature information on the nodes of the graph through convolution operations, so that the features of connected nodes influence and update each other. In each layer of convolution, the feature vector of the node is updated by aggregating the features and edge weights of neighboring nodes to achieve feature propagation and fusion. In order to capture the importance differences between nodes, the graph embedding subunit introduces an attention mechanism, which dynamically adjusts the aggregation method of node features by learning the attention weights of different neighboring nodes. After multiple layers of convolution and attention mechanism, the graph embedding subunit maps the high-dimensional archive hash value to a low-dimensional embedding vector space, so that semantically similar archives are closer in the embedding space.
[0093] Community discovery: The community discovery subunit uses the k-means clustering algorithm to cluster archives in the generated low-dimensional embedding vector space. The k-means algorithm iteratively assigns data points to k cluster centers so that the distance from each data point to its cluster center is minimized. In the archive embedding space, archives with similar themes or contents will form tight clusters, while archives with different themes will be assigned to different clusters. The clustering results reflect the subject community structure between archives, and each cluster represents a subject community containing semantically related archives.
[0094] Output association patterns: The output subunit groups the archive hash values belonging to the same subject community into a set based on the results of community discovery. Each set represents a subject community and contains archive hash values with similar themes or content. By analyzing the archive metadata within the subject community, association patterns between archives can be discovered, such as common keywords, authors, time periods, etc. The output subunit provides the discovered subject communities and association patterns as the results of association pattern mining for subsequent applications and analysis.
[0095] Topic community merging: The topic subunit receives the archive hash value sets output by the association pattern mining unit, each set represents a topic community. For each topic community, the topic subunit merges all the archive hash values inside it into a hash block. A hash block is a data structure used to store the archive hash values of related topics, ensuring their physical proximity on the blockchain. By merging the archive hash values of the same topic community into a hash block, the storage efficiency and query performance of the blockchain can be improved. Dynamic capacity adjustment: The capacity policy subunit is responsible for dynamically adjusting the capacity size of the hash block to adapt to the state changes of the blockchain network. Using the policy gradient method in reinforcement learning, the capacity policy subunit takes the current blockchain network state as the environment state and learns the optimal block capacity adjustment strategy. The network state can include indicators such as transaction throughput, block generation speed, and number of nodes, which reflects the overall performance and load of the blockchain network. By interacting with the environment and obtaining reward feedback, the capacity policy subunit continuously optimizes its strategy to maximize the performance and efficiency of the blockchain network.
[0096] Hash block generation: The block generation subunit dynamically adjusts the capacity of the hash block according to the optimal strategy learned by the capacity strategy subunit. When the capacity of a hash block reaches the upper limit, the block generation subunit triggers the blockchain consensus mechanism and generates a new block. The consensus mechanism can be proof of work (PoW), proof of stake (PoS), etc., which is used to ensure that the nodes in the blockchain network reach a consensus and prevent double spending and tampering. The block generation subunit packs the current hash block into the newly generated block and broadcasts the block to other nodes in the blockchain network for verification and confirmation.
[0097] Figure 4It is an exemplary module diagram of the update verification module shown in some embodiments of this specification. Blockchain update: When the newly generated block is verified and confirmed through the consensus mechanism, it will be appended to the end of the blockchain and become the latest block of the blockchain. All nodes in the blockchain network will update their local copies of the blockchain to keep in sync with the latest block. In this way, the archive hash value in the hash block is permanently recorded on the blockchain, achieving the immutability and traceability of the data. In a specific embodiment of the present application, the association pattern mining unit outputs the following three subject communities: Community 1: [Archive 1, Archive 2], Theme: Contract, Law; Community 2: [Archive 3, Archive 4], Theme: Invoice, Finance; Community 3: [Archive 5], Theme: Report, Summary. The subject subunit will merge the archive hash values in each subject community into the corresponding hash block: Hash block 1: [Archive 1 Hash, Archive 2 Hash], Theme: Contract, Law; Hash block 2: [Archive 3 Hash, Archive 4 Hash], Theme: Invoice, Finance; Hash block 3: [Archive 5 Hash], Theme: Report, Summary. The capacity strategy subunit learns the optimal block capacity adjustment strategy through reinforcement learning according to the current state of the blockchain network (such as a transaction throughput of 100TPS), such as setting the capacity of the hash block to 20. The block generation subunit dynamically adjusts the capacity of the hash block according to the learned strategy. When the capacity of hash block 1 reaches 20, the consensus mechanism is triggered to generate a new block and hash block 1 is packaged into the new block. The newly generated block is verified and confirmed by the consensus mechanism and appended to the end of the blockchain. All nodes in the blockchain network update their local copies of the blockchain to keep in sync with the latest block.
[0098] Archive hash value organization: The Merkle tree generation subunit receives all archive hash values in the hash block and organizes them according to the binary tree structure. If the number of archive hash values is odd, the last hash value is copied at the bottom layer so that the number of leaf nodes is even. The archive hash values are used as leaf nodes of the Merkle tree to build a bottom-up binary tree structure. Hash calculation: Pair the archive hash values at the bottom layer in pairs, use the SHA-256 hash function to calculate their hash values, and generate the hash value of the parent node. Recursively pair and hash the hash values of the parent node until a unique root hash value is generated. In each round of hash calculation, the hash values of the two child nodes are concatenated into a string, and then the string is hashed by SHA-256 to obtain the hash value of the parent node. Through this bottom-up hash calculation, a complete Merkle tree structure is formed, and the hash value of the root node represents the data fingerprint of the entire hash block.
[0099] Tree balance adjustment: The balance subunit uses a rotation algorithm based on a red-black tree to balance the generated Merkle tree to ensure that the height of the tree is as uniform as possible. The red-black tree is a self-balancing binary search tree that maintains the balance of the tree through rotation and recoloring operations to ensure that the height of the tree is at a logarithmic level. The balance subunit traverses the Merkle tree, checks the balance factor of each node (the difference between the height of the left subtree and the height of the right subtree), and performs corresponding rotation operations according to the size of the balance factor. Through tree balance adjustment, the search and verification efficiency of the Merkle tree can be optimized and the performance of the blockchain can be improved. Block header hash generation: The block header hash subunit combines the root hash value of the Merkle tree with the metadata of the hash block to generate the block header hash of the block. The metadata of the hash block can include information such as timestamp, previous block hash, difficulty target, etc., which are used to identify and verify the validity and link relationship of the block. The block header hash subunit concatenates the root hash value and metadata into a string in a fixed format, and then performs a SHA-256 hash operation on the string to obtain the block header hash. The block header hash serves as the unique identifier of the block and is used to link the adjacent blocks before and after to form the chain structure of the blockchain.
[0100] In a specific embodiment of the present application, the hash block contains the following 6 file hash values: [H1, H2, H3, H4, H5, H6]. The Merkle tree generation subunit organizes these hash values into a binary tree structure:
[0101] H1234→H12 H34→H1 H2 H3 H4→H1 H1 H2 H2 H3 H3. Pair and hash the bottom hash values in pairs to generate the hash value of the parent node: H1=SHA-256(H1+H1), H2=SHA-256(H2+H2), H3=SHA-256(H3+H3), H4=SHA-256(H4+H5). Recursively pair and hash the hash values of the parent nodes in pairs until the root hash value is generated:
[0102] H12=SHA-256(H1+H2), H34=SHA-256(H3+H4),
[0103] H1234 = SHA-256 (H12 + H34), the balancing subunit uses the red-black tree algorithm to balance the Merkle tree to ensure that the height of the tree is as uniform as possible. The block header hash subunit combines the root hash value H1234 with the block metadata (such as timestamp T, previous block hash P) to generate the block header hash: block header hash = SHA-256 (H1234 + T + P). Through this process, the Merkle tree construction unit generates the Merkle tree of the hash block and calculates the block header hash for linking and verifying the integrity and consistency of the blockchain. The use of Merkle trees improves the data verification efficiency of the blockchain and also saves storage space.
[0104] The block header hash generated by the Merkle tree building unit is assembled with the block metadata to form a complete block. Block metadata includes information such as timestamp, previous block hash, difficulty target, random number (Nonce), etc., which are used to identify the attributes and link relationships of the block. The block header part contains the block header hash and metadata, while the block body part contains all the archive hash values in the hash block. The structure of the block can be expressed as: block header: version number, the version number of the blockchain protocol, previous block hash: the hash value pointing to the previous block, used to link the block; timestamp: the timestamp of block generation; difficulty target: the difficulty target value of the block; Nonce: a random number used for proof of work; block body hash: the root hash value of the Merkle tree; block body: archive hash value list: the hash value of all archives in the hash block. Consensus mechanism verification: The newly generated block is verified and confirmed by the consensus mechanism of the blockchain network to ensure the validity and consistency of the block. Common consensus mechanisms include proof of work (PoW), proof of stake (PoS), and proof of delegation (DPoS). In proof of work, a node proves its workload by solving a mathematical problem of appropriate difficulty (such as finding a Nonce value that satisfies the conditions) to obtain the right to package a block. In proof of stake, a node decides the right to package a block through random selection or voting mechanism based on factors such as the number of tokens it holds and time. The goal of the consensus mechanism is to ensure that all nodes in the blockchain network agree on the validity of the block and prevent double spending and tampering attacks. Block linking: The new block verified by the consensus mechanism is linked to the original blockchain and becomes the latest block of the blockchain. The process of block linking is achieved by setting the hash of the previous block of the new block to the hash value of the last block of the original blockchain. Each block contains the hash value of the previous block, forming a chain structure, which ensures the integrity and immutability of the blockchain. Once a new block is linked to the blockchain, the archive hash value and metadata contained in it are permanently recorded in the blockchain and cannot be modified or deleted.
[0105] In a specific embodiment of the present application, the Merkle tree construction unit generates a block header hash H1234, and the block metadata is as follows: version number: 1.0, previous block hash: 0x987654321, timestamp: 2022-01-0112:00:00, difficulty target: 0x00001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, Nonce: a randomly generated value. The block assembly unit assembles the block header hash and metadata into a complete block: Block header: version number: 1.0, previous block hash: 0x987654321, timestamp: 2022-01-0112:00:00, difficulty target: 0x00001ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff, Nonce: 235987, block body hash: H1234. Block body: archive hash value list: [H1, H2, H3, H4, H5, H6]. The newly generated block is verified by the proof-of-work consensus mechanism. The node tries different Nonce values to find the block hash value that meets the difficulty target condition, thereby obtaining the right to package the block. After verification, the new block is linked to the end of the original blockchain and becomes the latest block. The structure of the blockchain is updated as follows: Block 1 <- Block 2 <-... <- Block N <- New Block. The archive hash value and metadata contained in the new block are permanently recorded in the blockchain, making the data tamper-proof and traceable.
[0106] Abnormal score calculation: When the administrator updates the archive metadata in the original archive database, the update verification module automatically triggers the abnormal score calculation unit to detect abnormalities in the update operation. The permission abnormality calculation subunit obtains the initiating account information in the update operation request and obtains the permission level of the account. Then the difference between the account permission level and the preset minimum permission level is calculated, and the difference is compared with the preset permission level threshold to obtain the permission abnormality score. The content abnormality calculation subunit obtains the modified content and the corresponding original content in the update operation request, and uses the natural language processing algorithm to calculate the edit distance between the modified content and the original content to obtain the content abnormality score. The larger the edit distance, the greater the difference between the modified content and the original content, and the higher the content abnormality score. The time abnormality calculation subunit obtains the timestamp of the update operation request and determines whether the timestamp is within the preset normal working time interval. If so, the time abnormality score is 0; otherwise, the deviation degree between the timestamp and the preset normal working time interval boundary is calculated to obtain the time abnormality score. The greater the deviation degree, the higher the time abnormality score. The anomaly score calculation subunit uses the weighted average method to perform weighted summation on the authority anomaly score, content anomaly score and time anomaly score to obtain a comprehensive anomaly score.
[0107] The alarm triggering unit obtains the comprehensive anomaly score of the update operation. For example, the comprehensive anomaly score of the update operation of administrator Carol is 3.8. The preset anomaly threshold in the smart contract is 3.0, which means that an alarm needs to be triggered when the comprehensive anomaly score exceeds 3.0. The alarm triggering unit compares the comprehensive anomaly score (3.8) of Carol's update operation with the anomaly threshold (3.0). Since 3.8 is greater than 3.0, the alarm triggering unit marks Carol's update operation as a suspicious operation. The alarm triggering unit generates a hash alarm that contains the unique identifier of Carol's update operation, the comprehensive anomaly score, and the timestamp of the alarm triggering. The alarm broadcasting unit broadcasts Carol's update operation marked as suspicious to other nodes in the blockchain network in the form of an event. The event contains the following information: Event type: abnormal update operation alarm, Operation initiating account address: Carol's account address, Operation timestamp: the time when Carol initiated the update operation, such as 14:30:00 on May 12, 2023, Operation content hash value: the hash value obtained by hashing the modified content of Carol's update operation, used to verify the integrity of the content, Comprehensive abnormality score: 3.8, Alarm generation timestamp: May 12, 2023 14:31:00. The alarm broadcast unit broadcasts the event to other nodes in the blockchain network so that other nodes can receive the alarm notification of abnormal update operation in time. At the same time, the alarm broadcast unit writes the hash alarm and related information into the blockchain to form a new block. The block records the relevant information of Carol's update operation, including the operation initiating account address, operation timestamp, operation content hash value, and comprehensive abnormality score. By writing the alarm and related information into the blockchain, the immutability and traceability of the alarm can be ensured, which is convenient for subsequent auditing and accountability.
[0108] In a specific embodiment of the present application, the administrator Carol uses her account to update the archive metadata and modify the key fields of the archive. The update verification module performs anomaly detection on the operation and calculates the comprehensive anomaly score to be 3.8. The alarm triggering unit compares the comprehensive anomaly score (3.8) with the preset anomaly threshold (3.0) and finds that it exceeds the threshold, so Carol's update operation is marked as a suspicious operation and generates a hash alarm. The alarm broadcasting unit broadcasts Carol's update operation marked as suspicious to other nodes of the blockchain network in the form of an event. The event contains Carol's account address, the timestamp of the update operation (14:30:00 on May 12, 2023), the hash value of the modified content, the comprehensive anomaly score (3.8), and the timestamp of the alarm generation (14:31:00 on May 12, 2023). After receiving the alarm event, other nodes can further verify and process Carol's update operation based on the information in the event, such as comparing with the local anomaly detection results, manually reviewing suspicious operations, etc. At the same time, the alarm broadcast unit writes the hashed alarm and related information into the blockchain to form a new block. The block records the details of Carol's update operation, ensuring the immutability and traceability of the alarm.
[0109] Abnormal operation marking: Through the alarm triggering and broadcasting mechanism, the update operation of administrator David is marked as an abnormal operation. The comprehensive abnormality score of this update operation is 4.2, which exceeds the preset abnormal threshold (3.0). Calling the smart contract blocking function: The blocking unit calls the predefined blocking function in the smart contract and passes David's update operation marked as abnormal as a parameter to the blocking function. After receiving the information of the abnormal operation, the blocking function starts to execute the blocking logic. Refusing to execute abnormal operations: The blocking function returns a predefined error code to the update request of David's update operation, indicating that the operation is refused. The error code can be a specific value or string, such as "ERROR_ABNORMAL_OPERATION". When David's client receives the error code, it will know that the update operation is refused to execute and can handle the error accordingly. The blocking function will also record a log of the refusal to execute in the event log of the smart contract, including information such as the account address of the operation initiator, the operation timestamp, and the hash value of the operation content. Adding the account initiating the abnormal operation to a temporary blacklist: The blocking function adds David's account address to a temporary blacklist maintained by the smart contract. The temporary blacklist is a special data structure used to store account addresses that are marked as abnormal. Each account address added to the blacklist has a corresponding ban time, which means that the account is prohibited from initiating any update operations during this time. The preset ban time is 24 hours, so when the blocking function is executed, David's account address will be added to the blacklist, and the ban time will be set to the current time plus 24 hours. Reject update requests from accounts in the blacklist: During the ban time, if David's account attempts to initiate any update operations, the smart contract will automatically reject these requests. The smart contract will first check whether the account address initiating the update request is in the blacklist. If the account address is in the blacklist and the current time is still within the ban time, the smart contract will directly return a predefined error code to indicate that the operation is refused. This prevents abnormal accounts from continuing to perform malicious or suspicious update operations during the ban period. Automatic blacklist release: When the ban time expires, the smart contract will automatically remove David's account address from the blacklist. After removal, David's account can re-initiate update operations, but it will still be monitored by the anomaly detection mechanism. If David's account continues to perform abnormal operations, it will be marked and blocked again and added to the blacklist again.
[0110] Abnormal operation broadcast: Node A detects that an update operation of administrator Eve is marked as an abnormal operation. Node A broadcasts this marked abnormal operation to other nodes in the blockchain network in the form of an event. After receiving the abnormal operation event, other nodes begin to perform their own abnormal detection and verification on the operation. Abnormal detection result sharing: Each node in the blockchain network independently performs abnormal detection on Eve's update operation. There may be two detection results: abnormal or normal. Each node sends its own detection result to the consensus verification unit. Node voting statistics: The consensus verification unit collects the abnormal detection results of all nodes on Eve's update operation. There are a total of 10 nodes in the blockchain network, of which 7 nodes believe that Eve's operation is abnormal and 3 nodes believe that it is normal. The consensus verification unit counts the node votes and obtains that the number of nodes that are considered abnormal is 7 and the number of nodes that are considered normal is 3. Consensus threshold judgment: The preset consensus threshold is 2 / 3, that is, when more than 66.67% of the nodes are considered as abnormal operations, the operation can be confirmed as an abnormal operation. In this example, the number of nodes that are considered abnormal is 7, accounting for 70% of the total number of nodes, exceeding the preset consensus threshold. Therefore, the consensus verification unit confirms Eve's update operation as an abnormal operation. Abnormal operation is written to the blacklist: The blacklist recording unit receives the abnormal operation information confirmed by the consensus verification unit. The blacklist recording unit writes Eve's abnormal operation into the blacklist of the smart contract. The blacklist records the following information: Operation initiation account address: Eve's account address; Operation timestamp: The time when Eve initiates the update operation, such as 09:30:00 on May 15, 2023; Operation content hash value: The hash value obtained by hashing the modified content of Eve's update operation; The blacklist recording unit also broadcasts the blacklist update event to other nodes in the blockchain network. Blacklist synchronization update: After receiving the blacklist update event, other nodes synchronize the local blacklist with the blacklist in the event. Each node saves a complete copy of the blacklist for subsequent abnormal operation judgment and verification. Through the synchronous update of the blacklist, the consistency of the cognition of abnormal operations by all nodes in the blockchain network is ensured. Audit and tracking of abnormal operations: The blacklist provides a basis for the audit and tracking of abnormal operations. Administrators can query the blacklist to understand abnormal operations in the system. If further investigation and processing of abnormal operations is required, targeted analysis and evidence collection can be carried out based on the information recorded in the blacklist, such as the account address of the operation initiator, the operation timestamp, and the hash value of the operation content.
[0111] Update operation verification passed: Administrator Frank submitted an archive update operation request. After anomaly detection and consensus verification, the operation was deemed to be a legitimate operation. The update verification module passes the operation to the data management module for further processing. Archive modification difference record: The data management module uses the version control system git to track and record Frank's update operation. git can capture the difference before and after the archive modification and generate a modification difference report. The modification difference report contains the following information: the modified file name and path, the comparison of the file content before and after the modification, the number of modified lines and specific content, the modified timestamp and the operator. Through the version control function of git, the modification history of the archive can be easily tracked and traced back.
[0112] Archive metadata update: After recording the modification difference, the data management module applies Frank's update operation to the original archive database. Assuming that Frank updates the title and keyword fields of archive A, the data management module will find the metadata record of archive A in the archive database and update the corresponding field values. The updated metadata record may be as follows: Archive ID: A001, Title: Annual Budget Report (2023 Updated Version), Keywords: Budget, Finance, 2023, Version Number: 2.0, Update Time: May 20, 2023 14:30:00, Updated by: Frank. Archive hash value recalculation: Since the content of archive A has changed, its hash value needs to be recalculated. The archive hash calculation unit performs a hash operation on the content of the updated archive A to obtain a new hash value. The new hash value will replace the original hash value as the unique identifier of archive A.
[0113] The updated hash value may be as follows: Archive ID: A001, Hash value: 0x7f83b1657ff1fc53b92dc18148a1d65dfc2d4b1fa3d677284addd200126d9069. Association analysis: The association pattern mining unit performs association analysis on the updated archive A. By analyzing the metadata and content of archive A, the association pattern mining unit finds that archive A has a certain association relationship with other archives (such as archive B and archive C). The association relationship may be based on similar keywords, the same author, similar creation time and other factors. The association pattern mining unit generates an association report to describe the degree of association and association factors between archive A and other archives. Generate a new block: Construct a new block based on the above-mentioned archive modification difference report, updated metadata, new hash value and association report. The new block contains the following information: Block height: the height of the current blockchain + 1, Timestamp: the time when the block was generated, Transaction data: detailed information of the archive update operation, including modification difference report, updated metadata, new hash value and association report, Previous block hash: the hash value of the last block in the current blockchain, Current block hash: the hash value obtained by hashing the content of the current block, The new block is verified and accepted through the consensus mechanism and added to the end of the blockchain. Archive modification operation evidence: By packaging the information related to the archive update operation into blocks and adding them to the blockchain, the blockchain evidence of the archive modification operation is realized. The immutability and traceability of the blockchain ensure the authenticity and integrity of the archive modification operation. Anyone can understand the modification history and association relationship of archive A by querying the blockchain. This blockchain-based evidence storage method provides a trusted audit and verification mechanism to prevent the archive modification operation from being tampered with or denied.
Claims
1. A digital archive system based on blockchain, comprising: The data collection module collects archival data and converts it into digital archival data, and uploads the digital archival data to the IPFS distributed storage network to obtain the IPFS hash value; Construct an original archive database to record archive data including archive name, archive type and creation time metadata; The block construction module performs SHA-256 hash calculation on each archive data to obtain the archive hash value; uses a machine learning algorithm based on a graph neural network to perform correlation analysis on the archive hash values to obtain the association pattern between archives, which includes the archive subject; merges the archive hash values of the same subject into a hash block according to the association pattern and sets the block capacity upper limit; Merkle tree structure is performed on the hash block to generate the block header hash; The blockchain consensus module obtains the logical relationship between hash blocks and links the hash blocks into a linked list structure in the order of the generation time of the hash blocks. It adopts a consensus mechanism based on proof of stake (POS), calculates the weight of the node according to the number of tokens held by the blockchain node and the length of time the tokens are held, and selects the block generation node according to the weight. The selected block generation node adds the newly generated block to the blockchain and broadcasts it to other nodes for verification. Update verification module, deploy smart contracts on blockchain, set file update rules in the deployed smart contracts; calculate the abnormal score of update operation, trigger hash alarm when the abnormal score exceeds the threshold, and block abnormal operation through smart contracts; The data management module uses the version control system git to record the difference of each modification when modifying the original archive data. After performing data adjustment, it updates the metadata of the corresponding archive in the original archive database and generates a new block to be added to the blockchain.
2. The blockchain-based digital archive system according to claim 1, characterized in that: Data acquisition module, including: The archive digitization unit collects archive data and pre-processes the collected archive data to obtain standardized digitized archive data; The archive chain unit uploads the standardized digital archive data to the IPFS distributed storage network and obtains the IPFS hash value of the archive data in the IPFS network through the IPFS protocol; A metadata extraction unit extracts metadata of archival data from standardized digitized archival data; The original archive database establishes a structured archive directory and index based on the extracted metadata, and records the IPFS hash value, creation time and creator of each archive data.
3. The blockchain-based digital archive system according to claim 2, characterized in that: The archive chain unit uploads standardized digital archive data to the IPFS distributed storage network, including: Divide the standardized digital archival data into data blocks; Perform SHA-256 hash calculation on each data block to obtain the hash value of the data block; Combine the data block with the corresponding hash value to generate an IPFS node object, and upload the IPFS node object to the IPFS network through the IPFS protocol; where the IPFS node object represents a data node in the IPFS network; The IPFS node objects are associated with a Merkle dag-based data structure to generate an IPFS object, which is composed of all IPFS node objects, and the root node hash value of the IPFS object is output; The root node hash value of the IPFS object is used as the IPFS hash value of the archive data in the IPFS network.
4. The blockchain-based digital archive system according to claim 3, characterized in that: Block building blocks, including: The archive hash calculation unit obtains the IPFS hash value corresponding to each archive data; performs SHA-256 hash calculation on the IPFS hash value to obtain the archive hash value as the unique fingerprint feature of the archive data; The association pattern mining unit uses a machine learning algorithm based on a graph neural network to extract features and measure similarity of archive hash values, obtains association patterns between archives through cluster analysis, and classifies archive hash values with association patterns of the same archive subject into the same set, generating multiple archive hash value sets; The hash block generation unit constructs a corresponding hash block according to the association pattern between the files contained in each file hash value set, and adds all the file hash values in the file hash value set to the corresponding hash block; The Merkle tree construction unit constructs a Merkle tree based on the hash values of all the files contained in the hash block and calculates the root hash value of the Merkle tree.
5. The blockchain-based digital archive system according to claim 4, characterized in that: Association pattern mining unit, including: The graph construction subunit uses the archive hash value as the node of the graph; the co-occurrence frequency between nodes is calculated based on the metadata of the archive data recorded in the original archive database, and the co-occurrence frequency is used as the weight of the edge between nodes to construct an undirected weighted graph; The graph embedding subunit uses a graph convolutional neural network to update and propagate the feature vectors of nodes in an undirected weighted graph, and obtains a low-dimensional representation vector of the archive hash value by aggregating the neighborhood information of the node; and uses an attention mechanism to obtain the node allocation weights of different neighborhoods; The community discovery subunit clusters the archive hash values in the low-dimensional representation vector space using the k-means clustering algorithm to obtain the community structure of the archive hash values; and obtains the association pattern between the archive data based on the community structure; The output subunit outputs a set of archive hash values containing association patterns, each set corresponding to a topic community.
6. The blockchain-based digital archive system according to claim 5, characterized in that: The attention mechanism is used to obtain the node allocation weights of different neighborhoods, including: For each central node in the undirected weighted graph, the cosine similarity between the feature vectors of the central node and the neighboring nodes is calculated; The calculated cosine similarity is normalized by the softmax function to obtain the attention weight corresponding to each neighborhood node; Multiply the feature vector of each neighborhood node by the corresponding attention weight to obtain a weighted neighborhood feature vector; add the weighted neighborhood feature vectors to obtain an aggregated neighborhood feature vector; Concatenate the central node feature vector and the aggregated neighborhood feature vector to form a concatenated feature vector; The concatenated feature vector is transformed nonlinearly through a fully connected neural network to obtain a node feature vector, which serves as a low-dimensional representation vector of the corresponding archive hash value.
7. The blockchain-based digital archive system according to claim 6, characterized in that: Hash block generation unit, including: The subject subunit,combines the subject communities in the archive hash value collection,and the archive hash values of the same subject community into one,hash block; The capacity strategy subunit uses the current blockchain network status indicator as the environment status and the adjusted block capacity size as the action to obtain the optimal block capacity adjustment strategy through the policy gradient method; the status indicator includes the transaction throughput of the blockchain; The block generation subunit adjusts the size of the hash block according to the optimal block capacity adjustment strategy; when the number of archive hash values in a hash block reaches the capacity limit, a new block is generated through the blockchain consensus mechanism and the current hash block is added to the new block.
8. The blockchain-based digital archive system according to claim 7, characterized in that: Merkle tree building units include: The Merkle tree generation subunit organizes all the file hash values in the hash block according to the binary tree structure; pairs the file hash values at the bottom of the Merkle tree, and calculates the SHA-256 hash value of each pair of hash values as the corresponding parent node hash value; recursively pairs and hashes the parent node hash values until a root hash value is generated, forming a bottom-up Merkle tree; Balance sub-units and adjust the Merkle tree structure using a rotation algorithm based on a red-black tree; The block header hash subunit combines the root hash value of the adjusted Merkle tree with the metadata of the hash block as the block header hash of the corresponding hash block.
9. The blockchain-based digital archive system according to any one of claims 1 to 8, characterized in that: Updated authentication modules, including: The abnormal score calculation unit is used to calculate the abnormal score of the update operation, including: The permission anomaly calculation subunit obtains the initiating account information in the update operation request; obtains the permission level of the initiating account, calculates the difference between the obtained permission level and the preset minimum permission level, compares the calculated difference with the preset permission level threshold, and obtains the permission anomaly score; The content anomaly calculation subunit obtains the modified content and the corresponding original content in the update operation request; uses a natural language processing algorithm to calculate the edit distance between the modified content and the original content to obtain a content anomaly score; The time anomaly calculation subunit obtains the timestamp of the update operation request and determines whether the timestamp is within the preset normal working time interval. If so, the time anomaly score is 0; otherwise, the deviation degree between the timestamp and the preset normal working time interval boundary is calculated to obtain the time anomaly score; The anomaly score calculation subunit uses a weighted average method to perform a weighted summation of the authority anomaly score, the content anomaly score, and the time anomaly score to obtain an anomaly score.
10. The blockchain-based digital archive system according to claim 9, characterized in that: Update the verification module, also includes: The alarm triggering unit compares the abnormal score of the update operation with the abnormal threshold preset in the smart contract. When the abnormal score exceeds the abnormal threshold, the corresponding update operation is marked as suspicious and a hash alarm is generated; The alarm broadcast unit broadcasts the marked update operation to other nodes in the blockchain network in the form of an event, and writes the hash alarm and the relevant information of the corresponding update operation into the blockchain. The relevant information includes the operation initiating account address, operation timestamp and operation content hash value; A blocking unit calls a function in the smart contract to block the marked update operation; wherein the blocking includes: returning an error code indicating that the update operation is rejected to the update request of the marked update operation, thereby terminating the execution of the update operation; adding the initiating account address of the marked update operation to the temporary blacklist of the smart contract, and rejecting all update requests initiated by the corresponding account address within the preset ban time; The consensus verification unit receives the abnormality detection results of the marked update operation from other nodes, counts the node votes, and confirms the marked update operation as an abnormal operation when the number of nodes identified as abnormal operations reaches a preset consensus threshold; The blacklist recording unit writes the confirmed abnormal operations into the blacklist of the smart contract for monitoring.
Citation Information
Patent Citations
Archive data tamper-proofing method and system based on block chain guarantee
CN117744159A
Digital archive security management method and system
CN118013493A
Social network with network-based rewards
US20240046318A1
