A test data storage system and method based on blockchain
Through the blockchain-based test data storage system, the problems of low security and low credibility of test data storage in traditional systems are solved, reliable storage and rapid retrieval of data are achieved, and the authenticity and authority of the data are ensured. , reducing storage costs.
Patent Information
- Application Number
- CN202210783235.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-05
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2042-07-05
AI Technical Summary
The storage of traditional system test data has problems such as low security, low credibility, high storage cost, and low data sharing efficiency. In particular, the viewing and acquisition permissions of the original data are limited, the storage is unreliable, and the data is easily tampered with.
A test data evidence storage system based on the blockchain is adopted, including a test data aggregation storage module, a confirmation module, an evidence chain module and a verification module. The data is transmitted through the RocketMQ message bus, encrypted using the SM3 national secret algorithm and stored in the blockchain. Parallel storage with the search server to achieve reliable storage and authenticity verification of data.
It improves the traceability and security of the whole life cycle of test data, reduces storage costs, realizes reliable storage and rapid retrieval of data, ensures the authenticity and authority of data, and solves the convenience of data sharing and permission management. question.
Smart Images

Figure CN115242401B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of data processing technology, and in particular to a test data storage system and method based on blockchain. Background Art
[0002] System testing treats the hardware, software, and operators as a whole, and verifies whether the system's manufacturing quality, functions, and performance do not meet the design requirements under real or simulated conditions. System testing involves system manufacturers, system testing and appraisal units, system users, etc. Test data is mainly electronic data such as tabular data, video data, and document data, which has the characteristics of high value, large data volume, and easy tampering. The secure storage and credible evidence of test data are directly related to the reliability and authority of the testing and appraisal unit.
[0003] Traditional data storage is mainly carried out by the test and appraisal unit to store test data in a centralized manner, and the security and authority of the data are guaranteed through backup and strict management systems. This will result in high storage costs, and the authenticity and legality of the data are also easily questioned by other test participants. There are several problems in data storage and sharing: (1) There is no right to view the original data of the system test. Although the system under test is developed by the research and development unit and the test process is supervised by the regulatory unit, the research and development unit can only obtain the final test report, and has the right to view and obtain the original data only after approval. The regulatory unit can generally only obtain the original data after the test is completed. (2) Test data storage is unreliable and has low credibility. Since test data is mainly implemented in a centralized storage method, once the data is maliciously attacked or tampered by external or internal personnel, the credibility of the test evidence will decrease. (3) Data sharing is not convenient. Data sharing requires approval at all levels and is implemented through methods such as burning disks and USB flash drives. There are problems such as low efficiency and uncontrollable data sharing. (4) Storage costs are high. In order to ensure data security, traditional storage often requires multiple backups, which will lead to problems of excessively high storage costs and labor costs. Summary of the invention
[0004] In order to solve the above technical problems, the present invention proposes a test data notarization solution based on blockchain (including a test data notarization system based on blockchain, a test data notarization method based on blockchain, an electronic device, and a computer-readable storage medium).
[0005] The first aspect of the present invention discloses a test data evidence storage system based on blockchain. The test data includes structured data and unstructured data; the evidence storage system includes a test data aggregation storage module, a test data right confirmation module, a test evidence chain module, and a test data verification module; wherein:
[0006] The test data aggregation and storage module is configured to: aggregate and store various types of test data within the entire test life cycle;
[0007] The test data right confirmation module is configured to: extract ownership information and fingerprint information from the stored test data, and combine the ownership information and the fingerprint information to form evidence data of the test data;
[0008] The test evidence chain module is configured to: store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server;
[0009] The test data verification module is configured to: extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
[0010] According to the system of the first aspect of the present invention, the test data is transmitted to the test data aggregation storage module via the RocketMQ message bus in a subscription manner, and the test data aggregation storage module stores the structured data in a Mysql database and stores the unstructured data in the HDFS file system.
[0011] According to the system of the first aspect of the present invention, the ownership information includes the ownership, management rights and usage rights of the test data; the fingerprint information of the structured data is the structured data itself; the fingerprint information of the unstructured data includes file size, creation time, modification time, data hash and storage path.
[0012] According to the system of the first aspect of the present invention, the encryption of the evidence data includes: taking each piece of data in the evidence data as a transaction record, calculating the hash value of each transaction record using the SM3 national encryption algorithm, pairing the hash values of every two transaction records to calculate the hash value of the previous layer, and if there are an odd number of hash values of the transaction records, the hash values of the remaining single transaction records directly enter the pairwise calculation process of the hash value of the previous layer, until a hash value of the top layer is obtained as the root hash, and traversing each layer of hash from the root hash downward to obtain a complete hash tree.
[0013] According to the system of the first aspect of the present invention, the storage of the evidence data on the blockchain includes storing the evidence data and the hash tree on the chain in JSON format and broadcasting them to each node on the blockchain; the parallel storage of the evidence data in the search server includes storing the evidence data in the search server using online data mirroring OLDM technology, and the search server is an ES index database.
[0014] According to the system of the first aspect of the present invention, verifying the authenticity of the test data based on the fingerprint information of the evidence data specifically includes:
[0015] The test data is obtained from the blockchain; wherein:
[0016] When the test data is the structured data, the fingerprint information of the test data itself is the test data;
[0017] When the test data is the unstructured data, extracting a storage path of the test data from the fingerprint information of the test data, and reading the test data based on the storage path;
[0018] The hash tree is calculated for the acquired test data, and the hash tree calculated based on the acquired test data is compared with the hash tree stored on the blockchain. When the comparison results are consistent, it indicates that the test data is true and has not been tampered with.
[0019] According to the system of the first aspect of the present invention, when the comparison results are inconsistent, traversal starts from the bottom layer of the hash tree to locate the position where the test data has been tampered with.
[0020] The second aspect of the present invention discloses a test data evidence storage method based on blockchain. The method implements the evidence storage of the test data through the test data evidence storage system based on blockchain described in the first aspect, the test data includes structured data and unstructured data, and the evidence storage system includes a test data aggregation storage module, a test data right confirmation module, a test evidence chain module, and a test data verification module; wherein:
[0021] Step S1, using the test data aggregation and storage module to aggregate and store various types of test data within the entire test life cycle;
[0022] Step S2: extracting ownership information and fingerprint information from the stored test data using the test data ownership confirmation module, and combining the ownership information and the fingerprint information to form evidence data of the test data;
[0023] Step S3: Using the test evidence chain module to store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server;
[0024] Step S4: Utilize the test data verification module to extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
[0025] According to the method of the second aspect of the present invention, the test data is transmitted to the test data aggregation storage module via the RocketMQ message bus in a subscription manner, and the test data aggregation storage module stores the structured data in a Mysql database and stores the unstructured data in the HDFS file system.
[0026] According to the method of the second aspect of the present invention, the ownership information includes the ownership, management rights and usage rights of the test data; the fingerprint information of the structured data is the structured data itself; the fingerprint information of the unstructured data includes file size, creation time, modification time, data hash and storage path.
[0027] According to the method of the second aspect of the present invention, the encryption of the evidence data includes: taking each piece of data in the evidence data as a transaction record, calculating the hash value of each transaction record using the SM3 national encryption algorithm, pairing the hash values of every two transaction records to calculate the hash value of the previous layer, and if there are an odd number of hash values of the transaction records, the hash values of the remaining single transaction records directly enter the pairwise calculation process of the hash value of the previous layer, until a hash value of the top layer is obtained as the root hash, and traversing each layer of hash from the root hash downward to obtain a complete hash tree.
[0028] According to the method of the second aspect of the present invention, the storage of the evidence data on the blockchain includes storing the evidence data and the hash tree on the chain in JSON format and broadcasting them to each node on the blockchain; the parallel storage of the evidence data in the search server includes storing the evidence data in the search server using online data mirroring OLDM technology, and the search server is an ES index database.
[0029] According to the method of the second aspect of the present invention, verifying the authenticity of the test data based on the fingerprint information of the evidence data specifically includes:
[0030] The test data is obtained from the blockchain; wherein:
[0031] When the test data is the structured data, the fingerprint information of the test data itself is the test data;
[0032] When the test data is the unstructured data, extracting a storage path of the test data from the fingerprint information of the test data, and reading the test data based on the storage path;
[0033] The hash tree is calculated for the acquired test data, and the hash tree calculated based on the acquired test data is compared with the hash tree stored on the blockchain. When the comparison results are consistent, it indicates that the test data is true and has not been tampered with.
[0034] According to the method of the second aspect of the present invention, when the comparison results are inconsistent, traversal is started from the bottom layer of the hash tree to locate the position where the test data has been tampered with.
[0035] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the test data storage method based on blockchain described in any one of the first aspects of the present disclosure are implemented.
[0036] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the test data storage method based on blockchain described in any one of the first aspects of the present disclosure are implemented.
[0037] In summary, the technical solution provided by the present invention solves the traceability of the entire life cycle of existing test data and improves the secure access and reliable evidence storage capabilities of test data. Furthermore, distributed files represented by HDFS can ensure the reliable storage of large amounts of data through data slicing backup strategies, and full-text search engines represented by ES can achieve rapid data retrieval through index routing. At the same time, blockchain technology is a decentralized or multi-centralized distributed ledger database technology with the characteristics of time series data, collective maintenance, programmability, and security and reliability, providing a feasible solution for the evidence storage of electronic data. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0039] Figure 1 A structural diagram of a test data notarization system based on blockchain according to an embodiment of the present invention;
[0040] Figure 2 A schematic diagram of calculating a root hash according to an embodiment of the present invention;
[0041] Figure 3 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0043] The first aspect of the present invention discloses a test data notarization system based on blockchain. The test data includes structured data and unstructured data. Figure 1 A structural diagram of a test data storage system based on blockchain according to an embodiment of the present invention; Figure 1 As shown, the evidence storage system includes a test data aggregation and storage module, a test data rights confirmation module, a test evidence chain module, and a test data verification module; wherein: the test data aggregation and storage module is configured to: aggregate and store various types of test data within the entire life cycle of the test; the test data rights confirmation module is configured to: extract ownership information and fingerprint information from the stored test data, and merge the ownership information and the fingerprint information to form evidence data of the test data; the test evidence chain module is configured to: store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server; the test data verification module is configured to: extract the evidence data from the search server through query, and after verifying the ownership information in the evidence data, verify the authenticity of the test data based on the fingerprint information of the evidence data.
[0044] In some embodiments, the test data is transmitted to the test data aggregation storage module via the RocketMQ message bus in a subscription manner, and the test data aggregation storage module stores the structured data in a Mysql database and stores the unstructured data in an HDFS file system.
[0045] Specifically, the test data aggregation and storage module mainly completes the aggregation and storage of various types of data in the entire test life cycle, such as input data, process data, and result data during the system test process, where the data format includes table-type structured data and unstructured data such as audio and video, documents, etc. Data aggregation adopts RocketMQ message bus transmission, and testers aggregate various types of original test data distributed geographically through subscription. The subscription process includes the selection of source data location and destination storage location. The unstructured data storage in the original test data adopts HDFS (Hadoop Distributed File System) file system, and the structured data storage adopts Mysql database.
[0046] In some embodiments, the ownership information includes ownership, management rights and usage rights of the test data; the fingerprint information of the structured data is the structured data itself; the fingerprint information of the unstructured data includes file size, creation time, modification time, data hash and storage path.
[0047] Specifically, the test data rights confirmation module mainly completes the determination of ownership information and fingerprint information such as ownership, management rights, and usage rights of the test original data. The ownership information and fingerprint information are combined to form evidence data of the test data. For unstructured data, the fingerprint information includes fingerprint information such as file size, creation time, modification time, hash, storage path, etc.; for structured data, the fingerprint information is the data itself.
[0048] In some embodiments, the encryption of the evidence data includes: treating each piece of data in the evidence data as a transaction record, calculating the hash value of each transaction record using the SM3 national encryption algorithm, pairing the hash values of every two transaction records to calculate the hash value of the previous layer; if there are an odd number of hash values of the transaction records, the hash values of the remaining single transaction records directly enter the pairwise calculation process of the hash value of the previous layer, until a hash value of the top layer is obtained as the root hash, and traversing each layer of hash from the root hash downward to obtain a complete hash tree.
[0049] Figure 2 A schematic diagram of calculating a root hash according to an embodiment of the present invention; Figure 2As shown in the figure, there are 5 transaction data in total. The corresponding hash values Hash1, Hash2, Hash3, Hash4, and Hash5 are calculated by calculation. Hash1 and Hash2 are calculated as a group to obtain Hash12, and Hash3 and Hash4 are calculated as a group to obtain Hash34, and enter the previous layer. The remaining Hash5 directly enters the previous layer. After reaching the previous layer, Hash12 and Hash34 are calculated as a group to obtain Hash1234, and the remaining Hash5 directly enters the next layer again and directly calculates the root hash Hash12345 with Hash1234.
[0050] In some embodiments, the storage of the evidence data on the blockchain includes storing the evidence data and the hash tree in JSON format on the chain and broadcasting them to each node on the blockchain; the parallel storage of the evidence data in the search server includes storing the evidence data in the search server using online data mirroring OLDM technology, and the search server is an ES index database.
[0051] Specifically, the test evidence chain module mainly completes the chain storage of evidence data, including encryption of evidence data, storage of evidence data on the blockchain, and parallel storage of block data in the blockchain in ES (ElasticSearch).
[0052] (1) In addition to the evidence data itself, the data stored on the chain also needs to store its MerkleHash value MH. The evidence data is stored on the chain in JSON format, and each piece of data is used as a transaction record. When constructing MerkleHash, first, the SM3 national encryption algorithm is used to calculate the hash value for each transaction record; then, the hash values are paired in pairs (if there is an odd number, the last one is paired separately), and the previous layer of hash is calculated. This step is repeated until the root hash value is calculated. The specific calculation process is as follows: Figure 2 shown.
[0053] (2) Trusted storage of test data is the core of the entire system, which is mainly achieved by building a "HDFS+blockchain+ES" hyper-converged trusted data evidence warehouse. The original test data is reliably stored through the distributed HDFS file system and MySQL database, and the evidence data is tamper-proof and trusted through the blockchain block storage. At the same time, in order to improve the data verification throughput, after the evidence data is stored in the blockchain block, it is stored in the ES index database using the online data mirroring (OLDM) technology.
[0054] (3) To ensure data security and privacy protection, the system supports encrypted data storage on the chain, and the supported algorithms include but are not limited to SM1, SM2 and other national encryption algorithms. Data access rights are set according to security policies. The system supports both automatic and manual data storage methods. In addition, the data storage process supports TLS / SSL encrypted transmission.
[0055] In some embodiments, verifying the authenticity of the test data based on the fingerprint information of the evidence data specifically includes:
[0056] The test data is obtained from the blockchain; wherein:
[0057] When the test data is the structured data, the fingerprint information of the test data itself is the test data;
[0058] When the test data is the unstructured data, extracting a storage path of the test data from the fingerprint information of the test data, and reading the test data based on the storage path;
[0059] The hash tree is calculated for the acquired test data, and the hash tree calculated based on the acquired test data is compared with the hash tree stored on the blockchain. When the comparison results are consistent, it indicates that the test data is true and has not been tampered with.
[0060] In some embodiments, when the comparison result is inconsistent, traversal is started from the bottom layer of the hash tree to locate the position where the test data has been tampered with.
[0061] Specifically, the test data verification module is used to verify and download the authenticity of various test data in the test data, focusing on answering whether the test event actually occurred, how it happened, whether there were any violations in the process, whether the records were complete or incomplete, and whether the data was tampered with. It is mainly applicable to the following work scenarios: 1) System performance evaluation endorsement: examine the reliability of the test environment, the validity of the test parameters, the standardization of the test process, and the authenticity and integrity of the test data; 2) Test violation and disciplinary accountability: There is a significant deviation between the test results and the set goals, and it is suspected that there are violations of regulations and disciplines in the test process. The data verification subsystem can be used to calibrate important test data links such as the environment, parameters, and results, and clarify the direct or indirect responsible persons for the data review and chain of each link, providing irrefutable evidence for the accountability of test accidents; 3) Identification of differences in installation and evaluation performance: There are differences between the actual application performance indicators of the system and the approved indicators, and it is necessary to re-examine whether the conclusion of the system identification is reasonable. The data verification subsystem can reproduce the holographic data content of the system test event and ensure the authenticity and objectivity of the holographic data information source.
[0062] In addition, in some embodiments, the evidence storage system also includes an operation and maintenance module for access management of new blockchain chains, chain array node management, tester user rights management, etc. Blockchain new chain access management mainly completes the registration and filing of newly added blockchain types, consensus mechanisms, number of organizations, etc.; chain array node management mainly completes configuration management of node certificate management, node organization members, account book information, etc.; user rights management mainly completes tester user registration, user rights allocation, user group management, and hierarchical and classified authorization management, etc.
[0063] First embodiment
[0064] (1) User B configures the IP, port, data location, etc. of the host where data V is located, as well as the storage destination path in the HDFS file system. The system calls the RocketMQ data bus to perform data aggregation and storage, and stores data V in HDFS.
[0065] (2) User B configures the owner, manager, and user of data V to be users A, B, and C respectively, and performs data ownership confirmation. The system automatically extracts fingerprint information such as file size, creation time, modification time, hash, storage path, etc. of data V, and combines the fingerprint information with ownership information to form evidence data Ev;
[0066] (3) User B performs the data upload operation. The system uses user B's private key to sign the evidence data and sends it to the rights confirmation users A, B, and C.
[0067] (4) Users A, B, and C call the smart contract to verify whether the on-chain transaction is legal. If the verification is successful, they sign it with their own private keys and package it and send it to user B on the chain;
[0068] (5) User B sends the three packaged data to the blockchain system, and the blockchain system uses the election mechanism to regard the transaction result that is consistent with the majority as the correct transaction;
[0069] (6) The system packages the transactions into blocks according to the block generation strategy and broadcasts them to the rights confirmation users A, B and C in the blockchain network. The block generation strategy includes the number of transactions, the time or the block size, etc. The packaging process adopts the Merkle tree generation algorithm;
[0070] (7) The generated blocks are distributed and stored in the blockchain system and simultaneously stored in the ES index database;
[0071] (8) Taking user D's authentication and downloading as an example, user D queries the ES database to obtain the data fingerprint and unique positioning path;
[0072] (9) User D initiates a download request for data V from the file path in HDFS. The system checks whether the user's permissions are met. If the user's permissions are met, the download is allowed; if the user's permissions are not met, the download is not allowed.
[0073] (10) The system generates evidence data for the downloaded data according to the ownership confirmation process and calculates the hash;
[0074] (11) The system compares the hash with the hash of the evidence stored on the blockchain. If they are consistent, it proves that the test screen recording video is authenticated correctly.
[0075] Second embodiment
[0076] Step 1: Test data aggregation and storage
[0077] The extraction layer is at the forefront of the entire data storage ETL, completing the data aggregation and storage. It is the data interface of the storage system. It is mainly responsible for connecting and aggregating various original test data, establishing corresponding data distribution channels according to data distribution rules, and realizing the initial aggregation, distribution and storage of test data. Specifically, the "data connection agent-distributed data pipeline-subscription data distribution" architecture model is adopted. The test data connection types cover all types of data sources such as file system data, structured data, and stream data. The distributed data pipeline is implemented using RocketMQ message bus technology. At the same time, the "2m-2s-sync" multi-Master multi-Slave synchronous dual-write mode deployment is adopted to realize back-end data distribution. The data consumers in the data loading service include the storage of various types of original test data and the blockchain on-chain storage of test evidence data. Among them, the structured data storage uses Mysql database, the unstructured data storage uses HDFS file system, and the data storage uses blockchain block storage.
[0078] Step 2: Test data rights confirmation
[0079] The conversion layer completes the test data ownership confirmation. It is mainly responsible for subscribing and pulling data from the front-end data aggregation and distribution bus, and completing the confirmation of ownership information and fingerprint information such as ownership, usage rights, and management rights of the original test data. The ownership information and fingerprint information are merged to form the evidence data of the test data. For unstructured data, the fingerprint information includes fingerprint information such as file size, creation time, modification time, hash, storage path, etc.; for structured data, the fingerprint information is the data itself.
[0080] Step 3: Test evidence on the chain
[0081] The loading layer and storage layer complete the on-chain storage of the test evidence. First, the national secret algorithms such as SM1 and SM2 are used to encrypt the evidence data after confirmation of ownership; then, the smart contract for evidence storage is called according to different evidence storage requirements to complete the on-chain evidence storage.
[0082] Trusted storage of test data is the core of the entire system, which is mainly achieved by building a "HDFS+blockchain+ES" hyper-converged trusted data evidence warehouse. The original test data is reliably stored through the distributed HDFS file system and MySQL database, and the evidence data is tamper-proof and trustworthy through the blockchain block storage. At the same time, in order to improve the data verification throughput, the evidence data is stored in the ES index database using the online data mirroring (OLDM) technology after being stored in the blockchain block.
[0083] Step 4: Test data verification
[0084] The service layer completes the test data verification, which is used to check the authenticity and download various test data. The focus is on answering whether the test event actually happened, how it happened, whether there were any violations in the process, whether the records were complete or incomplete, and whether the data was tampered with. The authenticity of the test data is verified by comparing the data hash stored on the blockchain with the hash of the original data. The download of the test data obtains the original test data through the index of the structured data and unstructured data stored in the ES database.
[0085] Step 5: System operation and maintenance
[0086] The operation and maintenance service system is used to manage the operation and maintenance of the system, including access management of new blockchain chains, chain array node management, and user authority management of testers.
[0087] (1) Blockchain new chain access management mainly includes the registration and filing of new chain access, the registration and filing of new chain access node information, and the backup management of new chain access node certificates. It includes the entry of basic information such as chain name, business scope, management unit, responsible leader, person in charge, contact information, etc., as well as the setting of chain administrator users and authorization of them.
[0088] (2) Chain array node management includes seven parts: node registration management, node network configuration management, node certificate management, node organization member management, node ledger information management, node deployment smart contract management, and node status monitoring. 1) Node filing management registers and audits nodes connected to the blockchain system, configures networks and issues certificates for them, meets system specifications and regulatory requirements, prevents security risks caused by illegal access, and provides functions such as node registration, review, standardized naming, network configuration and certificate issuance; 2) Node network configuration management provides network configuration and management functions for all blockchain nodes, and updates the network configuration and access proxy configuration of blockchain nodes according to the needs of management specifications; 3) Node certificate management provides management functions such as node certificate issuance, backup, extension, recovery, and viewing; 4) Node organization member management provides management functions such as adding, deleting, modifying, and checking members of the organization corresponding to the node on the chain; 5) Node ledger information management provides viewing of node corresponding ledger information and provides basic management functions; 6) Node deployment smart contract management provides functions such as retrieval and viewing of smart contracts deployed on blockchain nodes; 7) Node status monitoring management provides node health analysis monitoring, network status monitoring, business database monitoring, data induction module middleware monitoring, block generation status monitoring, transaction volume monitoring, chain data traffic monitoring, user access traffic monitoring, and statistical analysis of sub-item classified data;
[0089] (3) Tester user rights management includes tester user registration, user rights allocation, user group management, and hierarchical and classified authorization management.
[0090] It can be seen that the second embodiment adopts the design concept of strong integration and loose coupling, and establishes a test data evidence service platform based on the hyper-convergence architecture of big data plus blockchain. The system logic architecture is divided into extraction layer, conversion layer, loading layer, storage layer and service layer from bottom to top according to the data ETL process, and the operation and maintenance service system runs through the entire system. It solves the traceability of the entire life cycle of existing test data and improves the safe access and reliable evidence storage capabilities of test task data.
[0091] The second aspect of the present invention discloses a test data evidence storage method based on blockchain. The method implements the evidence storage of the test data through the test data evidence storage system based on blockchain described in the first aspect, the test data includes structured data and unstructured data, and the evidence storage system includes a test data aggregation storage module, a test data right confirmation module, a test evidence chain module, and a test data verification module; wherein:
[0092] Step S1, using the test data aggregation and storage module to aggregate and store various types of test data within the entire test life cycle;
[0093] Step S2: extracting ownership information and fingerprint information from the stored test data using the test data ownership confirmation module, and combining the ownership information and the fingerprint information to form evidence data of the test data;
[0094] Step S3: Using the test evidence chain module to store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server;
[0095] Step S4: Utilize the test data verification module to extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
[0096] According to the method of the second aspect of the present invention, the test data is transmitted to the test data aggregation storage module via the RocketMQ message bus in a subscription manner, and the test data aggregation storage module stores the structured data in a Mysql database and stores the unstructured data in the HDFS file system.
[0097] According to the method of the second aspect of the present invention, the ownership information includes the ownership, management rights and usage rights of the test data; the fingerprint information of the structured data is the structured data itself; the fingerprint information of the unstructured data includes file size, creation time, modification time, data hash and storage path.
[0098] According to the method of the second aspect of the present invention, the encryption of the evidence data includes: taking each piece of data in the evidence data as a transaction record, calculating the hash value of each transaction record using the SM3 national encryption algorithm, pairing the hash values of every two transaction records to calculate the hash value of the previous layer, and if there are an odd number of hash values of the transaction records, the hash values of the remaining single transaction records directly enter the pairwise calculation process of the hash value of the previous layer, until a hash value of the top layer is obtained as the root hash, and traversing each layer of hash from the root hash downward to obtain a complete hash tree.
[0099] According to the method of the second aspect of the present invention, the storage of the evidence data on the blockchain includes storing the evidence data and the hash tree on the chain in JSON format and broadcasting them to each node on the blockchain; the parallel storage of the evidence data in the search server includes storing the evidence data in the search server using online data mirroring OLDM technology, and the search server is an ES index database.
[0100] According to the method of the second aspect of the present invention, verifying the authenticity of the test data based on the fingerprint information of the evidence data specifically includes:
[0101] The test data is obtained from the blockchain; wherein:
[0102] When the test data is the structured data, the fingerprint information of the test data itself is the test data;
[0103] When the test data is the unstructured data, extracting a storage path of the test data from the fingerprint information of the test data, and reading the test data based on the storage path;
[0104] The hash tree is calculated for the acquired test data, and the hash tree calculated based on the acquired test data is compared with the hash tree stored on the blockchain. When the comparison results are consistent, it indicates that the test data is true and has not been tampered with.
[0105] According to the method of the second aspect of the present invention, when the comparison results are inconsistent, traversal is started from the bottom layer of the hash tree to locate the position where the test data has been tampered with.
[0106] The third aspect of the present invention discloses an electronic device. The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the test data storage method based on blockchain described in any one of the first aspects of the present disclosure are implemented.
[0107] Figure 3 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 3 As shown, the electronic device includes a processor, a memory, a communication interface, a display screen and an input device connected via a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the electronic device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, near field communication (NFC) or other technologies. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covered on the display screen, or a button, a trackball or a touch pad set on the housing of the electronic device, or an external keyboard, touch pad or mouse, etc.
[0108] Those skilled in the art will understand that Figure 3The structure shown in the figure is only a structural diagram of the part related to the technical solution of the present invention, and does not constitute a limitation on the electronic device to which the technical solution of the present invention is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0109] The fourth aspect of the present invention discloses a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the test data storage method based on blockchain described in any one of the first aspects of the present disclosure are implemented.
[0110] In summary, the technical solution provided by the present invention solves the traceability of the entire life cycle of existing test data and improves the secure access and reliable evidence storage capabilities of test data. Furthermore, distributed files represented by HDFS can ensure the reliable storage of large amounts of data through data slicing backup strategies, and full-text search engines represented by ES can achieve rapid data retrieval through index routing. At the same time, blockchain technology is a decentralized or multi-centralized distributed ledger database technology with the characteristics of time series data, collective maintenance, programmability, and security and reliability, providing a feasible solution for the evidence storage of electronic data.
[0111] Furthermore, the technical solution provided by the present invention can query and verify the test parameters, environmental factors, and management system implementation in the system test process. It is an effective means of tracing and holding accountable for management deficiencies and data falsification during the test process, and is a strong support for ensuring the standardization and rigor of the system test process, as well as the authenticity, reliability, and effectiveness of the test data. In addition, the system adopts a distributed data storage architecture that integrates blockchain evidence, ElasticSearch index storage, and HDFS to provide external service support, solving the problem of trusted storage of large amounts of data during the system test process. Compared with traditional data evidence, the proposed blockchain-based test big data evidence system will bring the following advantages: (1) Non-repudiation of original data. The original test data can be non-repudiated and authoritative of the test results after multiple witnesses and chain consensus. (2) Convenient data sharing and viewing. As data confirmation units, the research and development unit and the test unit can directly access and download the confirmation data; the user unit can also obtain access and download permissions for the test data after authorization. (3) Refined management of data. Through the hierarchical management and authorization mechanism of users, each user will obtain different data permissions; at the same time, the entire process flow information such as the owner of the data, the time of generation, the time of chain upload, and the time of downloading are all clear at a glance, realizing the full process and refined management of data. (4) Reliable storage and fast retrieval of big data. The distributed HDFS file system and ES index storage technology are used to realize the reliable storage of multiple copies of data; the index routing technology of ES is used to realize the fast retrieval of big data.
[0112] Please note that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification. The above-mentioned embodiments only express several implementation methods of the present invention, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present invention, several variations and improvements can be made, which all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be based on the attached claims.
Claims
1. A test data notarization system based on blockchain, wherein the test data includes structured data and unstructured data, characterized in that: The evidence storage system includes a test data aggregation and storage module, a test data rights confirmation module, a test evidence chain module, and a test data verification module; wherein: The test data aggregation and storage module is configured to: aggregate and store various types of test data within the entire test life cycle; The test data right confirmation module is configured to: extract ownership information and fingerprint information from the stored test data, and combine the ownership information and the fingerprint information to form evidence data of the test data; The test evidence chain module is configured to: store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server; The test data verification module is configured to: extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
2. According to a blockchain-based test data storage system according to claim 1, it is characterized in that: The test data is transmitted to the test data aggregation storage module via the RocketMQ message bus in a subscription manner. The test data aggregation storage module stores the structured data in a Mysql database and stores the unstructured data in an HDFS file system.
3. According to a blockchain-based test data storage system according to claim 2, it is characterized in that: The ownership information includes the ownership, management rights and usage rights of the test data; the fingerprint information of the structured data is the structured data itself; the fingerprint information of the unstructured data includes file size, creation time, modification time, data hash and storage path.
4. According to the blockchain-based test data storage system of claim 3, it is characterized in that: The encryption of the evidence data includes: taking each piece of data in the evidence data as a transaction record, calculating the hash value of each transaction record using the SM3 national encryption algorithm, pairing the hash values of every two transaction records to calculate the hash value of the previous layer, and if there are an odd number of hash values of the transaction records, the hash values of the remaining single transaction records directly enter the pairwise calculation process of the hash value of the previous layer, until a hash value at the top layer is obtained as the root hash, and traversing each layer of hash from the root hash downward to obtain a complete hash tree.
5. A test data evidence storage system based on blockchain according to claim 4, characterized in that: The storage of the evidence data on the blockchain includes storing the evidence data and the hash tree on the blockchain in JSON format and broadcasting them to each node on the blockchain; The parallel storage of the evidence data in the search server includes storing the evidence data in the search server using online data mirroring (OLDM) technology, and the search server is an ES index database.
6. According to the blockchain-based test data storage system of claim 5, it is characterized in that: Verifying the authenticity of the test data based on the fingerprint information of the evidence data specifically includes: The test data is obtained from the blockchain; wherein: When the test data is the structured data, the fingerprint information of the test data itself is the test data; When the test data is the unstructured data, extracting a storage path of the test data from the fingerprint information of the test data, and reading the test data based on the storage path; The hash tree is calculated for the acquired test data, and the hash tree calculated based on the acquired test data is compared with the hash tree stored on the blockchain. When the comparison results are consistent, it indicates that the test data is true and has not been tampered with.
7. A test data evidence storage system based on blockchain according to claim 6, characterized in that: When the comparison results are inconsistent, traverse from the bottom layer of the hash tree to locate the location where the test data has been tampered with; The test data verification module is configured to: extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
8. A test data storage method based on blockchain, characterized in that: The method implements the storage of the test data through a blockchain-based test data storage system as described in any one of claims 1 to 7, wherein the test data includes structured data and unstructured data, and the storage system includes a test data aggregation storage module, a test data right confirmation module, a test evidence chain module, and a test data verification module; wherein: Step S1, using the test data aggregation and storage module to aggregate and store various types of test data within the entire test life cycle; Step S2: extracting ownership information and fingerprint information from the stored test data using the test data ownership confirmation module, and combining the ownership information and the fingerprint information to form evidence data of the test data; Step S3: Using the test evidence chain module to store the evidence data on the chain, including encryption of the evidence data, storage of the evidence data on the blockchain, and parallel storage of the evidence data in the search server; Step S4: Utilize the test data verification module to extract the evidence data from the search server through query, verify the ownership information in the evidence data, and then verify the authenticity of the test data based on the fingerprint information of the evidence data.
9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and when the processor executes the computer program, the steps in the blockchain-based test data storage method described in claim 8 are implemented.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by the processor, the steps in the blockchain-based test data storage method described in claim 8 are implemented.
