A blockchain-assisted medical big data search mechanism and privacy protection method

By using multiple encryption schemes and database queries in the medical blockchain system, combined with access control and smart contracts, efficient search and privacy protection are achieved, solving the problems of privacy protection and search efficiency in medical big data, and improving data security. sex and correctness.

CN114579998BActive Publication Date: 2024-09-03FANGCHENGGANG AKAN INTERNET MEDICAL CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210215578.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-07
Publication Date
2024-09-03
Estimated Expiration
2042-03-07

AI Technical Summary

Technical Problem

In medical blockchain systems, it is difficult to achieve efficient search with patient privacy protection. Existing technology cannot effectively support data search in ciphertext states under different conditions, and there is a risk of single point of failure and privacy leakage.

Method used

Use multiple encryption schemes to process electronic medical data and upload it to the blockchain, use the database to improve search efficiency, combine access control and smart contracts for identity recognition and permission management, and support equivalent queries, range queries, and keywords Retrieval and Boolean queries, search results protected with random keys.

Benefits of technology

It achieves efficient search of medical big data while ensuring patient privacy, improves data security and accuracy, and solves the problem of single point of failure and privacy leakage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114579998B
    Figure CN114579998B
Patent Text Reader

Abstract

The present invention relates to a blockchain-assisted medical big data search mechanism and privacy protection method, and belongs to the field of information technology. The method is: S1: uploading encrypted electronic medical data to the blockchain; S2: the medical blockchain system processes the encrypted electronic medical data in the blockchain into a database, and supports ciphertext query in the database; S3: users who join the medical blockchain system perform access control, determine user identity and electronic medical data access rights; S4: the user sends a search request to the medical blockchain system, and the medical blockchain system performs ciphertext search; S5: the medical blockchain system decrypts the search results, and then uses a unified encryption algorithm to re-encrypt the electronic medical data and returns the encryption result and random key to the user. The present invention shortens the search time of medical blockchain data, while taking into account the correctness and reliability of the data while ensuring that the patient's privacy is not leaked.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of informatization and relates to a blockchain-assisted medical big data search mechanism and privacy protection method. Background Art

[0002] With the development of the medical field, medical health has penetrated into every household and has become a basic physiological need of human beings. With the advent of the big data era, medical institutions and individuals generate a large amount of structured and unstructured electronic medical data every day. The amount and scale of these electronic medical data are also increasing rapidly, which makes it extremely difficult for traditional databases and software technologies to process these data.

[0003] In the era of medical big data, the integrity and accuracy of medical data are valuable assets for patients, and the sharing of medical data is conducive to controlling the spread of diseases. However, the medical data originally stored by medical institutions formed data islands, which is not conducive to data sharing. The development of cloud services facilitates data sharing and saves local costs, but cloud servers with third parties as the medium are prone to single point failures and collusion attacks. Patient information is easily abused and privacy leaks occur. Therefore, in the era of big data, when sharing medical data, its security and privacy protection should be considered.

[0004] Blockchain is popular among the public due to its distributed, tamper-proof, transparent, traceable and anonymity characteristics. The decentralization, security and privacy characteristics of big data can be well combined with blockchain. With blockchain technology, all users who join the blockchain can view the corresponding data, which facilitates data sharing. At the same time, due to its distributed characteristics, it solves the problem of single point failure. Due to its tamper-proof characteristics, it solves the conspiracy attacks such as malicious tampering and deletion of data in cloud storage. At this stage, blockchain has been used in the fields of finance, energy, power grid and medical care. In the medical field, blockchain technology makes up for the shortcomings of the above two storage methods.

[0005] However, in the medical blockchain system, first of all, although its anonymity can avoid the leakage of user privacy to a certain extent, the medical data stored in the medical blockchain is inherently private and sensitive. How to protect the privacy of patients in medical data is an issue that needs to be paid attention to. Secondly, since the blockchain records data in a linear structure, it is necessary to traverse the search in sequence when searching, so it is necessary to view a complete blockchain. As the amount of data and blocks increase, the chain continues to grow, and the search will be quite time-consuming. Taking Ethereum as an example, after the medical institution encrypts the patient's medical data, it uploads it to the blockchain through a smart contract. These encrypted medical data will be stored in the "input" field of the corresponding transaction in hexadecimal form as additional data. When searching, it is necessary to traverse the block first, traverse the transaction, decode the input, and finally decrypt the data to determine whether the data to be searched meets the requirements. This is undoubtedly quite time-consuming. Finally, existing research rarely supports searching for different conditions for the stored additional data, and in the ciphertext state, ordinary encryption cannot support searching for different conditions. Therefore, how to efficiently search for medical data under different conditions while ensuring patient privacy is a very important task. Summary of the invention

