Hospital medicine directory sharing method and device based on block chain

By establishing a trust relationship between hospitals and pharmacies through blockchain technology and encryption algorithms, the problem of hospitals not sharing their drug catalogs with external parties is solved, enabling trusted data sharing and drug catalog queries in untrusted environments.

CN118964484APending Publication Date: 2024-11-15SHANDONG LANGCHAO YUNTOU INFORMATION TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411056180.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

In the medical environment, the information silos between hospitals and pharmacies make it difficult to exchange and share information in the drug distribution service chain. Hospital drug catalogs are not shared with external parties, making it difficult to achieve reliable data sharing in an untrusted environment.

Method used

By using blockchain technology, combined with symmetric and asymmetric encryption algorithms (such as SM2), a trust relationship between hospitals and pharmacies is established on the blockchain. The drug catalog is encrypted with a symmetric key and uploaded to the chain, and the pharmacy can decrypt it using its private key to obtain the hospital's drug catalog.

Benefits of technology

It enables trusted drug catalog sharing between hospitals and pharmacies in untrusted environments, ensuring data security and immutability, and improving the efficiency and accuracy of drug catalog searches for pharmacies.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118964484A_ABST
    Figure CN118964484A_ABST
Patent Text Reader

Abstract

The invention provides a hospital medicine catalog sharing method and device based on a block chain, and the method and device can achieve the credible medicine catalog sharing in an uncredible environment through the block chain technology. The hospital medicine catalog sharing method based on the block chain comprises the following steps: importing a medicine catalog, encrypting the medicine catalog through a symmetric encryption algorithm, and uploading the encrypted medicine catalog to a chain; associating the hospital and the medicine catalog; setting each hospital in the plurality of hospitals into a group, and respectively adding the plurality of drugstores into the groups for association; wherein the group of one hospital comprises a plurality of drugstores, and one drugstore belongs to a plurality of groups; after the drugstores join the group of the hospitals, the hospitals encrypt the symmetric keys through the public keys of the drugstores joining the group and then link the symmetric keys, so that the drugstores decrypt the symmetric keys on the chain through the private keys of the drugstores, and then decrypt the drug catalogue through the symmetric keys; wherein the number of the drugstores is consistent with the number of the encrypted symmetric keys, and each drugstore corresponds to one encrypted symmetric key.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of blockchain technology in the medical industry, and in particular to a hospital drug catalog sharing method and device based on blockchain. Background Art

[0002] In the current medical environment, the informatization construction of hospital drug management systems has made significant progress, but there are still many shortcomings. Most hospital information management systems mainly focus on basic information management such as storage and distribution of drugs within the hospital, while the information sharing mechanism with drug suppliers is still imperfect. This information island phenomenon makes it difficult to achieve information exchange and sharing in the drug circulation service chain when it is desired to achieve separation of medicine and pharmacy in the future, thus restricting the idea of ​​separating hospital pharmacies from hospitals in terms of organizational structure. In addition, the hospital's drug catalog is usually not shared with the outside world, and the environment between hospitals and pharmacies is untrusted. Different hospitals have their own drug catalogs, and the drug catalogs of each hospital are generally not shared with the outside world. It is difficult to achieve trusted data sharing in an untrusted environment. Summary of the invention

[0003] In order to solve the above technical problems, the present invention is proposed. The embodiments of the present invention provide a hospital drug catalog sharing method and device based on blockchain, which can realize the sharing of credible drug catalogs in an untrusted environment by means of blockchain technology.

[0004] According to one aspect of the present invention, a method for sharing a hospital drug catalog based on blockchain is provided, comprising: importing a drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to a chain; associating hospitals and drug catalogs; wherein one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs; each of the multiple hospitals is established as a group, and multiple pharmacies are added to the group for association; wherein a hospital group includes multiple pharmacies, and one pharmacy belongs to multiple groups; when a pharmacy joins the hospital's group, the hospital encrypts the symmetric key through the public key of the pharmacy that joins the group and then uploads it to the chain, so that the pharmacy can decrypt the symmetric key on the chain through the pharmacy's private key, and then decrypt the drug catalog through the symmetric key; wherein the number of pharmacies is consistent with the number of encrypted symmetric keys, and each pharmacy corresponds to an encrypted symmetric key.

[0005] In one embodiment, before importing the drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to the chain, the blockchain-based hospital drug catalog sharing method also includes: obtaining basic information of the hospital; wherein the basic information includes at least one of the hospital's identification number, the hospital's name, and the hospital's address; based on the hospital's basic information and the hospital's key generation instruction, generating the hospital's public key and private key; based on the registrant's signature instruction, generating the registrant's first public key and first digital signature; wherein the registrant represents the platform administrator, and the registrant's first digital signature represents the digital signature generated after SM2 asymmetric encryption of the hospital's identification number and the hospital's public key using the platform administrator's private key; writing the hospital's public key, private key, registrant's first public key and first digital signature into the hospital contract and database table to complete the hospital's registration; when the hospital is successfully registered, binding the hospital administrator's account information to the hospital; wherein the hospital administrator is used to maintain the drug catalog bound to the hospital.

