Data integrity protection method in archival record tracing process based on blockchain
By generating a unique hash value for archive records on the blockchain and generating integrity check codes, combining encrypted indexes and smart contract permission management, data integrity and reliability problems in traditional archive management systems are solved, and the efficient and secure traceability process of data is achieved.
Patent Information
- Application Number
- CN202510131774.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-06
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2045-02-06
AI Technical Summary
Traditional archive management systems have a single point of failure risk, and data is easily tampered with and difficult to trace, which cannot effectively guarantee the integrity and reliability of data.
The blockchain-based data integrity protection method is adopted to ensure the integrity of the data during storage and transmission by generating a unique hash value for each archive record and generating integrity check codes during the traversal of the blockchain node. At the same time, fine permission management and data access control are achieved through encrypted indexes and smart contracts.
Effectively detect and prevent changes in archive records, enhance the reliability and security of data, and ensure the integrity and verifiability of data in the traceability process.
Smart Images

Figure CN119557927B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data privacy, and more particularly to a method for protecting data integrity in a blockchain-based archival record tracing process. Background Art
[0002] In today's digital age, archive management faces many challenges. Traditional archive management systems rely on centralized servers to store data, which poses a single point of failure risk. Once the server is attacked or fails, archive data may be lost or damaged, seriously affecting data integrity. At the same time, under the centralized management model, data is easy to be tampered with and difficult to trace. In areas involving important archives such as medical, financial, and government affairs, the authenticity and reliability of data cannot be effectively guaranteed.
[0003] Blockchain technology brings new opportunities for archive management. Blockchain has the characteristics of decentralization, immutability, and traceability. Its distributed ledger storage mode can effectively avoid single point failures and ensure the continuous availability of archive data. Using the hash algorithm and timestamp technology of blockchain, archive records can be accurately marked and sorted, and any data changes can be quickly detected to ensure data integrity.
[0004] The data integrity protection method in the archival record tracing process based on blockchain combines multi-factor precise setting and dynamic adjustment to balance data utilization and security. In terms of access control, more refined permission management is achieved to prevent unauthorized access. In addition, in the face of complex traceability requirements, the traceability process is optimized to improve efficiency and accuracy. The present invention can not only improve the security and reliability of archive management, but also significantly enhance the integrity and verifiability of archive data in the traceability process. Summary of the invention
[0005] The purpose of the present invention is to provide a method for protecting data integrity in the process of archival record tracing based on blockchain.
[0006] To achieve the above object, the present invention is implemented according to the following technical solutions:
[0007] The first aspect of the present invention provides a method for protecting data integrity in a blockchain-based archival record tracing process, comprising:
[0008] S100 generates a unique hash value for each archive record and uses it as the starting point for tracing;
[0009] S200 traverses from the tracing starting point and generates an integrity check code each time a node of the blockchain is passed;
[0010] S300 compares the current time with the file confidentiality period. If the period is met, the user is allowed to access and the integrity check code is returned. If the period is not met, the user is denied access, and the file confidentiality period is updated and re-uploaded to the chain to obtain the access control result.
[0011] S400 creates an encrypted index for the archive record in the access control result that the user is allowed to access;
[0012] S500 selectively discloses data through the encrypted index for the purpose of tracing the source, and obtains identification data;
[0013] S600 decomposes the traceability request into multiple sub-requests and distributes them to different blockchain nodes for traceability processing based on the identification data, and obtains the final traceability result by aggregating different sub-query results.
[0014] As a further method, the method of generating a unique hash value for each archive record and using it as a tracing starting point includes:
[0015] Standardize archival records, remove irrelevant format information and convert them into a unified coding format;
[0016] Divide the processed archive record data into data blocks according to the 512-bit unit size;
[0017] Perform 64 rounds of iterative calculations on each data block to obtain a hash value of fixed length, where the expression for each round of calculation process is:
[0018] ,
[0019] ,
[0020] ,
[0021] Among them, X and Y are the mixed feature screening value and the multi-step logic mixed value respectively. is the i-th data block, and They represent bitwise XOR and bitwise AND operations respectively. ROL, ROT, and MOD represent circular left shift, circular right shift, and modulo operations respectively. The hash value calculated for the previous iteration, The hash value calculated for the current round of iterations;
[0022] The generated hash value is stored on the blockchain and marked as the traceable starting point of the archival record.
[0023] As a further method, the method of traversing from the tracing starting point and generating an integrity check code each time passing through a node of the blockchain includes:
[0024] Receive the unique hash value of each archive record as the tracing starting point, traverse each node in the blockchain network, and for each node, calculate the hash value of all archive records contained in the node;
[0025] Combine the calculated hash value with the existing hash value in the node, and perform a hash calculation on the combined hash value again using the node's encryption algorithm to generate the node's integrity check code;
[0026] The newly generated integrity check code is stored in the current node and used as input data for the next node traversal until all nodes are traversed and the integrity check code generation of the entire blockchain network is completed;
[0027] The integrity check code generated by each node is recorded on the blockchain together with the node information.
[0028] As a further method, the method of comparing the current time with the archive confidentiality period, allowing the user to access and returning the integrity check code if the period is met, includes:
[0029] Based on the importance of the archive, a confidentiality period is set for each archive record. The expression is:
[0030] ,
[0031] in, For confidentiality period, The creation time of the archive record. is the basic confidentiality period, k is the importance coefficient of the archive record, L is the category coefficient of the file, L=1 represents ordinary archives, L=2 represents sensitive archives, L=3 represents confidential archives, b is the blockchain activity, is the average access frequency of archive records during the observation period, is the access frequency threshold, a is the access frequency influence coefficient;
[0032] When access to an archive record is requested, the system obtains the current timestamp, compares the current timestamp with the confidentiality period of the archive record, and determines whether the confidentiality period has expired;
[0033] If the current time is within the archive confidentiality period, the system allows the user to access the archive records and returns the corresponding integrity verification code to the user. The user uses the integrity verification code to verify the integrity of the archive records.
[0034] As a further method, if the file confidentiality period is not met, the user access is denied, and the file confidentiality period is updated and then re-uploaded to the chain, including:
[0035] Calculate the association complexity of archive records, expression:
[0036] ,
[0037] in, To calculate the number of feature dimensions for correlation, is the weight of the tth feature dimension in the calculation of relevance, n is the total number of archive records, and are the i-th and j-th archive records respectively, and File records and archival records The eigenvalue in the tth feature dimension;
[0038] The update coefficient is determined based on the file association complexity, and the expression is:
[0039] ,
[0040] in, and are the highest and lowest complexity values observed in all archival record associations, respectively. To control the adjustment coefficient of the update coefficient to the change of the complexity of the association of archival records;
[0041] Multiply the current confidentiality period by the update coefficient, adjust the confidentiality period, and update the confidentiality period information of the archive record on the blockchain to ensure that all nodes can access the latest confidentiality period information.
[0042] As a further method, the method of creating an encrypted index for the archive records that the user is allowed to access in the access control result includes:
[0043] Based on the access control result, a unique access token is generated for each archive record that is allowed to be accessed, and the token contains an encrypted representation of the user's access rights;
[0044] Combine the access token with the hash value of the archive record to generate an index key, and use the public key infrastructure in the blockchain network to generate a corresponding encrypted index for each index key;
[0045] The encrypted index is stored in the distributed ledger of the blockchain, and a smart contract containing the encrypted index, a list of authorized users, and preset access rights rules is created for each archive record;
[0046] Deploy smart contracts to the blockchain network, and only users who meet the preset access permission rules can access the corresponding archive records through the smart contract.
[0047] As a further method, the method of selectively disclosing data through the encrypted index for the purpose of tracing the source to obtain identification data includes:
[0048] Extract the encrypted index corresponding to the target archive record from the blockchain distributed ledger, analyze the archive record hash value and access token permission information in the index key corresponding to the encrypted index, and filter out the encrypted index set that the requester has permission to access;
[0049] Use the selected encrypted index to locate the storage location of the archive record in the blockchain network, and use the private key resources in the public key infrastructure to perform decryption operations;
[0050] Obtain a set of elements for the purpose of traceability, including the traceable archive type, time interval and event keywords, and extract the data that meets the element set from the decrypted archive records as identification data.
[0051] As a further method, the method of decomposing the traceability request into a plurality of sub-requests and distributing them to different blockchain nodes for traceability processing based on the identification data includes:
[0052] The traceability request is decomposed into sub-requests through distributed point functions, and the expression is:
[0053] ,
[0054] ,
[0055] in, Indicates that Mapping to Node , is the i-th request element in the traceability request, is the jth blockchain node, is the number of iterations, is the weight coefficient for adjusting the complexity of the mapping at the kth iteration, For A hash function that performs k iterations, where N is the set of blockchain nodes, for Corresponds to The encrypted subrequest, Indicates the use The public key performs asymmetric encryption operations. To use the key seed and Generate pseudo-random values;
[0056] After distributing the encrypted sub-request to the blockchain nodes, each node uses the corresponding private key to decrypt it, obtains the corresponding identification data, and retrieves the archive record based on the identification data.
[0057] In a second aspect, an embodiment of the present application further provides an electronic device, comprising: a processor; and a memory arranged to store computer executable instructions, wherein when the executable instructions are executed, the processor executes the method steps described in the first aspect.
[0058] In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by an electronic device including multiple applications, the electronic device executes the method steps described in the first aspect.
[0059] Compared with the prior art, the embodiments of the present invention have at least the following advantages or beneficial effects:
[0060] (1) The present invention can effectively detect any changes in the storage and transmission of archive records by generating a unique hash value for each archive record and traversing the blockchain nodes to generate integrity check codes. Moreover, through a multi-node verification mechanism, even if some nodes encounter failures or attacks, data integrity can still be ensured through other nodes, thereby enhancing the reliability and security of archive record data.
[0061] (2) The present invention generates index keys and encrypted indexes through encrypted representation of user rights, and defines access rules through smart contracts, which effectively ensures that archive data is accessed only by legally authorized users, helps to accurately manage access rights, and helps to protect data integrity;
[0062] (3) The present invention selectively discloses data based on the purpose of traceability, which can maximize the protection of other sensitive data in archival records while meeting traceability requirements. It also avoids unnecessary data exposure through encrypted indexing and permission verification, which helps to protect data integrity. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] Figure 1 This is a flowchart of the steps of a method for protecting data integrity in a blockchain-based archival record tracing process in an embodiment of the present invention;
[0064] Figure 2 It is a schematic diagram of the structure of an electronic device in an embodiment of this specification. DETAILED DESCRIPTION
[0065] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0066] Reference Figure 1 As shown, the present invention provides a data integrity protection method in the archival record tracing process based on blockchain, including:
[0067] S100 generates a unique hash value for each archive record and uses it as the starting point for tracing;
[0068] What needs to be explained is that by taking the hash value as the starting point for tracing, all subsequent operation records, circulation paths, data changes and other information about the archive can be connected and sorted out based on this starting point, thus forming a complete and clear archive tracing chain. Whether tracing starts from the source of archive creation or intervening in reverse tracing at a certain link in the middle, there is a clear starting reference;
[0069] For a specific implementation case, a large pharmaceutical company has a large number of drug R&D files, production process files, clinical trial files, and sales and regulatory compliance files. These files record every link of drug R&D, experimental data, production process, sales of drugs in the market, and interaction information with regulatory authorities.
[0070] In the actual evaluation, taking a drug research and development file as an example, the file contains a large amount of text data, experimental image data, chemical molecular formula data and other formats. It is standardized, font format, image resolution irrelevant format information is removed, and it is uniformly converted into UTF-8 encoding format. The unique hash value of the file is "h1x2y3z4..." and is stored on the blockchain as the starting point for tracing.
[0071] S200 traverses from the tracing starting point and generates an integrity check code each time a node of the blockchain is passed;
[0072] It needs to be explained that the generation and transmission of integrity check codes can establish a trust chain based on data verification between various nodes. Each node calculates the check code based on the received archive record hash value information and passes it to the next node. The next node can check the accuracy of the data again based on this check code. By analogy, the relationship between various nodes is not just a simple data storage and forwarding relationship, but also a verification mechanism through the check code, thereby ensuring the credibility of the entire blockchain network when storing and transmitting archive records, and strengthening the stability and security of the entire network;
[0073] In the actual evaluation, the enterprise's internal blockchain network has a total of 20 nodes. The traversal starts from the hash value of the above-mentioned archive. At each node, the hash values of all stored archive records are calculated, where each node stores an average of 500 archive records. At the first node, after the archive hash value is calculated, these hash values are combined with the existing basic hash values in the node (node identification hash, a total of 10), and then the node's SHA-256 encryption algorithm is used to perform hash calculations again to generate the node's integrity check code "c1a2b3d4...", which is stored in the current node and used as one of the input data for the next node traversal to complete the generation of the integrity check code for the entire blockchain network, and the integrity check code of each node is recorded on the blockchain together with the node information.
[0074] S300 compares the current time with the file confidentiality period. If the period is met, the user is allowed to access and the integrity check code is returned. If the period is not met, the user is denied access, and the file confidentiality period is updated and re-uploaded to the chain to obtain the access control result.
[0075] It should be explained that by comparing the current time with the confidentiality period of the archive, it is ensured that users can access the relevant archive records only when the archive reaches the prescribed confidentiality period, which helps to protect sensitive data from being accessed without authorization, thereby maintaining the confidentiality of the data; if the archive confidentiality period is not met, the system denies user access, and re-uploads the archive confidentiality period after updating it. This process ensures that the integrity of the archive records is not destroyed, preventing unauthorized access and potential data leakage;
[0076] In the actual evaluation, for a new clinical trial file, its creation time is March 15, 2023, and the basic confidentiality period is set to 5 years (1825 days). Because the file involves key clinical trial data of drugs that have not yet been launched, it is determined to be a confidential file, and the confidentiality period is set to 1624 days. When the file is requested to be accessed on May 1, 2024, the system obtains the current timestamp and compares it with the confidentiality period. It is found that it has not exceeded the period. The system allows the user to access the file record and returns the corresponding integrity check code. For an expired early drug R&D idea file created in 2018, when it is requested to be accessed on June 1, 2024, it is denied access due to exceeding the confidentiality period. The association complexity is calculated. The file is associated with 30 other files. The number of feature dimensions for calculating the association is 5 (R&D team, drug categories involved, experimental technology, funding sources, and related projects). According to the update coefficient expression, the update coefficient is calculated to be 0.24. Multiply the original period by the update coefficient, and the adjusted confidentiality period is 912.5 days, and the confidentiality period information of the file record on the blockchain is updated.
[0077] S400 creates an encrypted index for the archive record in the access control result that the user is allowed to access;
[0078] It should be explained that the creation of encrypted indexes can protect the security and privacy of archival data while allowing users to access archival records. This step ensures that only authenticated and authorized users can retrieve and access specific archival information. Through encrypted indexes, even if the data is intercepted during transmission, unauthorized third parties cannot read or understand the data content. This method improves data security while maintaining the integrity and confidentiality of archival records.
[0079] In the actual assessment, for the pharmaceutical production process archives that are allowed to be accessed, a unique access token is generated for it. The token contains the work number range of the production department employees, the encrypted representation of the user's access rights for the specific position authority code, and the access token is combined with the hash value of the archive record to generate an index key. The public key infrastructure in the enterprise's internal blockchain network is used to generate a corresponding encrypted index for the index key, and the encrypted index is stored in the distributed ledger of the blockchain. A smart contract is created that includes the encrypted index, a list of authorized users (production workshop supervisors, quality inspectors), and preset access rights rules (production workshop supervisors can view all production process steps, and quality inspectors can only view process links related to quality inspection).
[0080] S500 selectively discloses data through the encrypted index for the purpose of tracing the source, and obtains identification data;
[0081] In the actual assessment, the regulatory department's traceability purpose element set includes the traceable file type (production process files, raw material procurement files), time period (the production cycle of this batch of drugs, i.e. October 1, 2023 - December 31, 2023) and event keywords (drug quality issues, specific raw material suppliers). The data that meets the element set is extracted from the decrypted file records, and the encrypted indexes of various files related to the drug are extracted from the blockchain distributed ledger, including the encrypted indexes of the drug research and development process files, production batch files, and distribution channel files. Using the encrypted index of the production batch file, the production equipment number "EQ-003" of this batch of drugs and the key excipient batch "MAT-20230401-XYZ" used are extracted from the decrypted production batch file as identification data.
[0082] S600 decomposes the traceability request into multiple sub-requests and distributes them to different blockchain nodes for traceability processing based on the identification data, and obtains the final traceability result by aggregating different sub-query results.
[0083] In the actual evaluation, the traceability request is decomposed into sub-requests through distributed point functions. There are three request elements in the traceability request (production process, raw material procurement, quality inspection data), and the number of iterations is set to 2. The request is decomposed and encrypted according to the distributed point function expression and distributed to different nodes. Each node uses the corresponding private key to decrypt and obtain the corresponding identification data. The archive records are retrieved according to the identification data and the results are returned. Finally, the sub-query results of different nodes are aggregated to obtain the final traceability result of the quality problem of this batch of drugs, which determines that the quality problem is caused by improper temperature control of the raw materials provided by a certain supplier in a specific production process.
[0084] In this embodiment, the method of generating a unique hash value for each archive record and using it as the starting point for tracing includes:
[0085] Standardize archival records, remove irrelevant format information and convert them into a unified coding format;
[0086] Divide the processed archive record data into data blocks according to the 512-bit unit size;
[0087] Perform 64 rounds of iterative calculations on each data block to obtain a hash value of fixed length, where the expression for each round of calculation process is:
[0088] ,
[0089] ,
[0090] ,
[0091] Among them, X and Y are the mixed feature screening value and the multi-step logic mixed value respectively. is the i-th data block, and They represent bitwise XOR and bitwise AND operations respectively. ROL, ROT, and MOD represent circular left shift, circular right shift, and modulo operations respectively. The hash value calculated for the previous iteration, The hash value calculated for the current round of iterations;
[0092] The generated hash value is stored on the blockchain and marked as the traceable starting point of the archival record.
[0093] In this embodiment, the method of traversing from the tracing starting point and generating an integrity check code each time a node of the blockchain is passed includes:
[0094] Receive the unique hash value of each archive record as the tracing starting point, traverse each node in the blockchain network, and for each node, calculate the hash value of all archive records contained in the node;
[0095] Combine the calculated hash value with the existing hash value in the node, and perform a hash calculation on the combined hash value again using the node's encryption algorithm to generate the node's integrity check code;
[0096] The newly generated integrity check code is stored in the current node and used as input data for the next node traversal until all nodes are traversed and the integrity check code generation of the entire blockchain network is completed;
[0097] The integrity check code generated by each node is recorded on the blockchain together with the node information.
[0098] In this embodiment, the method of comparing the current time with the archive confidentiality period, allowing the user to access and returning the integrity check code if the period is met, includes:
[0099] Based on the importance of the archive, a confidentiality period is set for each archive record. The expression is:
[0100] ,
[0101] in, For confidentiality period, The creation time of the archive record. is the basic confidentiality period, k is the importance coefficient of the archive record, L is the category coefficient of the file, L=1 represents ordinary archives, L=2 represents sensitive archives, L=3 represents confidential archives, b is the blockchain activity, is the average access frequency of archive records during the observation period, is the access frequency threshold, a is the access frequency influence coefficient;
[0102] When access to an archive record is requested, the system obtains the current timestamp, compares the current timestamp with the confidentiality period of the archive record, and determines whether the confidentiality period has expired;
[0103] If the current time is within the archive confidentiality period, the system allows the user to access the archive records and returns the corresponding integrity verification code to the user. The user uses the integrity verification code to verify the integrity of the archive records.
[0104] In this embodiment, if the file confidentiality period is not met, the method of denying user access and updating the file confidentiality period and then re-uploading the file to the chain includes:
[0105] Calculate the association complexity of archive records, expression:
[0106] ,
[0107] in, To calculate the number of feature dimensions for correlation, is the weight of the tth feature dimension in the calculation of relevance, n is the total number of archive records, and are the i-th and j-th archive records respectively, and File records and archival records The eigenvalue in the tth feature dimension;
[0108] The update coefficient is determined based on the file association complexity, and the expression is:
[0109] ,
[0110] in, and are the highest and lowest complexity values observed in all archival record associations, respectively. To control the adjustment coefficient of the update coefficient to the change of the complexity of the association of archival records;
[0111] Multiply the current confidentiality period by the update coefficient, adjust the confidentiality period, and update the confidentiality period information of the archive record on the blockchain to ensure that all nodes can access the latest confidentiality period information.
[0112] In this embodiment, the method for creating an encrypted index for the archive record that the user is allowed to access in the access control result includes:
[0113] Based on the access control result, a unique access token is generated for each archive record that is allowed to be accessed, and the token contains an encrypted representation of the user's access rights;
[0114] Combine the access token with the hash value of the archive record to generate an index key, and use the public key infrastructure in the blockchain network to generate a corresponding encrypted index for each index key;
[0115] The encrypted index is stored in the distributed ledger of the blockchain, and a smart contract containing the encrypted index, a list of authorized users, and preset access rights rules is created for each archive record;
[0116] Deploy smart contracts to the blockchain network, and only users who meet the preset access permission rules can access the corresponding archive records through the smart contract.
[0117] In this embodiment, the method for selectively disclosing data through the encrypted index for the purpose of tracing the source to obtain identification data includes:
[0118] Extract the encrypted index corresponding to the target archive record from the blockchain distributed ledger, analyze the archive record hash value and access token permission information in the index key corresponding to the encrypted index, and filter out the encrypted index set that the requester has permission to access;
[0119] Use the selected encrypted index to locate the storage location of the archive record in the blockchain network, and use the private key resources in the public key infrastructure to perform decryption operations;
[0120] Obtain a set of elements for the purpose of traceability, including the traceable archive type, time interval and event keywords, and extract the data that meets the element set from the decrypted archive records as identification data.
[0121] In this embodiment, the method of decomposing the traceability request into several sub-requests and distributing them to different blockchain nodes for traceability processing based on the identification data includes:
[0122] The traceability request is decomposed into sub-requests through distributed point functions, and the expression is:
[0123] ,
[0124] ,
[0125] in, Indicates that Mapping to Node , is the i-th request element in the traceability request, is the jth blockchain node, is the number of iterations, is the weight coefficient for adjusting the complexity of the mapping at the kth iteration, For A hash function that performs k iterations, where N is the set of blockchain nodes, for Corresponds to The encrypted subrequest, Indicates the use The public key performs asymmetric encryption operations. To use the key seed and Generate pseudo-random values;
[0126] After distributing the encrypted sub-request to the blockchain nodes, each node uses the corresponding private key to decrypt it, obtains the corresponding identification data, and retrieves the archive record based on the identification data.
[0127] Figure 2 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application. Figure 2 At the hardware level, the electronic device includes a processor, and optionally also includes an internal bus, a network interface, and a memory. The memory may include a memory, such as a high-speed random access memory (RAM), and may also include a non-volatile memory (non-volatile memory), such as at least one disk storage. Of course, the electronic device may also include hardware required for other services.
[0128] The processor, network interface and memory can be interconnected through an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc.
[0129] The memory is used to store the program. Specifically, the program may include a program code, and the program code includes a computer operation instruction. The memory may include a memory and a non-volatile memory, and provides instructions and data to the processor.
[0130] The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a data integrity protection method in the blockchain-based archival record tracing process at the logical level. The processor executes the program stored in the memory and is specifically used to execute any of the aforementioned data integrity protection methods in the blockchain-based archival record tracing process.
[0131] The present invention can be applied to a processor or implemented by a processor. The processor may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware in the processor or an instruction in the form of software. The above processor can be a general-purpose processor, including a central processing unit, a network processor (Network Processor, NP), etc.; it can also be a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiments of the present application can be directly embodied as a hardware decoding processor to be executed, or the hardware and software modules in the decoding processor can be executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0132] An embodiment of the present application also proposes a computer-readable storage medium, which stores one or more programs, and the one or more programs include instructions. When the instructions are executed by an electronic device including multiple applications, they execute the data integrity protection method in any of the aforementioned blockchain-based archival record tracing processes.
[0133] The above contents are merely examples and explanations of the structure of the present invention. The technicians in this technical field may make various modifications or additions to the specific embodiments described or replace them in a similar manner. As long as they do not deviate from the structure of the invention or exceed the scope defined by the claims, they should all fall within the protection scope of the present invention.
Claims
1. A method for protecting data integrity in the archival record tracing process based on blockchain, characterized in that: The following steps are involved: Generate a unique hash value for each archival record and use it as a tracing starting point; Traverse from the tracing starting point, and generate an integrity check code each time the blockchain node is passed; Compare the current time with the file confidentiality period. If the period is met, the user is allowed to access and the integrity check code is returned. If the file confidentiality period is not met, the user is denied access, and the file confidentiality period is updated and re-uploaded to the chain to obtain the access control result. Creating an encrypted index for the archive records that the user is allowed to access in the access control result; For the purpose of tracing the source, data is selectively disclosed through the encrypted index to obtain identification data; Decompose the traceability request into multiple sub-requests and distribute them to different blockchain nodes for traceability processing based on the identification data, and obtain the final traceability result by aggregating different sub-query results; The method for selectively disclosing data through the encrypted index for the purpose of tracing the source to obtain identification data includes: Extract the encrypted index corresponding to the target archive record from the blockchain distributed ledger, analyze the archive record hash value and access token permission information in the index key corresponding to the encrypted index, and filter out the encrypted index set that the requester has permission to access; Use the selected encryption index to locate the storage location of the archive record in the blockchain network, and use the private key resources in the public key infrastructure to perform decryption operations; Obtain a set of elements for the purpose of traceability, including the traceable archive type, time interval and event keywords, and extract the data that meets the element set from the decrypted archive records as identification data.
2. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method of generating a unique hash value for each archive record and using it as a tracing starting point includes: Standardize archival records, remove irrelevant format information and convert them into a unified coding format; Divide the processed archive record data into data blocks according to the 512-bit unit size; Perform 64 rounds of iterative calculations on each data block to obtain a hash value of fixed length, where the expression for each round of calculation process is: , , , Among them, X and Y are the mixed feature screening value and the multi-step logic mixed value respectively. is the i-th data block, and They represent bitwise XOR and bitwise AND operations respectively. ROL, ROT, and MOD represent circular left shift, circular right shift, and modulo operations respectively. The hash value calculated for the previous iteration, The hash value calculated for the current round of iterations; The generated hash value is stored on the blockchain and marked as the traceable starting point of the archival record.
3. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method of traversing from the tracing starting point and generating an integrity check code each time a node of the blockchain is passed through includes: Receive the unique hash value of each archive record as the tracing starting point, traverse each node in the blockchain network, and for each node, calculate the hash value of all archive records contained in the node; Combine the calculated hash value with the existing hash value in the node, and perform a hash calculation on the combined hash value again using the node's encryption algorithm to generate the node's integrity check code; The newly generated integrity check code is stored in the current node and used as input data for the next node traversal until all nodes are traversed and the integrity check code generation of the entire blockchain network is completed; The integrity check code generated by each node is recorded on the blockchain together with the node information.
4. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method of comparing the current time with the file confidentiality period and allowing the user to access and return the integrity check code if the period is met includes: Based on the importance of the archive, a confidentiality period is set for each archive record. The expression is: , in, For confidentiality period, The creation time of the archive record. is the basic confidentiality period, k is the importance coefficient of the archive record, L is the category coefficient of the file, L=1 represents ordinary archives, L=2 represents sensitive archives, L=3 represents confidential archives, b is the blockchain activity, is the average access frequency of archive records during the observation period, is the access frequency threshold, a is the access frequency influence coefficient; When access to an archive record is requested, the system obtains the current timestamp, compares the current timestamp with the confidentiality period of the archive record, and determines whether the confidentiality period has expired; If the current time is within the archive confidentiality period, the system allows the user to access the archive records and returns the corresponding integrity verification code to the user. The user uses the integrity verification code to verify the integrity of the archive records.
5. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method of denying user access if the file confidentiality period is not met, and updating the file confidentiality period and then re-uploading the file to the chain includes: Calculate the association complexity of archive records, expression: , in, To calculate the number of feature dimensions for correlation, is the weight of the tth feature dimension in the calculation of relevance, n is the total number of archive records, and are the i-th and j-th archive records respectively, and File records and archival records The eigenvalue in the tth feature dimension; The update coefficient is determined based on the file association complexity, and the expression is: , in, and are the highest and lowest complexity values observed in all archival record associations, respectively. To control the adjustment coefficient of the update coefficient to the change of the complexity of the association of archival records; Multiply the current confidentiality period by the update coefficient, adjust the confidentiality period, and update the confidentiality period information of the archive record on the blockchain to ensure that all nodes can access the latest confidentiality period information.
6. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method for creating an encrypted index for the archive record that the user is allowed to access in the access control result comprises: Based on the access control result, a unique access token is generated for each archive record that is allowed to be accessed, and the token contains an encrypted representation of the user's access rights; Combine the access token with the hash value of the archive record to generate an index key, and use the public key infrastructure in the blockchain network to generate a corresponding encrypted index for each index key; The encrypted index is stored in the distributed ledger of the blockchain, and a smart contract containing the encrypted index, a list of authorized users, and preset access rights rules is created for each archive record; Deploy smart contracts to the blockchain network, and only users who meet the preset access permission rules can access the corresponding archive records through the smart contract.
7. The data integrity protection method in the archival record tracing process based on blockchain according to claim 1 is characterized in that: The method of decomposing the traceability request into a plurality of sub-requests and distributing them to different blockchain nodes for traceability processing based on the identification data includes: The traceability request is decomposed into sub-requests through distributed point functions, and the expression is: , , in, Indicates that Mapping to Node , is the i-th request element in the traceability request, is the jth blockchain node, is the number of iterations, is the weight coefficient for adjusting the complexity of the mapping at the kth iteration, For A hash function that performs k iterations, where N is the set of blockchain nodes, for Corresponds to The encrypted subrequest, Indicates the use The public key performs asymmetric encryption operations. To use the key seed and Generate pseudo-random values; After distributing the encrypted sub-request to the blockchain nodes, each node uses the corresponding private key to decrypt it, obtains the corresponding identification data, and retrieves the archive record based on the identification data.
8. An electronic device, comprising: processor; as well as A memory arranged to store computer executable instructions, which when executed cause the processor to perform the method according to any one of claims 1 to 7.
9. A computer-readable storage medium storing one or more programs, which, when executed by an electronic device including a plurality of application programs, enables the electronic device to execute the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
College student information management system based on block chain
CN116684057A
Archive data protection method based on block chain
CN118228312A