[0006] In view of this, the purpose of the present invention is to provide a blockchain-assisted medical big data search mechanism and privacy protection method, which uses multiple encryption schemes to ensure that the patient's privacy is not leaked, and adds access control, classifies the identity to clarify its access rights, and restricts different user types from accessing electronic medical data within different ranges, further protecting the privacy of patients. Finally, the encrypted electronic medical data is processed into a database, allowing users to search for electronic medical data in ciphertext according to different conditions.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

[0008] A blockchain-assisted medical big data search mechanism and privacy protection method specifically includes the following steps:

[0009] S1: The medical institution uploads the patient's electronic medical data, and the medical blockchain system executes the encryption strategy and uploads the encrypted electronic medical data to the blockchain;

[0010] S2: The medical blockchain system processes the encrypted electronic medical data in the blockchain into the database and supports ciphertext queries in the database;

[0011] S3: Access control for users added to the medical blockchain system to determine user identities and access rights to electronic medical data;

[0012] S4: The user sends a search request to the medical blockchain system, and the medical blockchain system performs a ciphertext search;

[0013] S5: The medical blockchain system decrypts the search results encrypted by the encryption strategy, and then uses a unified encryption algorithm to encrypt the electronic medical data again and returns the encryption result and random key to the user.

[0014] Furthermore, the specific process in step S1 includes:

[0015] In order to ensure that the privacy of patients' electronic medical data is not leaked during storage and search, from the perspective of encryption, medical institutions encrypt patients' electronic medical data before uploading them. The encryption strategy is to use different encryption algorithms according to different types of information in an electronic medical data, so as to support ciphertext search, and finally upload the encrypted electronic medical data to the blockchain; considering the storage capacity limitation of the blockchain, for data such as CT images that occupy a large space, the blockchain only retains its hash value, storage location and encrypted text description, and the original data is stored in the local cloud. In this method, the encryption strategy includes three functions:

[0016] (1) getKeyValue()→<key,(value,type)>:The medical blockchain system receives a piece of electronic medical data and traverses to obtain all key-value pairs.

[0017] (2)isSensitive(data)→{true,false}: Determines the sensitivity of keys and values ​​in electronic medical data.

[0018] (3) encData(key, value, type, true) → Encrypted data encdata: Encrypt sensitive key-value pairs. The key uses a unified encryption algorithm; the value uses different encryption algorithms according to its type. The final ciphertext is in the form of "ciphertext. encryption algorithm type", where ". encryption algorithm type" is an encryption flag used to determine which algorithm key to use during subsequent decryption.

[0019] Further, the specific process in step S2 includes:

[0020] In order to shorten the search time of blockchain, the medical blockchain system is responsible for monitoring the blockchain. If the block generated by the blockchain contains electronic medical data, it will process the electronic medical data contained in all transactions generated in the block, and finally process the information contained in a piece of electronic medical data into the form of key-value and upload it to the database, using the database to improve the search efficiency of the blockchain and provide rich query functions. In order to make up for the situation of incorrectly uploading medical data due to mistakes made by medical institutions, the medical blockchain system allows the addition of a transaction with a modification mark for update instructions, and the medical blockchain system updates the data in the database according to the mark.

[0021] Further, the specific process in step S3 includes:

[0022] In order to further protect the privacy of patients' electronic medical data, from the perspective of access control, identity classification is completed through smart contracts before searching to clarify their access rights. All users entering the medical blockchain system register their identities. Depending on the registered identity, the scope of data authorized to search is also different. Medical institutions need to diagnose and treat patients with various diseases or conduct research on certain diseases every day, so it is necessary to search all medical data; patients are usually only allowed to search their own electronic medical data; third parties (for example, insurance companies) are usually only allowed to search the electronic medical data of people related to them.

[0023] Further, the specific process in step S4 includes:

[0024] After access control, legitimate users can make search requests normally. When a user sends a plaintext search request to the medical blockchain system through a smart contract, the medical blockchain is responsible for processing it into a ciphertext search request, and the system uses the database to perform university searches. In this method, the encrypted electronic medical data supports complex queries such as equivalent queries, range queries, keyword searches, and Boolean queries.

[0025] Equivalence query: mainly queries the relevant electronic medical data corresponding to a specific value of a certain field.

[0026] Range query: mainly for numeric types, query related electronic medical data that meets a certain range.

[0027] Keyword search: mainly searches whether a certain word is contained in a certain text information in the electronic medical data, and queries all relevant electronic medical data that meet the conditions.

[0028] Boolean query: This operation is a query statement with conjunctions such as AND or OR, which is used to connect equality queries, range queries, and keyword searches.

[0029] Further, the specific process in step S5 includes:

[0030] After the medical blockchain system searches for ciphertext electronic medical data that meets all conditions, if the system key is used directly to decrypt it and the plaintext data is returned to the user, the patient's privacy will be leaked; if the searched ciphertext and system key are directly returned to the user, it will be detrimental to the internal security of the system. The medical blockchain system decrypts the searched encrypted electronic medical data in the form of key-value, and determines which encryption algorithm to use for secret key decryption based on the encryption mark ".Encryption algorithm type". If it is plaintext, no processing is performed. Then a random key is generated using a more secure encryption algorithm, the decrypted data is encrypted again, and then the validity period is set for the key. Finally, the random key and the processed encrypted electronic medical data are returned to the user for browsing and viewing.

[0031] The beneficial effects of the present invention are as follows: on the premise of improving the search efficiency of the medical blockchain, the present invention enables users to search for encrypted electronic medical data with different conditions within the scope of their own search authority after identity authentication. The present invention protects the privacy of patients while taking into account the security and correctness of the data.

[0032] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

[0034] Figure 1 This is a flow chart of the blockchain-assisted medical big data encryption search mechanism and privacy protection method of the present invention;

[0035] Figure 2 The system model of the blockchain-assisted medical big data encryption search mechanism and privacy protection method of the present invention;

[0036] Figure 3 For encryption strategy;

[0037] Figure 4 The plain text and cipher text forms of basic personal information;

[0038] Figure 5 A working diagram for encryption search. DETAILED DESCRIPTION

[0039] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0040] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0041] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "rear", etc. indicate the orientation or position relationship, they are based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operate in a specific orientation. Therefore, the terms describing the position relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0042] See also Figure 1 to Figure 5 , the present invention provides a blockchain-assisted medical big data search mechanism and privacy protection method, which includes the following stages:

[0043] Phase 1: Medical institutions upload patients’ electronic medical data, and the medical blockchain system executes encryption strategies and uploads the encrypted electronic medical data to the blockchain;

[0044] Phase 2: The medical blockchain system processes the encrypted electronic medical data in the blockchain into the database and supports ciphertext queries in the database;

[0045] Phase 3: Access control for users added to the medical blockchain system to determine user identity and access rights to electronic medical data;

[0046] Phase 4: The user sends a search request to the medical blockchain system, and the medical blockchain system performs a ciphertext search;

[0047] Phase 5: The medical blockchain system decrypts the search results encrypted by the encryption strategy, then uses a unified encryption algorithm to encrypt the electronic medical data again and returns the encryption results and random keys to the user.

[0048] As an optional embodiment, stage one specifically includes: electronic medical data encryption and chain upload stage.