[0006] In one embodiment, the blockchain-based hospital drug catalog sharing method also includes: dividing hospital data into two parts: hospital on-chain data and hospital off-chain data; wherein, the hospital on-chain data includes the hospital's public key, private key, first public key of the registrant, first digital signature, drug catalog and at least one of the symmetric keys encrypted by the pharmacy's public key, and the hospital off-chain data includes at least one of the hospital name, hospital private key and hospital address; wherein, the hospital's public key, private key, first public key and first digital signature of the registrant are written into the hospital contract and database table, including: storing the hospital on-chain data into the hospital contract; storing the hospital off-chain data into the database table.

[0007] In one embodiment, before importing the drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to the chain, the blockchain-based hospital drug catalog sharing method also includes: obtaining basic information of the pharmacy; wherein the basic information includes at least one of the pharmacy's identity number, the pharmacy's name, and the pharmacy's address; based on the pharmacy's basic information and the pharmacy key generation instruction, generating the pharmacy's public key and private key; based on the registrant's signature instruction, generating the registrant's second public key and second digital signature to complete the pharmacy registration; wherein the registrant represents the platform administrator, and the registrant's second digital signature represents the digital signature generated by using the platform administrator's private key to asymmetrically encrypt the pharmacy's identity number and the pharmacy's public key through SM2; writing the pharmacy's public key, private key, registrant's second public key and second digital signature into the pharmacy contract and database table to complete the pharmacy registration; when the pharmacy is successfully registered, binding the pharmacy administrator's account information to the pharmacy; wherein the pharmacy administrator is used to view the drug catalog shared by the associated hospital.

[0008] In one embodiment, the hospital drug catalog sharing method based on blockchain also includes: dividing the pharmacy data into two parts: pharmacy on-chain data and pharmacy off-chain data; wherein, the pharmacy on-chain data includes at least one of the pharmacy's public key, private key, second public key of the registrant and second digital signature, and the pharmacy off-chain data includes at least one of the pharmacy name, pharmacy address and pharmacy private key; wherein, the pharmacy's public key, private key, second public key of the registrant and second digital signature are written into the pharmacy contract and database table to complete the registration of the pharmacy, including: storing the pharmacy on-chain data into the pharmacy contract; storing the pharmacy off-chain data into the database table.

[0009] In one embodiment, the hospital and the drug catalog are associated, including: the drug catalog corresponding to the hospital, after being encrypted by the AES symmetric encryption algorithm, is uploaded to the chain through the hospital contract as an attribute of the hospital; wherein the drug catalog is in the JSON array format, and the drug catalog includes two fields: drug name and drug identification number.

[0010] In one embodiment, a drug catalog is imported and encrypted through a symmetric encryption algorithm and then uploaded to a chain, including: importing the drug catalog in batches using Excel; when importing the drug catalog, verifying the drugs in the drug catalog; when the drug's identity identification number does not exist in the global drug catalog, importing the corresponding drug record fails.

[0011] In one embodiment, the blockchain-based hospital drug catalog sharing method also includes: when the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key, the association between the pharmacy and the hospital is verified; when the pharmacy and the hospital have no association, the pharmacy's private key cannot decrypt the symmetric key on the chain; when the pharmacy and the hospital have an association, the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key and obtains the drug catalog shared by the hospital.

[0012] In one embodiment, the hospital drug catalog sharing method based on blockchain also includes: when any pharmacy needs to join the group of the target hospital, the pharmacy submits an application to join the target hospital; wherein the target hospital is any one of multiple hospitals; the approval node of the target hospital approves the application to join; when the application to join is approved, the pharmacy joins the group of the target hospital for association to obtain the drug catalog of the target hospital.

[0013] According to another aspect of the present invention, a hospital drug catalog sharing device based on blockchain is provided, including: an import module, used to import the drug catalog and encrypt the drug catalog through a symmetric encryption algorithm and then upload it to the chain; an association module, used to associate hospitals and drug catalogs; wherein, one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs; a grouping module, used to establish each of the multiple hospitals as a group, and add multiple pharmacies to the group for association; wherein, a hospital group includes multiple pharmacies, and one pharmacy belongs to multiple groups; an encryption module, used when the pharmacy joins the hospital's group, the hospital encrypts the symmetric key through the public key of the pharmacy joining the group and then uploads it to the chain, so that the pharmacy can decrypt the symmetric key on the chain through the pharmacy's private key, and then decrypt the drug catalog through the symmetric key; wherein the number of pharmacies is consistent with the number of encrypted symmetric keys, and each pharmacy corresponds to an encrypted symmetric key.

[0014] The hospital drug catalog sharing method and device based on blockchain provided by the present invention establish a trust relationship between hospitals and pharmacies with the help of blockchain technology, and combine multiple encryption technologies to enable hospitals to safely share drug catalogs with pharmacies, so that pharmacies can query the drug catalogs and use them as a reference for stocking, thereby realizing trusted data sharing in an untrusted environment. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The above and other purposes, features and advantages of the present invention will become more apparent by describing the embodiments of the present invention in more detail in conjunction with the accompanying drawings. The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings, the same reference numerals generally represent the same components or steps.

[0016] Figure 1 It is a flowchart of a hospital drug catalog sharing method based on blockchain provided by an exemplary embodiment of the present invention.

[0017] Figure 2 It is a schematic diagram of the principle of a hospital drug catalog sharing method based on blockchain provided by an exemplary embodiment of the present invention.

[0018] Figure 3 It is a structural diagram of a hospital drug catalog sharing principle based on blockchain provided by an exemplary embodiment of the present invention.

