Traditional Chinese medicine decoction substitution tracing method, device, equipment and medium
By employing pharmacist identity verification, zero-knowledge proofs, and blockchain technology, combined with automated parameter collection via IoT devices, the challenges of accountability and data privacy leaks in traditional Chinese medicine decoction services have been resolved. This has enabled a trusted traceability loop across institutions, ensuring data security and privacy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SSC HLDG CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-05-29
AI Technical Summary
In the traditional Chinese medicine decoction service, problems such as accountability, data tampering, information silos, and privacy leaks have not been effectively resolved, making it difficult to identify the responsible party for quality issues and ensuring data security and privacy.
By employing pharmacist identity verification, zero-knowledge proof, and blockchain technology, the system enables the signature confirmation of encrypted prescriptions and the on-chain storage of key information. Combined with the automated collection of parameters by IoT devices and the generation of trusted traceability reports, it establishes cross-institutional data links and forms a trusted traceability closed loop.
It enables precise identification and responsibility definition of operational behaviors, ensures automated and reliable storage of core process parameters for decoction, breaks down information silos, protects data security and privacy, achieves a balance between process reliability and data privacy, and forms a reliable traceability closed loop across institutions.
Smart Images

Figure CN122117266A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of traditional Chinese medicine decoction technology, and in particular to a method, device, equipment and medium for tracing traditional Chinese medicine decoction. Background Technology
[0002] In traditional traceability models for Chinese herbal medicine decoction services, systems often focus solely on recording material information such as batch numbers of medicinal herbs, failing to accurately link key operations like decoction and packaging with responsible parties. This makes it difficult to pinpoint the responsible party in case of quality issues. Furthermore, the reliance on manual recording of core data is not only inefficient but also prone to tampering and omissions, compromising data authenticity. Simultaneously, the independent and unrecognized identity authentication systems of participating institutions such as hospitals, pharmacies, decoction centers, and logistics companies create multiple gaps in the traceability chain, hindering the formation of a complete closed loop. Moreover, some traditional blockchain traceability solutions, in pursuit of transparency, directly publish prescriptions in plaintext or related hash values on the blockchain. This fails to effectively protect patient medication privacy and exposes core prescription information to the risk of leakage, making it difficult to balance traceability needs with privacy security. Summary of the Invention
[0003] The purpose of this invention is to provide a method, device, equipment, and medium for tracing the decoction of traditional Chinese medicine, which can solve the problem of responsibility traceability, achieve automated and reliable evidence storage of decoction process parameters, open up cross-institutional data links, form a reliable traceability closed loop, and realize reliable traceability where data is available but not visible.
[0004] To address the aforementioned technical problems, this invention provides a method for tracing the decoction of traditional Chinese medicine, applied in decoction centers, comprising: After the pharmacist's identity verification is successful, the encrypted prescription and corresponding on-chain evidence hash sent by the hospital are received, the signature is confirmed and the key information is stored on the chain, and a decoction work order is generated. After decrypting the encrypted prescription, the decoction work order is assigned to the corresponding decoction equipment and personnel. The Internet of Things device is linked to collect decoction parameters, and zero-knowledge proof is used to verify compliance and update the status of the decoction work order. Based on the updated decoction work order, a delivery task is generated and connected with logistics. The delivery status is recorded on the blockchain and corresponding notification information is pushed to the patient. In response to traceability requests from patients or authorized regulators, the system aggregates on-chain evidence data, provides privacy-protected verification or authorized raw data verification according to preset permissions, and generates a reliable traceability report.
[0005] To address the aforementioned technical problems, this invention also provides a traditional Chinese medicine decoction traceability device, applied in a decoction center, comprising: The work order generation module is used to receive the encrypted prescription and corresponding on-chain evidence hash sent by the hospital after the pharmacist's identity verification is successful, perform signature confirmation and on-chain evidence storage of key information, and generate a decoction work order. The work order allocation module is used to decrypt the encrypted prescription and allocate the decoction work order to the corresponding decoction equipment and personnel, link IoT devices to collect decoction parameters, use zero-knowledge proof to perform compliance verification and update the status of the decoction work order. The delivery processing module is used to generate delivery tasks based on the updated decoction work order and connect with logistics, record the delivery status on the blockchain, and push corresponding notification information to patients. The traceability verification module is used to respond to traceability requests from patients or authorized regulators, aggregate on-chain evidence data, provide privacy-protected verification or authorized raw data verification according to preset permissions, and generate a reliable traceability report.
[0006] To address the aforementioned technical problems, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-described method for tracing the decoction of traditional Chinese medicine.
[0007] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described method for tracing the decoction of traditional Chinese medicine.
[0008] As can be seen from the above technical solution, the traditional Chinese medicine decoction traceability method provided by this invention, applied to a decoction center, includes: after the pharmacist's identity verification is successful, firstly, receiving the encrypted prescription and corresponding on-chain notarized hash sent by the hospital, performing signature confirmation and on-chain notarization of key information, and generating a decoction work order; then, after decrypting the encrypted prescription, allocating the decoction work order to the corresponding decoction equipment and personnel, linking IoT devices to collect decoction parameters, using zero-knowledge proof for compliance verification and updating the status of the decoction work order; subsequently, generating a delivery task based on the updated decoction work order and connecting with logistics, notifying the delivery status on the blockchain, and pushing corresponding notification information to the patient; finally, responding to the traceability request from the patient or authorized regulatory body, aggregating the on-chain notarized data, providing privacy-protected verification or authorized original data verification according to preset permissions, and generating a trusted traceability report.
[0009] The beneficial effects of this invention are as follows: The above-mentioned traditional Chinese medicine decoction traceability method provided by this invention achieves accurate identity traceability and responsibility definition of operational behavior through pharmacist identity verification and signature confirmation mechanism, effectively solving the problem of responsibility traceability; it realizes automated and reliable storage of core decoction process parameters by automatically collecting core decoction process parameters through IoT devices and completing compliance verification by combining zero-knowledge proof, thus constructing an automated proof mechanism from "formal compliance" to "substantive reliability"; it breaks down information silos and forms a cross-institutional reliable traceability closed loop by connecting the data links of hospitals, decoction centers, logistics, patients and regulators through on-chain storage; it adopts an efficient "on-chain storage, off-chain storage" collaborative architecture, which ensures data security while taking into account system performance and operating costs; it introduces privacy computing methods such as zero-knowledge proof, which can not only verify that each step of the decoction process has been executed correctly, achieving a perfect balance between process reliability and data privacy, but also unlock and verify encrypted off-chain complete data with authorization, supporting penetrating supervision, fundamentally solving the contradiction between process transparency and data privacy, and achieving the goal of "data usable but not visible" reliable traceability.
[0010] In addition, the present invention also provides a corresponding traditional Chinese medicine decoction traceability device, electronic device and computer-readable storage medium for the traditional Chinese medicine decoction traceability method, which has the same or corresponding technical features as the traditional Chinese medicine decoction traceability method mentioned above, and has the same effect. Attached Figure Description
[0011] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 A flowchart of the traditional Chinese medicine decoction traceability method provided in this embodiment of the invention; Figure 2 This is a schematic diagram illustrating the interaction between prescription issuance and privacy initialization provided in an embodiment of the present invention; Figure 3 This is a schematic diagram illustrating the interaction between prescription delegation and task allocation provided in an embodiment of the present invention; Figure 4 This is a schematic diagram illustrating the interaction between decoction execution and compliance verification provided in an embodiment of the present invention. Figure 5 This is a schematic diagram illustrating the interaction between delivery completion and status update provided in an embodiment of the present invention; Figure 6 An interactive schematic diagram of trusted traceability and verification provided in an embodiment of the present invention; Figure 7This is a schematic diagram of the structure of the traditional Chinese medicine decoction traceability device provided in an embodiment of the present invention. Detailed Implementation
[0013] 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. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.
[0014] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.
[0015] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0016] The specific application environment architecture or specific hardware architecture on which the traditional Chinese medicine decoction traceability method depends is described here.
[0017] The embodiments of the present invention provide a method for tracing the decoction of traditional Chinese medicine, and the method is described in detail in conjunction with the execution flow of the method. Figure 1 The flowchart of the traditional Chinese medicine decoction traceability method provided in the embodiments of the present invention is as follows: Figure 1 As shown, this method is applied in a decoction center and includes: S101. After the pharmacist's identity verification is successful, receive the encrypted prescription and corresponding on-chain evidence hash sent by the hospital, perform signature confirmation and on-chain evidence storage of key information, and generate a decoction work order.
[0018] It should be noted that in this invention, the decoction center deploys a management system; the management system connects to a blockchain network, off-chain encrypted storage services, and a zero-knowledge proof (ZKP) service engine, and is integrated with the hospital information system, logistics and distribution system, and IoT devices for decoction. This invention issues decentralized distributed digital identity identifiers (DIDs) to each participating entity (physician, pharmacist, decoction operator, logistics personnel). All key operations must be digitally signed using the DID and recorded on the blockchain, ensuring that any step can be accurately traced to a single responsible entity, achieving non-repudiation of responsibility. The DID can be a decentralized identity control module generated and managed by the user. This invention can generate user-exclusive DID identifiers; anchor DID documents (including public keys and server endpoints) to the blockchain; support cross-institutional identity recognition, eliminating centralized dependence on traditional Certificate Authorities (CAs); and support verifiable credential functionality.
[0019] Figure 2 This is a schematic diagram illustrating the interaction between prescription issuance and privacy initialization provided in an embodiment of the present invention. Figure 2 As shown, after logging into the Hospital Information System (HIS) using their own DID, physicians can issue electronic prescriptions for patients within the HIS system. The HIS system can then call an off-chain encrypted data storage service to encrypt the original prescription data, which contains sensitive information such as medicines and dosages, and store it on a secure off-chain storage medium (such as a hospital server or InterPlanetary File System). At the same time, it calculates the hash value of the encrypted prescription. The physician then signs the prescription hash value using their own distributed digital identity private key. The Hospital Information System calls a smart contract to record the patient information, prescription hash value, physician's distributed digital identity signature, timestamp, and prescription status on the blockchain. The smart contract simultaneously mints a unique token representing this service and distributes it to the patient's address.
[0020] Step S101 is the service acceptance stage of the traditional Chinese medicine decoction service in the traceability process. It achieves compliance control from the outset through dual verification and evidence storage. Pharmacist identity verification clarifies the responsible party for the operation, ensuring traceability of task reception. Synchronous reception of encrypted prescriptions and on-chain evidence hashes ensures the confidentiality of prescription data transmission and eliminates the risk of data tampering through hash verification. Signature confirmation and on-chain evidence storage of key information form an electronic contractual closed loop, providing an immutable basis for defining the rights and responsibilities of hospitals and decoction service centers. Finally, the generation of a decoction work order transforms business needs into execution instructions, laying the process foundation for subsequent decoction and delivery stages.
[0021] S102. After decrypting the encrypted prescription, the decoction work order is assigned to the corresponding decoction equipment and personnel. The IoT device is linked to collect the decoction parameters, and zero-knowledge proof is used to verify compliance and update the status of the decoction work order.
[0022] It should be noted that the zero-knowledge proof service engine includes two main functions: off-chain proof generation and on-chain proof verification. At the service provider end (such as a decoction center), the engine generates a zero-knowledge proof that can prove the decoction operation meets the requirements of a prescription without disclosing the prescription content and specific parameters, based on encrypted prescription data and actual decoction parameters collected by the Internet of Things. At the same time, it provides an on-chain verification contract. Any participant can submit the zero-knowledge proof to the contract, which automatically verifies the validity of the proof and records the success / failure verification results on the chain, forming cryptographic evidence that the process was completed compliantly.
[0023] Step S102 is the core execution and compliance verification step of the decoction service. After the encrypted prescription is decrypted, work orders are accurately assigned, and the execution responsibilities of decoction equipment and personnel are determined. IoT devices collect decoction parameters in real time to ensure the objectivity and traceability of process data. Zero-knowledge proof methods complete the compliance verification of decoction operation and prescription requirements without disclosing sensitive prescription information and specific parameters, thus protecting data privacy and building a substantially credible verification mechanism. The synchronous update of work order status provides accurate process node basis for subsequent delivery and traceability links, ensuring that the entire process is manageable and controllable.
[0024] S103. Generate a delivery task based on the updated decoction work order and connect with logistics, record the delivery status on the blockchain, and push the corresponding notification information to the patient.
[0025] Step S103 is the transition point from the execution stage to the delivery stage of the decoction service. Based on the compliantly updated work order, a delivery task is generated and connected to logistics, delivery execution requirements are determined, and business process continuity is ensured. Delivery status is stored on the blockchain to ensure that information such as "in progress" and "completed" is tamper-proof, completing the full-chain traceability loop. Pushing corresponding notifications to patients improves service transparency, satisfies patients' right to know about their medication collection progress, and balances traceability integrity with user experience.
[0026] S104. In response to traceability requests from patients or authorized regulators, aggregate on-chain evidence data, provide privacy-protected verification or authorized original data verification according to preset permissions, and generate a trusted traceability report.
[0027] Step S104 is the final closed-loop link in the entire process traceability of the decoction service. By aggregating the evidence data stored in the chain at all stages, it provides complete data support for traceability requests; it provides privacy-preserving verification (to protect patient privacy) and authorized original data verification (to support regulatory penetration) according to preset permissions, balancing privacy and security with regulatory needs; the finally generated credible traceability report provides patients with evidence of process compliance and regulators with authoritative verification basis, completing the traceability closed loop of "data usable but not visible".
[0028] The above-mentioned traditional Chinese medicine decoction traceability method provided in this invention achieves accurate identity traceability and responsibility definition of operational behavior through pharmacist identity verification and signature confirmation mechanism, effectively solving the problem of responsibility traceability; it realizes automated and reliable storage of core decoction process parameters by automatically collecting core process parameters through IoT devices and completing compliance verification with zero-knowledge proof, thus constructing an automated proof mechanism from "formal compliance" to "substantive reliability"; it breaks down information silos and forms a cross-institutional reliable traceability closed loop by connecting the data links of hospitals, decoction centers, logistics, patients and regulators through on-chain storage; it adopts an efficient "on-chain storage, off-chain storage" collaborative architecture, which ensures data security while taking into account system performance and operating costs; it introduces privacy computing methods such as zero-knowledge proof, which can verify that each step of the decoction process has been executed correctly, achieving a perfect balance between process reliability and data privacy, and can also unlock and verify encrypted off-chain complete data with authorization, supporting penetrating supervision, fundamentally solving the contradiction between process transparency and data privacy, and achieving the goal of "data usable but not visible" reliable traceability.
[0029] It should be noted that the traditional Chinese medicine decoction traceability method of this invention is based on zero-knowledge proof and an on-chain / off-chain collaborative architecture. It addresses the core contradiction between privacy leaks caused by plaintext prescriptions on traditional blockchains and the requirement for business confidentiality by focusing on the compliant circulation and reliable traceability of medical and health data, particularly traditional Chinese medicine prescription data. Through zero-knowledge proof technology to generate process existence verification credentials, collaborative management of off-chain encrypted storage and on-chain hash anchoring, and a full-process transparent supervision mechanism under privacy protection, a reliable infrastructure is constructed that both protects patient prescription privacy and medical prescriptions, while ensuring the immutability and traceability of key decoction processes.
[0030] Furthermore, in specific implementation, in the above-mentioned traditional Chinese medicine decoction traceability method provided in this embodiment of the invention, step S101, after the pharmacist's identity verification is successful, receives the encrypted prescription and corresponding on-chain notarized hash sent by the hospital, performs signature confirmation and on-chain notarization of key information, and generates a decoction work order. Specifically, this may include: receiving the encrypted prescription data and corresponding blockchain notarized hash sent by the hospital, verifying the integrity of the hash value, and triggering a task reminder after confirming that the data has not been tampered with; authorizing the pharmacist to log in to the decoction center, enter their personal identity credentials to complete identity verification, and after successful verification, displaying basic task information to the pharmacist; and after the pharmacist confirms receipt of the task, allocating additional... The process involves several steps: First, a decryption key is used for the prescription. This key is temporarily stored and destroyed after use. Second, a digital signature request is initiated. After authorization by the pharmacist, a digital signature is generated for the task reception using the pharmacist's personal private key, and this signature is synchronized to the decoction center. Third, a task reception receipt containing the digital signature is sent to the hospital information system, completing the electronic signing confirmation between both parties. Fourth, a blockchain smart contract is invoked to submit key information, including the prescription hash, decoction center identifier, digital signature, and reception timestamp, to the blockchain for evidence storage. After consensus is reached among the blockchain nodes, a successful transaction receipt is received, a decoction work order is generated internally, and the work order is placed in the execution queue.
[0031] Figure 3 This is a schematic diagram illustrating the interaction between prescription delegation and task allocation provided in an embodiment of the present invention. In implementation, as... Figure 3 As shown, after a physician initiates a "decoction commission" instruction for a prescription that has already been encrypted and stored in the HIS system, the HIS system does not transmit the original prescription. Instead, it sends the encrypted prescription data along with its unique on-chain storage hash to the decoction commissioning center system. The authorized pharmacist at the decoction commissioning center logs in using their personal DID and completes identity verification. After confirming receipt of the task, they obtain a prescription decryption key that does not contain patient data. The decoction commissioning center system then generates a "task acceptance" digital signature based on the pharmacist's DID private key on behalf of the pharmacist and sends a confirmation receipt containing this signature back to the HIS system, completing the electronic agreement between the two parties. The HIS system calls a smart contract to store key information such as the prescription hash, the decoction commissioning center's DID, the pharmacist's signature, and the timestamp on the blockchain. After the blockchain nodes reach a consensus and return a success receipt, the HIS system sends a "commission successful" message to the physician. Simultaneously, after confirming the on-chain storage, the decoction commissioning center system generates an internal decoction work order and places it in the execution queue, preparing for the subsequent decoction execution and compliance verification stages.
[0032] The above process ensures the confidentiality and integrity of prescription data transmission through encrypted transmission and hash verification, and uses DID identity authentication and digital signature to accurately bind the operating subject and the task, giving the entrustment process non-repudiation and legal effect. On-chain evidence storage solidifies key entrustment information, ensuring that the entrustment process is open, transparent and tamper-proof. At the same time, electronic signing and process closure improve business collaboration efficiency, which not only clarifies the boundaries of rights and responsibilities between hospitals and decoction centers, but also lays a credible foundation for full-process traceability, effectively avoiding risks such as data leakage and unclear responsibilities.
[0033] Furthermore, in specific implementation, in the above-mentioned traditional Chinese medicine decoction traceability method provided in the embodiments of the present invention, after decrypting the encrypted prescription, step S102 allocates the decoction work order to the corresponding decoction equipment and personnel, and links the Internet of Things (IoT) device to collect decoction parameters. Specifically, this may include: allocating the decoction work order to the designated decoction equipment and corresponding decoction personnel in queue order, so that the decoction personnel can view the list of tasks to be executed on the interface, find the medicine package corresponding to the work order, and scan the identification label on the medicine package with a handheld device; after verifying that the binding relationship between the identification label and the decoction work order is correct, sending a start command to the IoT device containing the decoction equipment; encrypting and loading the decoction parameters corresponding to the prescription into the IoT device, so that the IoT device enters the standby state after receiving the parameters; after the decoction personnel confirm that the medicine package is correctly placed, starting the IoT device, collecting process parameters and uploading them to the decoction center through an encryption protocol; after the decoction is completed, the IoT device sends a completion signal to the decoction center.
[0034] Figure 4 This is a schematic diagram illustrating the interaction between decoction execution and compliance verification provided in an embodiment of the present invention. In implementation, as... Figure 4 As shown, the decoction center system decrypts the encrypted prescription (obtaining plaintext prescription information without patient data), generates a decoction work order containing bound Radio Frequency Identification (RFID) information, and assigns the work orders to specific decoction equipment and decoction personnel according to the queue order. The system interface simultaneously displays a list of tasks to be decocted. The decoction personnel find the corresponding medicine pack based on the work order information, scan the RFID tag of the medicine pack with a handheld device, triggering the system to send a start command to the IoT device (including the decoction equipment) and load the encrypted decoction parameters corresponding to the prescription (such as decocting first, adding last, duration, temperature, etc.). After the IoT device is started, it automatically collects key process parameters such as decoction temperature, holding time, and pressure in real time and uploads the data to the decoction center system.
[0035] The above process accurately assigns work orders and binds them to RFID tags after decryption, confirming the correspondence between the executing entity and the task, thus improving operational standardization. Data from the decoction process is automatically collected by IoT devices and uploaded to the blockchain in real time after being signed by the operator's DID, ensuring the authenticity and reliability of core process data and providing irrefutable electronic evidence for service quality and accident traceability.
[0036] Furthermore, in specific implementation, in the above-mentioned traditional Chinese medicine decoction traceability method provided in the embodiments of the present invention, step S102 uses zero-knowledge proof to perform compliance verification and update the status of the decoction work order. Specifically, it may include: after receiving the completion signal, triggering the zero-knowledge proof engine to start, the engine synchronously retrieves the prescription standard decoction requirements in the off-chain encrypted storage and the actual process parameters uploaded by the equipment; the zero-knowledge proof engine runs the algorithm off-chain to generate a proof document; submitting the proof document to the blockchain smart contract, the verification contract on the blockchain verifies the validity of the proof document, and only returns a compliant result or a non-compliant result; after receiving the compliance result returned by the blockchain, updating the status of the decoction work order to "decoction completed", and simultaneously pushing a delivery notification to the logistics and distribution system.
[0037] In implementation, such as Figure 4 As shown, after the decoction center system triggers the zero-knowledge proof service engine, the engine retrieves the encrypted prescription standard requirements from off-chain storage and simultaneously retrieves the actual decoction data uploaded by IoT devices. It then runs a zero-knowledge proof algorithm off-chain to generate a zero-knowledge proof. This proof confirms that "the actual decoction parameters fully comply with the prescription standard requirements" without revealing the specific content of the prescription (such as what medicine it is and how much). The decoction center system then calls a smart contract to submit the zero-knowledge proof to the blockchain network. A pre-built verification smart contract on the chain performs a pure mathematical verification of the proof's validity (without involving the original data) and returns a verification result of "yes" (compliant) or "no" (non-compliant). After receiving the successful verification receipt, the decoction center system updates the decoction work order status to "decoction completed" (this status is based solely on the blockchain verification result as the only reliable basis) and simultaneously pushes a "medicine has been decocted" notification to the logistics system or administrator interface to prepare for subsequent delivery.
[0038] After introducing privacy-preserving computing technologies such as zero-knowledge proofs, the above process can verify the compliance of the decoction process with patients and logistics providers without disclosing prescription details. Internally, it can unlock complete off-chain data with authorization, supporting regulatory agencies and dispute arbitration parties to achieve transparent supervision and protect patient privacy and prescription security.
[0039] Furthermore, in specific implementation, in the above-mentioned traditional Chinese medicine decoction traceability method provided in this embodiment of the invention, step S103 generates a delivery task based on the updated decoction work order and connects with logistics, records the delivery status on the blockchain, and pushes corresponding notification information to the patient. Specifically, this may include: after pushing a delivery notification to the logistics and delivery system, generating a delivery task based on the updated decoction work order and assigning the delivery task to the corresponding delivery person; after the decoction person or warehouse manager completes the physical handover of the completed decoction and labeled medicine package with the delivery person, the delivery person confirms receipt of the medicine package through the terminal to complete the acceptance. The process involves: the terminal triggering a service status update request; invoking the blockchain smart contract to update the service status of the prescription to "delivering," and recording the update on the blockchain for evidence storage; after the delivery person delivers the medicine package to the patient and the patient confirms receipt, the patient clicks "delivery complete" on the terminal, triggering the smart contract again; the blockchain smart contract finally updates the service status to "completed" and returns a success receipt; the success receipt is received and recorded, and the work order is archived; based on the status update result returned by the blockchain, a notification message indicating that the medicine has been delivered is sent to the patient's terminal to inform the patient that the traditional Chinese medicine decoction service has been completed.
[0040] Figure 5 This is a schematic diagram illustrating the interaction between delivery completion and status update provided in an embodiment of the present invention. In implementation, as... Figure 5 As shown, after the decoction center system updates the decoction work order status to "decocted," it automatically or manually generates a delivery task bound to the medicine package and patient information, and assigns it to the logistics delivery system or a specific delivery person. The decoction clerk or warehouse manager hands over the labeled decocted medicine package to the delivery person. After the delivery person confirms the order through the terminal, the logistics system or the decoction center system calls the smart contract to update the on-chain prescription status to "delivering." After the blockchain completes the processing, a transaction receipt is returned. After the delivery person delivers the medicine package to the patient and confirms "delivery completed" on the terminal, the system calls the smart contract again to finally update the on-chain status to "completed," marking the end of the entire decoction service process. At the same time, the system triggers the system to send a "medication delivered" notification to the patient.
[0041] The precise binding of delivery tasks with medicine packages and patient information in the above process, combined with the immutable evidence storage of delivery statuses such as in progress and completed via blockchain, achieves full traceability of the logistics process and clarifies the handover responsibilities of each party. The linkage between the deliveryman's terminal confirmation and the on-chain status update ensures the real-time nature and credibility of the status information and avoids information asymmetry. The automatic push notification of delivery to the patient enhances the service experience. The entire process completes the closed-loop traceability of the decoction service from the completion of decoction to the patient's signature, further strengthening the transparency and credibility of the entire process.
[0042] Furthermore, in specific implementation, in the above-mentioned traditional Chinese medicine decoction traceability method provided in the embodiments of the present invention, step S104 responds to the traceability request of the patient or authorized regulatory party, aggregates on-chain evidence data, provides privacy-protected verification or authorized original data verification according to preset permissions, and generates a trusted traceability report, including: receiving a traceability request initiated by the patient or authorized regulatory party by scanning the medicine package label and entering the query code, triggering the traceability response process; querying and aggregating service evidence records from the blockchain to form an evidence chain; generating a visual process timeline for the patient's traceability request to display the time and execution status of each step, while providing a zero-knowledge proof validity verification entry point so that the patient only needs to confirm the compliance of the process; for the regulatory party's traceability request, receiving the legal authorization certificate submitted by the regulatory party and verifying it, providing the regulatory party with encrypted original data, and assisting the regulatory party in verifying the consistency between the off-chain original data and the on-chain evidence hash; generating a trusted traceability report; the trusted traceability report includes evidence summary, verification path and results, serving as a valid proof document for the compliance of this traditional Chinese medicine decoction service.
[0043] Figure 6 This is a schematic diagram illustrating the interaction between trusted traceability and verification provided in an embodiment of the present invention. In implementation, as... Figure 6 As shown, patients or authorized regulators can initiate a full-process traceability request by scanning the QR code on the medicine package or entering the query code on the terminal (APP or mini-program). After the system is triggered, it automatically queries and aggregates the evidence stored at each stage of the service from the blockchain. These evidences can include records such as prescription hashes, task assignments, and successful zero-knowledge proof verifications, all with timestamps and the operator's DID signature, forming a complete and credible chain of evidence. Subsequently, verification and result generation are completed through a dual path: privacy-protected verification is provided for patients, displaying a visual process timeline (such as "prescription issued", "commission successful", "decoction completed", "delivered"), and providing an entry point for verifying zero-knowledge proofs. Patients can confirm that each step has been executed correctly, but cannot view the specific contents of the prescription (such as herbs and dosages), achieving data usability without visibility. Authorized in-depth verification is provided for regulators. If regulators need to conduct in-depth investigations (such as in the event of a quality dispute), they can apply to the decoction center system for access to encrypted raw data (such as the plaintext prescription and detailed decoction parameters) after obtaining additional authorization (such as patient authorization or judicial order). On-chain notarized hashes can be used to verify whether off-chain data has been tampered with during transmission and storage, thus enabling transparent oversight. The system ultimately generates a comprehensive, credible traceability report. This report not only includes a summary of all on-chain notarized data but also clearly records the verification path and results, proving that the entire process from prescription issuance to drug delivery is authentic, compliant, and traceable.
[0044] The above process employs a dual-path verification mechanism to both protect patient privacy (without disclosing core prescription information) and meet the regulatory authorities' need for thorough verification, thus balancing privacy protection and regulatory compliance. The on-chain aggregation of evidence across all stages forms an immutable chain of evidence, providing strong trust endorsement for the traceability results. The visualized timeline and credible reports enhance the readability and authority of the traceability results, facilitating quick confirmation of process compliance by patients and providing clear evidence for handling quality disputes. Ultimately, this completes a closed-loop system for the entire process of decoction preparation services, ensuring traceability and verifiability at every stage.
[0045] Furthermore, in specific implementation, the above-mentioned traditional Chinese medicine decoction traceability method provided in the embodiments of the present invention may further include: if hash verification fails when receiving hospital data, the task is rejected and a data anomaly signal is sent back to the hospital; if the data collection of the IoT device is interrupted, an alarm is issued to notify the decoction operator to check the equipment failure, and after the failure is resolved and the device retransmits the missing data, the data integrity is re-verified before triggering the generation of zero-knowledge proof; if the zero-knowledge proof verification result is non-compliant, the decoction work order is frozen, prohibiting it from entering the delivery process, and the pharmacist is notified to review the decoction parameters and prescription requirements; if the patient cancels the decoction request, the blockchain smart contract is invoked to update the service status to canceled, and the relevant operation record is uploaded to the chain, and the hospital and relevant parties are notified.
[0046] In implementation, this invention can build a full-process risk prevention and control system by setting multiple scenario anomaly handling rules: when hash verification fails, tasks are rejected and data anomalies are reported, blocking the flow of tampered or damaged data from the source; when data collection by IoT devices is interrupted, alarms are triggered and data retransmission is required to ensure the integrity of core process data; if zero-knowledge proof verification does not comply with the rules, work orders are frozen, delivery is prohibited, and a review is initiated to prevent the outflow of non-compliant drugs; when a patient cancels a request, the status is updated through a smart contract and recorded on the blockchain to ensure that the change operation is traceable.
[0047] This invention constructs a cross-domain identity mutual recognition layer based on DID, enabling signatures and vouchers in cross-institutional collaborative processes such as prescription issuance, drug dispensing, decoction entrustment, and logistics distribution to be verified by all participants, forming a complete and reliable business and traceability closed loop. The multi-dimensional anomaly handling mechanism further strengthens the reliability of this closed loop, avoiding the impact of data tampering, process violations, and equipment failures on service compliance, and ensuring the transparency and traceability of the anomaly handling process through on-chain evidence storage and cross-institutional mutual recognition. Ultimately, it achieves risk controllability and accountability throughout the entire decoction service process, improving the credibility and service quality of cross-institutional collaboration.
[0048] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.
[0049] An embodiment of the present invention also provides a traditional Chinese medicine decoction traceability device. Figure 7 This is a schematic diagram of the traditional Chinese medicine decoction traceability device provided in an embodiment of the present invention. This embodiment is based on functional modules, such as… Figure 7 As shown, this device is used in a decoction center and includes: The work order generation module 10 is used to receive the encrypted prescription and corresponding on-chain storage hash sent by the hospital after the pharmacist's identity verification is successful, perform signature confirmation and on-chain storage of key information, and generate a decoction work order. The work order allocation module 11 is used to decrypt the encrypted prescription and allocate the decoction work order to the corresponding decoction equipment and personnel, link IoT devices to collect decoction parameters, use zero-knowledge proof to verify compliance and update the status of the decoction work order. Delivery processing module 12 is used to generate delivery tasks based on the updated decoction work order and connect with logistics, record the delivery status on the blockchain, and push corresponding notification information to patients. The traceability verification module 13 is used to respond to traceability requests from patients or authorized regulators, aggregate on-chain evidence data, provide privacy-protected verification or authorized original data verification according to preset permissions, and generate a reliable traceability report.
[0050] In the above-mentioned traditional Chinese medicine decoction traceability device provided in this embodiment of the invention, the pharmacist identity verification and signature confirmation mechanism realizes accurate identity traceability and responsibility definition of operation behavior, effectively solving the problem of responsibility traceability; by automatically collecting core decoction process parameters through IoT devices and combining them with zero-knowledge proof to complete compliance verification, the device realizes automated and reliable evidence storage of core decoction process parameters, constructing an automated proof mechanism from "formal compliance" to "substantive reliability"; by storing evidence on the blockchain, the device connects the data links of hospitals, decoction centers, logistics, patients and regulators, breaking down information silos and forming a reliable traceability closed loop across institutions; by adopting an efficient "on-chain evidence storage, off-chain storage" collaborative architecture, the device ensures data security while taking into account system performance and operating costs; by introducing privacy computing methods such as zero-knowledge proof, the device can verify that each step of the decoction process has been executed correctly, achieving a perfect balance between process reliability and data privacy, and can also unlock and verify encrypted off-chain complete data with authorization, supporting penetrating supervision, fundamentally solving the contradiction between process transparency and data privacy, and achieving the goal of "data usable but not visible" reliable traceability.
[0051] Since the embodiments of the traditional Chinese medicine decoction traceability device and the traditional Chinese medicine decoction traceability method correspond to each other, the descriptions of the features in the embodiments corresponding to the traditional Chinese medicine decoction traceability device can be found in the relevant descriptions of the embodiments corresponding to the traditional Chinese medicine decoction traceability method, and will not be repeated here. Furthermore, it has the same beneficial effects as the traditional Chinese medicine decoction traceability method mentioned above.
[0052] Furthermore, in specific implementation, the above-mentioned traditional Chinese medicine decoction traceability device provided in the embodiments of the present invention may also include: a fault handling module, used to refuse to receive the task and send a data abnormality signal to the hospital if the hash verification fails when receiving hospital data; if the data collection of the IoT device is interrupted, an alarm is issued to notify the decoction operator to check the equipment fault, and after the fault is eliminated and the device retransmits the missing data, the data integrity is re-verified before triggering the generation of zero-knowledge proof; if the zero-knowledge proof verification result is non-compliant, the decoction work order is frozen, prohibiting it from entering the delivery process, and the pharmacist is notified to review the decoction parameters and prescription requirements; if the patient cancels the decoction request, the blockchain smart contract is invoked to update the service status to canceled, and the relevant operation record is uploaded to the chain, and the hospital and relevant parties are notified.
[0053] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the traditional Chinese medicine decoction traceability method.
[0054] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the traditional Chinese medicine decoction traceability method.
[0055] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0056] The embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the embodiments of the traditional Chinese medicine decoction traceability method described above.
[0057] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the traditional Chinese medicine decoction traceability method.
[0058] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0059] The above provides a detailed description of the method, apparatus, equipment, and medium for tracing the decoction of traditional Chinese medicine provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.
Claims
1. A method for tracing the decoction of traditional Chinese medicine, characterized in that, Applications in decoction centers include: After the pharmacist's identity verification is successful, the encrypted prescription and corresponding on-chain evidence hash sent by the hospital are received, the signature is confirmed and the key information is stored on the chain, and a decoction work order is generated. After decrypting the encrypted prescription, the decoction work order is assigned to the corresponding decoction equipment and personnel. The Internet of Things device is linked to collect decoction parameters, and zero-knowledge proof is used to verify compliance and update the status of the decoction work order. Based on the updated decoction work order, a delivery task is generated and connected with logistics. The delivery status is recorded on the blockchain and corresponding notification information is pushed to the patient. In response to traceability requests from patients or authorized regulators, the system aggregates on-chain evidence data, provides privacy-protected verification or authorized raw data verification according to preset permissions, and generates a reliable traceability report.
2. The method for tracing the decoction of traditional Chinese medicine according to claim 1, characterized in that, After the pharmacist's identity verification is successful, the encrypted prescription and corresponding on-chain notarized hash sent by the hospital are received. The pharmacist then performs signature confirmation and on-chain notarization of key information, generating a decoction work order, including: Receive encrypted prescription data and corresponding blockchain notarization hash sent by the hospital, verify the integrity of the hash value, and trigger a task reminder when it is confirmed that the data has not been tampered with; Authorized pharmacists log in to the decoction center, enter their personal identification credentials to complete identity verification, and after verification, show the pharmacist the basic information of the task. After the pharmacist confirms receipt of the task, a decryption key for the encrypted prescription is assigned; the decryption key uses a temporary storage mechanism and is destroyed after use. A digital signature request is initiated. After authorization by the pharmacist, a digital signature is generated for the task receiving behavior using the pharmacist's personal private key, and the digital signature is synchronized to the decoction center. The task receipt containing the digital signature is sent to the hospital information system to complete the electronic signing confirmation between the two parties. The blockchain smart contract is invoked to submit key information, including prescription hash, decoction center identifier, digital signature, and receiving timestamp, to the blockchain for notarization. After the blockchain nodes reach a consensus and confirm, a successful transaction receipt is received, a decoction work order is generated internally, and the decoction work order is placed in the execution queue.
3. The method for tracing the decoction of traditional Chinese medicine according to claim 1, characterized in that, After decrypting the encrypted prescription, the decoction work order is assigned to the corresponding decoction equipment and personnel, and IoT devices are linked to collect decoction parameters, including: The decoction work orders are assigned to the designated decoction equipment and corresponding decoction operators according to the queue order, so that the decoction operators can view the list of tasks to be executed on the interface, find the medicine pack corresponding to the work order, and use a handheld device to scan the identification label on the medicine pack. After verifying that the binding relationship between the identification tag and the decoction work order is correct, a start command is sent to the IoT device containing the decoction equipment; The decoction parameters corresponding to the prescription are encrypted and loaded into the IoT device. After receiving the parameters, the IoT device enters a standby state. After the decoction operator confirms that the medicine packet is put in the correct position, the IoT device is activated to collect the process parameters and upload them to the decoction center through an encryption protocol. After the decoction is completed, the IoT device sends a completion signal to the decoction center.
4. The method for tracing the decoction of traditional Chinese medicine according to claim 3, characterized in that, Zero-knowledge proofs are used to perform compliance checks and update the status of the decoction work order, including: Upon receiving the completion signal, the zero-knowledge proof engine is triggered to start. The engine synchronously retrieves the prescription standard decoction requirements from the off-chain encrypted storage and the actual process parameters uploaded by the device. The zero-knowledge proof engine runs the algorithm off-chain to generate a proof file. The supporting documents are submitted to a blockchain smart contract, and the verification contract on the blockchain verifies the validity of the supporting documents, returning only a compliant or non-compliant result. Upon receiving the compliance result returned by the blockchain, the status of the decoction work order is updated to "decoction completed," and a delivery notification is pushed to the logistics and delivery system.
5. The method for tracing the decoction of traditional Chinese medicine according to claim 1, characterized in that, Based on the updated decoction work order, a delivery task is generated and connected to logistics. The delivery status is recorded on the blockchain and corresponding notification information is pushed to the patient, including: After pushing a delivery notification to the logistics and distribution system, a delivery task is generated based on the updated decoction work order, and the delivery task is assigned to the corresponding delivery person; after the decoction person or warehouse manager completes the physical handover of the decoction package with the label and the delivery person, the delivery person confirms receipt of the medicine package through the terminal to complete the order acceptance; the terminal triggers a service status update request. The blockchain smart contract is invoked to update the service status of the prescription to "delivering" and the update record is stored on the blockchain for evidence. After the delivery person delivers the medicine package to the patient and the patient confirms receipt, the patient clicks "delivery complete" on the terminal, which triggers the smart contract call again. The blockchain smart contract finally updates the service status to "completed" and returns a success receipt. Receive and record the update success receipt, and complete the work order archiving; Based on the status update results returned by the blockchain, a notification message indicating that the medicine has been delivered is sent to the patient's terminal to inform the patient that the traditional Chinese medicine decoction service has been completed.
6. The method for tracing the decoction of traditional Chinese medicine according to claim 1, characterized in that, In response to traceability requests from patients or authorized regulators, the system aggregates on-chain evidence data, provides privacy-preserving verification or authorized raw data verification according to preset permissions, and generates a reliable traceability report, including: Upon receiving a traceability request initiated by a patient or authorized regulator by scanning the medicine package label and entering the query code, the traceability response process is triggered. Query and aggregate service storage records from the blockchain to form a chain of evidence; In response to patients' traceability requests, a visual process timeline is generated to show the time and execution status of each step, while providing an entry point for verifying the validity of zero-knowledge proofs so that patients can simply confirm that the process is compliant. In response to regulatory requests for traceability, after receiving and verifying the legal authorization credentials submitted by the regulator, the system provides the regulator with encrypted original data and assists the regulator in verifying the consistency between the off-chain original data and the on-chain evidence hash. Generate a credible traceability report; the credible traceability report includes a record summary, verification path and results, serving as valid proof of compliance for this traditional Chinese medicine decoction service.
7. The method for tracing the decoction of traditional Chinese medicine according to claim 1, characterized in that, Also includes: If a hash verification fails when receiving data from a hospital, the task is rejected and a data anomaly signal is sent to the hospital. If the IoT device fails to collect data, an alarm will be issued to notify the herbal medicine preparer to check for equipment failure. After the failure is resolved and the device retransmits the missing data, the data integrity will be re-verified before the generation of zero-knowledge proof is triggered. If the zero-knowledge proof verification result is non-compliant, the decoction work order will be frozen, prohibited from entering the delivery process, and the pharmacist will be notified to review the decoction parameters and prescription requirements. If a patient cancels their decoction service request, the blockchain smart contract will be invoked to update the service status to "cancelled," and the relevant operation record will be uploaded to the blockchain, notifying the hospital and relevant parties.
8. A traditional Chinese medicine decoction traceability device, characterized in that, Applications in decoction centers include: The work order generation module is used to receive the encrypted prescription and corresponding on-chain evidence hash sent by the hospital after the pharmacist's identity verification is successful, perform signature confirmation and on-chain evidence storage of key information, and generate a decoction work order. The work order allocation module is used to decrypt the encrypted prescription and allocate the decoction work order to the corresponding decoction equipment and personnel, link IoT devices to collect decoction parameters, use zero-knowledge proof to perform compliance verification and update the status of the decoction work order. The delivery processing module is used to generate delivery tasks based on the updated decoction work order and connect with logistics, record the delivery status on the blockchain, and push corresponding notification information to patients. The traceability verification module is used to respond to traceability requests from patients or authorized regulators, aggregate on-chain evidence data, provide privacy-protected verification or authorized raw data verification according to preset permissions, and generate a reliable traceability report.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor is configured to execute the computer program to implement the steps of the traditional Chinese medicine decoction traceability method as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the traditional Chinese medicine decoction traceability method as described in any one of claims 1 to 7.