Method and system for digitally tracing hemp essence medicine
By attaching unique, dynamically writable RFID tags to narcotic and psychotropic drugs and building a multi-channel isolated consortium blockchain framework, the problem of reliable, transparent, efficient traceability and closed-loop supervision of narcotic and psychotropic drugs throughout their entire life cycle has been solved, and the secure storage and supervision of data throughout the entire process has been achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-18
- Publication Date
- 2026-05-26
AI Technical Summary
Existing technologies cannot achieve reliable, transparent, efficient traceability and closed-loop supervision of narcotic and psychotropic drugs throughout their entire life cycle. They suffer from problems such as the inability to dynamically update identification information, inadequate isolation of business data, incomplete coverage of data throughout the entire process, unclear encryption mechanisms, and a lack of supervision over consumer verification and recycling processes.
Production information is encrypted using unique, dynamically writable RFID tags. A blockchain system is built based on a multi-channel isolated consortium blockchain framework to achieve independent storage and synchronization of data from production, logistics, and sales channels. The data is encrypted using national cryptographic algorithms, decrypted and aggregated by regulatory authorities, and can be queried by consumers, thus constructing a closed loop for full-process traceability.
It enables reliable, transparent, and efficient traceability of narcotic and psychotropic drugs throughout their entire lifecycle, solving problems such as unupdable labeling information, inadequate isolation of business data, incomplete coverage of data throughout the entire process, unclear encryption mechanisms, lack of consumer verification, and lack of supervision over the recycling process, thus ensuring drug safety and controllability.
Smart Images

