Medical examination data traceability system and method based on block chain
The blockchain-based medical testing data traceability system solves the problems of insufficient data security and traceability capabilities in existing technologies, realizes trusted data storage and traceability throughout the entire lifecycle, improves the efficiency of multi-entity collaboration and privacy protection, and ensures the authenticity and integrity of data.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- ZHENXIONG COUNTY PEOPLES HOSPITAL
- Filing Date
- 2026-02-28
- Publication Date
- 2026-05-19
AI Technical Summary
Existing medical testing data management suffers from problems such as poor security, susceptibility to tampering, weak traceability capabilities, insufficient multi-entity collaboration, and inadequate privacy protection, making it impossible to achieve reliable storage, full traceability, and clear definition of rights and responsibilities throughout the entire lifecycle.
The medical testing data traceability system based on blockchain is adopted, including a multi-entity node module, a data acquisition module, a data preprocessing module, a data encryption module, a blockchain core module, a smart contract module, a traceability query module, an access control module, and an anomaly warning module, to achieve decentralized data storage, full lifecycle traceability, and privacy protection.
It ensures the authenticity and integrity of medical testing data, enables traceability throughout the entire lifecycle, improves the efficiency of multi-entity collaboration and the level of supervision, protects privacy and security, and reduces operating costs and the difficulty of dispute resolution.
Smart Images