[0019] Figure 4 It is a structural diagram of a hospital drug catalog sharing device based on blockchain provided by an exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0020] Below, the exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, rather than all the embodiments of the present invention, and it should be understood that the present invention is not limited to the exemplary embodiments described here.

[0021] Separation of medicine and pharmacy means that treatment and medication are separated. Hospitals only provide treatment, and medication is not provided with the doctor, which reduces medical expenses. The hospital pharmacy is separated from the hospital in terms of organizational structure, and its ownership or management rights are handed over to other institutions (such as retail pharmacies). A prescription sharing mechanism is established between medical institutions and retail pharmacies, and electronic prescriptions are synchronously shared with patients and pharmacies through APP, WeChat, web pages, etc., so that after visiting the hospital, patients can choose to buy medicine in the hospital or at a pharmacy outside the hospital. Therefore, the hospital needs to safely share the drug catalog with the pharmacy so that the pharmacy can query the drug catalog and make a reference for stocking. However, the hospital's drug catalog is usually not shared with the outside world, and the environment between the hospital and the pharmacy is untrustworthy. How to achieve trusted data sharing in an untrustworthy environment is an urgent problem to be solved.

[0022] The hospital drug catalog sharing method and device based on blockchain provided by the present invention establish a trust relationship between hospitals and pharmacies with the help of blockchain technology, and combine multiple encryption technologies to enable hospitals to safely share drug catalogs with pharmacies, so that pharmacies can query the drug catalogs and use them as a reference for stocking, thereby realizing trusted data sharing in an untrusted environment.

[0023] Figure 1 is a flowchart of a hospital drug catalog sharing method based on blockchain provided by an exemplary embodiment of the present invention, such as Figure 1 As shown, the blockchain-based hospital drug catalog sharing method includes:

[0024] Step 100: Import the drug catalog and encrypt it through a symmetric encryption algorithm and then upload it to the chain.

[0025] Symmetric encryption algorithm, also known as private key encryption or single key encryption, refers to an encryption algorithm that uses the same key for encryption and decryption. When performing symmetric encryption, the data sender will input the plaintext to be encrypted and the encryption key into the encryption algorithm for processing, turning it into a more complex encrypted ciphertext, and then publish the ciphertext. If the party receiving the ciphertext needs to interpret the received ciphertext, it is necessary to use the same encryption key as the sender of the ciphertext and verify it through the inverse operation (decryption) of the encryption to obtain the original plaintext data. After encryption, the chain is to select a suitable blockchain platform according to actual needs, and then upload the encrypted ciphertext as data to the blockchain. The distributed ledger characteristics of the blockchain can ensure the security and immutability of the drug catalog.

[0026] Step 200: Associate hospitals and drug catalogs.

[0027] Among them, one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs.

[0028] Establish a correspondence between hospitals and drug catalogs, and bind each hospital and the corresponding drug catalog to each other, forming a one-to-one relationship between hospitals and drug catalogs. For example, the drug catalog is used as a property of the hospital and is put on the chain through the hospital contract. That is, different hospitals manage different drug catalogs, and each hospital has a drug catalog corresponding to the hospital. The drug catalog contains multiple drugs and drug information, such as drug names and drug IDs (identification numbers).

[0029] Step 300: Each of the multiple hospitals is established as a group, and multiple pharmacies are added to the groups for association.

[0030] Among them, a hospital group includes multiple pharmacies, and a pharmacy belongs to multiple groups.

[0031] For each hospital, a group is created, and a pharmacy is assigned to the group, which means that the pharmacy has the right to view the drug catalog of the hospital. For example, all pharmacies in a city are assigned to a hospital, which means that all pharmacies in the city have the right to view the drug catalog of the hospital. A hospital group can include multiple pharmacies, and a pharmacy can also belong to multiple hospital groups. In other words, a hospital can cooperate with multiple pharmacies, and a pharmacy can also supply multiple hospitals at the same time.

[0032] Step 400: When a pharmacy joins the hospital's group, the hospital encrypts the symmetric key using the public key of the pharmacy that has joined the group and uploads it to the chain, so that the pharmacy can decrypt the symmetric key on the chain using its private key, and then decrypt the drug catalog using the symmetric key.

[0033] The number of pharmacies is consistent with the number of encrypted symmetric keys, and each pharmacy corresponds to one encrypted symmetric key.

[0034] When hospital administrators establish a relationship between a pharmacy and a hospital, they will encrypt the symmetric key with the pharmacy's public key and also upload it to the chain. That is, if a hospital has 10 associated pharmacies, there will be 10 encrypted symmetric keys uploaded to the chain. The pharmacy system can decrypt the symmetric key on the chain with the pharmacy's private key, and then decrypt the drug catalog with the symmetric key. Encrypting the symmetric key with the public key ensures that only the intended recipient (pharmacy) can decrypt the key and further decrypt the message. Therefore, the security of communication can be further guaranteed, and the efficiency of encryption and decryption can be improved.

[0035] Figure 2This is a schematic diagram of the principle of a hospital drug catalog sharing method based on blockchain provided by an exemplary embodiment of the present invention. Figure 2 As shown, S21: the hospital administrator uploads the drug catalog corresponding to the hospital, encrypts the drug catalog with a symmetric key and then uploads it to the chain; S22: creates a hospital authorization group; S23: adds the pharmacy to a hospital authorization group; S24: encrypts the symmetric key with the pharmacy public key, and uploads the encrypted symmetric key to the chain; S25: the pharmacy decrypts the symmetric key with the private key; S26: the pharmacy decrypts the drug catalog with the symmetric key. Among them, the hospital administrator executes S21-S24, and the pharmacy POS system executes S25-S26.