[0049] In order to ensure that the privacy of patients in electronic medical data is not leaked, we first consider encryption and design an encryption strategy using various encryption algorithms (such as Figure 3 As shown in the figure, the electronic medical data is encrypted and uploaded to the blockchain; considering the storage capacity limit of the blockchain, for data such as CT images that occupy a large space, the blockchain only retains its hash value, storage location and encrypted text description, and the original data is stored in the local cloud. Its encryption strategy mainly includes three steps:

[0050] (1) getKeyValue()→<key,(value,type)>: First, the medical blockchain system receives the electronic medical data submitted by the medical institution, and then executes the getKeyValue() function to obtain all key-value values ​​in the electronic medical data and the data type corresponding to the value.

[0051] (2)isSensitive(data)→{true,false}: After obtaining all key-value pairs from step 1, the system loops to determine whether the information contained in the key and value is sensitive. If it is sensitive information, it outputs true and continues to step 3. Otherwise, it outputs false and determines the next set of key-value pairs.

[0052] (3) encData(key, value, type, true) → Encrypted data encdata: Execute the function encData(key, value, type, true) for sensitive data. This function contains three sets of encryption algorithms: symmetric encryption, order-preserving encryption, and searchable encryption. Among them, symmetric encryption uses the Advanced Encryption Standard (AES) to encrypt non-numeric data; order-preserving encryption is used to encrypt numeric data, and the encrypted numeric type can be compared. The algorithm is represented by OPE; searchable encryption can retrieve encrypted data in text form. The algorithm is represented by Search. First, the AES, OPE, and Search algorithms execute their respective gen(λ) functions to generate the corresponding secret key Key AES 、Key OPE and Key Search. Secondly, this method uniformly uses the symmetric encryption algorithm AES to encrypt the key and calls AES.enc(key); if the type corresponding to the received value is a numeric type, the OPE algorithm is used and OPE.enc(value) is called to encrypt the value; if the type corresponding to the received value is a string text type, the Search algorithm is used and Search.enc(value) is called to encrypt the value; if the type corresponding to the value is other types, the AES algorithm is uniformly used for encryption. Finally, the encrypted data is in the form of "ciphertext.encryption algorithm type". This method uses personal information as an example to execute the encryption strategy, and the results are as follows: Figure 4 shown.

[0053] The encrypted electronic medical data is ultimately uploaded to the blockchain through a smart contract and saved in hexadecimal form in the “input” field in the transaction.

[0054] As an optional embodiment, Phase 2 specifically includes: transaction data off-chain storage phase.

[0055] In order to shorten the search time of blockchain, the medical blockchain system is responsible for monitoring and maintaining the blockchain and processing it into the database, using the database to improve the search efficiency of the blockchain. When a block is generated, the medical blockchain system will process the electronic medical data contained in all transactions generated in the block and process it into the database. The specific processing process is as follows:

[0056] (1) The medical blockchain system traverses all blocks from beginning to end, obtains the block number N and its generated timestamp t, and stores all transactions contained therein into a list.

[0057] (2) Determine whether the list storing transactions is empty. If it is empty, return to step (1). If it is not empty, continue to execute the following steps to process the transactions in the list.

[0058] (3) Traverse the transactions in the list and obtain the transaction hash value H, input field, and index n of the transaction in the block. Since the encrypted electronic medical data in the input field is saved in hexadecimal form, it needs to be decoded and processed into ciphertext data in JSON format.

[0059] (4) Store N, n, H and the ciphertext data in JSON format in the database in the form of key-value.

[0060] (5) Determine whether the transactions in the list have been processed. If they have been processed, continue to process the next block; otherwise, continue to execute step (3).

[0061] In order to make up for the situation where medical institutions make mistakes and upload erroneous electronic medical data, it is necessary to add a new transaction with a modification mark to update the description. The medical blockchain system will make a judgment based on the modification mark and update the original data in the database.

[0062] As an optional embodiment, stage three specifically includes: access control stage.

[0063] In order to further protect the privacy of patients, this method restricts different types of users from searching different data ranges from the perspective of access control. Before users search, they need to be authenticated and granted access rights. In our method, there are three types of users: medical institutions, patients, and third parties (for example, insurance companies). All users need to register their identities before joining the medical blockchain system, so as to authenticate their identities and perform access control.

[0064] Depending on the identity, when the user registers through the smart contract, this method uses 0, 1, 2, and 3 to represent unregistered users, medical institutions, patients, and third-party institutions respectively. Before the user searches, the identity authentication is required to determine the range of electronic medical data that the user can search. If the authentication identity is 0, it is an illegal user and its access request will be denied; if it is 1, it is a medical institution and can access all electronic medical data; if it is 2, it is a patient and can search for his own electronic medical data; if it is 3, it means a third-party institution and can search the electronic medical data of related personnel.

[0065] As an optional embodiment, stage four specifically includes: data search stage.

[0066] After access control, legitimate users can perform search requests normally. When a user sends a search request to the medical blockchain system, the medical blockchain system uses the database to perform efficient ciphertext search. In this method, some complex queries such as equivalent query, range query, keyword search, and Boolean query in the ciphertext state can be supported. The search process is as follows: Figure 5 shown.

[0067] Equivalence query: mainly queries the electronic medical data corresponding to a specific value of a field. For example, if a user wants to search for the electronic medical data of a patient with name = Bob, the query statement

[0068] db.enc.find({"name":"Bob"})

[0069] It is sent to the medical blockchain system, which then processes it into a ciphertext query statement.

[0070] db.enc.find({"0x2f4a47cb":"0xda25f062.AES"})

[0071] The database performs the ciphertext query.

[0072] Range query: mainly for numeric types, query related electronic medical data that meets a certain range. For example, if a user wants to search for electronic medical data of all patients with age>10, by using the plain text query statement

[0073] db.enc.find({"age":{$gt:10}})

[0074] Send it to the medical blockchain system and process it into a ciphertext query statement

[0075] db.enc.find({"0xff11e138":{$gt:"0x54afa2b8.OPE"}})

[0076] Finally, the database executes the range query in the encrypted state.

[0077] Keyword search: mainly searches for a word in a textual information in the electronic medical data, and searches for all relevant electronic medical data that meet the conditions. For example, a user requests the medical blockchain system to search for electronic medical data containing "chongqing" in the address, where the information in the address is a description in the form of a text string. Therefore, the plaintext query statement

[0078] db.enc.find({"address":"chongqing"})

[0079] After encryption processing by the medical blockchain system, the ciphertext query statement is obtained

[0080] db.enc.find({"0x06250cec":"0x219b8951.Search"})

[0081] Finally, the ciphertext keyword retrieval function is executed.

[0082] Boolean query: This operation is a query statement with conjunctions such as AND or OR, which is used to connect equivalent queries, range queries, and keyword searches. For example, when a user requests to search for the electronic medical data of all patients with name = Bob and age > 10, a query statement will be sent to the medical blockchain system first.

[0083]

[0084] This statement is encrypted by the system to generate another ciphertext query statement

[0085]

[0086] Likewise, the final search operation is performed by the medical blockchain system.

[0087] As an optional embodiment, stage five specifically includes: search result processing stage.

[0088] After the medical blockchain system searches for ciphertext electronic medical data that meets all the conditions, if the system key is used to decrypt it directly and the plaintext data is returned to the user, the patient's privacy will be leaked; if the searched ciphertext and system key are directly returned to the user, it will be detrimental to the internal security of the system. Therefore, the search results need to be further processed.

[0089] First, decrypt the searched ciphertext results, and use the secret key corresponding to AES to decrypt all keys. Do not process the unencrypted keys. Then determine the encryption identifier ".Encryption algorithm type" contained in the encrypted value. If it ends with ".AES", use AES.dec(encdata) to decrypt. If it ends with ".OPE", use OPE.dec(encdata) to decrypt. If it ends with ".Serarch", use Search.dec(encdata) to decrypt. Do not process the unencrypted value data.

[0090] Since the search results are electronic medical data that have met the user's search conditions, the user does not need to perform any search query operations, just receive and view. Therefore, after the encrypted electronic medical data is initially decrypted, a more secure asymmetric encryption algorithm (RSA is used uniformly in this invention) is used to uniformly encrypt each piece of electronic medical data after decryption. First, a pair of public and private keys Key is randomly generated by the medical blockchain system. pub and Key pri , the medical blockchain system uses private key Key pri The data is encrypted and each piece of electronic medical data is returned to the user in sequence. pub It will be sent to the user in the form of email or text message, and the user will decrypt and view it.

[0091] Phases 4 and 5 are the entire search phase. The overall workflow is as follows: Figure 5 shown.

[0092] Finally, it should be noted that the above embodiments are only used to illustrate the technical solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A blockchain-assisted medical big data search mechanism and privacy protection method, characterized by: The method specifically comprises the following steps: S1: The medical institution uploads the patient's electronic medical data, and the medical blockchain system executes the encryption strategy and uploads the encrypted electronic medical data to the blockchain; The encryption strategy consists of three steps: (11) getKeyValue()→<key,(value,type)>:First, the medical blockchain system receives the electronic medical data submitted by the medical institution, and then executes the getKeyValue() function to obtain all key-value values ​​in the electronic medical data and the data type corresponding to the value; (12) isSensitive(data)→{true,false}: After all key-value pairs are obtained from step (11), the process loops to determine whether the information contained in the key and value pairs is sensitive. If the information is sensitive, the process outputs true and continues to step (13). Otherwise, the process outputs false and determines the next set of key-value pairs. (13) encData(key, value, type, true) → Encrypted data encdata: Execute the function encData(key, value, type, true) for sensitive data; this function contains three sets of encryption algorithms: symmetric encryption, order-preserving encryption, and searchable encryption; Finally, the encrypted electronic medical data is uploaded to the blockchain through the smart contract and saved in the "input" field in the transaction in hexadecimal form; S2: The medical blockchain system processes the electronic medical data encrypted in the blockchain into the database and supports ciphertext queries in the database. When a block is generated, the medical blockchain system processes the electronic medical data contained in all transactions generated in the block and processes it into the database. The specific processing process is as follows: (21) The medical blockchain system traverses all blocks from beginning to end, obtains the block number N and its generated timestamp t, and stores all transactions contained therein into a list; (22) Determine whether the list storing transactions is empty. If it is empty, return to step (21). If it is not empty, continue to execute the following steps to process the transactions in the list. (23) Traverse the transactions in the list and obtain the hash value H of the transaction, the input field, and the index n of the transaction in the block; the encrypted electronic medical data in the input field is saved in hexadecimal form, which is decoded and processed into ciphertext data in JSON format; (24) Store N, n, H and the ciphertext data in JSON format in the database in the form of key-value; (25) Determine whether the transactions in the list have been processed. If they have been processed, continue to process the next block. Otherwise, continue to execute step (23); S3: Access control for users added to the medical blockchain system to determine user identities and access rights to electronic medical data; S4: The user sends a search request to the medical blockchain system, and the medical blockchain system performs a ciphertext search; S5: The medical blockchain system decrypts the search results encrypted by the encryption strategy, and then uses a unified encryption algorithm to encrypt the electronic medical data again and returns the encryption result and random key to the user.

2. According to claim 1, a blockchain-assisted medical big data search mechanism and privacy protection method is characterized by: In S1, in order to ensure that the privacy of the patient's electronic medical data is not leaked during storage and search, from the perspective of encryption, the medical institution encrypts the patient's electronic medical data before uploading it. The encryption strategy is to use different encryption algorithms according to different types of information in a piece of medical data, thereby supporting ciphertext search and finally uploading the encrypted electronic medical data to the blockchain.

3. According to claim 1, a blockchain-assisted medical big data search mechanism and privacy protection method is characterized by: The S2 specifically includes: the medical blockchain system is responsible for monitoring the blockchain. If the blocks generated by the blockchain contain electronic medical data, it determines whether the electronic medical data are newly uploaded or need to be updated. Based on the judgment, the electronic medical data are inserted or updated into the database, and the database is used to improve search efficiency and provide rich queries.

4. According to claim 1, a blockchain-assisted medical big data search mechanism and privacy protection method is characterized by: In S3, in order to protect the privacy of patients' electronic medical data, from the perspective of access control, all users entering the medical blockchain system must register their identities. Depending on the registered identity, the scope of data authorized to be searched is also different. Medical institutions can search all electronic medical data, patients can search their own electronic medical data, and third parties can search the electronic medical data of related persons.

5. According to claim 1, a blockchain-assisted medical big data search mechanism and privacy protection method is characterized by: In S4, the user sends a plaintext search request to the medical blockchain system through a smart contract, which is then processed into a ciphertext search request by the medical blockchain system, and the ciphertext search query service is executed through the database, supporting equivalent queries, range queries, keyword retrievals, and Boolean queries in the ciphertext state, and finally returning the ciphertext electronic medical data to the user for viewing.

6. According to claim 1, a blockchain-assisted medical big data search mechanism and privacy protection method is characterized by: In S5, the medical blockchain system decrypts the encrypted electronic medical data that meets the user's search conditions, and does not perform any processing if it is plain text; then uses an encryption algorithm to generate a random key, and uniformly encrypts the electronic medical data, and returns the final ciphertext electronic medical data and the random key to the user for the user to browse and view.