Figure CN122089330A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to a method for digital traceability of narcotic and psychotropic drugs, and also to a system for implementing this method, belonging to the field of pharmaceutical logistics management technology. Background Technology
[0002] As a class of controlled substances possessing both special medical value and potential abuse risks, the standardization of their full life-cycle management directly relates to public medication safety and social order. For a long time, the traditional management model, limited by technological means, has remained primarily manual—from production and warehousing to pharmacy dispensing and empty bottle recycling, each step relies on handwritten ledgers and manual verification. This model is not only inefficient, requiring significant time for data processing and cross-verification, but also prone to errors due to the subjectivity and randomness of manual operations, such as omissions, illegible handwriting, and incorrect information entry. This creates "breakpoints" in drug traceability: the inability to accurately track the complete flow of a single drug from production to use. Once drug loss or abuse occurs, it is difficult to quickly pinpoint the problem, leaving loopholes for illegal drug acquisition and posing a direct threat to public safety.
[0003] To overcome the limitations of manual management, existing digital traceability solutions have been explored, but significant technical flaws and management loopholes remain. Current mainstream models can be divided into two categories: pharmaceutical company-built systems and third-party platforms. Both employ a centralized storage architecture, concentrating data management authority in the hands of a single entity. Since these entities are themselves stakeholders in the supply chain, when the traceability information they store involves their own responsibilities (e.g., excessive temperature and humidity during logistics, or irregular sales shipments), they have an incentive to tamper with or delete negative records, compromising the authenticity and credibility of the traceability results. Furthermore, existing solutions largely rely on barcodes with limited information capacity as an identification method. Once generated, this data cannot be dynamically updated, resulting in traceability information often only covering the production stage, lacking crucial data such as temperature and humidity during logistics, transportation routes, and sales personnel and time information in the sales stage. This creates a broken data chain: "production is recorded, circulation is untracked, and sales are untraceable." In addition, centralized architectures are relatively weak in security protection and are susceptible to attacks or failures, which increases the risk of data loss and further exacerbates the possibility of drug swapping and theft during the circulation process, making it difficult to meet the strict regulatory requirements of "full control, traceability of source, and traceability of destination" for narcotic and psychotropic drugs.
[0004] In existing technologies, for example, Chinese patent application CN109993546A proposes a drug traceability system based on RFID and blockchain. This system collects data through RFID readers and stores it in the blockchain, employing a consortium blockchain and multi-channel architecture to achieve data isolation and privacy protection. However, this system still has several shortcomings: identification information cannot be dynamically updated during circulation; there is a lack of effective isolation between business processes; downstream data (such as logistics temperature and humidity, and sales-related prescriptions) is incompletely recorded; the encryption mechanism does not explicitly support regulatory intervention; there is a lack of consumer-side query and verification; empty bottle recycling information is not systematically recorded; and there is still room for improvement in privacy protection.
[0005] In summary, current technologies have not yet been able to construct a digital traceability system for narcotic and psychotropic drugs that features dynamically updatable identifiers, robust isolation of business data, complete data coverage across the entire process, a balance between encryption and regulatory mechanisms, support for consumer verification, and coverage of the recycling stage. Therefore, there is an urgent need to propose a new technical solution to address these issues and achieve reliable, transparent, efficient traceability and closed-loop regulation of narcotic and psychotropic drugs throughout their entire lifecycle. Summary of the Invention
[0006] The primary technical problem to be solved by this invention is to provide a method for digital traceability of narcotic and psychotropic drugs.
[0007] Another technical problem to be solved by the present invention is to provide a system for digital traceability of narcotic and psychotropic drugs.
[0008] To achieve the above-mentioned technical objectives, the present invention adopts the following technical solution: According to a first aspect of the present invention, a method for digital traceability of narcotic and psychotropic drugs is provided, comprising the following steps: S1: Pharmaceutical companies affix a unique, dynamically writable RFID tag to the smallest sales unit of narcotic and psychotropic drugs, and then encrypt the production information using national cryptographic algorithms before recording it into the tag; S2: Build a blockchain system based on a consortium blockchain framework that supports multi-channel isolation. The blockchain system includes a production channel, a logistics channel, and a sales channel; upload the encrypted production information to the distributed ledger of the production channel; S3: Distributors collect logistics information of medicines through RFID reading and writing devices, encrypt it using national cryptographic algorithms, and append it to the distributed ledger of the logistics channel; the logistics information includes transportation temperature and humidity data; S4: The pharmacy collects drug sales information through RFID reading and writing equipment, associates it with de-identified prescription information, encrypts it using national cryptographic algorithms, and uploads it to the distributed ledger of the sales channel; wherein, the sales information includes sales time, store number, and sales personnel; S5: Regulatory authorities use the private keys backed up by the blockchain certificate center to decrypt and obtain the full-process data of each channel and summarize them to form a regulatory database; at the same time, based on the regulatory database, they open a query interface to consumers, allowing consumers to query traceability information through the unique drug code, thus forming a traceability closed loop.
[0009] Preferably, in step S2, the blockchain certificate center generates a public-private key pair of national cryptographic algorithm for each participant during node authentication, and backs up the private key to the regulatory authority's dedicated key management system for decryption and access by the regulatory authority.
[0010] Preferably, in step S2, the production channel, the logistics channel, and the sales channel are independent of each other, and the data between each channel is synchronized through a relay chain for information digest synchronization.
[0011] Preferably, the production channel, the logistics channel, and the sales channel are all equipped with smart contracts to automatically trigger compliance checks during the drug circulation process and freeze the circulation rights of the relevant drugs when data is abnormal.
[0012] Preferably, the smart contract is configured as follows: When the distributed ledger records of the logistics channel show that the transportation temperature and humidity of a certain batch of medicines continuously exceed the preset threshold, or when the distributed ledger records of the sales channel show that the sales frequency for the same patient is abnormal, the subsequent circulation rights of that batch or the associated medicines will be automatically triggered and frozen.
[0013] Preferably, step S4 further includes: The pharmacy collects empty bottle recycling information through RFID reading and writing devices and uploads it in encrypted form to the distributed ledger of the sales channel.
[0014] According to a second aspect of the present invention, a system for digital traceability of narcotic and psychotropic drugs is provided, comprising: The pharmaceutical supply chain layer is used to generate traceability data in the production, transportation, distribution, sales, and recycling of pharmaceuticals. The data acquisition layer interacts with the pharmaceutical supply chain layer and is used to automatically collect the traceability data through RFID tags and various RFID reading and writing devices. The blockchain layer, connected to the data acquisition layer, is used to write encrypted traceability data into the distributed ledgers of the corresponding production, logistics, and sales channels according to business type, and to realize cross-channel information synchronization, smart contract verification, and grant full access to data for regulatory authorities.
[0015] Preferably, the data acquisition layer includes: The RFID tag unit is a passive UHF band tag that is attached to the smallest sales unit of medicines and supports dynamic writing; The RFID reading and writing device unit includes industrial-grade reading and writing devices, fixed reading and writing devices, handheld reading and writing devices, and vehicle-mounted reading and writing devices, which are used for non-contact reading or writing of data in the RFID tag unit.
[0016] Preferably, the blockchain layer includes: Multi-channel architecture units are used to build independent production channels, logistics channels, and sales channels; Distributed ledger units are used for time-series storage of encrypted traceability data for each channel; Smart contract units are used to automatically perform compliance checks and process control in various channels; The certificate center unit is used to generate public and private key pairs for nodes using national cryptographic algorithms and to back up the private keys to regulatory authorities. The relay chain unit is used to synchronize information summaries between the production channel, the logistics channel, and the sales channel.
[0017] Preferably, the production, logistics, and sales channels of the blockchain layer all employ a practical Byzantine fault-tolerant consensus algorithm to ensure the correctness of the consensus in the presence of malicious nodes.
[0018] Compared with existing technologies, this invention solves the problems of non-updatable identification information, lack of business isolation, lack of midstream and downstream data, unclear encryption and supervision design, lack of consumer verification, lack of recycling supervision, and lack of privacy protection in existing technologies by attaching a unique, dynamically writable RFID tag to the smallest packaging of narcotic and psychotropic drugs, constructing a blockchain multi-channel architecture, automatically collecting full-dimensional data such as logistics temperature and humidity and sales prescriptions, adopting national cryptographic encryption and regulatory key backup, opening a consumer query interface, recording empty bottle recycling information and de-identifying prescription association. Attached Figure Description
[0019] Figure 1 This is a flowchart of a method for digital traceability of narcotic and psychotropic drugs in the first embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of a digital traceability system for narcotic and psychotropic drugs in the second embodiment of the present invention. Detailed Implementation
[0020] The technical content of the present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0021] First Embodiment like Figure 1 As shown, the first embodiment of the present invention provides a method for digital traceability of narcotic and psychotropic drugs, which includes at least the following steps: S1: Pharmaceutical companies affix a unique, dynamically writable RFID tag to the smallest sales unit of narcotic and psychotropic drugs, and then encrypt the production information using national cryptographic algorithms before recording it into the tag; S2: Build a blockchain system based on a consortium blockchain framework that supports multi-channel isolation. The blockchain system includes a production channel, a logistics channel, and a sales channel; upload the encrypted production information to the distributed ledger of the production channel; S3: Distributors collect logistics information of medicines through RFID reading and writing devices, encrypt it using national cryptographic algorithms, and append it to the distributed ledger of the logistics channel; the logistics information includes transportation temperature and humidity data; S4: The pharmacy collects drug sales information through RFID reading and writing equipment, associates it with de-identified prescription information, encrypts it using national cryptographic algorithms, and uploads it to the distributed ledger of the sales channel; wherein, the sales information includes sales time, store number, and sales personnel; S5: Regulatory authorities use the private keys backed up by the blockchain certificate center to decrypt and obtain the full-process data of each channel and summarize them to form a regulatory database; at the same time, based on the regulatory database, they open a query interface to consumers, allowing consumers to query traceability information through the unique drug code, thus forming a traceability closed loop.
[0022] The following is a detailed explanation of each step of the above method: For step S1, at the end of the production process of narcotic and psychotropic drugs, pharmaceutical companies need to complete the unique identification and coding operation for each smallest sales unit of drug. The core is to attach a unique RFID tag to the outside of the drug packaging box and enter the encrypted basic production information through professional reading and writing equipment to build the "identity cornerstone" for the entire life cycle traceability of drugs.
[0023] First, the selection of RFID tags must be strictly matched to the storage and circulation scenarios of controlled substances. Considering the potential low-temperature storage and long-distance transportation environments for these drugs, passive RFID tags with heat resistance and impact resistance should be selected. These tags do not require an internal power source; they obtain energy by receiving electromagnetic waves of a specific frequency emitted by RFID readers, enabling contactless data communication with the readers. This effectively avoids the tag failure problem caused by battery depletion in traditional active tags, while also meeting the stability requirements for long-term storage. The tag placement should be uniformly selected at the upper right corner of the front of the drug packaging box, avoiding printed text and graphic areas to ensure rapid identification by the readers. The labeling process must be completed by automated labeling equipment, with labeling accuracy controlled within ±1mm to prevent label wrinkles, misalignment, or detachment. After labeling, a visual inspection system must be used to verify the label position and status by taking pictures of the label position and status with a high-definition camera, automatically rejecting drugs with unqualified labels to ensure that each drug has a complete and identifiable RFID tag.
[0024] Secondly, the input and encryption of production information must adhere to the principle of "full coverage and high security protection." Staff connect to the company's internal drug management system via industrial-grade RFID readers. The input production information must include core data such as the pharmaceutical company name, unique drug code, generic and trade names, dosage form, specifications, production date, shelf life, production workshop number, and quality inspector number. To prevent information leakage and tampering, a dual encryption mechanism is implemented during the input process: the first layer is data transmission encryption, using the TLS 1.3 protocol to encrypt the transmission link between the reader and the management system, ensuring that data is not stolen or intercepted during transmission; the second layer is data storage encryption, using the AES-256 encryption algorithm to encrypt the information on the input tag chip. The key is uniformly generated and stored by the company's key management system, with each batch of drugs corresponding to an independent encryption key, which is updated regularly to further enhance data security.
[0025] Finally, a verification and backup mechanism for production information needs to be established. After information entry is completed, the tag information is read a second time using a separate RFID reader / writer. The reading results are compared with the original data in the enterprise management system. If data inconsistencies or reading failures occur, the system automatically triggers an alarm, and staff must immediately check the tag status and entry process to rule out equipment malfunctions or data entry errors. Simultaneously, the encrypted production information is backed up to the enterprise's local server and cloud backup system, employing a disaster recovery architecture to ensure that even if a single storage node fails, the production information can still be fully recovered, providing reliable source data support for subsequent traceability management. This step, through the combination of the unique identifier of the RFID tag and encrypted production information, completely solves the problems of small information capacity and inability to dynamically update traditional barcodes, laying a core data foundation for the full-process traceability of controlled substances.
[0026] In step S2, based on the coded and information-entered controlled substances, a blockchain system based on a consortium blockchain framework supporting multi-channel isolation is further constructed, and the encrypted production information is uploaded to the corresponding dedicated channel. This blockchain system utilizes the decentralized and tamper-proof characteristics of blockchain to achieve secure storage and controllable sharing of production information, while simultaneously protecting the data privacy of different participants through a channel isolation mechanism.
[0027] The overall design of the blockchain system is based on a "consortium blockchain," balancing system security and business collaboration. Participating nodes in the consortium blockchain include pharmaceutical companies, logistics companies, distributors, pharmacies, and regulatory authorities. Each node must be authenticated before joining the network. When applying to join, a node must submit qualification certificates to the blockchain certificate center. After the certificate center approves the application, it generates a unique digital certificate and public-private key pair for the node and backs up the private key to the regulatory authority's dedicated key management system, thus providing support for the regulatory authority's subsequent decryption and access permissions. The underlying blockchain uses the Hyperledger Fabric framework, which supports multi-channel architecture and flexible consensus mechanisms, to adapt to the complex business needs in the traceability of controlled substances.
[0028] In one embodiment of the present invention, based on the coded and information-entered controlled substances, a blockchain system with the Hyperledger Fabric framework as its underlying layer is further built, and the encrypted production information is uploaded to a dedicated channel. This framework is specifically designed for commercial consortium blockchain scenarios, and its core characteristics are highly compatible with the stringent requirements of controlled substance traceability for data isolation, privacy protection, and regulatory control, as specifically reflected below: (I) Integration of Permission Identity Management and National Cryptographic Algorithm The permissioned joining of nodes is achieved using the Certificate Authority (CA) service built into the Hyperledger Fabric framework. Participants such as pharmaceutical companies, logistics companies, distributors, pharmacies, and regulatory authorities must submit qualification certificates to the CA when applying to join the network. Upon approval, they receive a unique digital identity certificate. To comply with national security regulations, the default encryption suite of Fabric is replaced with the national cryptographic algorithms (SM2 / SM4) recognized by the State Cryptography Administration, used to generate public-private key pairs for nodes and for data encryption. All node private keys are synchronously backed up by the CA to the regulatory authority's dedicated key management system, providing a foundation for the regulatory authority to legally decrypt and access data across the entire chain.
[0029] (ii) Multi-channel architecture to achieve business data isolation Utilizing Fabric's core Channel mechanism, "Production Channel," "Logistics Channel," and "Sales Channel" were constructed. Each channel is an independent, private sub-blockchain with its own distributed ledger and membership policies. For example, only pharmaceutical company A and regulatory authorities can join "Production Channel A," while competitor pharmaceutical company B is isolated in "Production Channel B," thus achieving physical-level isolation of core production data and effectively protecting business privacy. Data interaction between channels is conducted through a relay chain, synchronizing only necessary non-sensitive information digests (such as the unique hash value of the drug's code), ensuring business collaboration without compromising privacy.
[0030] (iii) Customizable consensus and smart contracts (chaincode) Fabric's flexible consensus mechanism allows for different endorsement strategies to be configured for each channel. For example, in the "sales channel," a sales transaction can be configured to require the joint endorsement (signature confirmation) of at least one pharmacy node and one regulatory node to be valid. This is essentially a practical implementation of the Byzantine fault-tolerant consensus principle in a permissioned blockchain, ensuring network consistency even with a few malicious or faulty nodes. Business logic is implemented through chaincode (i.e., smart contracts) and deployed across each channel. For example, the "logistics monitoring chaincode" can automatically verify uploaded temperature and humidity data. If the data exceeds the limits continuously, it automatically marks the drug status as abnormal in the ledger and triggers an alert, achieving automated compliance management.
[0031] (iv) Supporting a balance between regulatory auditing and privacy As a privileged node, the regulatory authority is configured as a member of all channels, thus gaining access to all network data. Combined with the aforementioned private key backup mechanism, the regulatory authority, under legal authorization, can call the backup private key to decrypt encrypted transactions within any channel, achieving transparent oversight. This design, based on Fabric's channel isolation architecture, achieves a precise balance between "data isolation from ordinary participants and controllable visibility for regulators."
[0032] Next, the process of uploading encrypted production information to the blockchain will be executed within the aforementioned architecture: Pharmaceutical companies, acting as authorized nodes in their respective production channels, digitally sign the encrypted production information in S1 using a blockchain client, and then initiate a transaction proposal. Based on the endorsement policy configured for the channel, required nodes (such as other pharmaceutical partner nodes or regulatory nodes) endorse and sign the proposal. The endorsed transactions are sent to a sorting service, packaged into blocks in chronological order, broadcast to all nodes within the channel for verification, and finally written into an immutable distributed ledger. This step completely resolves the shortcomings of traditional centralized data storage, which is easily tampered with by a single stakeholder, and provides a reliable technical platform for data privacy protection and cross-organizational business collaboration through the Fabric framework.
[0033] Secondly, the multi-channel architecture must adhere to the principles of "business isolation and data privacy." Based on the circulation stages of controlled substances, the blockchain system is divided into three core dedicated channels: a production channel, a logistics channel, and a sales channel. The production channel is only open to pharmaceutical companies and regulatory authorities, used to store encrypted information from the drug production process. The logistics channel is open to logistics companies, pharmaceutical companies, distributors, and regulatory authorities, used to store data from the drug logistics and distribution process. The sales channel is open to pharmacies, distributors, and regulatory authorities, used to store information from the drug sales process. Each channel uses an independent ledger and consensus mechanism. Cross-chain data interaction is achieved between the production channel and the logistics and sales channels through a relay chain. When a relay link receives a synchronization request from a channel, it must verify the identity and permissions of the requesting node. After verification, the information digest is synchronized to other related channels, ensuring the independence and security of data in each channel. For example, the production channel only synchronizes the unique code digest of the drug to the logistics channel. The logistics channel does not need to obtain complete production information to complete drug identity verification, effectively protecting the commercial privacy of pharmaceutical companies.
[0034] Then, the process of uploading encrypted production information to the blockchain must strictly follow the steps of "encrypted transmission and consensus verification." Pharmaceutical companies, as the initiating node of the production channel, upload the encrypted production information from S1 to the production channel network through their own blockchain client. Before uploading, the client must digitally sign the data to ensure the authenticity of the data source. During data transmission, the blockchain's built-in P2P encrypted transmission protocol is used to prevent data tampering during transmission between nodes. After the data reaches other nodes in the production channel, each node verifies the data through a consensus mechanism—the production channel uses the PBFT (Practical Byzantine Fault Tolerance) consensus algorithm, which can ensure the correctness of the consensus even in the presence of malicious nodes. The consensus nodes (composed of core nodes from pharmaceutical companies and regulatory authorities) verify the digital signature, format compliance, and encryption integrity of the uploaded data. After verification, the data is written to the production channel's distributed ledger. Ledger records are arranged in timestamp order, and each block contains the hash value of the previous block, forming a chain structure to ensure that once the data is written, it cannot be tampered with.
[0035] Finally, a ledger maintenance and monitoring mechanism for the production channel needs to be established. Each node must periodically synchronize the ledger data of the production channel, with a synchronization frequency set to once every 5 minutes, to ensure the consistency of the ledgers across all nodes. The regulatory department, acting as the supervisory node for the production channel, can monitor the ledger's write activity in real time. When abnormal write operations are detected, the system automatically triggers an alert, suspends the write permissions of that node, and notifies relevant nodes to conduct verification. This step, through the construction of a multi-channel architecture and the on-chain storage of production information, completely solves the problem of data tampering in the traditional centralized storage model. Simultaneously, through channel isolation and cross-chain interaction design, a balance between data privacy protection and business collaboration is achieved, providing a secure and reliable technical platform for subsequent information addition in logistics and sales processes.
[0036] When narcotic drugs flow from pharmaceutical companies to distributors (i.e., step S3), distributors need to collect key information in the logistics and distribution process through RFID reading and writing devices based on the drug identity verification results of the production channel, and encrypt and add this information to the logistics channel to achieve traceability of the drug flow process, while completing the connection and docking with upstream production information.
[0037] First, distributors must complete identity verification and information retrieval during the drug receiving process. After the drugs arrive at the distributor's warehouse, staff must scan the drugs in batches at a fixed RFID reading and writing area at the warehouse entrance. The reading and writing device activates the RFID tags on the drug packaging through electromagnetic wave signals, reads the encrypted production information digest within the tag, and sends the read information to the distributor's blockchain client. The client automatically connects to the production channel, calls the ledger query interface of the production channel, inputs the unique code of the drug, retrieves the production information digest of the drug stored in the production channel, and compares it with the information read by the RFID. If the two match, it proves that the drug source is legal and there has been no substitution or tampering, and the system automatically generates an "acceptance passed" instruction; if the information is inconsistent or the corresponding production information cannot be found, the system immediately triggers an alarm, locks the batch of drugs, and notifies the regulatory authorities for verification. At the same time, it records the unique code of the abnormal drug, the acceptance time, the operator, and other information to provide a basis for subsequent traceability.
[0038] Secondly, the collection of logistics and distribution information must cover the entire process of "warehousing-transportation-inbound" to ensure data integrity. In the warehousing stage, staff use handheld RFID readers (supporting mobile scanning and adaptable to flexible operations between warehouse shelves) to register medicines upon entry. The collected information includes warehouse code, inbound timestamp, warehouse temperature and humidity data, and storage location number. In the transportation stage, staff must install vehicle-mounted RFID readers and GPS positioning modules on transport vehicles. The collected information includes vehicle number, driver's name and contact information, departure time, estimated arrival time, real-time transportation trajectory, and temperature and humidity data inside the vehicle. All collected logistics information must be processed using structured coding, employing JSON format to standardize data fields and ensure compatibility between different systems. For example, the temperature and humidity data field is uniformly set to "temperature:25℃, humidity:60%" to avoid information parsing problems caused by formatting issues.
[0039] Then, the encryption and on-chaining of logistics information needs to be linked with upstream production information. The distributor's blockchain client associates the collected logistics information with the unique code of the drug, forming a combined data of "unique code + logistics information." This combined data is then encrypted using the same AES-256 encryption algorithm as the production information to ensure the security of data transmission and storage. After encryption, the client digitally signs the data and uploads it to the logistics channel. The logistics channel uses the same PBFT consensus algorithm as the production channel. Consensus nodes verify the signature validity and information integrity of the uploaded data—verification includes whether the logistics information contains a complete timestamp, whether the temperature and humidity data are within a reasonable range, and whether the transportation trajectory is continuous. After verification, the data is written to the distributed ledger of the logistics channel and linked to the information digest of the drug's production channel, forming a chain-like traceability relationship of "production-logistics." For example, the record for a certain drug in the logistics channel ledger contains "unique code: XXX, production information digest: XXX, logistics information: XXX," realizing the information connection between production and logistics links.
[0040] Finally, a real-time monitoring and anomaly handling mechanism for logistics information needs to be established. Distributors' blockchain clients must monitor the ledger entries in the logistics channel in real time. When a logistics information upload fails, the system automatically caches the data and re-uploads it after the network is restored, recording the number of retries and the time taken. Regulatory authorities, acting as supervisory nodes in the logistics channel, can view the logistics trajectory and temperature and humidity data of the medicines in real time. When the transportation trajectory deviates from the preset route or the temperature and humidity exceed the standards, the system automatically sends warning messages to the distributors and drivers, requiring them to explain the situation and take corrective measures. Simultaneously, the abnormal information is written into the regulatory database as a basis for subsequent regulatory verification. This step, through the full-process information collection using RFID reading and writing devices and the addition of information to the logistics channel, solves the problem of missing logistics data in traditional traceability systems, achieving traceability of medicines from production to distribution. Furthermore, through real-time monitoring and anomaly handling, it reduces the safety risks of medicines in the logistics process.
[0041] Once controlled substances have been transferred from distributors to pharmacies (i.e., step S4), pharmacies need to collect key information about the drug sales process through RFID reading and writing devices based on the drug identity verification results from the logistics channel, and link it with patient prescription information. This information is then encrypted and uploaded to the sales channel to achieve closed-loop traceability of the drug sales process, while ensuring the compliance of sales activities.
[0042] First, pharmacies must complete the receipt and verification of drug logistics information. After the drugs arrive at the pharmacy, staff use desktop RFID readers in the store's receiving area to scan each drug and read the logistics information summary from the RFID tag. The reader sends the read information to the pharmacy's blockchain client. The client automatically connects to the logistics channel, enters the drug's unique code to query the corresponding logistics information, and compares it with the read summary. If the comparison matches, it proves that the drug circulation process is compliant and there is no risk of tampering. The system generates a "successful receipt" record, automatically updates the pharmacy's drug management system (PMS) inventory, and marks the drug status as "awaiting sale." If the comparison does not match or the logistics information cannot be found, the system immediately locks the drug, suspends the warehousing process, and notifies the distributor and regulatory authorities for verification. At the same time, it records the receiving time, operator, abnormal drug code, and other information to ensure that problematic drugs do not enter the sales process.
[0043] Secondly, the collection of sales information must differentiate between "prescription drugs" and "over-the-counter drugs" to ensure compliance. For over-the-counter controlled substances, sales personnel must scan drug labels using handheld RFID readers during sales. The collected sales information includes the sales timestamp, store number, sales personnel's name and employee number, sales quantity, and amount received. For prescription controlled substances, additional patient prescription information must be linked—sales personnel must first obtain the patient's prescription number, patient name, prescribing physician's name and employee number, prescription date, drug specifications, and dosage through the pharmacy's HIS system or prescription verification system. Then, they must use RFID readers to bind the prescription number to the drug's unique code, ensuring "one prescription corresponds to one drug," preventing overdose sales or sales without a prescription. The collected prescription information must be anonymized, removing sensitive data such as patient ID numbers and contact information, retaining only key identifiers for traceability, and protecting patient privacy.
[0044] Then, the encrypted uploading of sales and prescription information to the blockchain needs to be linked to upstream logistics information. The pharmacy's blockchain client associates the collected sales information with the unique drug code, forming a combined data of "unique code + sales information + prescription information," which is then encrypted using the AES-256 encryption algorithm. After encryption, the client digitally signs the data using the pharmacy's private key, generating a signature file, which is uploaded to the sales channel along with the encrypted data. The sales channel uses the PBFT consensus algorithm, and consensus nodes verify the uploaded data: for over-the-counter drugs, the integrity of the sales information is verified; for prescription drugs, the validity of the prescription number is additionally verified. After verification, the data is written to the distributed ledger of the sales channel. The ledger record contains an information digest of the previous link (logistics channel), forming a complete traceability chain of "production-logistics-sales." For example, the sales channel ledger record might be "Unique code: XXX, Logistics information digest: XXX, Sales information: XXX, Prescription number: XXX."
[0045] Finally, a mechanism for recording and uploading post-sale empty bottle recycling information to the blockchain needs to be established. After patients use the medication, they must return the empty bottle to the pharmacy. Pharmacy staff use RFID readers to scan the residual RFID tags on the empty bottle, collecting information such as the recycling time, the person who handled the recycling, and the bottle's condition. This information is then linked to the unique code of the medication, encrypted, and uploaded to the sales channel. The medication is marked as "recycled" in the ledger, achieving closed-loop management of "sales-use-recycling." Simultaneously, pharmacies must regularly summarize the information on recycled empty bottles and upload it to the regulatory department's waste disposal system to ensure that the empty bottles are disposed of in compliance with regulations and prevent illegal use. This step, by collecting and uploading sales and prescription information to the blockchain, solves the problem of missing sales data in traditional traceability systems. Furthermore, through prescription association and empty bottle recycling management, it ensures the compliance of the sale and use of controlled substances, further reducing the space for illegal abuse.
[0046] In step S5, based on the encrypted data of the entire production, logistics and sales process stored in each channel of the blockchain system, the regulatory authorities need to complete the data collection and analysis, build a unified regulatory database, and open a query interface to consumers to realize two-way traceability between "regulation and consumption" and form a closed loop of traceability for the entire life cycle of narcotic and psychotropic drugs.
[0047] First, regulatory authorities need to achieve full-channel data decryption and retrieval through key backup. When generating public-private key pairs for each participant, the blockchain certificate center backs up the private keys of all nodes to the regulatory authority's dedicated key management system. When regulatory authorities need to read the full-process data of a particular drug, staff enter the drug's unique code through the regulatory blockchain client. The system automatically identifies the production, logistics, and sales channels involved in the drug, calls the backup private keys for the corresponding channels, and decrypts the encrypted data stored in each channel—the decryption process is completed on the regulatory authority's local encryption server, avoiding the transmission of private keys and data over the network and ensuring security. After decryption, the system obtains complete production, logistics, and sales information for the drug, automatically removes duplicate fields from the data, and generates a structured, full-process traceability data report.
[0048] Secondly, regulatory authorities need to construct a unified regulatory database to achieve end-to-end data aggregation and analysis. The regulatory database adopts a distributed storage architecture, divided into production data sub-databases, logistics data sub-databases, sales data sub-databases, and anomaly data sub-databases. Each sub-database synchronizes data in real time with the corresponding channel in the blockchain system to ensure data timeliness. The database has a built-in data cleaning module that automatically removes invalid data and standardizes the data to ensure consistency. Simultaneously, the database is equipped with a data mining and analysis module, enabling multi-dimensional regulatory analysis: for example, statistically analyzing the total sales volume of controlled substances by region to identify areas with sudden sales increases; analyzing logistics flow time by drug type to identify logistics delays; and analyzing the compliance of prescriptions issued by physicians based on prescription information to identify cases of over-dosage prescriptions. The analysis results are presented in the form of visual reports, allowing regulatory personnel to intuitively grasp the dynamics of controlled substance circulation and promptly detect clues of illegal circulation.
[0049] Then, regulatory authorities need to establish an abnormal data early warning and handling mechanism to achieve proactive supervision. The system presets multiple abnormal early warning thresholds, such as in the drug sales process: the same patient purchasing the same type of controlled substance more than twice within 7 days; a pharmacy selling more than 50 vials of a certain type of controlled substance in a single day; or temperature and humidity exceeding standards for more than 2 hours in the logistics process. When the database detects data reaching the early warning threshold, an early warning is automatically triggered, generating an alert message, which is pushed to regulatory personnel in the corresponding area via SMS, system messages, etc. After receiving the warning, regulatory personnel can access the full-process traceability data of the drug through the regulatory client to verify the cause of the abnormality—if it is a legitimate abnormality, the regulatory personnel need to enter the verification results and lift the warning; if it is an illegal abnormality, the regulatory personnel need to initiate enforcement procedures, suspend the sales authority of the pharmacy involved, and track the drug's flow to ensure the problem is dealt with promptly. Early warning and handling records must be simultaneously written into the regulatory database to form a closed-loop supervision system.
[0050] Finally, regulatory authorities need to provide consumers with a public query interface to enable consumer participation in traceability verification. The query interface will be presented in two forms: a web page and a mobile app. After purchasing controlled substances, consumers can enter the unique code on the drug packaging into the query interface. The system will automatically retrieve the publicly available traceability information for the drug from the regulatory database and display it to the consumer in a concise and clear format. For example, the query results page might display: "Drug Name: Pethidine Hydrochloride Injection; Manufacturer: XX Pharmaceutical Factory; Production Batch: 20250101; Logistics Track: XX Logistics Company → XX Distributor → XX Pharmacy; Sales Date: 2025-01-08; Sales Store: XX Pharmacy." If consumers find that the query information does not match the actual drug, they can submit a description of the anomaly and relevant supporting documents through the "Report" function in the interface. Upon receiving the report, the regulatory authorities will immediately verify and provide feedback on the processing results, forming a closed-loop traceability system linking "regulation and consumption." This step, through the aggregation of data across the entire process by regulatory authorities and the opening of consumer query interfaces, has thoroughly achieved the management goal of ensuring that narcotic and psychotropic drugs are "traceable in origin, traceable in destination, and accountable for responsibility," effectively preventing illegal abuse and malpractice, and safeguarding public medication safety and social safety.
[0051] Second Embodiment like Figure 2 As shown, to implement the above method, the second embodiment of the present invention provides a system for digital traceability of narcotic and psychotropic drugs, comprising at least a drug supply chain layer, a data acquisition layer, and a blockchain layer. In the drug supply chain layer, each participating unit collects data during drug production, transportation, distribution, and sales operations through RFID tags and various RFID reading and writing devices in the data acquisition layer. The collected data from all stages of production, logistics, and sales is encrypted and then transmitted to the dedicated production, logistics, and sales channels of the blockchain layer according to business type and written into the distributed ledger. The blockchain layer uses smart contracts to complete data compliance verification and a relay chain to achieve cross-channel information digest synchronization. Simultaneously, it opens full-channel data access permissions to regulatory authorities to support the construction of a regulatory database and provides traceability data sources for consumer query interfaces, forming a closed-loop transmission relationship of "data generated by the supply chain layer—data acquired by the data acquisition layer—data stored and shared by the blockchain layer."
[0052] In one embodiment of the present invention, the pharmaceutical supply chain layer includes: pharmaceutical company unit, logistics company unit, distributor unit, retail pharmacy unit, regulatory authority unit, and consumer unit.
[0053] Among them, the pharmaceutical enterprise unit, as the source participant, is responsible for affixing a unique RFID tag to the smallest sales unit of narcotic and psychotropic drugs, entering encrypted production information through RFID reading and writing equipment, applying to join the production channel, and completing the on-chaining of production information.
[0054] Logistics Company Unit: This unit handles the transportation from pharmaceutical companies to distributors. It collects logistics data such as transportation temperature and humidity, timestamps, and vehicle numbers through onboard RFID readers and synchronizes them to the logistics channel to ensure that the transportation trajectory is traceable.
[0055] Distributor Unit: After receiving the medicines, the distributor verifies the production information through fixed RFID reading and writing equipment, collects data such as warehouse code, warehousing time, and storage temperature and humidity, and adds it to the logistics channel; when distributing to downstream pharmacies, the distributor information is encrypted and uploaded to complete the connection between logistics and sales.
[0056] Retail pharmacy unit: Verify logistics information through desktop / handheld RFID readers and writers, collect sales time, store number, sales personnel information, link patient desensitized prescriptions, and upload to the sales channel; when empty bottles are collected, the collection time and empty bottle status are collected and uploaded to the blockchain.
[0057] Regulatory Unit: As the overall network administrator, it enjoys access to the ledgers of all blockchain channels, decrypts data from each channel using the public and private keys backed up by the blockchain certificate center, aggregates production / logistics / sales data to form a regulatory database, and triggers and handles anomaly alerts.
[0058] Consumer Unit: As the end user, consumers can obtain full-process traceability data of drugs by entering information into the public query interface opened by regulatory authorities through the unique code on the drug packaging, and verify the legality of the drugs.
[0059] In one embodiment of the present invention, the data acquisition layer includes an RFID tag unit and an RFID reader / writer unit. The RFID tag unit is a passive UHF band tag, attached to the smallest packaging of the medicine, possessing massive information storage and dynamic writing capabilities, recording information throughout the entire lifecycle of the medicine, serving as a unique identifier. The RFID reader / writer unit includes four sub-types of devices—industrial-grade reader / writer, fixed reader / writer, handheld reader / writer, and vehicle-mounted reader / writer—all supporting contactless data reading / writing and linking with a blockchain client to upload data.
[0060] In one embodiment of the present invention, the blockchain layer includes: a multi-channel architecture unit, a distributed ledger unit, a smart contract unit, a transaction block unit, a certificate center unit, and a relay chain unit.
[0061] The multi-channel architecture unit is divided into production channel, logistics channel, and sales channel according to business. Each channel maintains its own ledger to achieve data isolation.
[0062] Distributed ledger unit: Each channel corresponds to a distributed ledger, which stores data in a time-series manner according to timestamps, records include the hash value of the previous block, has the characteristic of being immutable, and completely retains the information and state changes of each link.
[0063] Smart contract unit: Embedded in the ledger of each channel, it automatically triggers compliance verification when drugs are transferred, and freezes the relevant drug circulation permissions when an anomaly occurs, reducing manual intervention.
[0064] Transaction block unit: Stores encrypted transaction data at each stage. Each block is associated with a unique drug code to ensure that the data corresponds one-to-one with the drug, facilitating traceability and query.
[0065] Certificate Center Unit: Generates SM2 algorithm public and private key pairs for each participant, synchronously backs up the private keys to the regulatory authorities, is responsible for node identity authentication, and ensures the legitimacy of nodes in the blockchain system.
[0066] Relay Chain Unit: Connects production / logistics / sales channels to enable cross-chain information exchange, such as synchronizing the unique drug code summary from the production channel to the logistics channel, ensuring data collaboration across channels and preventing privacy leaks.
[0067] It should be noted that the above embodiments are merely illustrative examples. The technical solutions of each embodiment can be combined, and all are within the protection scope of this invention.
[0068] The method and system for digital traceability of narcotic and psychotropic drugs provided by this invention have been described in detail above. Any obvious modifications made to this invention by those skilled in the art without departing from its essential content will constitute an infringement of the patent rights of this invention and will incur corresponding legal liability.
Claims
1. A method for digital traceability of narcotic and psychotropic drugs, characterized in that... include: S1: Pharmaceutical companies affix a unique, dynamically writable RFID tag to the smallest sales unit of narcotic and psychotropic drugs, and then encrypt the production information using national cryptographic algorithms before recording it into the tag; S2: Build a blockchain system based on a consortium blockchain framework that supports multi-channel isolation. The blockchain system includes a production channel, a logistics channel, and a sales channel; upload the encrypted production information to the distributed ledger of the production channel; S3: Distributors collect logistics information of medicines through RFID reading and writing devices, encrypt it using national cryptographic algorithms, and append it to the distributed ledger of the logistics channel; the logistics information includes transportation temperature and humidity data; S4: The pharmacy collects drug sales information through RFID reading and writing equipment, associates it with de-identified prescription information, encrypts it using national cryptographic algorithms, and uploads it to the distributed ledger of the sales channel; wherein, the sales information includes sales time, store number, and sales personnel; S5: Regulatory authorities use the private keys backed up by the blockchain certificate center to decrypt and obtain the full-process data of each channel and summarize them to form a regulatory database; at the same time, based on the regulatory database, they open a query interface to consumers, allowing consumers to query traceability information through the unique drug code, thus forming a traceability closed loop.
2. The method as described in claim 1, characterized in that... In step S2, the blockchain certificate center generates public and private key pairs of national cryptographic algorithms for each participant during node authentication, and backs up the private keys to the regulatory authority's dedicated key management system for decryption and access by the regulatory authority.
3. The method as described in claim 1, characterized in that... In step S2, the production channel, the logistics channel, and the sales channel are independent of each other, and the data between each channel is synchronized through a relay chain for information digest synchronization.
4. The method as described in claim 3, characterized in that... The production channel, the logistics channel, and the sales channel are all equipped with smart contracts to automatically trigger compliance checks during the drug circulation process and freeze the circulation rights of the relevant drugs when data is abnormal.
5. The method as described in claim 4, characterized in that... The smart contract is configured as follows: When the distributed ledger records of the logistics channel show that the transportation temperature and humidity of a certain batch of medicines continuously exceed the preset threshold, or when the distributed ledger records of the sales channel show that the sales frequency for the same patient is abnormal, the subsequent circulation rights of that batch or the associated medicines will be automatically triggered and frozen.
6. The method as described in claim 1, characterized in that... Step S4 further includes: The pharmacy collects empty bottle recycling information through RFID reading and writing devices and uploads it in encrypted form to the distributed ledger of the sales channel.
7. A system for digital traceability of narcotic and psychotropic drugs, used to implement the method described in any one of claims 1 to 6, characterized in that... include: The pharmaceutical supply chain layer is used to generate traceability data in the production, transportation, distribution, sales, and recycling of pharmaceuticals. The data acquisition layer interacts with the pharmaceutical supply chain layer and is used to automatically collect the traceability data through RFID tags and various RFID reading and writing devices. The blockchain layer, connected to the data acquisition layer, is used to write encrypted traceability data into the distributed ledgers of the corresponding production, logistics, and sales channels according to business type, and to realize cross-channel information synchronization, smart contract verification, and grant full access to data for regulatory authorities.
8. The method as described in claim 7, characterized in that The data acquisition layer includes: The RFID tag unit is a passive UHF band tag that is attached to the smallest sales unit of medicines and supports dynamic writing; The RFID reading and writing device unit includes industrial-grade reading and writing devices, fixed reading and writing devices, handheld reading and writing devices, and vehicle-mounted reading and writing devices, which are used for non-contact reading or writing of data in the RFID tag unit.
9. The method as described in claim 7, characterized in that... The blockchain layer includes: Multi-channel architecture units are used to build independent production channels, logistics channels, and sales channels; Distributed ledger units are used for time-series storage of encrypted traceability data for each channel; Smart contract units are used to automatically perform compliance checks and process control in various channels; The certificate center unit is used to generate public and private key pairs for nodes using national cryptographic algorithms and to back up the private keys to regulatory authorities. The relay chain unit is used to synchronize information summaries between the production channel, the logistics channel, and the sales channel.
10. The method as described in claim 9, characterized in that... The production, logistics, and sales channels of the blockchain layer all employ a practical Byzantine fault-tolerant consensus algorithm to ensure the correctness of the consensus even in the presence of malicious nodes.
Citation Information
Patent Citations
Medicine tracing system based on RFID and block chain and implementation method
CN109993546A