[0036] In one embodiment, before step 100, the blockchain-based hospital drug catalog sharing method may also include: obtaining basic information of the hospital; wherein the basic information includes at least one of the hospital's identification number, the hospital's name, and the hospital's address; based on the hospital's basic information and the hospital's key generation instruction, generating the hospital's public key and private key; based on the registrant's signature instruction, generating the registrant's first public key and first digital signature; wherein the registrant represents the platform administrator, and the registrant's first digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric SM2 encryption of the hospital's identification number and the hospital's public key; writing the hospital's public key, private key, the registrant's first public key and the first digital signature into the hospital contract and database table to complete the hospital's registration; when the hospital is successfully registered, binding the hospital administrator's account information to the hospital; wherein the hospital administrator is used to maintain the bound hospital's drug catalog.

[0037] The registration interface and management interface of the hospital are provided to the platform administrator. The method of this scheme needs to rely on the platform implementation, and the platform administrator is equivalent to the super administrator in the platform and has higher operation rights. Among them, in the registration interface of the hospital, the platform administrator needs to enter the basic information of the hospital such as ID (identification number), name, address, etc., and can automatically generate the public key and private key of the hospital by clicking the "hospital key generation" button, and automatically generate the public key and digital signature of the registrant by clicking the "registrant signature" button, and click the "submit" button to write the corresponding data into the hospital contract and database table. The registrant here refers to the platform administrator, and the registrant signature refers to the use of the platform administrator's private key to generate a digital signature after SM2 asymmetric encryption of "hospital id + hospital public key". Therefore, based on the hospital key generation instruction of clicking the "hospital key generation" button, the public key and private key of the hospital are generated, and based on the registrant signature instruction of clicking the "registrant signature" button, the first public key and the first digital signature of the registrant are generated. Based on the instruction generated by clicking the "submit" button, the public key, private key, the first public key and the first digital signature of the registrant of the hospital are written into the hospital contract and the database table. Successfully registered hospitals can be displayed in a list on the management interface, which can provide basic management functions such as hospital query, deletion, and modification.

[0038] Each hospital needs a hospital administrator to maintain the hospital's drug catalog. For example, when the hospital is successfully registered, a hospital administrator account can be added for each hospital in the hospital management interface. When a user logs in to the system with a hospital administrator account, he can only see the basic information of the hospital and the drug catalog of the hospital.

[0039] In one embodiment, the blockchain-based hospital drug catalog sharing method may also include: dividing hospital data into two parts: hospital on-chain data and hospital off-chain data; wherein, the hospital on-chain data includes the hospital's public key, private key, the registrant's first public key, the first digital signature, the drug catalog and at least one of the symmetric keys encrypted by the pharmacy's public key, and the hospital off-chain data includes at least one of the hospital name, hospital private key and hospital address; wherein, the hospital's public key, private key, the registrant's first public key and the first digital signature are written into the hospital contract and the database table, including: storing the hospital on-chain data in the hospital contract; storing the hospital off-chain data in the database table.

[0040] The hospital data is divided into two parts: on-chain and off-chain. The on-chain data is stored in the hospital contract. The hospital contract data structure is designed as follows:

[0041] {

[0042] Hospital id, / / hospital's unified code, primary key

[0043] Hospital public key,

[0044] Registrant public key, / / Registrant is the platform administrator

[0045] Registrant signature, / / Registrant performs SM2 digital signature on "hospital id + hospital public key" Drug catalog, / / Hospital drug catalog

[0046] Encrypted symmetric key / / Encrypt the symmetric key using the pharmacy's public key

[0047] }

[0048] The hospital contract provides interfaces for adding, deleting, modifying, and querying (querying a single entry by ID).

[0049] The hospital's off-chain data is stored in the MySQL database, and its table structure adds the following fields on the basis of the hospital contract fields: hospital name, hospital address, and hospital private key.

[0050] Hospital contracts are deployed on the blockchain BaaS platform to realize encrypted storage of hospital data on the chain. The hospital smart contract includes attributes such as hospital ID, hospital public key, registrant public key, registrant signature, drug catalog encrypted with symmetric key, symmetric key encrypted with pharmacy public key, etc. Attributes such as hospital name and hospital private key are stored in the off-chain database. Hospital contract is a smart contract that uses smart contracts to manage data access rights and verification logic stored off-chain on the blockchain. Smart contracts can ensure that only authorized users can access data stored off-chain. At the same time, smart contracts can also record data access history and change records to increase data traceability. The hash value and smart contract stored on the chain can ensure the security and authenticity of the data stored off-chain, and off-chain storage can use low-cost storage solutions to reduce overall storage costs.

