On-chain and off-chain interaction method and system for hierarchical diagnosis and treatment data based on consortium blockchain
Through the tiered diagnosis and treatment data link on-chain interaction method based on the alliance chain, the problem of inconvenience of information sharing among medical institutions is solved, efficient, secure sharing and verification of data is achieved, and referral efficiency and treatment effect are improved.
Patent Information
- Application Number
- CN202410604745.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-15
- Publication Date
- 2025-06-03
- Estimated Expiration
- 2044-05-15
AI Technical Summary
The lack of information sharing and collaboration mechanisms between different medical institutions leads to the possibility of omission, loss, and lack of referral materials when carrying referral materials, which affects the patient's referral efficiency and treatment effect.
The hierarchical diagnosis and treatment data chain offline interaction method based on the alliance chain is adopted, and data sharing and verification between superior and subordinate hospitals is realized through patient private key signature, and plaintext data generated on-chain by lower-level hospitals, and encryption, proxy re-encryption, storage in alliance chain and transmission to off-chain data channels.
Through the collaborative interaction between alliance chain and cloud storage, hybrid storage of referral data is realized, which improves data transmission efficiency, security and controllability, and solves the inconvenience of information sharing and collaboration.
Smart Images

Figure CN118802100B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of medical information technology, and particularly relates to a method and system for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain. Background Art
[0002] Hierarchical diagnosis and treatment is an important means for the rational allocation of medical resources. It is graded according to the severity and difficulty of diseases, and medical and health institutions at different levels undertake the diagnosis and treatment of different diseases, thus forming a reasonable medical treatment and diagnosis pattern; establishing and improving the hierarchical diagnosis and treatment system, and gradually realizing a reasonable medical treatment order of primary diagnosis, two-way referral, up-down linkage, and separation of acute and chronic diseases is the key to accelerating the promotion of medical and health informatization.
[0003] However, in fact, due to reasons such as trust mechanisms and interest conflicts, there are problems such as lack of information sharing and poor cooperation mechanisms between different medical institutions. Referral patients often need to carry various referral materials (referral certificates, medical records, medical images, expense lists, etc.) back and forth between upper and lower hospitals. These materials are often omitted, lost, or missing during the carrying process, bringing great inconvenience to patient referrals; especially in the case of emergency referrals, it is urgent to obtain the patient's historical diagnosis and treatment information so that emergency personnel can take appropriate diagnosis and treatment measures, thereby improving the treatment effect of patients.
[0004] Therefore, there is an urgent need to provide a technical solution to address the deficiencies of the above-mentioned existing technologies. Summary of the Invention
[0005] The purpose of the present application is to provide a method and system for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain to solve or alleviate the problems existing in the above-mentioned existing technologies.
[0006] To achieve the above purpose, the present application provides the following technical solutions:
[0007] The present application provides a method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain, including: after the patient signs the off-chain encrypted data generated by the lower-level hospital based on the patient's authorization with the patient's private key, the lower-level hospital generates on-chain plaintext data HF c , and encrypts the generated on-chain plaintext data HF c with the patient's public key corresponding to the patient's private key to obtain the on-chain ciphertext data HF p ;
[0008] The lower-level hospital re-encrypts the on-chain ciphertext data HF p based on the proxy re-encryption key to generate a proxy re-encrypted ciphertext HF hlh ;
[0009] The subordinate hospital stores the proxy re-encrypted ciphertext HF on the consortium blockchain based on the patient's pseudo-identity information, and transmits the signed off-chain encrypted data through the off-chain data channel; hlh
[0010] In response to the successful verification of the superior hospital's authority, the superior hospital obtains the proxy re-encrypted ciphertext HF from the consortium blockchain hlh and decrypts it to obtain the on-chain plaintext data HF c ;
[0011] The superior hospital obtains the off-chain encrypted data based on the on-chain plaintext data HF obtained by decryption c and decrypts it to obtain the patient's original diagnosis and treatment data F p , and verifies the original diagnosis and treatment data F p .
[0012] Preferably, after the patient signs the off-chain encrypted data generated by the subordinate hospital based on the patient's authorization with the patient's private key, the subordinate hospital generates the on-chain plaintext data HF c , and encrypts the generated on-chain plaintext data HF c with the patient's public key corresponding to the patient's private key to obtain the on-chain ciphertext data HF p , including:
[0013] The patient performs a hash operation on the original diagnosis and treatment data F p , and based on the SM2 signature algorithm, calculates through the patient's private key and the result of the hash operation to generate the signature SigP;
[0014] The subordinate hospital encrypts the signed original diagnosis and treatment data F p based on the random key KEY p to obtain the ciphertext F s ;
[0015] The subordinate hospital splits the ciphertext F s , randomly inserts encrypted bytes into the obtained n split sub-files to generate the off-chain encrypted data; where the off-chain encrypted data contains n encrypted sub-files, and n is a positive integer;
[0016] The patient signs the encrypted sub-file based on the patient's private key;
[0017] The subordinate hospital integrates the patient's basic information, the signature SigP, the random key KEY p , file name, the number of encrypted sub-files, and the signed encrypted sub-files to generate the on-chain plaintext data HF c ; among them, the basic patient information includes: ID number, medical record number, name, gender, age, and description of the condition;
[0018] The lower-level hospital encrypts the plaintext data on the chain based on the patient's public key to obtain the ciphertext data HF on the chain p .
[0019] Preferably, the off-chain data channel includes: private data set, dedicated channel, and cloud storage; the transmission of the signed off-chain encrypted data through the off-chain data channel includes:
[0020] Dividing the off-chain encrypted data into fee transaction data and disease diagnosis and treatment data,
[0021] Transmitting the fee transaction data through the private data set;
[0022] Based on a pre-determined transmission weight, transmitting the disease diagnosis and treatment data through a dedicated channel or cloud storage.
[0023] Preferably, the upper-level hospital obtains the proxy re-encrypted ciphertext HF from the consortium chain hlh and decrypts it to obtain the plaintext data HF on the chain c , including: the upper-level hospital decrypts the proxy re-encrypted ciphertext obtained from the consortium chain based on the private key of the upper-level hospital to obtain the plaintext data HF on the chain c .
[0024] Preferably, the upper-level hospital, according to the plaintext data HF obtained by decryption c , obtains the off-chain encrypted data based on the off-chain data channel and decrypts it to obtain the patient's original diagnosis and treatment data F p , and verifies the original diagnosis and treatment data F p , including: according to the plaintext data HF obtained by decryption c , obtaining the off-chain encrypted data based on the off-chain data channel;
[0025] Decrypting all the encrypted sub-files in the off-chain encrypted data to obtain the ciphertext F s ;
[0026] Based on the random key KEY included in the plaintext data HF on the chain c to decrypt the obtained ciphertext F p to obtain the original diagnosis and treatment data F s . p .
[0027] Preferably, decrypt all the encrypted sub-files in the off-chain encrypted data to obtain the ciphertext F s , including: performing signature verification on the obtained encrypted sub-files;
[0028] In response to the signature verification passing, obtain the encrypted bytes inserted correspondingly in the encrypted sub-files according to the plaintext information in the on-chain plaintext data HF c ;
[0029] Delete the encrypted bytes inserted correspondingly in the encrypted sub-files to obtain the corresponding split sub-files;
[0030] At the same time, decrypt the encrypted bytes inserted correspondingly in the encrypted sub-files to obtain the hash value of the corresponding split sub-files, so as to perform hash verification on the obtained split sub-files;
[0031] In response to the hash verification passing, merge all the split sub-files to obtain the ciphertext F s .
[0032] Preferably, the verification of the original diagnosis and treatment data F p includes:
[0033] Based on the patient's public key and the signature SigP, perform signature verification on the original diagnosis and treatment data F p .
[0034] Preferably, based on the elliptic curve public key cryptography algorithm, determine the patient's public key, the patient's private key, and the proxy re-encryption key.
[0035] The embodiment of the present application further provides a hierarchical diagnosis and treatment data on-chain and off-chain interaction system based on a consortium blockchain, including: an initial ciphertext unit configured to, after the patient signs the off-chain encrypted data generated by a lower-level hospital based on the patient's authorization through the patient's private key, the lower-level hospital generates on-chain plaintext data HF c , and encrypts the generated on-chain plaintext data HF c through the patient's public key corresponding to the patient's private key to obtain the on-chain plaintext data HF p ;
[0036] A proxy re-encryption unit configured to re-encrypt the on-chain ciphertext data HF p by the lower-level hospital based on the proxy re-encryption key to generate a proxy re-encrypted ciphertext HF hlh ;
[0037] A data transmission unit configured to, based on the pseudo-identity information of the patient, the lower-level hospital transmits the proxy re-encrypted ciphertext HF hlhStore it on the consortium blockchain, and transmit the signed off-chain encrypted data through the off-chain data channel;
[0038] The upper-level data acquisition unit is configured to, in response to the successful verification of the upper-level hospital's authority, the upper-level hospital obtains the proxy re-encrypted ciphertext HF from the consortium blockchain hlh and decrypt it to obtain the on-chain plaintext data HF c ;
[0039] The original data acquisition and verification unit is configured to, based on the on-chain plaintext data HF obtained by the upper-level hospital through decryption c , obtain the off-chain encrypted data acquired based on the off-chain data channel and decrypt it to obtain the patient's original diagnosis and treatment data F p , and verify the original diagnosis and treatment data F p .
[0040] Beneficial effects:
[0041] In the hierarchical diagnosis and treatment data on-chain and off-chain interaction method based on the consortium blockchain provided by the embodiments of the present application, based on the patient's authorization, first, the patient signs the off-chain encrypted data generated by the lower-level hospital based on the patient's authorization with the patient's private key, and then the lower-level hospital generates the on-chain plaintext data HF c , and encrypts the generated on-chain plaintext data HF c based on the patient's public key corresponding to the patient's private key to obtain the on-chain ciphertext data HF p ; then, the lower-level hospital re-encrypts the on-chain ciphertext data HF p based on the proxy re-encryption key to generate the proxy re-encrypted ciphertext HF hlh ; then, based on the patient's pseudo-identity information, store the proxy re-encrypted ciphertext HF hlh on the consortium blockchain, and transmit the signed off-chain encrypted data through the off-chain data channel; the upper-level hospital first conducts authority verification, and after the authority verification is passed, obtains the proxy re-encrypted ciphertext HF from the consortium blockchain hlh and decrypts it to obtain the on-chain plaintext data HF c ; then, based on the on-chain plaintext data HF obtained by decryption c , obtain the off-chain encrypted data based on the off-chain data channel and decrypt it to obtain the patient's original diagnosis and treatment data F p and verify it. Therefore, the upper and lower hospitals form a consortium blockchain, and the referral data is stored in a hybrid manner on-chain and off-chain. Through different on-chain and off-chain transmission methods and encryption strategies, cloud-chain collaborative data sharing is achieved, improving the data transmission efficiency, secure access, and controllable sharing. Description of the Drawings
[0042] The accompanying drawings of the specification, which form a part of this application, are used to provide a further understanding of this application. The schematic embodiments and descriptions thereof of this application are used to explain this application and do not constitute an improper limitation of this application. Among them:
[0043] Figure 1 It is a schematic flow chart of a method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain according to some embodiments of this application;
[0044] Figure 2 It is a schematic logical diagram of on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain according to some embodiments of this application;
[0045] Figure 3 It is a schematic diagram of secure breakpoint resumption of file sharding based on a consortium blockchain according to some embodiments of this application;
[0046] Figure 4 It is a schematic structural diagram of a system for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on a consortium blockchain according to some embodiments of this application. Detailed implementation manners
[0047] Hereinafter, this application will be described in detail with reference to the accompanying drawings and in conjunction with embodiments. Each example is provided by way of explanation of this application rather than a limitation of this application. In fact, those skilled in the art will clearly understand that modifications and variations can be made to this application without departing from the scope or spirit of this application. For example, features shown or described as part of one embodiment can be used in another embodiment to yield yet another embodiment. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in this invention embodiment shall fall within the scope of protection of this invention embodiment.
[0048] Currently, to accelerate the promotion of medical and health informatization construction, one of the keys is to achieve continuous recording of electronic health records and electronic medical records and information sharing between medical institutions of different levels and categories to ensure the smooth flow of referral information; however, due to reasons such as trust mechanisms and interest conflicts, there are problems such as lack of information sharing and unsmooth cooperation mechanisms between different medical institutions.
[0049] With the emergence of cloud services, electronic case sharing based on cloud platforms can conveniently manage data and reduce the cost of local storage. However, this model also faces problems such as availability, accessibility, standardization, as well as data tampering and hacker attacks, thus undermining the credibility of information.
[0050] As a chain - based storage, immutable, secure, and trustworthy decentralized distributed ledger, blockchain records information through continuously growing data blocks to ensure data security and transparency. However, current blockchain - based medical information sharing solutions all use the blockchain itself to share data. Due to reasons such as the multi - source heterogeneity, large amount of information, high privacy protection requirements of medical and health data, and limited storage capacity of consortium chain nodes, it is not suitable to directly store a large amount of raw data on the consortium chain. Therefore, it is necessary to combine blockchain and cloud storage technologies to complement each other's advantages and achieve data sharing with cloud - chain collaboration.
[0051] In the context of hierarchical medical treatment and cloud - chain collaboration, aiming at the problems of sensitive data sharing, timely data sharing during the referral of critically ill patients, and efficient contribution of large - file medical data, this application proposes a method for on - chain and off - chain interaction of hierarchical medical treatment data based on the consortium chain. The superior and inferior hospitals form a consortium blockchain, and the referral data is stored in a hybrid manner on - chain and off - chain. Through different transmission methods and encryption strategies, the data transmission efficiency, secure access, and controllable sharing are improved.
[0052] As Figures 1 to 3 shown, the method for on - chain and off - chain interaction of hierarchical medical treatment data based on the consortium chain includes:
[0053] Step S101: After the patient signs the off - chain encrypted data generated by the inferior hospital based on the patient's authorization using the patient's private key, the inferior hospital generates on - chain plaintext data HF c , and encrypts the generated on - chain plaintext data HF c using the patient's public key corresponding to the patient's private key to obtain on - chain ciphertext data HF p .
[0054] In this application, the patient is the user of the authorized data; for the use of all patient data, the patient's authorization is required. Only with the patient's authorization can the inferior hospital act as an agent. The inferior hospital generates the original data required for the patient's transfer based on the patient's authorization, encrypts these original data, and generates on - chain plaintext data and off - chain encrypted data.
[0055] In the process of generating off - chain encrypted data and on - chain plaintext data HF c , first, the inferior hospital packs various original materials required for the patient's transfer to obtain the original diagnosis and treatment data F p ; then, the patient performs a hash operation on the original diagnosis and treatment data F p to obtain Hash p , and based on the SM2 signature algorithm, calculates using the patient's private key PR p and the result Hash p of the hash operation to generate the signature SigP.
[0056] In the original diagnosis and treatment data Fp After signing, the lower-level hospital generates a ciphertext f by encrypting the original diagnosis and treatment data F based on a random key KEY p Specifically, after the lower-level hospital generates a 256-bit random key KEY using a random number generator p it encrypts the original diagnosis and treatment data F using the AES symmetric encryption algorithm to obtain the ciphertext f s . Specifically, after the lower-level hospital generates a 256-bit random key KEY using a random number generator p it encrypts the original diagnosis and treatment data F using the AES symmetric encryption algorithm to obtain the ciphertext F p with the corresponding file name Name s . s
[0057] Subsequently, the ciphertext F is split, and encrypted bytes are randomly inserted into the obtained n split sub-files to generate off-chain encrypted data; where the off-chain encrypted data contains n encrypted sub-files, and n is a positive integer. Specifically, the lower-level hospital splits the ciphertext F into n split sub-files according to the network bandwidth s The corresponding file names are s For the n split sub-files, first calculate the hash value of each split sub-file using the hash algorithm, and use the OAEP padding algorithm to generate encrypted bytes according to the hash value of each split sub-file The corresponding file names are
[0058] The generated encrypted bytes are randomly inserted into the corresponding split sub-files to generate n new encrypted sub-files, and the start position and end position where the encrypted bytes are inserted are recorded At the same time, the transfer position or storage position is generated and the end position At the same time, the transfer position or storage position is generated Here, it should be noted that the n new encrypted sub-files together constitute the off-chain encrypted data, which is separately transmitted by the lower-level hospital through the off-chain data channel
[0059] After generating the n new encrypted sub-files, the patient signs the encrypted sub-files based on the patient's private key PR p Then the lower-level hospital integrates the patient's basic information, signature SigP, random key KEY p , file name, the number of encrypted sub-files, and the signed encrypted sub-files to generate on-chain plaintext data HF c ; and the lower-level hospital encrypts the on-chain plaintext data based on the patient's public key to obtain on-chain ciphertext data HF p . In this application, since the transmission channel and cloud storage are not completely trusted, the original data and split sub-files need to be signed, and the signature information is saved on the consortium chain. By virtue of the immutability of the consortium chain, the signature is verified to ensure that the file comes from the corresponding patient and has not been tampered with
[0060] Specifically, the lower-level hospital first performs a hashing operation on the encrypted sub-file to obtain Then, the patient uses the SM2 signature algorithm with the patient's private key PR p and to perform calculations and obtain the signature Then, the lower-level hospital integrates the patient's basic information (ID number, medical record number, name, gender, age, description of the condition): info p 、Name p 、SigP、KEY p 、Name s 、 to obtain the on-chain plaintext data HF c ; Finally, use the patient's public key PUB p to encrypt the on-chain plaintext data HF c to obtain the on-chain ciphertext data HF p .
[0061] Step S102: The lower-level hospital re-encrypts the on-chain ciphertext data HF p based on the proxy re-encryption key to generate the proxy re-encrypted ciphertext HF hlh .
[0062] In this application, for the use of all patient data, patient authorization is required. Only with patient authorization can the lower-level hospital act as an agent to generate a proxy re-encryption key based on SM2; the lower-level hospital generates the proxy re-encrypted ciphertext without knowing the data plaintext. This method not only ensures data security but also controls data sharing.
[0063] Based on patient authorization, the lower-level hospital acts as an agent for proxy re-encryption, executes the proxy re-encryption task, and produces the proxy re-encrypted ciphertext HF hlh . Specifically, the lower-level hospital acts as an agent. After obtaining patient authorization, first, use the patient's public key PUB p and the public key PUB of the upper-level hospital hlh to generate the proxy re-encryption key rk p→hlh ; Then use the proxy re-encryption key rk p→hlh to re-encrypt the on-chain ciphertext data HF p to generate the proxy encrypted ciphertext HF hlh .
[0064] In this application, based on the elliptic curve public key cryptography algorithm, the patient's public key, patient's private key, and proxy re-encryption key are determined. Specifically, first, given the security parameter λ, generate the elliptic curve parameters where p is a large prime number, Fp is a finite field. On the finite field F p (where p is a prime number greater than 3), the elliptic curve equation is defined as:
[0065] y 2 = x 3 + ax + b, where a, b ∈ F p , and (4a 3 + 27b 2 ) mod p ≠ 0
[0066] The points satisfying the above elliptic curve equation form an Abelian group, denoted as G represents the generator point of order q on the elliptic curve; is a secure hash function.
[0067] The elliptic curve E(F p ) is defined as:
[0068]
[0069] where O is the point at infinity.
[0070] Input the public parameter params. The user randomly selects d ∈ [1, q - 1] and calculates:
[0071] P = d · G
[0072] where d is saved as the private key and P is made public as the public key. That is, the patient randomly selects the private key d = RP p , and through:
[0073] PUB p = PR p · G
[0074] calculates the patient's public key PUB p . Similarly, the lower-level hospital and the upper-level hospital respectively randomly select the private keys RP llh (private key of the lower-level hospital), private key RP hlh (private key of the upper-level hospital) in [1, q - 1], and calculate the corresponding public keys PUB llh (public key of the lower-level hospital), public key PUB hlh (public key of the upper-level hospital).
[0075] In this application, the patient's public key PUB p and the upper-level hospital's public key PUBh llh are used to generate the proxy re-encryption key rk p→hlh . Specifically, first, a random number generator generates a random number r ∈ [1, q - 1]; then, according to the formula:
[0076]
[0077] Calculate the proxy re-encryption key of the superior hospital; wherein, is a secure hash function.
[0078] Step S103, the inferior hospital stores the proxy re-encrypted ciphertext HF hlh onto the consortium blockchain, and transmits the signed off-chain encrypted data through the off-chain data channel.
[0079] In this application, the consortium blockchain is based on a distributed ledger, effectively removing certain centralization risks, having good immutability, and can effectively guarantee the security and non-changeability of data. By providing patient smart contracts and patient transfer smart contracts on the consortium blockchain, storing and querying encrypted data on the chain, and through the fabric private data collection function, peer-to-peer privacy data sharing is carried out to ensure the security of sensitive data.
[0080] When a patient registers personal information in different hospitals, the hospital generates a unique visit number for the patient. When the patient visits an inferior hospital, the inferior hospital generates a patient number Num llh , and when the patient needs to transfer to another hospital, the superior hospital generates a patient number Num hlh .
[0081] When the patient visits an inferior hospital, the inferior hospital first generates a pseudo-identity information FID P = H i (IdCard|Num llh ), then, uses the pseudo-identity information to store the encrypted data HF p onto the consortium blockchain (Hyperledger Fabric, abbreviated as HF) through a smart contract (PatientTransferContract). When the patient needs to be transferred, the patient provides the visit number of the superior hospital, generates the patient pseudo-identity information FID hlh = H I (IdCard|Num hlh ), and uses the pseudo-identity information FID hlh = H I (IdCard|Num hlh ) to store the proxy re-encrypted ciphertext HF hlh onto the consortium blockchain (HF) through a smart contract (PatientTransferContract). Thereby, through the encryption policy, it effectively ensures that the patient's information will not be maliciously obtained, and by generating the patient's pseudo-identity, the patient's real identity is hidden to protect the patient's privacy.
[0082] During the data transmission process, file transmission may fail due to network latency, interruption, packet loss, etc. Especially for the transmission of large medical files, it will seriously affect the transmission efficiency. Based on this, in this application, a file sharding secure breakpoint resumption scheme based on the consortium blockchain is adopted. First, the ciphertext F s is split into n split sub-files Randomly insert encrypted bytes into the obtained n split sub-files to generate n new encrypted sub-files, and insert the insertion information of the encrypted bytes into the start position and the end position are stored in the consortium blockchain. According to the network bandwidth situation, the encrypted sub-files are sent to the receiving end (upper-level hospital) individually or in parallel. At the same time, the lower-level hospital records the file transmission situation in the local document. If a transmission interruption or failure occurs, the restart and resend mechanism can be based on the transmission record to resend the failed file or the untransmitted file
[0083] For off-chain encrypted data, according to the sensitivity and urgency of the data, the lower-level hospital transmits it through the off-chain data channel. Specifically, the off-chain data channel includes: private data set, dedicated channel, and cloud storage. Among them, the private data set is based on Hyperledger Fabric and can transmit data in a peer-to-peer manner. The transmission security is high but the efficiency is low, which is suitable for transmitting data with high sensitivity; the dedicated channel directly transmits data through the public network interface. The transmission security is moderate and the transmission efficiency is high, but the cost is high, which is suitable for transmitting urgent data; cloud storage is semi-trusted storage, with low security, but large storage capacity, which is suitable for ordinary referral patients
[0084] In this application, the off-chain encrypted data is divided into expense transaction data and disease diagnosis and treatment data. For the disease diagnosis and treatment data, based on the pre-determined transmission weight, it is transmitted through the dedicated channel or cloud storage. Specifically, different transmission weights are set for different off-chain data channels, and files are transmitted from different channels according to the sensitivity and urgency of the files. For ordinary referral patients, the data is sent to the ordinary transmission queue (transmission weight 201 - 1000) for single or multiple parallel uploads to the cloud storage; for critically ill referral patients, the data is distributed to the emergency transmission queue (transmission weight 101 - 200), and the data is transmitted through the dedicated channel provided by the upper-level hospital. After the data transmission is completed, a backup is made on the cloud storage so that the data can also be used when transferred to other upper-level hospitals
[0085] For the fee transaction data, it is transmitted through a private data collection. Specifically, sensitive data such as fee transaction data is sent to a transaction queue, and the transaction queue is shared with the superior hospital through the fabric private data collection method. At this time, other organizations in the channel cannot see the shared data. Thus, by defining a private data collection between the superior and subordinate hospitals to share private data, the security of sensitive data transmission is ensured.
[0086] Due to problems such as network instability, bandwidth limitations, large medical data files, and concurrent use by multiple users, the timeliness and high efficiency of data transmission cannot be satisfied. Therefore, in this application, on-chain and off-chain collaborative interaction is used to store patient basic information, encrypted information, signature information, etc. on the consortium chain, while the files are directly transmitted or stored in cloud storage. During the off-chain file transmission process, for the timeliness of transmission, by increasing the transmission weight, different transmission channels and transmission orders are adopted according to the weight information to transmit or store the files in a timely manner. For the high efficiency of transmission, a file sharding and secure breakpoint resumption scheme based on the consortium chain is adopted. By splitting large files and tracking the transmission process, efficient data transmission is achieved.
[0087] Step S104: In response to the successful permission verification of the superior hospital, the superior hospital obtains the proxy re-encrypted ciphertext HF from the consortium chain hlh and decrypts it to obtain the on-chain plaintext data HF c .
[0088] In this application, the storage and query of on-chain data are carried out through smart contracts, and an attribute-based access control policy is adopted to control the access rights of users on the smart contracts. When a user's identity is registered, the login certificate can contain one or more attribute names and values. When the chain code runs, it can extract the attribute values to make access control decisions. By verifying the visitor's attribute (userType), if the visitor's attribute conforms to the preset attribute, the access is allowed to continue; otherwise, an access permission exception is thrown. Through the differentiation of the visitor's attribute values, the access rights of data are controlled.
[0089] The smart contract first verifies the visitor's attribute of the superior hospital. After successful verification, the superior hospital queries the patient's information from the smart contract and decrypts the on-chain ciphertext using the private key of the superior hospital. Then, according to the decrypted on-chain information, the corresponding encrypted file is obtained from the off-chain data channel. Here, the proxy re-encrypted ciphertext HF obtained from the smart contract hkh ; and based on the private key of the superior hospital, the proxy re-encrypted ciphertext HF obtained from the consortium chain hkh is decrypted to obtain the on-chain plaintext data HF c .
[0090] Specifically, the superior hospital uses its own private key (superior hospital private key) PR hlh to decrypt the proxy re-encrypted ciphertext HF hlh , and obtain the plaintext information info p , Name p , SigP, KEY p , Name s ,
[0091] In addition, the patient can access the smart contract through the pseudo-identity information FID P = H I (IdCard|Num llh ). After the smart contract verifies the attributes of the visitor for the patient and the verification is successful, the patient uses the pseudo-identity information FID P to obtain the on-chain ciphertext data HF p on the smart contract; then, the patient decrypts the on-chain ciphertext data HF p with the patient's private key PR p to obtain the on-chain plaintext data HF c .
[0092] Step S105: Based on the on-chain plaintext data HF c decrypted by the superior hospital, the superior hospital obtains the off-chain encrypted data based on the off-chain data channel and decrypts it to obtain the patient's original diagnosis and treatment data F p , and verifies the original diagnosis and treatment data F p .
[0093] Based on the on-chain plaintext data HF c decrypted by the superior hospital, the superior hospital obtains the off-chain encrypted data based on the off-chain data channel, and decrypts all the encrypted sub-files in the off-chain encrypted data to obtain the ciphertext F s . Specifically, the superior hospital obtains n encrypted sub-files from the corresponding transmission location or storage location based on the transmission location or storage location of the data in the obtained plaintext information .
[0094] In this application, the original data and the split sub-files are signed, and the signature information is saved on the consortium chain. By virtue of the immutability of the consortium chain, the signature is verified to ensure that the file comes from the corresponding patient and has not been tampered with. Through signature the signature verification of the n obtained encrypted sub-files is carried out; when the signature verification of the n encrypted sub-files passes, according to the plaintext information in the on-chain plaintext data( )Obtain the encrypted bytes inserted in the corresponding encrypted sub-file; delete the corresponding inserted encrypted bytes in the encrypted sub-file to obtain n split sub-files Meanwhile, decrypt the corresponding inserted encrypted bytes in the encrypted sub-file to obtain the hash value of the corresponding split sub-file, so as to perform hash verification on the obtained split sub-files; in response to the passing of the hash verification of the molecular file, merge all the split sub-files to obtain the ciphertext F s . By inserting encrypted bytes, it is possible to verify whether the file has been tampered with and increase the security of the merged file.
[0095] Then, based on the on-chain plaintext data HF c containing the random key KEY p , decrypt the obtained ciphertext F s to obtain the original diagnosis and treatment data F p ; finally, based on the patient's public key and signature SigP, perform signature verification on the original diagnosis and treatment data F p . If the verification passes, it indicates that the data has not been tampered with.
[0096] Due to problems such as network instability, bandwidth limitations, large medical data files, and concurrent use by multiple users, the timeliness and high efficiency of data transmission cannot be satisfied. Therefore, in this application, on-chain and off-chain collaborative interaction is adopted. Patient basic information, encrypted information, signature information, etc. are stored on the consortium chain, while files are directly transmitted or stored in cloud storage. For the high timeliness and efficiency requirements of data during patient referral, an on-chain and off-chain collaborative interaction scheme is adopted to achieve hybrid storage of referral data on-chain and off-chain. Through different on-chain and off-chain transmission methods and encryption strategies, cloud-chain collaborative data sharing is realized, improving the data transmission efficiency, secure access, and controllable sharing.
[0097] As Figure 4 shown, the embodiment of this application also provides an on-chain and off-chain interaction system for hierarchical diagnosis and treatment data based on the consortium chain, including:
[0098] The initial ciphertext unit 401 is configured to, after the patient signs the off-chain encrypted data generated by the lower-level hospital based on the patient's authorization using the patient's private key, the lower-level hospital generates the on-chain plaintext data HF c , and encrypt the generated on-chain plaintext data HF c using the patient's public key corresponding to the patient's private key to obtain the on-chain plaintext data HF p ;
[0099] The proxy re-encryption unit 402 is configured to re-encrypt the on-chain ciphertext data HF p using the proxy re-encryption key to generate the proxy re-encrypted ciphertext HF hlh ;
[0100] A data transmission unit 403, configured to enable a lower-level hospital to store the proxy re-encrypted ciphertext HF on a consortium blockchain based on the pseudo identity information of a patient, and transmit the signed off-chain encrypted data through an off-chain data channel; hlh
[0101] A superior data acquisition unit 404, configured to enable a superior hospital to acquire the proxy re-encrypted ciphertext HF from the consortium blockchain in response to successful verification of the superior hospital's permissions, and decrypt it to obtain the on-chain plaintext data HF; hlh c ;
[0102] An original data acquisition and verification unit 405, configured to enable a superior hospital to decrypt the off-chain encrypted data acquired through the off-chain data channel based on the on-chain plaintext data HF obtained by decryption, to obtain the patient's original diagnosis and treatment data F, and verify the original diagnosis and treatment data F. c p p
[0103] The off-chain and on-chain interaction system for hierarchical diagnosis and treatment data based on a consortium blockchain provided in the embodiments of the present application can implement the steps and processes of the off-chain and on-chain interaction method for hierarchical diagnosis and treatment data based on a consortium blockchain described in any of the above embodiments, and achieve the same technical effects, which will not be elaborated herein one by one.
[0104] In the description of the present invention, the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples", etc., mean that the specific features, structures, materials, or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials, or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0105] The above are only the preferred embodiments of the present application, and are not used to limit the present application. For those skilled in the art, the present application may have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain, characterized in that: include: After the patient signs the off-chain encrypted data generated by the subordinate hospital based on the patient's authorization with the patient's private key, the subordinate hospital generates the on-chain plaintext data , and the plaintext data on the chain generated by the patient public key corresponding to the patient private key Encrypt to obtain the ciphertext data on the chain Among them, patients’ original diagnosis and treatment data Perform hash operations and based on The signature algorithm is calculated using the patient's private key and the result of the hash operation to generate a signature ; The subordinate hospital is based on a random key The original medical data after signing Encryption, the ciphertext obtained ; The lower-level hospital Split, and get The encrypted bytes are randomly inserted into the split sub-files to generate the off-chain encrypted data; the off-chain encrypted data includes Encrypted sub-files, is a positive integer; the patient signs the encrypted subfile based on the patient's private key; the subordinate hospital signs the patient's basic information, the signature , the random key , file name, number of the encrypted sub-files, and the signed encrypted sub-files are integrated to generate plaintext data on the chain ; The patient's basic information includes: ID number, consultation number, name, gender, age, and condition description; The subordinate hospital re-encrypts the on-chain ciphertext data based on the proxy re-encryption key Re-encrypt and generate proxy re-encrypted ciphertext ; The subordinate hospital re-encrypts the ciphertext based on the pseudo-identity information of the patient. Storing on the consortium chain, and transmitting the signed off-chain encrypted data through the off-chain data channel; In response to the superior hospital's authority verification being passed, the superior hospital obtains the proxy re-encrypted ciphertext from the alliance chain And decrypt to get the plaintext data on the chain ; The superior hospital obtains the plaintext data on the chain based on the decryption , based on the off-chain data channel, the off-chain encrypted data is obtained and all the encrypted sub-files in the off-chain encrypted data are decrypted to obtain the ciphertext After that, based on the plaintext data on the chain The random key contained in , for the obtained ciphertext Decrypt to obtain the patient's original diagnosis and treatment data , and the original diagnosis and treatment data to verify.
2. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: The on-chain plaintext data generated by the patient public key pair corresponding to the patient private key Encrypt to obtain the ciphertext data on the chain ,include: The subordinate hospital uses the patient's public key to access the plaintext data on the chain. Encrypt to obtain the ciphertext data on the chain .
3. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: The off-chain data channel includes: private data collection, proprietary channel and cloud storage; The step of transmitting the signed off-chain encrypted data through an off-chain data channel includes: The off-chain encrypted data is divided into fee transaction data and disease diagnosis and treatment data, transmitting the fee transaction data via the private data set; Based on the predetermined transmission weight, the disease diagnosis and treatment data is transmitted through a dedicated channel or cloud storage.
4. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: The superior hospital obtains the proxy re-encrypted ciphertext from the alliance chain And decrypt to get the plaintext data on the chain ,include: The superior hospital decrypts the proxy re-encrypted ciphertext obtained from the alliance chain based on the superior hospital private key to obtain the plaintext data on the chain. .
5. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: Decrypting all the encrypted sub-files in the off-chain encrypted data to obtain the ciphertext ,include: Performing signature verification on the obtained encrypted sub-file; In response to the signature verification being successful, the plaintext data on the chain is Obtain the encrypted bytes correspondingly inserted in the encrypted subfile from the plaintext information in the encrypted subfile; Deleting the encrypted bytes inserted into the encrypted sub-file to obtain the corresponding split sub-file; At the same time, the encrypted bytes inserted into the encrypted sub-file are decrypted to obtain the hash value of the corresponding split sub-file, so as to perform hash verification on the obtained split sub-file; In response to the hash verification being passed, all the split sub-files are merged to obtain the ciphertext .
6. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: The original diagnosis and treatment data Perform verification, including: Based on the patient's public key and the signature , the original diagnosis and treatment data Perform signature verification.
7. The method for on-chain and off-chain interaction of hierarchical diagnosis and treatment data based on alliance chain according to claim 1 is characterized in that: Based on the elliptic curve public key cryptography algorithm, the patient public key, the patient private key, and the proxy re-encryption key are determined.
8. A hierarchical diagnosis and treatment data chain-on-chain interaction system based on alliance chain, characterized in that: The system is deployed with the on-chain and off-chain interaction method of hierarchical diagnosis and treatment data based on the alliance chain as described in any one of claims 1 to 7, and the system includes: The initial ciphertext unit is configured such that after the patient signs the off-chain encrypted data generated by the subordinate hospital based on the patient's authorization with the patient's private key, the subordinate hospital generates the on-chain plaintext data , and the plaintext data on the chain generated by the patient public key corresponding to the patient private key Encrypt to obtain the plaintext data on the chain ; The proxy re-encryption unit is configured to enable the subordinate hospital to re-encrypt the chain ciphertext data based on the proxy re-encryption key. Re-encrypt and generate proxy re-encrypted ciphertext ; The data transmission unit is configured to transmit the proxy re-encrypted ciphertext to the subordinate hospital based on the pseudo identity information of the patient. Storing on the consortium chain, and transmitting the signed off-chain encrypted data through the off-chain data channel; The superior data acquisition unit is configured to respond to the superior hospital's authority verification being passed, and the superior hospital acquires the proxy re-encrypted ciphertext from the alliance chain And decrypt to get the plaintext data on the chain ; The original data acquisition verification unit is configured to obtain the plaintext data on the chain obtained by the superior hospital according to the decryption , based on the off-chain data channel, the off-chain encrypted data is obtained and decrypted to obtain the original diagnosis and treatment data of the patient , and the original diagnosis and treatment data to verify.
Citation Information
Patent Citations
Consortium blockchain-based data transfer method and device
WO2020108019A1
Consortium blockchain consensus identity authentication method
WO2023115850A1