Figure CN122065352A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the intersection of medical laboratory data processing and blockchain technology. Specifically, it relates to a blockchain-based medical laboratory data traceability system and method, applicable to the full lifecycle traceability scenario of medical laboratory data involving multiple stakeholders such as hospitals, third-party medical laboratory institutions, medical regulatory departments, and patients. It can achieve trusted storage, full traceability, tamper-proof identification, and delineation of rights and responsibilities for medical laboratory data, ensuring the authenticity, integrity, and privacy security of medical laboratory data. Background Technology
[0002] Medical laboratory data is a core basis for clinical diagnosis, treatment planning, prognosis assessment, and public health prevention and control. Its authenticity, completeness, and traceability are directly related to medical quality and patient safety. Currently, the management of medical laboratory data mainly adopts a centralized storage model, with hospitals or testing institutions maintaining the data independently. This model has many technical defects and industry pain points that urgently need to be addressed.
[0003] On the one hand, under the centralized storage model, the security of medical test data is difficult to guarantee, and problems such as data tampering, loss, and leakage are prone to occur. Some unscrupulous institutions or individuals may tamper with test results for profit, leading to errors in clinical diagnosis. At the same time, once a centralized server suffers a network attack or hardware failure, it can cause a large-scale loss of test data that is difficult to recover. In addition, patients' test data contains personal privacy information, and centralized storage is prone to privacy leaks, infringing on patients' legitimate rights and interests.
[0004] On the other hand, the traceability of medical laboratory data is weak, and the traceability of the entire process is insufficient. Medical testing is a multi-stage collaborative process, encompassing patient sampling, sample transportation, testing operations, result review, and report publication. Data from each stage is scattered among different entities, lacking a unified traceability carrier and collaborative mechanism. When disputes arise regarding test results or medical disputes, it is impossible to quickly trace the data source, operating entity, and time point of each stage, making it difficult to define the rights and responsibilities of each party, thus increasing the difficulty and cost of dispute resolution.
[0005] In addition, existing traceability technologies are mostly targeted at a single link or a single entity, lacking the ability for multi-entity collaborative traceability, and cannot achieve closed-loop traceability of test data throughout the entire lifecycle from sampling to reporting. At the same time, there are problems such as data redundancy, low query efficiency, and chaotic access control in the traceability process, which are not conducive to efficient supervision by medical regulatory authorities and data sharing among various entities.
[0006] Blockchain technology possesses core characteristics such as decentralization, immutability, traceability, transparency, trustworthiness, and encryption security. Its decentralized architecture prevents a single entity from monopolizing data, its immutability ensures data authenticity, and its traceability enables tracking of data throughout its entire lifecycle. These characteristics effectively address the aforementioned issues in current medical laboratory data management and traceability. While blockchain technology is widely used in food and logistics traceability, a mature, comprehensive, and practical system and methodology for medical laboratory data traceability has yet to be established, failing to meet the practical needs of multi-entity collaboration, end-to-end traceability, privacy protection, and efficient supervision. Therefore, developing a blockchain-based medical laboratory data traceability system and methodology has become an urgent technical challenge. Summary of the Invention
[0007] To address the problems of poor security, susceptibility to tampering, weak traceability, insufficient multi-party collaboration, and inadequate privacy protection in existing medical testing data technologies, this invention provides a blockchain-based medical testing data traceability system and method. This system enables trusted storage, full traceability, tamper identification, and delineation of responsibilities throughout the entire lifecycle of medical testing data. It ensures the authenticity, integrity, and privacy security of testing data, improves the standardization and regulatory efficiency of the medical testing industry, and balances data sharing with privacy protection, meeting the practical needs of hospitals, testing institutions, regulatory authorities, patients, and other stakeholders.
[0008] To achieve the above objectives, the present invention provides the following technical solution: The blockchain-based medical testing data traceability system is characterized by comprising a multi-entity node module, a data acquisition module, a data preprocessing module, a data encryption module, a blockchain core module, a smart contract module, a traceability query module, an access control module, a data backup module, and an anomaly warning module. These modules work together to achieve full lifecycle traceability management of medical testing data. The multi-entity node module includes hospital nodes, third-party testing institution nodes, medical supervision nodes, patient nodes, and operation and maintenance nodes. Each node is deployed independently and interconnected through a blockchain network. Each node stores a complete copy of the blockchain ledger. The data acquisition module is used to collect data from all stages of the entire life cycle of medical testing. It adopts a combination of interface connection, automatic acquisition and manual entry, and sets up a data entry verification mechanism. The data preprocessing module is used to remove redundant and abnormal data, fill in missing data, convert unstructured data into structured data, standardize data format, and generate unique data identifiers from the collected raw data. The data encryption module is used to encrypt preprocessed sensitive data and non-sensitive data using different encryption algorithms, and at the same time generate data hash values for integrity verification and tamper identification. The core blockchain module includes a ledger storage unit, a consensus mechanism unit, a P2P network unit, and a block generation unit, enabling decentralized data storage, node consensus, peer-to-peer communication, and block generation. The smart contract module is deployed in the core blockchain module and has multiple preset smart contracts to achieve automated execution, definition of rights and responsibilities, and rule constraints. The source tracing query module is used to provide multi-dimensional source tracing query services for each main node, and to generate and support the export of source tracing reports. The permission management module adopts the RBAC model to uniformly manage and dynamically adjust the access permissions of each node; The data backup module adopts a combination of local backup and off-site backup to achieve regular data backup and emergency recovery; The anomaly warning module is used to monitor the system status and data status in real time, and to issue warnings and record details in a timely manner when anomalies are detected.
[0009] Furthermore, the data collected by the data acquisition module includes patient basic information, sampling information, sample transportation information, testing information, testing result information, and report release information; the patient basic information is anonymized, the sampling information includes sampling time, sampling personnel, sampling site, and sampling number, and the testing information includes testing equipment, testing personnel, testing reagents, testing steps, and testing time.
[0010] Furthermore, the data preprocessing module uses OCR recognition technology to achieve the structured transformation of unstructured data and uses a hash algorithm to generate data identifiers; in the data encryption module, sensitive data uses the RSA asymmetric encryption algorithm, non-sensitive data uses the AES symmetric encryption algorithm, and the data hash value is generated using the SHA-256 algorithm.
[0011] Furthermore, in the core blockchain module, the ledger storage unit adopts distributed ledger technology; the consensus mechanism unit adopts a practical Byzantine fault-tolerant consensus mechanism, supporting dynamic joining and leaving of nodes; the P2P network unit adopts an encrypted transmission protocol to realize peer-to-peer communication between nodes; and the block generation unit packages encrypted data, data hash value, data identifier, timestamp, and the hash value of the previous block to generate a new block.
[0012] Furthermore, the smart contract module includes a pre-set data on-chain contract to standardize the data on-chain process and standards, a traceability query contract to define traceability query rules, an access control contract to define node access permissions, an anomaly verification contract to verify data integrity and consistency, and an accountability contract to define the rights and responsibilities of relevant entities.
[0013] Furthermore, the traceability query module supports query conditions including sampling number, patient identifier, testing equipment number, testing time, and operating entity. The generated traceability report includes data lifecycle trajectory information, data hash value verification results, and anomaly records. The permission management module records all permission operation logs for subsequent auditing and tracing.
[0014] Furthermore, the backup frequency of the data backup module is set according to the data volume and business needs, and the backup data is stored in encrypted form; the anomaly warning module's anomaly types include data tampering, data loss, node failure, and unauthorized access, and warning information is pushed through various means such as system messages, SMS, and email.
[0015] A blockchain-based method for tracing medical laboratory data includes the following steps: Step 1: Node initialization, building a blockchain network, deploying multiple entity nodes and completing identity registration, initializing each core module, and preset smart contract rules, permission allocation rules and consensus mechanism parameters; Step 2: Data Acquisition. Collect data from all stages of the entire medical testing lifecycle through the data acquisition module, and set up a data verification mechanism to filter invalid and abnormal data; Step 3: Data preprocessing. The collected raw data is preprocessed to generate unique data identifiers and to classify the data into sensitive data and non-sensitive data. Step 4: Data encryption. Sensitive and non-sensitive data are encrypted using corresponding encryption algorithms to generate data hash values. Step 5: Data is uploaded to the blockchain. The smart contract for data upload is triggered to verify the data. After the verification is successful, a new block is generated, consensus is reached through the consensus mechanism, and the data is added to the blockchain ledger. Step 6: Full-process monitoring, real-time monitoring of data status and node operation status, comparison of data hash values to identify data tampering, and triggering early warnings upon detection of anomalies; Step 7: Source tracing query. Each subject node initiates a query request according to its permissions. The source tracing query contract retrieves data and generates a source tracing report, which is then returned to the querying subject. Step 8: Access control. Verify node access permissions based on the RBAC model, allow legitimate access, block unauthorized access, and record details. Step 9: Data backup and recovery. Perform local and off-site data backups regularly, and restore data from backups in case of data loss or failure. Step 10: Anomaly Handling and Accountability. When an anomaly occurs, the accountability smart contract is triggered based on the source tracing records and operation logs to define rights and responsibilities, handle disputes, and pursue accountability.
[0016] Furthermore, in step 1, a unique node identifier and role identifier are assigned to each multi-entity node, and an asymmetric encryption public key and private key are generated. The private key is kept separately by each node, and the public key is uploaded to the blockchain network. In step 3, the SHA-256 algorithm is used to generate data identifiers, and the data identifiers correspond one-to-one with the verification data.
[0017] Furthermore, in step 5, the data-on-chain smart contract verifies the data format, encryption integrity, and data identifier uniqueness. If the verification fails, an exception message is returned. In step 6, the exception verification contract periodically compares the data hash value. If the hash value is inconsistent, it is determined that the data has been tampered with, the tampering details are recorded, and an alert is pushed. In step 10, the accountability smart contract automatically generates an accountability report based on the operation entity information, timestamp, and data trajectory retained in the blockchain.
[0018] Compared with the prior art, the present invention has the following significant advantages: 1. Ensuring the credibility and integrity of medical test data: By adopting the decentralized storage and tamper-proof characteristics of blockchain, the data of the entire life cycle of medical tests is encrypted and stored on the chain. Each node stores a complete copy of the ledger. Once the data is on the chain, it cannot be tampered with. At the same time, through the hash value verification mechanism, it can quickly identify whether the data has been tampered with, ensuring the authenticity and integrity of the test data and avoiding clinical diagnostic errors caused by data fraud and tampering.
[0019] 2. Achieve full lifecycle traceability of medical laboratory data: Covering all stages from patient sampling, sample transportation, testing operations, result review, and report release, each piece of data is assigned a unique data identifier, and information such as the operating entity, operation time, and data content of each stage is recorded to form a complete traceability chain. The entire lifecycle trajectory of data can be quickly obtained through multi-dimensional queries, solving the problems of weak traceability capabilities and difficulty in defining responsibilities in existing technologies.
[0020] 3. Enhance privacy protection and data security: Employ a layered encryption strategy, using different encryption algorithms for sensitive and non-sensitive data, combining the advantages of asymmetric and symmetric encryption to ensure privacy and security while improving encryption and decryption efficiency; at the same time, adopt a role-based access control model to clearly define the access permissions of each main node, preventing unauthorized access and privacy leaks, and protecting the legitimate rights and interests of patients; in addition, a data backup mechanism is used to avoid data loss and further enhance data security.
[0021] 4. Improve the efficiency and regulatory level of multi-entity collaboration: Build a multi-entity collaborative blockchain network to enable data sharing and collaborative work among hospitals, testing institutions, regulatory departments, patients, and other entities, breaking down data silos; medical regulatory nodes can view the entire process data and traceability records in real time, achieving efficient supervision of the medical testing industry and standardizing testing operations; at the same time, the automated execution of smart contracts reduces manual intervention, improves the efficiency of data on-chaining, traceability query, and anomaly handling, and reduces operating costs.
[0022] 5. Excellent flexibility and scalability: Adopting the PBFT consensus mechanism, it supports dynamic joining and leaving of nodes, and the number of nodes can be flexibly expanded according to business needs; the system modules adopt a modular design, and the module functions and parameters can be flexibly adjusted according to the needs of actual application scenarios, adapting to medical testing institutions of different sizes and types and regulatory requirements, and has broad application prospects.
[0023] 6. Facilitates dispute resolution and accountability: The operation logs, traceability records, and hash value verification results stored in the blockchain can serve as strong evidence for dispute resolution and accountability. Smart contracts can automatically define the rights and responsibilities of relevant parties, reduce the time and cost of dispute resolution, and improve the standardization of the medical testing industry. Attached Figure Description
[0024] Figure 1 This is a diagram illustrating the overall architecture of the blockchain-based medical testing data traceability system of this invention. Figure 2 This is a flowchart illustrating the implementation of the blockchain-based medical testing data traceability method of the present invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0026] This invention proposes a blockchain-based medical laboratory data traceability system, comprising a multi-entity node module, a data acquisition module, a data preprocessing module, a data encryption module, a blockchain core module, a smart contract module, a traceability query module, an access control module, a data backup module, and an anomaly warning module. These modules work collaboratively to achieve traceability management of medical laboratory data throughout its entire lifecycle. The specific structure is as follows: Multi-subject node module: The system comprises hospital nodes, third-party testing institution nodes, medical supervision nodes, patient nodes, and operation and maintenance nodes. Each node is deployed independently and interconnected through a blockchain network. Each node stores a complete copy of the blockchain ledger, ensuring decentralized storage and trusted sharing of data. Specifically, hospital nodes are responsible for collecting patient sampling information and basic sample data; third-party testing institution nodes are responsible for collecting testing operation data and test result data; medical supervision nodes are responsible for supervising the entire process of data and traceability records; patient nodes are responsible for querying their own test data and traceability information; and operation and maintenance nodes are responsible for the system's daily operation and maintenance and troubleshooting.
[0027] Data acquisition module: This system collects various data throughout the entire lifecycle of medical testing, covering sampling, sample transportation, testing, result review, and report publication. The types of data collected include: patient basic information (de-identified), sampling information (sampling time, sampler, sampling site, sample number), sample transportation information (transporter, transportation time, transportation tool, transportation status), testing information (testing equipment, testing personnel, testing reagents, testing steps, testing time), testing result information (raw result, processed result, result reviewer, review time), and report publication information (publication time, recipient). Data collection methods combine interface integration, automatic acquisition, and manual entry. The interface connects to the hospital's LIS system and testing equipment terminals to achieve automatic data synchronization. Manual entry is used to supplement unstructured data in special scenarios. A data entry verification mechanism is also implemented to ensure the integrity and accuracy of the collected data.
[0028] Data preprocessing module: The data acquisition module is used to preprocess the collected raw medical test data, removing redundant, abnormal, and invalid data, completing missing data (using interpolation or default values), converting unstructured data (scanned copies of test reports and handwritten records) into structured data (using OCR recognition technology), standardizing the data format, and dividing the preprocessed data into sensitive data (patient privacy information) and non-sensitive data (test operation data and result data), providing a foundation for subsequent data encryption and storage. At the same time, a unique data identifier (generated using a hash algorithm) is generated for the preprocessed data, with each data identifier corresponding one-to-one with the data, serving as the core index for data traceability.
[0029] Data encryption module: The connected data preprocessing module encrypts the preprocessed medical test data to ensure data privacy and transmission security. For sensitive data, an asymmetric encryption algorithm (RSA) is used to generate public and private keys. The public key is used for data encryption and verification, while the private key is kept separately by each entity node for data decryption. For non-sensitive data, a symmetric encryption algorithm (AES) is used to improve encryption and decryption efficiency. Simultaneously, a data hash value (using the SHA-256 algorithm) is generated for the encrypted data. This hash value is associated with the encrypted ciphertext and data identifier for subsequent data integrity verification and tamper identification, ensuring that data is not tampered with or leaked during transmission and storage.
[0030] Blockchain core modules: The core support of the system includes a ledger storage unit, a consensus mechanism unit, a P2P network unit, and a block generation unit. The ledger storage unit uses distributed ledger technology to store encrypted medical test data, data hash values, data identifiers, operation logs, and traceability records uploaded by each principal node. Each node stores a complete copy of the ledger, achieving decentralized data storage and preventing data loss due to single-node failure. The consensus mechanism unit uses a Practical Byzantine Fault Tolerance (PBFT) consensus mechanism, suitable for multi-principal collaborative scenarios. It can quickly reach consensus, ensuring the consistency of ledger data across nodes, while also supporting dynamic node joining and leaving, improving the system's flexibility and scalability. The P2P network unit enables point-to-point communication between principal nodes, ensuring efficient and stable data transmission. It uses an encrypted transmission protocol to prevent data theft and tampering during transmission. The block generation unit packages the encrypted data, data hash values, data identifiers, timestamps, and operation entity information into blocks. Each block contains the hash value of the previous block, forming a chain structure to ensure data immutability and traceability. The block generation frequency can be dynamically adjusted according to the amount of data collected.
[0031] Smart contract module: Deployed on the core blockchain module, this system automates the execution, responsibilities definition, and rule constraints in the medical testing data traceability process. It includes pre-defined smart contracts for data upload, traceability query, access control, anomaly verification, and accountability. The data upload contract standardizes the data upload process, ensuring only pre-processed and encrypted data is uploaded and stored on the blockchain, rejecting non-compliant data and providing feedback on any anomalies. The traceability query contract defines the rules for traceability queries, automatically retrieving traceability data from the blockchain ledger based on the query subject's permissions and query conditions, and returning the query results. The access control contract defines the access permissions of each node, clarifying the data scope that different nodes can view and manipulate, preventing unauthorized access. The anomaly verification contract verifies the integrity and consistency of uploaded data in real time, comparing data hash values; if data tampering is detected, it immediately triggers an anomaly warning and records the tampering node, time, and content. The accountability contract automatically defines the responsibilities of relevant parties based on operation logs and traceability records stored in the blockchain when data tampering or testing errors occur, providing a basis for dispute resolution and accountability.
[0032] Source tracing and query module: This system connects the core blockchain module and the smart contract module to provide traceability and query services for medical testing data to various stakeholders. It supports multi-dimensional queries, with query conditions including sample number, patient identifier (de-identified), testing equipment number, testing time, and operating entity. During the query process, the user inputs query conditions, and the traceability query contract automatically retrieves relevant data from the blockchain ledger, generating a complete traceability report. The report includes the data's entire lifecycle trajectory information (operating entity, operation time, data content, and data status at each stage), data hash value verification results, and any anomaly records. It also provides a traceability result export function, supporting PDF, Excel, and other formats for convenient user retention and use. The query process employs an encrypted verification mechanism to ensure the legality and security of the query operation and prevent the unauthorized acquisition of traceability information.
[0033] Access control module: The system connects a multi-entity node module and a smart contract module to uniformly manage and dynamically adjust the access permissions of each entity node. It employs a Role-Based Access Control (RBAC) model, assigning a unique role identifier to each entity node, with different roles corresponding to different access permissions. For example, hospital nodes can only view and manipulate sampling data and associated test data collected by their own institution; third-party testing institution nodes can only view and manipulate their own institution's test data; medical regulatory nodes can view the entire process data and traceability records of all entities; patient nodes can only view their own test data and traceability information; and operation and maintenance nodes can only perform system operation and maintenance-related operations and cannot view core test data. Simultaneously, it supports dynamic adjustment and revocation of permissions. When an entity node's role changes or it exits the system, its access permissions are promptly adjusted or revoked to ensure data access security. Furthermore, all permission operation logs are recorded for subsequent auditing and traceability.
[0034] Data backup module: It connects to the core blockchain module for regular backup and emergency recovery of blockchain ledger data and core system data. It adopts a combination of local backup and off-site backup. Local backup is used to quickly restore recent data, while off-site backup is used to deal with local data loss caused by major failures (natural disasters, large-scale cyberattacks). The backup frequency can be set according to data volume and business needs (daily backup, weekly full backup). Backup data is stored in encrypted form to ensure its security. At the same time, a backup recovery mechanism is set up so that when the system experiences data loss or failure, backup data can be quickly retrieved for recovery, ensuring the continuity and stability of the system.
[0035] Anomaly warning module: Connecting the blockchain core module, smart contract module, and multi-entity node module, this system monitors the system's operational status and the entire lifecycle of medical testing data in real time, promptly detecting anomalies and issuing warnings. Anomaly types include data tampering, missing data, data errors, node failures, and unauthorized access. When the anomaly verification contract detects data tampering, the anomaly warning module immediately generates a tampering warning, sends it to relevant entity nodes (medical supervision nodes and corresponding operation nodes), and records the tampering details. When a node failure is detected, a node failure warning is sent, notifying the maintenance node to handle it promptly. When unauthorized access is detected, an unauthorized access warning is sent, blocking the access operation and recording the accessing entity and access details. Warning information can be pushed through various methods such as system messages, SMS, and email to ensure that relevant entities are promptly aware of and can handle anomalies, reducing risks.
[0036] Based on the above system, this invention also proposes a blockchain-based method for tracing medical laboratory data, comprising the following steps: 1. Node initialization: A blockchain network is established, deploying multiple entity nodes (hospital nodes, third-party testing institution nodes, medical supervision nodes, patient nodes, and operation and maintenance nodes). Each node is assigned a unique node identifier and role identifier, and asymmetric encryption public and private keys are generated for each node. The private keys are kept separately by each node, and the public keys are uploaded to the blockchain network to complete node identity registration. At the same time, core modules such as the blockchain core module, smart contract module, and permission management module are initialized, and smart contract rules, permission allocation rules, and consensus mechanism parameters are preset to complete system initialization. 2. Data Collection: The data acquisition module collects data from all stages of the medical testing lifecycle, including patient basic information (de-identified), sampling information, sample transportation information, testing information, test result information, and report release information. It adopts a combination of interface integration, automatic acquisition, and manual entry to ensure the completeness and accuracy of data collection. Data verification is set up during the acquisition process to filter and prompt invalid or abnormal data in real time. 3. Data preprocessing: The data preprocessing module preprocesses the collected raw data, removing redundant and abnormal data, filling in missing data, converting unstructured data into structured data, unifying the data format, and dividing the preprocessed data into sensitive and non-sensitive data. At the same time, a hash algorithm is used to generate a unique data identifier for each preprocessed data, with each data identifier corresponding to a data item, serving as the core index for subsequent traceability. 4. Data encryption: The data encryption module uses the RSA asymmetric encryption algorithm to encrypt pre-processed sensitive data and the AES symmetric encryption algorithm to encrypt non-sensitive data. At the same time, it generates a SHA-256 hash value for each encrypted data. The hash value is associated with the encrypted ciphertext, data identifier, operation subject information, and timestamp, and is used for data integrity verification and tamper identification. The encrypted ciphertext and hash value are uploaded to the blockchain network together. 5. Data on-chain: After data encryption is completed, the data upload smart contract is triggered to verify the uploaded data (verifying data format, encryption integrity, and data identifier uniqueness). If the verification passes, the block generation unit packages the encrypted ciphertext, data hash value, data identifier, operation entity information, timestamp, and the hash value of the previous block to generate a new block. Through the PBFT consensus mechanism, all nodes in the blockchain network reach a consensus and add the newly generated block to the blockchain ledger, completing the data upload process. If the verification fails, an exception message is returned, and the relevant entity nodes are notified to correct and re-upload the data. 6. Full-process monitoring: The anomaly warning module and anomaly verification contract monitor the entire lifecycle status of data after it is uploaded to the blockchain in real time. The anomaly verification contract periodically compares the data hash value in the blockchain ledger with the original hash value. If the hash value is found to be inconsistent, it is determined that the data has been tampered with, and an anomaly warning is immediately triggered. The tampering details (tampering node, tampering time, data before tampering, and data after tampering) are recorded, and the warning information is pushed to the relevant subject nodes. At the same time, the operating status and access operations of each node are monitored to promptly detect node failures and unauthorized access and issue corresponding warnings.
[0037] 7. Source tracing query: Each entity node initiates a traceability query request through the traceability query module according to its own permissions, and inputs query conditions (sampling number, patient identifier, testing equipment number, etc.); the traceability query smart contract retrieves relevant data from the blockchain ledger according to the query conditions and permission rules, extracts the trajectory information of the data's entire life cycle, hash value verification results and abnormal records, generates a complete traceability report, and returns it to the query entity; the query entity can view the traceability report or export the traceability report for storage. The entire query process is encrypted to ensure the security of traceability information; 8. Access Control: The access control module is based on the RBAC model and controls the access permissions of each main node in real time. According to the role of the node, it restricts the range of data that it can view and operate. When a main node initiates an access request, the access control smart contract verifies its role and permissions. If the verification is successful, access is allowed; if the verification fails, access is blocked, the details of unauthorized access are recorded, and an anomaly warning is triggered. At the same time, it supports the dynamic adjustment and cancellation of permissions, and updates the permission settings in a timely manner according to business needs and changes in the roles of main nodes. 9. Data Backup and Recovery: The data backup module performs local and off-site backups of blockchain ledger data and core system data according to a preset backup frequency, and the backup data is stored in encrypted form. When the system experiences data loss, node failure, or other problems, the operation and maintenance node triggers the data recovery mechanism to call the local or off-site backup data to quickly restore the system data and blockchain ledger, ensuring the normal operation of the system and reducing the losses caused by data loss. 10. Exception Handling and Accountability: When anomalies such as data tampering, verification errors, or unauthorized access occur, relevant nodes initiate accountability requests based on anomaly warning information and operation logs and traceability records stored in the blockchain. This triggers an accountability smart contract, which automatically defines the rights and responsibilities of relevant entities based on the operation entity information, timestamps, and data traces stored in the blockchain, and generates an accountability report. Relevant entities can handle disputes and pursue accountability based on the accountability report, and medical regulatory nodes can impose regulatory penalties on relevant entities based on the accountability report, ensuring that all entities operate in a standardized manner.
[0038] The present invention will be further described in detail below with reference to specific embodiments. It should be understood that the specific embodiments described herein are only for explaining the present invention and are not intended to limit the present invention.
[0039] Example 1: Specific Deployment of a Blockchain-Based Medical Laboratory Data Traceability System In this embodiment, the blockchain-based medical testing data traceability system is deployed in a regional medical testing collaboration network, covering 3 tertiary hospitals, 2 third-party medical testing institutions, 1 regional medical regulatory department, and several patient users. The specific deployment is as follows: Multi-entity node deployment: A consortium blockchain network is established, deploying 3 hospital nodes, 2 third-party testing institution nodes, 1 medical supervision node, several patient nodes (registered as needed), and 1 operation and maintenance node; each node is deployed on a server with the following configuration: CPU: Intel Xeon E5-2690 v4, RAM: 64GB, hard drive: 1TB SSD, operating system: Ubuntu 20.04 LTS; each node is assigned a unique node ID and role identifier, and an RSA asymmetric encryption public key (key length 2048 bits) and private key are generated. The private key is kept separately by each node administrator, and the public key is uploaded to the blockchain network to complete node identity registration and authentication; Core Module Deployment: The core blockchain module is built using the Hyperledger Fabric open-source framework. The ledger storage unit uses a distributed ledger, with each node storing a complete copy of the ledger, and the ledger data is stored in encrypted form. The consensus mechanism unit uses the PBFT consensus mechanism, with 5 consensus nodes (3 hospital nodes + 2 testing institution nodes), and the consensus latency is controlled within 500ms to ensure efficient data uploading. The P2P network unit uses the Gossip protocol to achieve peer-to-peer communication between nodes, with a data transmission rate of no less than 100Mbps. The block generation unit is set to generate one block every 10 minutes, with a maximum block size of 100MB, which can be dynamically adjusted according to the amount of data collected. Smart Contract Deployment: Five smart contracts are deployed on the core blockchain module: data upload contract, traceability query contract, access control contract, anomaly verification contract, and accountability contract. These smart contracts are written in Solidity and tested and debugged via maintenance nodes after deployment to ensure accuracy and stability. The data upload contract has preset data verification rules, requiring uploaded data to include a data identifier, the operation subject, a timestamp, and encrypted ciphertext; otherwise, upload is rejected. The anomaly verification contract sets a hash value verification period of every 5 minutes, comparing data hash values in real time and triggering an alert immediately upon detecting anomalies. Data acquisition module deployment: The data acquisition module interfaces with the LIS systems and laboratory equipment terminals (blood routine analyzers, biochemical analyzers) of various hospitals to achieve automatic synchronization of sampling data and test data; the manual data entry module is deployed on the client side of each node to supplement unstructured data (handwritten test records) in special scenarios; the data acquisition verification mechanism is set to verify mandatory fields, format verification, and range verification to ensure the integrity and accuracy of the collected data. For example, the sampling time must conform to the format "YYYY-MM-DD HH:MM:SS", and the test results must be within the preset normal range; otherwise, the user is prompted to correct. Other module deployments: The data preprocessing module is written in Python and integrates an OCR recognition tool (TesseractOCR) to achieve the structured transformation of unstructured data; the data encryption module integrates RSA and AES encryption algorithms, using RSA encryption for sensitive data (patient name, ID number, contact information) and AES encryption for non-sensitive data (testing equipment number, testing steps); the traceability query module is deployed on the client and web interface of each node, supporting multi-dimensional queries and traceability report export; the access control module adopts the RBAC model, with five preset roles (hospital administrator, testing institution administrator, supervisor, patient, and maintenance personnel), and assigns corresponding access permissions; the data backup module is set to perform local backups daily at 23:00 and off-site backups (to an off-site server) every Sunday; the anomaly warning module supports three warning methods: system messages, SMS, and email, with warning information pushed to the clients and mobile phones of relevant entities in real time.
[0040] Example 2: Specific Implementation Process of Blockchain-Based Medical Laboratory Data Traceability Method Based on the system deployed in Example 1, this example provides a specific execution flow of a blockchain-based medical test data traceability method. Taking the traceability of a patient's blood routine test data as an example, the specific steps are as follows: Node initialization: The operation and maintenance node builds the consortium blockchain network, completes the deployment and identity registration of each main node, assigns role identifiers and encryption keys to 3 hospital nodes, 2 testing institution nodes, 1 regulatory node, and the operation and maintenance node, initializes each core module, presets smart contract rules and permission allocation rules, completes system initialization, and ensures normal interconnection and interoperability of each node. Data collection: The patient undergoes a blood routine sampling at a certain hospital. Medical staff at the hospital node collect the patient's blood sample through a sampling device and enter the sampling information (sampling time: 2026-02-01 09:30:00, sampler: Zhang XX, sampling site: venous blood, sampling number: JY20260201001), and the patient's basic information (after desensitization: name **San, ID number XXXX****XXXX, contact number ****8888); after sampling, the sample is transported to a third-party inspection agency, and the transporter enters the transportation information (transporter: Li XX, transportation time: 2026-02-01 10:00:00, transportation tool: special transportation box, transportation status: normal); the inspector at the inspection agency node inspects the sample using a blood routine analyzer and collects the inspection information (inspection equipment: XN-9000 blood routine analyzer, inspector: Wang XX, inspection reagent: blood routine detection kit, inspection steps: sample dilution → staining → detection → result analysis, inspection time: 2026-02-01 10:30:00), and the inspection result information (white blood cells: 6.5×10 9 / L, red blood cells: 4.8×10¹² / L, hemoglobin: 135g / L, result reviewer: Zhao XX, review time: 2026-02-01 11:00:00); after the report is released, the report release information is entered (release time: 2026-02-0111:30:00, recipient: Zhang XX); all data is automatically synchronized or manually entered through the data collection module to complete data collection; Data preprocessing: The data preprocessing module preprocesses the collected raw data, removes redundant repeated records of the transportation status, completes the missing inspection reagent batch number (default completion of the current batch: 20260101), converts the handwritten inspector's signature into structured text through an OCR recognition tool, and unifies the data format (time format, numerical format); defines the patient's basic information as sensitive data and the rest of the data as non-sensitive data; uses the SHA-256 algorithm to generate a unique data identifier for this blood routine inspection data: Hash value (JY20260201001 + 20260201093000) = 7a3f9d2e8b4c6e0a1d3f5b7c9e1a2d4f6b8c0e2a4d6f8b0c1e3a5d7b9f1c2e4d, and the data identifier corresponds to this inspection data one by one; Data encryption: The data encryption module encrypts sensitive data (de-identified patient basic information) using the RSA asymmetric encryption algorithm (public key: hospital node public key) to generate encrypted ciphertext; it encrypts non-sensitive data (sampling information, transport information, testing information, test result information, report release information) using the AES symmetric encryption algorithm (key: 1234567890abcdef) to generate encrypted ciphertext; simultaneously, it uses the SHA-256 algorithm to generate a data hash value for all encrypted ciphertext, data identifiers, operation subject information (hospital node ID, testing institution node ID, related personnel ID), and timestamps: 8b4e6d8a2c0e4f6b8d0a2c4e6f8b0d2e4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b. This hash value is used for subsequent data integrity verification. Data Uploading to the Blockchain: After data encryption, both the hospital node and the testing institution node trigger the data uploading smart contract, uploading the encrypted ciphertext, data identifier, data hash value, operation entity information, and timestamp to the blockchain network. The data uploading smart contract verifies the uploaded data, checking the data format, encryption integrity, and data identifier uniqueness. Upon successful verification, the block generation unit packages the above information with the hash value of the previous block (6c2d4e8a0b6f2c4d8e0a6b2c4d8e0a6b2c4d8e0a6b2c4d8e0a6b2c) to generate a new block (block height: 1001, block timestamp: 2026-02-01). 11:35:00); Through the PBFT consensus mechanism, 5 consensus nodes (3 hospital nodes + 2 testing institution nodes) vote on the newly generated block. After the vote passes (more than 2 / 3 of the nodes agree), the new block is added to the blockchain ledger, and all nodes update their ledger copies synchronously to complete the data on-chain. End-to-end monitoring: The anomaly warning module and anomaly verification contract monitor the status of the verification data in real time. Every 5 minutes, the anomaly verification contract compares the data hash value (8b4e6d8a2c0e4f6b8d0a2c4e6f8b0d2e4a6c8e0b2d4f6a8c0e2b4d6f8a0c2e4b) in the blockchain ledger with the original hash value to confirm that the data has not been tampered with. At the same time, the running status and access operations of each node are monitored. No node failures or unauthorized access were found, and the system is operating normally. Source tracing query: The patient initiates a source tracing query request through the patient node client, entering the query conditions (sampling number: JY20260201001); the source tracing query smart contract verifies the patient node's permissions (only able to view its own test data). After successful verification, it retrieves the relevant data corresponding to the data identifier in the blockchain ledger, extracts the trajectory information of the entire lifecycle of the blood routine test data (operating entities, operation times, and data content of each stage of sampling, transportation, testing, review, and publication), and the data hash value verification result (unaltered), generating a source tracing report; the patient can view the source tracing report or export it in PDF format for retention; Access Control: Supervisors at medical monitoring nodes initiate query requests through the monitoring node client to view the full process information of a particular test data point. The access control smart contract verifies the supervisor's role and permissions (viewing all test data). Upon successful verification, the supervisor is allowed to view the encrypted ciphertext, traceability records, and operation logs of the data point. If a hospital node wants to view sampling data from other hospitals, the access control smart contract verifies its permissions (only viewing sampling data from its own institution is permitted). If verification fails, access is blocked, details of unauthorized access are recorded, an anomaly alert is triggered, and alert information is pushed to the operations and maintenance nodes and monitoring nodes. Data Backup and Recovery: At 23:00 on the same day, the data backup module performs a local backup of the inspection data and the system's core data in the blockchain ledger. The backup data is stored using AES encryption. Every Sunday, the local backup data is synchronized to an off-site server to complete the off-site backup. If a hardware failure occurs at the inspection agency node, resulting in the loss of local ledger data, the operation and maintenance node triggers the data recovery mechanism, calls the local backup data, and quickly restores the ledger data of the node to ensure the normal operation of the system and that the traceability information of the inspection data is not lost. Anomaly Handling and Accountability: Suppose a testing personnel at a testing facility tampered with test results (changing the white blood cell count from 6.5 × 10⁻⁶ to...). 9 / L changed to 8.5×10 9 / L), during the anomaly verification contract comparison of data hash values, it was found that the tampered hash value (9c3e5f7b1d5c7e9a3f5d7b9c1e3a5d7b9f1c3e5d7b9f1c3e5d7b9f1c3e5d7b9f1c3e5d7b9f) was inconsistent with the original hash value. This immediately determined that the data had been tampered with, triggering an anomaly alert and recording the tampering details (tampering node: verification agency node 2, tampering time: 2026-02-01 14:00:00, data before tampering: white blood cells 6.5×10). 9 / L, altered data: white blood cells 8.5×10 9The system will push early warning information to regulatory nodes, testing institution nodes, and hospital nodes; the regulatory node will initiate an accountability request, triggering an accountability smart contract, and automatically define the rights and responsibilities of testing personnel Wang XX and testing institution node 2 based on the operation log (operation record of testing personnel Wang XX), timestamps, and data trajectories retained in the blockchain, and generate an accountability report; the regulatory department will punish the testing personnel and issue a notice of criticism to the testing institution based on the accountability report to ensure that the responsibility is fulfilled.
[0041] As can be seen from the above embodiments, the blockchain-based medical testing data traceability system and method provided by the present invention can realize the trusted storage, full traceability, tamper identification, and delineation of rights and responsibilities of medical testing data throughout its entire life cycle. It effectively solves the problems existing in the prior art, ensures medical quality and patient safety, improves the standardization level and regulatory efficiency of the medical testing industry, and has good practicality and promotion value.
[0042] The present invention and its embodiments have been described above. This description is not restrictive, and the accompanying drawings are only one embodiment of the present invention; the actual structure is not limited thereto. In conclusion, if those skilled in the art are inspired by this description and design similar structures and embodiments without departing from the spirit of the invention, such designs should fall within the protection scope of the present invention.
Claims
1. A blockchain-based medical testing data traceability system, characterized in that, It includes a multi-entity node module, a data acquisition module, a data preprocessing module, a data encryption module, a blockchain core module, a smart contract module, a traceability query module, a permission management module, a data backup module, and an anomaly warning module. These modules work together to achieve full lifecycle traceability management of medical test data. The multi-entity node module includes hospital nodes, third-party testing institution nodes, medical supervision nodes, patient nodes, and operation and maintenance nodes. Each node is deployed independently and interconnected through a blockchain network. Each node stores a complete copy of the blockchain ledger. The data acquisition module is used to collect data from all stages of the entire life cycle of medical testing. It adopts a combination of interface connection, automatic acquisition and manual entry, and sets up a data entry verification mechanism. The data preprocessing module is used to remove redundant and abnormal data, fill in missing data, convert unstructured data into structured data, standardize data format, and generate unique data identifiers from the collected raw data. The data encryption module is used to encrypt preprocessed sensitive data and non-sensitive data using different encryption algorithms, and at the same time generate data hash values for integrity verification and tamper identification. The core blockchain module includes a ledger storage unit, a consensus mechanism unit, a P2P network unit, and a block generation unit, enabling decentralized data storage, node consensus, peer-to-peer communication, and block generation. The smart contract module is deployed in the core blockchain module and has multiple preset smart contracts to achieve automated execution, definition of rights and responsibilities, and rule constraints. The source tracing query module is used to provide multi-dimensional source tracing query services for each main node, and to generate and support the export of source tracing reports. The permission management module adopts the RBAC model to uniformly manage and dynamically adjust the access permissions of each node; The data backup module adopts a combination of local backup and off-site backup to achieve regular data backup and emergency recovery; The anomaly warning module is used to monitor the system status and data status in real time, and to issue warnings and record details in a timely manner when anomalies are detected.
2. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, The data acquisition module collects patient basic information, sampling information, sample transportation information, testing information, testing result information, and report release information. The patient basic information is anonymized. The sampling information includes sampling time, sampling personnel, sampling site, and sampling number. The testing information includes testing equipment, testing personnel, testing reagents, testing steps, and testing time.
3. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, The data preprocessing module uses OCR recognition technology to achieve the structural transformation of unstructured data and uses a hash algorithm to generate data identifiers; in the data encryption module, sensitive data uses the RSA asymmetric encryption algorithm, non-sensitive data uses the AES symmetric encryption algorithm, and the data hash value is generated using the SHA-256 algorithm.
4. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, In the core blockchain module, the ledger storage unit adopts distributed ledger technology; the consensus mechanism unit adopts a practical Byzantine fault-tolerant consensus mechanism, supporting dynamic joining and leaving of nodes; and the P2P network unit uses an encrypted transmission protocol to realize peer-to-peer communication between nodes. The block generation unit packages encrypted data, data hash value, data identifier, timestamp, and the hash value of the previous block to generate a new block.
5. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, The smart contract module pre-sets a data upload contract to standardize the data upload process and standards, a traceability query contract to define traceability query rules, an access control contract to define node access permissions, an anomaly verification contract to verify data integrity and consistency, and an accountability contract to define the rights and responsibilities of relevant entities.
6. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, The traceability query module supports query conditions including sampling number, patient identifier, testing equipment number, testing time, and operating entity. The generated traceability report includes data lifecycle trajectory information, data hash value verification results, and anomaly records. The permission management module records all permission operation logs for subsequent auditing and tracing.
7. The blockchain-based medical testing data traceability system according to claim 1, characterized in that, The backup frequency of the data backup module is set according to the data volume and business needs, and the backup data is stored in encrypted form; the anomaly warning module includes data tampering, data loss, node failure, and unauthorized access, and the warning information is pushed through system messages, SMS, email and other means.
8. A blockchain-based method for tracing medical laboratory data, characterized in that: The system according to any one of claims 1-7 includes the following steps: Step 1: Node initialization, building a blockchain network, deploying multiple entity nodes and completing identity registration, initializing each core module, and preset smart contract rules, permission allocation rules and consensus mechanism parameters; Step 2: Data Acquisition. Collect data from all stages of the entire medical testing lifecycle through the data acquisition module, and set up a data verification mechanism to filter invalid and abnormal data; Step 3: Data preprocessing. The collected raw data is preprocessed to generate unique data identifiers and to classify the data into sensitive data and non-sensitive data. Step 4: Data encryption. Sensitive and non-sensitive data are encrypted using corresponding encryption algorithms to generate data hash values. Step 5: Data is uploaded to the blockchain. The smart contract for data upload is triggered to verify the data. After the verification is successful, a new block is generated, consensus is reached through the consensus mechanism, and the data is added to the blockchain ledger. Step 6: Full-process monitoring, real-time monitoring of data status and node operation status, comparison of data hash values to identify data tampering, and triggering early warnings upon detection of anomalies; Step 7: Source tracing query. Each subject node initiates a query request according to its permissions. The source tracing query contract retrieves data and generates a source tracing report, which is then returned to the querying subject. Step 8: Access control. Verify node access permissions based on the RBAC model, allow legitimate access, block unauthorized access, and record details. Step 9: Data backup and recovery. Perform local and off-site data backups regularly, and restore data from backups in case of data loss or failure. Step 10: Anomaly Handling and Accountability. When an anomaly occurs, the accountability smart contract is triggered based on the source tracing records and operation logs to define rights and responsibilities, handle disputes, and pursue accountability.
9. The blockchain-based medical testing data traceability method according to claim 8, characterized in that, In step 1, a unique node identifier and role identifier are assigned to each multi-entity node, and an asymmetric encryption public key and private key are generated. The private key is kept separately by each node, and the public key is uploaded to the blockchain network. In step 3, the SHA-256 algorithm is used to generate data identifiers, and the data identifiers correspond one-to-one with the verification data.
10. The blockchain-based medical testing data traceability method according to claim 8, characterized in that, In step 5, the data-on-chain smart contract verifies the data format, encryption integrity, and data identifier uniqueness. If the verification fails, an exception message is returned. In step 6, the exception verification contract periodically compares the data hash value. If the hash value is inconsistent, it is determined that the data has been tampered with, the tampering details are recorded, and an alert is pushed. In step 10, the accountability smart contract automatically generates an accountability report based on the information of the operating entity, timestamps, and data traces stored in the blockchain.