[0051] In one embodiment, before the above step 100, the hospital drug catalog sharing method based on blockchain may also include: obtaining basic information of the pharmacy; wherein the basic information includes at least one of the pharmacy's identification number, the pharmacy's name, and the pharmacy's address; based on the pharmacy's basic information and the pharmacy key generation instruction, generating the pharmacy's public key and private key; based on the registrant's signature instruction, generating the registrant's second public key and second digital signature to complete the pharmacy registration; wherein the registrant represents the platform administrator, and the registrant's second digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric SM2 encryption of the pharmacy's identification number and the pharmacy's public key; writing the pharmacy's public key, private key, registrant's second public key and second digital signature into the pharmacy contract and database table to complete the pharmacy registration; when the pharmacy is successfully registered, binding the pharmacy administrator's account information to the pharmacy; wherein the pharmacy administrator is used to view the drug catalog shared by the associated hospital.

[0052] The present invention provides a registration and management interface for pharmacies for platform administrators, wherein, in the registration interface of the pharmacy, the platform administrator needs to input the basic information of the pharmacy such as ID, name, address, etc., and can automatically generate the public key and private key of the pharmacy by clicking the "drugstore key generation" button, and automatically generate the public key and digital signature of the registrant by clicking the "registrant signature" button, and click the "submit" button to write the corresponding data into the pharmacy contract and database table. The registrant here refers to the platform administrator, and the registrant signature refers to the use of the platform administrator's private key to generate a digital signature after SM2 asymmetric encryption of "drugstore id + drugstore public key". Successfully registered pharmacies can be displayed in a list form on the management interface, and basic management functions such as query, deletion, and modification of pharmacies can be provided on the management interface.

[0053] SM2 is an asymmetric encryption algorithm, a public key cryptographic algorithm based on the Elliptic Curve Cryptography (ECC) system, and based on the Elliptic Curve Discrete Logarithm Problem (ECDLP), which provides high security with a relatively short key length.

[0054] Every pharmacy needs a pharmacy administrator. For example, after the pharmacy is successfully registered, a pharmacy administrator account can be added for each pharmacy in the pharmacy's management interface. When the user logs in to the system with the pharmacy administrator account, he can only see the basic information of the pharmacy and view the drug catalog shared with the pharmacy by various hospitals.

[0055] In one embodiment, the hospital drug catalog sharing method based on blockchain may also include: dividing the pharmacy data into two parts: pharmacy on-chain data and pharmacy off-chain data; wherein the pharmacy on-chain data includes at least one of the pharmacy's public key, private key, second public key of the registrant and second digital signature, and the pharmacy off-chain data includes at least one of the pharmacy name, pharmacy address and pharmacy private key; wherein the pharmacy's public key, private key, second public key of the registrant and second digital signature are written into the pharmacy contract and database table to complete the registration of the pharmacy, including: storing the pharmacy on-chain data in the pharmacy contract; storing the pharmacy off-chain data in the database table.

[0056] The pharmacy data is divided into two parts: on-chain and off-chain. The on-chain data is stored in the pharmacy contract. The pharmacy contract data structure is designed as follows:

[0057] {

[0058] Pharmacy ID, / / The unified code of the pharmacy, primary key

[0059] Pharmacy public key,

[0060] Registrant public key, / / Registrant is the platform administrator

[0061] Registrant’s signature / / The registrant performs SM2 digital signature on “drug store ID + drug store public key”

[0062] }

[0063] The pharmacy contract provides interfaces for adding, deleting, modifying, and querying (querying a single item by ID).

[0064] The off-chain data of the pharmacy is stored in the MySQL database. The table structure is based on the pharmacy contract fields and adds the following fields: pharmacy name, pharmacy address, and pharmacy private key.

[0065] The pharmacy contract is deployed on the blockchain BaaS platform to realize the encrypted storage of pharmacy data on the chain. The pharmacy smart contract includes attributes such as the pharmacy ID, pharmacy public key, registrant public key, registrant signature, etc. Attributes such as the pharmacy name and pharmacy private key are stored in the off-chain database. The pharmacy contract is a smart contract that uses the pharmacy contract to manage the data access rights and verification logic stored off-chain on the blockchain. The pharmacy contract can ensure that only authorized users can access the data stored off-chain. At the same time, the pharmacy contract can also record the access history and change records of the data to increase the traceability of the data. The hash value and smart contract stored on the chain can ensure the security and authenticity of the data stored off-chain, and the off-chain storage can use low-cost storage solutions to reduce the overall storage cost.

[0066] In one embodiment, the above step 200 may include: the drug catalog corresponding to the hospital is encrypted by the AES symmetric encryption algorithm and uploaded to the chain through the hospital contract as an attribute of the hospital; wherein the drug catalog is in JSON array format, and the drug catalog includes two fields: drug name and drug identification number.

[0067] AES (Advanced Encryption Standard) is an efficient, secure and flexible symmetric encryption algorithm. The encryption and decryption process uses the same key and involves multiple steps, including key expansion, initial round key addition, multiple rounds of encryption operations (byte replacement, row shift, column confusion, round key addition), etc. The encrypted drug catalog is used as an attribute and uploaded to the chain through hospital agreement, which improves the data security of the drug catalog.

[0068] In one embodiment, the above step 100 may include: importing the drug catalog using Excel batch import; when importing the drug catalog, verifying the drugs in the drug catalog; when the drug's identification number does not exist in the global drug catalog, importing the corresponding drug record fails.

[0069] Due to the large number of drugs in the hospital, the drug catalog is uploaded by batch importing using Excel. During upload, a check will be performed. If the drug ID does not exist in the global drug catalog, the import of this record will fail. After verification, the accuracy of the drug catalog is ensured.

[0070] In one embodiment, the blockchain-based hospital drug catalog sharing method may also include: when the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key, the association between the pharmacy and the hospital is verified; when the pharmacy and the hospital have no association, the pharmacy's private key cannot decrypt the symmetric key on the chain; when the pharmacy and the hospital have an association, the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key and obtains the drug catalog shared by the hospital.

[0071] If the pharmacy is not bound to the hospital, the pharmacy's private key cannot decrypt the symmetric key, ensuring the security of the drug catalog and establishing a secure data sharing environment.

[0072] In one embodiment, the hospital drug catalog sharing method based on blockchain may also include: when any pharmacy needs to join the group of the target hospital, the pharmacy submits an application to join the target hospital; wherein the target hospital is any one of multiple hospitals; the approval node of the target hospital approves the application to join; when the application to join is approved, the pharmacy joins the group of the target hospital for association to obtain the drug catalog of the target hospital.

[0073] If a pharmacy wants to join a hospital group, it can submit an application online and can join only after approval. The approval node of the hospital can be configured arbitrarily, for example, the hospital administrator or other staff members of the hospital can be configured as the approval node.

[0074] Figure 3 is a schematic diagram of a hospital drug catalog sharing principle based on blockchain provided by an exemplary embodiment of the present invention. Figure 3 As shown, in Group 1 and Group 2, Drug Catalog 1 and Drug Catalog 2 are both symmetrically encrypted and put on the chain, and written into the hospital contract as the attributes of the hospital. Hospital 1 is associated with Drug Catalog 1, and Hospital 2 is associated with Drug Catalog 2. Hospital 1 is then associated with Pharmacy 1, Pharmacy 2, and Pharmacy 3 respectively, and Hospital 2 is associated with Pharmacy 3, Pharmacy 4, and Pharmacy 5 respectively. Pharmacy 3 can be associated with both Hospital 1 and Hospital 2 at the same time. Then, Pharmacy 1, Pharmacy 2, and Pharmacy 3 encrypt the symmetric key using the pharmacy public key, form three encrypted symmetric keys, put them on the chain, and write them into the hospital contract. Pharmacy 3, Pharmacy 4, and Pharmacy 5 encrypt the symmetric key using the pharmacy public key, form three encrypted symmetric keys, put them on the chain, and write them into the hospital contract.

[0075] Figure 4is a schematic diagram of a hospital drug catalog sharing device based on blockchain provided by an exemplary embodiment of the present invention. Figure 4 As shown, the hospital drug catalog sharing device 6 based on blockchain includes: an import module 41, which is used to import the drug catalog and encrypt the drug catalog through a symmetric encryption algorithm and then upload it to the chain; an association module 42, which is used to associate hospitals and drug catalogs; wherein, one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs; a grouping module 43, which is used to establish each of the multiple hospitals as a group, and add multiple pharmacies to the group for association; wherein, a hospital group includes multiple pharmacies, and one pharmacy belongs to multiple groups; an encryption module 44, which is used when a pharmacy joins the hospital's group, the hospital will encrypt the symmetric key through the public key of the pharmacy that joins the group and then upload it to the chain, so that the pharmacy can decrypt the symmetric key on the chain through the pharmacy's private key, and then decrypt the drug catalog through the symmetric key; wherein, the number of pharmacies is consistent with the number of encrypted symmetric keys, and each pharmacy corresponds to an encrypted symmetric key.

[0076] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured to: obtain the basic information of the hospital; wherein the basic information includes at least one of the hospital's identification number, the hospital's name, and the hospital's address; based on the hospital's basic information and the hospital's key generation instruction, generate the hospital's public key and private key; based on the registrant's signature instruction, generate the registrant's first public key and first digital signature; wherein the registrant represents the platform administrator, and the registrant's first digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric SM2 encryption of the hospital's identification number and the hospital's public key; write the hospital's public key, private key, the registrant's first public key and the first digital signature into the hospital contract and database table to complete the hospital's registration; when the hospital is successfully registered, bind the hospital administrator's account information to the hospital; wherein the hospital administrator is used to maintain the bound hospital's drug catalog.

[0077] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured to: divide hospital data into two parts: hospital on-chain data and hospital off-chain data; wherein, the hospital on-chain data includes the hospital's public key, private key, the registrant's first public key, the first digital signature, the drug catalog and at least one of the symmetric keys encrypted by the pharmacy's public key, and the hospital off-chain data includes at least one of the hospital name, hospital private key and hospital address; wherein, the hospital's public key, private key, the registrant's first public key and the first digital signature are written into the hospital contract and the database table, including: storing the hospital on-chain data in the hospital contract; storing the hospital off-chain data in the database table.

[0078] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured to: obtain basic information of the pharmacy; wherein the basic information includes at least one of the pharmacy's identification number, the pharmacy's name, and the pharmacy's address; based on the pharmacy's basic information and the pharmacy's key generation instruction, generate the pharmacy's public key and private key; based on the registrant's signature instruction, generate the registrant's second public key and second digital signature to complete the pharmacy's registration; wherein the registrant represents the platform administrator, and the registrant's second digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric SM2 encryption of the pharmacy's identification number and the pharmacy's public key; write the pharmacy's public key, private key, registrant's second public key and second digital signature into the pharmacy contract and database table to complete the pharmacy's registration; when the pharmacy is successfully registered, bind the pharmacy administrator's account information to the pharmacy; wherein the pharmacy administrator is used to view the drug catalog shared by the associated hospital.

[0079] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured to: divide the pharmacy data into two parts: pharmacy on-chain data and pharmacy off-chain data; wherein, the pharmacy on-chain data includes at least one of the pharmacy's public key, private key, second public key of the registrant and second digital signature, and the pharmacy off-chain data includes at least one of the pharmacy name, pharmacy address and pharmacy private key; wherein, the pharmacy's public key, private key, second public key of the registrant and second digital signature are written into the pharmacy contract and database table to complete the registration of the pharmacy, including: storing the pharmacy on-chain data in the pharmacy contract; storing the pharmacy off-chain data in the database table.

[0080] In one embodiment, the above-mentioned association module 42 can be configured as follows: the drug catalog corresponding to the hospital is encrypted by the AES symmetric encryption algorithm and uploaded to the chain through the hospital contract as an attribute of the hospital; wherein the drug catalog is in JSON array format, and the drug catalog includes two fields: drug name and drug identification number.

[0081] In one embodiment, the above-mentioned import module 41 can be configured as follows: importing the drug catalog by Excel batch import; when importing the drug catalog, verifying the drugs in the drug catalog; when the drug's identification number does not exist in the global drug catalog, the import of the corresponding drug record fails.

[0082] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured as follows: when the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key, the association between the pharmacy and the hospital is verified; when the pharmacy and the hospital have no association, the pharmacy's private key cannot decrypt the symmetric key on the chain; when the pharmacy and the hospital have an association, the pharmacy decrypts the symmetric key on the chain through the pharmacy's private key and obtains the drug catalog shared by the hospital.

[0083] In one embodiment, the blockchain-based hospital drug catalog sharing device 6 can also be configured as follows: when any pharmacy needs to join the group of a target hospital, the pharmacy submits an application to join the target hospital; wherein the target hospital is any one of a plurality of hospitals; the approval node of the target hospital approves the application to join; when the application to join is approved, the pharmacy joins the group of the target hospital for association to obtain the drug catalog of the target hospital.

[0084] The embodiment of the present invention provides a hospital drug catalog sharing device based on blockchain. The device embodiment can be implemented by software, or by hardware or a combination of software and hardware. From the hardware level, in addition to the CPU, memory, network interface, and non-volatile memory, the device in the embodiment where the device is located can generally include other hardware, such as a forwarding chip responsible for processing messages, etc. Taking software implementation as an example, as a device in a logical sense, it is formed by the CPU of the device where it is located reading the corresponding computer program instructions in the non-volatile memory into the memory for execution.

[0085] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the storage medium stores a computer program for executing the hospital drug catalog sharing method based on blockchain of any of the above embodiments.

[0086] In addition to the above-mentioned methods and devices, an embodiment of the present invention may also be a computer program product, which includes computer program instructions, which, when executed by a processor, enable the processor to execute the steps of the blockchain-based hospital drug catalog sharing method according to various embodiments of the present invention described in the above "Exemplary Method" section of this specification.

[0087] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing processor executable instructions; and a processor for executing the blockchain-based hospital drug catalog sharing method of any of the above embodiments.

[0088] In addition, an embodiment of the present invention may also be a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, causes the processor to execute the steps of the blockchain-based hospital drug catalog sharing method according to various embodiments of the present invention described in the above “Exemplary Method” section of this specification.

[0089] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A hospital drug catalog sharing method based on blockchain, characterized in that: include: Import the drug catalog and encrypt the drug catalog through a symmetric encryption algorithm and then upload it to the chain; Associate hospitals and drug catalogs; one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs; Each of the multiple hospitals is set up as a group, and multiple pharmacies are added to the groups for association; wherein a hospital group includes multiple pharmacies, and a pharmacy belongs to multiple groups; When a pharmacy joins the hospital's group, the hospital encrypts the symmetric key with the public key of the pharmacy and uploads it to the chain, so that the pharmacy can decrypt the symmetric key on the chain with the pharmacy's private key, and then decrypt the drug catalog with the symmetric key; the number of pharmacies is the same as the number of encrypted symmetric keys, and each pharmacy corresponds to an encrypted symmetric key.

2. The method for sharing hospital drug catalog based on blockchain according to claim 1, characterized in that: Before importing the drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to the chain, the hospital drug catalog sharing method based on blockchain also includes: Obtaining basic information of the hospital; wherein the basic information includes at least one of the hospital's identification number, the hospital's name, and the hospital's address; Generate the hospital's public key and private key based on the hospital's basic information and the hospital's key generation instructions; Based on the registrant's signature instruction, generate the registrant's first public key and first digital signature; wherein the registrant represents the platform administrator, and the registrant's first digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric encrypt the hospital's identity number and the hospital's public key through SM2; Write the hospital's public key, private key, the registrant's first public key and first digital signature into the hospital contract and database table to complete the hospital's registration; When the hospital is successfully registered, the account information of the hospital administrator is bound to the hospital; wherein, the hospital administrator is used to maintain the drug catalog of the bound hospital.

3. The method for sharing hospital drug catalog based on blockchain according to claim 2 is characterized in that: The blockchain-based hospital drug catalog sharing method also includes: The hospital data is divided into two parts: hospital on-chain data and hospital off-chain data; wherein the hospital on-chain data includes at least one of the hospital's public key, private key, first public key of the registrant, first digital signature, drug catalog and symmetric key encrypted by the public key of the pharmacy, and the hospital off-chain data includes at least one of the hospital name, hospital private key and hospital address; Among them, the hospital's public key, private key, the registrant's first public key and the first digital signature are written into the hospital contract and database table, including: Store the hospital's on-chain data into the hospital contract; The hospital off-chain data is stored in a database table.

4. The method for sharing hospital drug catalog based on blockchain according to claim 1, characterized in that: Before importing the drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to the chain, the hospital drug catalog sharing method based on blockchain also includes: Obtaining basic information of the pharmacy; wherein the basic information includes at least one of the pharmacy's identification number, the pharmacy's name, and the pharmacy's address; Generate the pharmacy's public key and private key based on the pharmacy's basic information and the pharmacy's key generation instruction; Based on the registrant's signature instruction, generate the registrant's second public key and second digital signature to complete the pharmacy's registration; wherein the registrant represents the platform administrator, and the registrant's second digital signature represents the digital signature generated by using the platform administrator's private key to asymmetric encrypt the pharmacy's identity number and the pharmacy's public key through SM2; Write the pharmacy's public key, private key, the registrant's second public key and second digital signature into the pharmacy contract and database table to complete the pharmacy's registration; When the pharmacy is successfully registered, the account information of the pharmacy administrator is bound to the pharmacy; wherein, the pharmacy administrator is used to view the drug catalog shared by the associated hospital.

5. The method for sharing hospital drug catalog based on blockchain according to claim 4 is characterized in that: The blockchain-based hospital drug catalog sharing method also includes: The pharmacy data is divided into two parts: pharmacy on-chain data and pharmacy off-chain data; wherein the pharmacy on-chain data includes at least one of the pharmacy's public key, private key, second public key of the registrant and second digital signature, and the pharmacy off-chain data includes at least one of the pharmacy name, pharmacy address and pharmacy private key; Among them, the pharmacy's public key, private key, the registrant's second public key and the second digital signature are written into the pharmacy contract and database table to complete the pharmacy's registration, including: Store the pharmacy on-chain data into the pharmacy contract; The off-chain data of the pharmacy is stored in a database table.

6. The method for sharing hospital drug catalog based on blockchain according to claim 1, characterized in that: A directory of associated hospitals and medicines, including: The hospital's corresponding drug catalog is encrypted using the AES symmetric encryption algorithm and uploaded to the chain through the hospital contract as an attribute of the hospital. The drug catalog is in JSON array format and includes two fields: drug name and drug identification number.

7. The method for sharing hospital drug catalog based on blockchain according to claim 6 is characterized in that: Importing a drug catalog and encrypting the drug catalog through a symmetric encryption algorithm and then uploading it to the chain includes: Import the drug catalog using Excel batch import; When importing a drug catalog, verify the drugs in the drug catalog; When the identification number of a drug does not exist in the global drug catalog, the import of the corresponding drug record fails.

8. The method for sharing hospital drug catalog based on blockchain according to claim 1, characterized in that: The blockchain-based hospital drug catalog sharing method also includes: When the pharmacy decrypts the symmetric key on the chain using the pharmacy’s private key, the association between the pharmacy and the hospital is verified; When the pharmacy and the hospital are not associated, the pharmacy's private key cannot decrypt the symmetric key on the chain; When a pharmacy and a hospital are associated, the pharmacy uses its private key to decrypt the symmetric key on the chain and obtain the hospital's shared drug catalog.

9. The method for sharing hospital drug catalog based on blockchain according to claim 1, characterized in that: The blockchain-based hospital drug catalog sharing method also includes: When any pharmacy needs to join the target hospital group, the pharmacy submits an application for joining the target hospital; the target hospital is any one of the multiple hospitals; The approval node of the target hospital approves the admission application; When the application for joining is approved, the pharmacy joins the group of the target hospital and is associated to obtain the drug catalog of the target hospital.

10. A hospital drug catalog sharing device based on blockchain, characterized in that: include: An import module, used to import a drug catalog and encrypt the drug catalog through a symmetric encryption algorithm and then upload it to the chain; An association module is used to associate hospitals and drug catalogs; one hospital corresponds to one drug catalog, and one drug catalog includes multiple drugs; A grouping module is used to set up each of the multiple hospitals as a group, and add multiple pharmacies to the groups for association; wherein a hospital group includes multiple pharmacies, and a pharmacy belongs to multiple groups; The encryption module is used when the pharmacy joins the hospital's group. The hospital encrypts the symmetric key through the public key of the pharmacy that has joined the group and then uploads it to the chain, so that the pharmacy can decrypt the symmetric key on the chain through the pharmacy's private key, and then decrypt the drug catalog through the symmetric key; the number of pharmacies is consistent with the number of encrypted symmetric keys, and each pharmacy corresponds to an encrypted symmetric key.

Citation Information

Patent Citations

  • Shared transfer method based on electronic prescription and shared transfer platform based on electronic prescription

    CN108648789A

  • Medical data sharing method, device and equipment and computer readable medium

    CN112908442A

  • Medical data sharing method based on block chain

    CN114979210A

  • Block chain prescription implementation method based on group signature

    CN115408709A

  • Method for Transmitting and Managing Doctor'sPrescription to Pharmacy in a Secured Manner

    KR1020010087920A