Encryption search method and device of medical data, storage medium and computer equipment
By introducing stripe filter technology in encrypted search of medical data, processing keyword vectors and generating index information, the problems of low efficiency and large storage overhead in cloud storage are solved, fast search and efficient storage are achieved, and the User privacy and security.
Patent Information
- Application Number
- CN202411033854.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-12-03
AI Technical Summary
Existing medical data has problems such as low encryption search efficiency and large storage overhead in the cloud storage and search process, especially in multi-keyword search scenarios, which leads to excessive computing resources and time consumption.
By introducing stripe filter technology, the keyword vectors of medical data are processed, encrypted index information is generated, and the fingerprint vector of the target word vector is calculated on the server side by using the preset hash function and fingerprint function to determine whether the index information exists. This will quickly filter out possible encrypted medical data and reduce actual decryption operations.
Improves encrypted search efficiency, reduces the storage overhead of encrypted searchable indexes, saves computing resources and time, and ensures the security of user privacy.
Smart Images

Figure CN119066142A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart medical technology, and in particular to an encrypted search method, device, storage medium and computer equipment for medical data. Background Art
[0002] In recent years, with the rapid development of related technologies such as cloud computing, the traditional medical industry is shifting towards a more flexible and efficient electronic medical paradigm. During physical examinations or inspections in hospitals, hospitals will obtain and collect some key vital signs information of relevant patients (such as blood draw indicators, urine test indicators, etc.). After processing, this information generates the corresponding patient's medical data and forwards it to the cloud server for storage. Trusted authorized parties (patients, third-party medical service providers) can query the patient's data and give feedback in a timely manner. Although the current solution uses relevant encryption algorithms, it still has major defects in data retrieval speed and storage overhead. Summary of the invention
[0003] In view of this, the present application provides an encrypted search method, apparatus, storage medium and computer device for medical data. By introducing a stripe filter, it is possible to improve the efficiency of ciphertext search while significantly reducing the storage overhead of encrypted searchable indexes.
[0004] According to an embodiment of one aspect of the present application, there is provided a method for encrypted search of medical data, which is applicable to a first client, wherein the first client is in communication connection with the server, and the method comprises:
[0005] Encrypting the medical data using the authorization key of the second client to generate encrypted medical data;
[0006] Processing the keyword vector of the encrypted medical data to determine index information of the encrypted medical data, wherein the index information includes an identification value of the keyword vector of the encrypted medical data, an index vector corresponding to the identification value of the keyword vector, and a first fingerprint vector;
[0007] The encrypted medical data and the index information are sent to the server for storage, so that the server calculates a second fingerprint vector of the target word vector indicated by the second client according to a preset hash function and the index vector, and when the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client.
[0008] Optionally, the processing the keyword vector of the encrypted medical data to determine the index information of the encrypted medical data includes:
[0009] Initialize the strip filter, obtain a preset identification function, the preset hash function and a preset fingerprint function;
[0010] Calculating the identification value of the keyword vector according to the preset identification function;
[0011] Calculate a first hash value of the keyword vector according to the preset hash function;
[0012] Determine a first selected row vector of the keyword vector according to the first Hash value;
[0013] Determine a first fingerprint vector of the keyword vector according to the preset fingerprint function;
[0014] Solving the index vector according to the first fingerprint vector and the first selected row vector;
[0015] The identification value of the associated keyword vector, the first selected row vector, the first fingerprint vector and the index vector are associated to form the index information.
[0016] Optionally, there are multiple keyword vectors, and before the identification value of the associated keyword vector, the first selected row vector, the first fingerprint vector and the index vector, the method further includes:
[0017] If the identification value of any keyword vector is the same as the identification values of other keyword vectors in the multiple keyword vectors, the first hash value and the first fingerprint vector of the any keyword vector are XORed, and the identification value of the any keyword vector is updated to make the identification value of the any keyword vector different from the identification values of the other keyword vectors.
[0018] Optionally, the method further comprises:
[0019] Obtaining the error rate of the strip filter;
[0020] Determining the matrix length of the strip filter according to the number of the keyword vectors and the error rate;
[0021] The number of the preset hash functions is determined according to the matrix length and the number of the keyword vectors.
[0022] Optionally, the method further comprises:
[0023] randomly extracting a plurality of first candidate words from the medical data according to a word segmentation algorithm;
[0024] Obtaining the relevance of each first candidate word to the medical data;
[0025] Inputting the medical data into a keyword prediction model to obtain a second candidate word, wherein the keyword prediction model is trained based on sample data and keyword labels;
[0026] Screening a target candidate word, wherein the target candidate word is the first candidate word having a relevance greater than a preset relevance and a first similarity with the second candidate word greater than a first preset similarity;
[0027] If there are multiple target candidate words, determine a second similarity between any target candidate word and other target candidate words in the multiple target candidate words;
[0028] The target candidate words whose second similarity is greater than the second preset similarity are converted to determine the keyword vector.
[0029] According to a second aspect of the present application, there is provided an encrypted search method for medical data, which is applicable to a server, wherein the server is in communication connection with a first client and a second client, and wherein the method comprises:
[0030] storing the encrypted medical data sent by the first client and index information of the encrypted medical data, wherein the index information includes an identification value of a keyword vector of the encrypted medical data, a first Hash value, and a first fingerprint vector corresponding to the first Hash value;
[0031] In response to a search token generated by the second client trigger, determining a target word vector indicated by the search token;
[0032] Calculate a second hash value of the target word vector by using a preset hash function;
[0033] Determine a second selected row vector of the target word vector according to the second Hash value;
[0034] Determining a second fingerprint vector of the target word vector according to the index vector corresponding to the identification value of the target word vector and the second selection vector;
[0035] If the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client, so that the second client decrypts the encrypted medical data according to the authorization key to obtain the target medical data.
[0036] Optionally, the encrypted search method for medical data further includes:
[0037] According to a third aspect of the present application, there is provided an encrypted search device for medical data, comprising:
[0038] An encryption module, used to encrypt the medical data using the authorization key of the second client to generate encrypted medical data;
[0039] a processing module, configured to process the keyword vector of the encrypted medical data to determine index information of the encrypted medical data, wherein the index information includes an identification value of the keyword vector of the encrypted medical data, an index vector corresponding to the identification value of the keyword vector, and a first fingerprint vector;
[0040] A communication module is used to send the encrypted medical data and the index information to the server for storage, so that the server calculates a second fingerprint vector of the target word vector indicated by the second client according to a preset hash function and the index vector, and when the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client.
[0041] Optionally, the processing module is specifically used to initialize the strip filter, obtain a preset identification function, the preset hash function and a preset fingerprint function; calculate the identification value of the keyword vector according to the preset identification function; calculate the first hash value of the keyword vector according to the preset hash function; determine the first selected row vector of the keyword vector according to the first hash value; determine the first fingerprint vector of the keyword vector according to the preset fingerprint function; solve the index vector according to the first fingerprint vector and the first selected row vector; solve the index vector according to the first fingerprint vector and the first hash value; associate the identification value of the keyword vector, the first selected row vector, the first fingerprint vector and the index vector to form the index information.
[0042] Optionally, there are multiple keyword vectors, and the processing module is further used to, if the identification value of any keyword vector is the same as the identification values of other keyword vectors in the multiple keyword vectors, perform XOR processing on the first hash value and the first fingerprint vector of the any keyword vector, and update the identification value of the any keyword vector so that the identification value of the any keyword vector is different from the identification values of the other keyword vectors.
[0043] Optionally, the device further comprises:
[0044] A configuration module is used to obtain the error rate of the strip filter; determine the matrix length of the strip filter according to the number of keyword vectors and the error rate; and determine the number of preset hash functions according to the matrix length and the number of keyword vectors.
[0045] Optionally, the device further comprises:
[0046] A keyword screening module is used to randomly extract multiple first candidate words from the medical data according to a word segmentation algorithm; obtain the correlation between each first candidate word and the medical data; input the medical data into a keyword prediction model to obtain a second candidate word, wherein the keyword prediction model is trained based on sample data and keyword labels; screen target candidate words, wherein the target candidate word is the first candidate word whose correlation is greater than a preset correlation and whose first similarity with the second candidate word is greater than a first preset similarity; if there are multiple target candidate words, determine the second similarity between any target candidate word and other target candidate words in the multiple target candidate words; convert the target candidate word whose second similarity is greater than the second preset similarity to determine the keyword vector.
[0047] According to a fourth aspect of the present application, there is provided an encrypted search device for medical data, comprising:
[0048] a storage module, configured to store the encrypted medical data sent by the first client and index information of the encrypted medical data, wherein the index information includes an identification value of a keyword vector of the encrypted medical data, a first Hash value, and a first fingerprint vector corresponding to the first Hash value;
[0049] A search module, configured to determine a target word vector indicated by a search token in response to a search token generated by the second client trigger; and
[0050] Calculate a second hash value of the target word vector by using a preset hash function; and
[0051] Determine a second selected row vector of the target word vector according to the second Hash value; and
[0052] Determining a second fingerprint vector of the target word vector according to the index vector corresponding to the identification value of the target word vector and the second selection vector;
[0053] A communication module is used to send the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs to to the second client if the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, so that the second client decrypts the encrypted medical data according to the authorization key to obtain the target medical data.
[0054] According to the fifth aspect of the present application, a readable storage medium is provided, on which a program or instruction is stored. When the program or instruction is executed by a processor, the steps of the above-mentioned encrypted search method for medical data are implemented.
[0055] According to the sixth aspect of the present application, a computer device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, and the processor implements the steps of the above-mentioned encrypted search method for medical data when executing the program.
[0056] By means of the above technical solution, the first client first encrypts the medical data using the authorization key agreed with the second client, and then processes the encrypted medical data to obtain the index information of the keywords of the encrypted medical data. The encrypted medical data and the index information are associated and uploaded to the cloud server side for storage. When the second client needs to search for medical data, the search token carrying the target word vector is uploaded to the server, so that the server solves the second fingerprint vector of the target word vector based on the decrypted index vector, and judges whether the filter element exists by comparing the results of the first fingerprint vector and the second fingerprint vector. If it exists, the encrypted medical data corresponding to the query target word vector is fed back to the second client, and if it does not exist, there is no need to further query the stored encrypted medical data. The second client uses the authorization key to decrypt the encrypted file returned by the server, and finally obtains the corresponding plaintext information. On the one hand, both the medical data and the associated words for search are encrypted, realizing dual searchable encryption under multiple keywords, the server does not save the user's plaintext information, and the entire storage and search process will not cause the leakage of user privacy. On the other hand, by searching for data through index information, the range of data sets that may contain search results can be quickly narrowed, thereby reducing the number of actual encryption and decryption operations and resource consumption, improving overall search efficiency, and saving computing resources and time.
[0057] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0059] Figure 1 A flow chart of an encrypted search method for medical data provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0060] The present application will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0061] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as limiting the present application.
[0062] Those skilled in the art will appreciate that, unless expressly stated, the singular forms "a", "an", "said" and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present application refers to the presence of the features, integers, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "connected" to another element, it may be directly connected or connected to the other element, or there may be intermediate elements. In addition, the "connection" or "connection" used herein may include wireless connection or wireless fusion. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.
[0063] Now, exemplary embodiments according to the present application will be described in more detail with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in a variety of different forms and should not be interpreted as being limited to the embodiments set forth herein. It should be understood that these embodiments are provided to make the disclosure of the present application thorough and complete, and to fully convey the concepts of these exemplary embodiments to those of ordinary skill in the art.
[0064] The encrypted search method for medical data provided in the embodiment of the present application can be applied to a medical data management system, which includes a first client, a second client and a server. The server can exchange information with the first client and the second client. Among them, the first client is used to provide medical data. In order to facilitate access by other users and reduce local storage, the medical data is usually encrypted and stored on the server. The second client is the authorized user of the data. The server is used to manage data. In some embodiments, the first client and the second client can be smart phones, tablet computers, laptops, desktop computers, etc.; the server can be configured as an independent physical server, or it can be configured as a server cluster or distributed system composed of multiple physical servers, and it can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms.
[0065] In this embodiment, a method for searching encrypted medical data is provided. Figure 1As shown, the method is described by taking the application to the first client, the second client and the server as an example, and includes:
[0066] Step 101: The first client encrypts the medical data using the authorization key of the second client to generate encrypted medical data.
[0067] Among them, medical data can be the patient's personal health records (such as electronic medical records), prescriptions, examination reports (such as medical imaging information) and other data.
[0068] In this embodiment, the medical data is encrypted by the authorization key pre-agreed by the first client and the second client, so that the medical data is always in a non-plaintext state during transmission, which not only ensures that the data is not tampered with during transmission and storage, ensuring data integrity, but also effectively protects the privacy information in the medical data from unauthorized access.
[0069] Step 102: The first client processes the keyword vector of the encrypted medical data to determine index information of the encrypted medical data.
[0070] The index information includes the identification value of the keyword vector of the encrypted medical data, the index vector corresponding to the identification value of the keyword vector, and the first fingerprint vector.
[0071] In this embodiment, the keywords of medical data are converted into at least one first hash value and a first fingerprint vector, and the index vector in the data structure is solved, which not only simplifies the keyword structure and reduces the system load, but also helps to reduce the number of times the system scans and searches for data, and improves the performance and response speed of the system, especially in the case of limited memory, so that the server can use the index information to quickly determine whether a certain element may exist in the stored data set. In addition, the keyword vector of medical data can be further encrypted to ensure the security of data search.
[0072] In one embodiment, before step 102, the method also includes: randomly extracting multiple first candidate words from medical data according to a word segmentation algorithm; obtaining the correlation between each first candidate word and the medical data; inputting the medical data into a keyword prediction model to obtain a second candidate word; screening the target candidate word; if there are multiple target candidate words, determining the second similarity between the target candidate word and other target candidate words in the multiple target candidate words; converting the target candidate word whose second similarity is greater than the second preset similarity to determine the keyword vector.
[0073] Among them, the target candidate word is a first candidate word whose relevance is greater than a preset relevance and whose first similarity with the second candidate word is greater than a first preset similarity. The keyword prediction model is trained based on sample data and keyword labels. The preset relevance, the first preset similarity, and the second preset similarity can be reasonably set according to the keyword relevance requirements, and this application does not make specific limitations.
[0074] In this embodiment, the first candidate words that exist in the medical data and the second candidate words that may not exist are extracted respectively through the word segmentation algorithm and the keyword prediction model. And the target candidate words whose correlation is greater than the preset correlation and whose first similarity between the first candidate word and the second candidate word is greater than the first preset similarity are screened out. Finally, the second similarity between the target candidate words is used to screen out the final keywords to generate the keyword vector. Thus, while ensuring the correlation between the extracted keywords and the medical data, the limitations or inaccuracies caused by only the words recorded in the medical data are avoided, so that the extracted keywords are not only the most frequent or more frequent words in the text, but also take into account the words of synonymous concepts, thereby improving the coverage and diversity of the keywords. And it can deeply explore the inherent correlation and characteristics of medical data, so that the keyword vector is not affected by the frequency of candidate words, which helps to improve the accuracy of subsequent data searches.
[0075] It is understood that the correlation can be calculated according to the following formula:
[0076]
[0077] In the formula, z represents the word feature vector of the first candidate word, S(z,D) represents the relevance, α represents the first weight coefficient, β represents the second weight coefficient, and Y sim (z, V0) represents the correlation function, V0 represents the feature vector of medical data, C i represents the cluster feature vector of the first candidate word, M represents the number of the first candidate words, and M is a positive integer.
[0078] In an actual application scenario, step 102, that is, the first client processes the keyword vector of the encrypted medical data to determine the index information of the encrypted medical data, specifically includes the following steps:
[0079] Step 102-1, initialize the strip filter, obtain a preset identification function, a preset hash function and a preset fingerprint function.
[0080] Specifically, a strip filter can be a data structure, which is usually used to quickly determine whether an element exists in a set, for example, a strip filter. The strip filter structure is provided with a bit array (binary array), at least one preset hash function and other operation logic. Among them, the bit array is used to store information, and each bit in the array represents a possible data item; the preset hash function is used to map the original data item to the position in the bit array.
[0081] In one embodiment, before step 102-1, the following steps are also included: obtaining the error rate of the strip filter; determining the matrix length of the strip filter according to the number of keyword vectors and the error rate; and determining the number of preset hash functions according to the matrix length and the number of keyword vectors.
[0082] In this embodiment, by obtaining the error rate of the strip filter, the possible misjudgment rate of the strip filter in practical applications can be evaluated. Based on this, combined with the number of keyword vectors, an appropriate matrix length is configured for the strip filter, so that the storage and query efficiency can be balanced, ensuring that the strip filter can operate effectively under different scale data sets, and optimizing the performance and space utilization of the strip filter. At the same time, since the matrix length determines the length of the selection row vector of each strip in the strip filter, and each selection row vector may require multiple hash functions to construct. By reasonably selecting the number of hash functions, it can be ensured that the hash function of each selection row vector achieves a good balance between uniform distribution and efficiency, thereby ensuring the accuracy of the search as much as possible while ensuring the efficiency of data search.
[0083] Step 102-2: Calculate the identification value of the keyword vector according to a preset identification function.
[0084] Step 102 - 3 , calculating a first hash value of the keyword vector in the stripe filter binary array according to a preset hash function.
[0085] Step 102 - 4 , determining a first selected row vector of the keyword vector according to the first Hash value.
[0086] It is understood that the stripe filter is designed with a selection rule or algorithm that takes a specific hash value as an input factor to determine the selection of the row vector.
[0087] For example, the initialization parameters are: strip filter strip width w, matrix length m, fingerprint length r, calculate the preset identification function s(x), the preset hash function c(x), calculate the preset fingerprint function b(x), i.e., the fingerprint function, and use the row number i as the identification value. For each keyword, calculate the row number identification i=s(x), the first hash value c=c(x), and the first fingerprint vector b=b(x). For the data structure of each keyword, there is the following equation:
[0088] c·I=b,I∈{0} i {0,1} w {0} |m-i-w| ,c∈{0,1} w ,b∈{0,1} r ;
[0089] Where c·I represents the data structure associated with a keyword in the strip filter.
[0090] Taking the strip width w = 4 and the matrix length m = 6 as an example, the initial data structure of the strip filter after initialization is as follows:
[0091] C*I=B
[0092] (1)[0,0,0,0,0,0]*[******]=[000000]
[0093] (2)[0,0,0,0,0,0]*[******]=[000000]
[0094] (3)[0,0,0,0,0,0]*[******]=[000000]
[0095] (4)[0,0,0,0,0,0]*[******]=[000000]
[0096] (5)[0,0,0,0,0,0]*[******]=[000000]
[0097] (6)[0,0,0,0,0,0]*[******]=[000000];
[0098] Among them, C represents the coefficient matrix, each row is the first selected row vector of a keyword, that is, the selected row vector mapped in the binary array during the filter construction process. The first selected row vector sets the parts pointed to by multiple preset hash functions to 1 and the others to 0; I represents the position matrix, each row is an index vector (slot value); B represents the fingerprint matrix, each row is the first fingerprint vector of a keyword. Define the fingerprint matrix B obtained by differentiating or calculating the coefficient matrix C and the position matrix I.
[0099] Furthermore, the strip filter can be understood as a matrix obtained by converting each index vector in the binary array into an element. When the i-th row of the strip filter is a zero vector, this row of the fingerprint matrix is also a zero vector; when the i-th row of the strip filter is a non-zero vector, the elements before the i-th column element are all 0, the i-th column element is 1, and the subsequent w-1 elements can be 1 or 0, forming a strip of w elements.
[0100] Step 102-5: Determine a first fingerprint vector of the keyword vector according to a preset fingerprint function.
[0101] Step 102-6, solving the index vector according to the first fingerprint vector and the first selected row vector.
[0102] Step 102-7, associating the identification value of the keyword vector, the first selected row vector, the first fingerprint vector and the index vector to form index information.
[0103] In this embodiment, the strip filter is configured with relevant parameters by initializing the strip filter. The keyword vector is substituted into the preset function set of the strip filter, and the unique position identifier of the keyword vector in the strip filter data structure, the first hash value of the keyword mapping position in the strip filter, and the first fingerprint vector used to quickly verify whether the keyword is in the filter are calculated respectively. The index vector of the strip filter is reversely solved by the first fingerprint vector and the first selected row vector determined based on the first hash value. Guided by the identification value of the keyword vector, the first selected row vector, the first fingerprint vector and the index vector are associated one by one to construct a strip filter data structure related to the keyword vector, that is, the index information of the keyword vector. Therefore, when constructing an encrypted index file, the solution process of the two-dimensional array can be converted into solving a linear equation system to achieve efficient matrix operations, and the Gaussian elimination method based on the determinant is applied when solving the result matrix to optimize the use of related resources, thereby greatly reducing the storage overhead of the encrypted searchable index while improving the efficiency of ciphertext search.
[0104] Furthermore, in one embodiment, when there are multiple keyword vectors, before step 102-7 it also includes: if the identification value of any keyword vector is the same as the identification value of other keyword vectors in the multiple keyword vectors, performing XOR processing on the first hash value and the first fingerprint vector of any keyword vector, and updating the identification value of any keyword vector so that the identification value of any keyword vector is different from the identification values of other keyword vectors.
[0105] In this embodiment, in order to ensure the uniqueness of the identification value, when it is detected that the identification value of any keyword vector is the same as the identification value of other keyword vectors, the first hash value and the first fingerprint vector of any keyword vector are XORed, and the identification value of any keyword vector is changed to a value different from the identification values of other keyword vectors. This reduces conflicts in the data structure, improves the efficiency and performance of the data structure, helps to ensure the uniqueness and accuracy of the keyword vectors in the data structure, and reduces conflicts, which can reduce the time complexity of the search or insertion operation, thereby improving the overall performance.
[0106] For example, take the strip width w = 4, the matrix length m = 6, and the three associated word vectors x1, x2, and x3 of encrypted medical data as examples. For the associated word vector x1, the calculated row number is 1, the strip is [1,1,1,0], and the first fingerprint vector is [100110]. Therefore, the first selected row vector is [1,1,1,0,0,0]. Because the first row of the coefficient matrix C is a zero vector, [1,1,1,0,0,0] can be directly added to the first row of the coefficient matrix C, and the result is:
[0107] C*I=B
[0108] (1)[1,1,1,0,0,0]*[******]=[100110]
[0109] (2)[0,0,0,0,0,0]*[******]=[000000]
[0110] (3)[0,0,0,0,0,0]*[******]=[000000]
[0111] (4)[0,0,0,0,0,0]*[******]=[000000]
[0112] (5)[0,0,0,0,0,0]*[******]=[000000]
[0113] (6)[0,0,0,0,0,0]*[******]=[000000];
[0114] For the associated word vector x2, the calculated row number is 2, the strip is [1,0,0,0], and the first fingerprint vector is [110000], so the first selected row vector is [0,1,0,0,0,0]. Because the second row of the coefficient matrix C is a zero vector, [0,1,0,0,0,0] can be directly added to the second row of the coefficient matrix C, and the result is:
[0115] C*I=B
[0116] (1)[1,1,1,0,0,0]*[******]=[100110]
[0117] (2)[0,1,0,0,0,0]*[******]=[110000]
[0118] (3)[0,0,0,0,0,0]*[******]=[000000]
[0119] (4)[0,0,0,0,0,0]*[******]=[000000]
[0120] (5)[0,0,0,0,0,0]*[******]=[000000]
[0121] (6)[0,0,0,0,0,0]*[******]=[000000];
[0122] For the associated word vector x3, the calculation row number is 2, the stripe is [1,1,0,0], and the first fingerprint vector is [1010101].
[0123] But at this time, because the second row of the coefficient matrix C is a non-zero vector, it needs to be XORed with the value of this row. The selected row vector after XOR is [0,0,1,0,0,0], the first fingerprint vector is [010010], and the row number is changed to 3. At this time, the third row is a zero vector, and [0,0,1,0,0,0] can be directly added to the third row of the coefficient matrix C. The result is:
[0124] C*I=B
[0125] (1)[1,1,1,0,0,0]*[******]=[100110]
[0126] (2)[0,1,0,0,0,0]*[******]=[110000]
[0127] (3)[0,0,1,0,0,0]*[******]=[010010]
[0128] (4)[0,0,0,0,0,0]*[******]=[000000]
[0129] (5)[0,0,0,0,0,0]*[******]=[000000]
[0130] (6)[0,0,0,0,0,0]*[******]=[000000];
[0131] Thus, all keyword vectors are added to the equation group of the strip filter. The coefficient matrix C satisfies the characteristics of the row echelon matrix, so when solving the i-th index vector, each row can be solved from bottom to top. When solving each column of each row, try to fill in 0 first. If the result does not match the expected fingerprint vector in the fingerprint matrix B, fill in 1 instead. As the coefficients of the lower three rows in the equation group of the strip filter mentioned above are all 0, the lower three rows of the position matrix I can be filled in arbitrarily, or all filled with 0. The third row only limits the index vector of the third keyword vector. When solving the index vector of the second row, and so on, until this set of equations is solved, that is, the matrix of the strip filter is completed, and the results are as follows:
[0132] C*I=B
[0133] (1)[1,1,1,0,0,0]*[000100]=[100110]
[0134] (2)[0,1,0,0,0,0]*[110000]=[110000]
[0135] (3)[0,0,1,0,0,0]*[010010]=[010010]
[0136] (4)[0,0,0,0,0,0]*[000000]=[000000]
[0137] (5)[0,0,0,0,0,0]*[000000]=[000000]
[0138] (6)[0,0,0,0,0,0]*[000000]=[000000];
[0139] Step 103: The first client sends the encrypted medical data and index information to the server for storage.
[0140] Step 104: The server stores the encrypted medical data and index information of the encrypted medical data sent by the first client.
[0141] Step 105: The server determines a target word vector indicated by the search token in response to the search token generated by the second client trigger.
[0142] Step 106: The server calculates a second hash value of the target word vector using a preset hash function.
[0143] Step 107, the server determines a second selected row vector of the target word vector according to the second Hash value;
[0144] Step 108: The server determines a second fingerprint vector of the target word vector according to the index vector corresponding to the identification value of the target word vector and the second selection vector.
[0145] Step 109: If the second fingerprint vector is identical to the first fingerprint vector corresponding to the identification value of the target word vector, the server sends the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs to the second client.
[0146] For example, first determine the row number of the stripe in the stored data structure as 1 based on the target word vector x1', and then search the index vector [100000] and the first fingerprint vector [100110] associated with it from the index information based on the target word vector. The second hash value stripe of the target word vector x1' calculated by the preset hash function is [1,1,0,0], so the second selected row vector is [1,1,1,0,0,0]. The second selected row vector is XORed to calculate the index vector to get 100110, which is equal to the first fingerprint vector, and it is considered to be possible. This indicates that the server may have data related to the target word vector, and the relevant data is retrieved and returned.
[0147] Step 110: The second client decrypts the encrypted medical data according to the authorization key to obtain the target medical data.
[0148] In the encrypted search method for medical data provided in the embodiment of the present application, the first client first encrypts the medical data using the authorization key agreed with the second client, and then processes the encrypted medical data to obtain the index information of the keywords of the encrypted medical data. The encrypted medical data and the index information are associated and uploaded to the cloud server side for storage. When the second client needs to search for medical data, the search token carrying the target word vector is uploaded to the server, so that the server solves the second fingerprint vector of the target word vector based on the decrypted index vector, and judges whether the filter element exists by comparing the results of the first fingerprint vector and the second fingerprint vector. If it exists, the encrypted medical data corresponding to the query target word vector is fed back to the second client, and if it does not exist, there is no need to further query the stored encrypted medical data. The second client uses the authorization key to decrypt the encrypted file returned by the server, and finally obtains the corresponding plaintext information. On the one hand, the medical data and the associated words for search are encrypted, realizing dual searchable encryption under multiple keywords, the server does not save the user's plaintext information, and the entire storage and search process will not cause the leakage of user privacy. On the other hand, by searching for data through index information, the scope of data sets that may contain search results can be quickly narrowed, thereby reducing the number of actual encryption and decryption operations and resource consumption, improving overall search efficiency, and saving computing resources and time.
[0149] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0150] Furthermore, as a specific implementation of the above-mentioned encrypted search method for medical data, an embodiment of the present application provides an encrypted search device for medical data applied to a first client, and the encrypted search device for medical data includes: an encryption module, a processing module and a communication module.
[0151] Among them, the encryption module is used to encrypt the medical data through the authorization key of the second client to generate encrypted medical data; the processing module is used to process the keyword vector of the encrypted medical data to determine the index information of the encrypted medical data, wherein the index information includes the identification value of the keyword vector of the encrypted medical data, the index vector corresponding to the identification value of the keyword vector, and the first fingerprint vector; the communication module is used to send the encrypted medical data and the index information to the server for storage, so that the server calculates the second fingerprint vector of the target word vector indicated by the second client according to the preset hash function and the index vector, and when the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client.
[0152] Furthermore, the processing module is specifically used to initialize the strip filter, obtain a preset identification function, a preset hash function and a preset fingerprint function; calculate the identification value of the keyword vector according to the preset identification function; calculate the first hash value of the keyword vector according to the preset hash function; determine the first selected row vector of the keyword vector according to the first hash value; determine the first fingerprint vector of the keyword vector according to the preset fingerprint function; solve the index vector according to the first fingerprint vector and the first selected row vector; solve the index vector according to the first fingerprint vector and the first hash value; associate the identification value of the keyword vector, the first selected row vector, the first fingerprint vector and the index vector to form index information.
[0153] Furthermore, there are multiple keyword vectors, and the processing module is also used to, if the identification value of any keyword vector is the same as the identification values of other keyword vectors in the multiple keyword vectors, perform XOR processing on the first hash value and the first fingerprint vector of any keyword vector, and update the identification value of any keyword vector to make the identification value of any keyword vector different from the identification values of other keyword vectors.
[0154] Furthermore, the encrypted search device for medical data also includes: a configuration module for obtaining the error rate of the strip filter; determining the matrix length of the strip filter according to the number of keyword vectors and the error rate; and determining the number of preset hash functions according to the matrix length and the number of keyword vectors.
[0155] Furthermore, the encrypted search device for medical data also includes: a keyword screening module, which is used to randomly extract multiple first candidate words from the medical data according to a word segmentation algorithm; obtain the correlation between each first candidate word and the medical data; input the medical data into a keyword prediction model to obtain a second candidate word, wherein the keyword prediction model is trained based on sample data and keyword labels; screen target candidate words, wherein the target candidate word is a first candidate word whose correlation is greater than a preset correlation and whose first similarity with the second candidate word is greater than a first preset similarity; if there are multiple target candidate words, determine the second similarity between any target candidate word and other target candidate words in the multiple target candidate words; convert the target candidate words whose second similarity is greater than the second preset similarity to determine the keyword vector.
[0156] Furthermore, as a specific implementation of the above-mentioned encrypted search method for medical data, an embodiment of the present application provides an encrypted search device for medical data applied to a server, and the encrypted search device for medical data includes: a storage module, a search module and a communication module.
[0157] The storage module is used to store the encrypted medical data and index information of the encrypted medical data sent by the first client, wherein the index information includes an identification value of a keyword vector of the encrypted medical data, a first hash value, and a first fingerprint vector corresponding to the first hash value;
[0158] A search module, configured to determine a target word vector indicated by a search token in response to a search token generated by a second client trigger; and, calculate a second hash value of the target word vector by a preset hash function; and, determine a second selected row vector of the target word vector according to the second hash value; and, determine a second fingerprint vector of the target word vector according to an index vector and a second selected vector corresponding to an identification value of the target word vector;
[0159] The communication module is used to send the encrypted medical data corresponding to the index information of the first fingerprint vector to the second client if the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, so that the second client can decrypt the encrypted medical data according to the authorization key to obtain the target medical data.
[0160] The specific definition of the encrypted search device for medical data can be found in the definition of the encrypted search method for medical data above, which will not be repeated here. The various modules in the above-mentioned encrypted search device for medical data can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0161] Based on the above Figure 1 The method shown in the embodiment of the present application accordingly provides a readable storage medium on which a computer program is stored, and when the program is executed by a processor, the above-mentioned Figure 1 The encrypted search method for medical data is shown.
[0162] Based on this understanding, the technical solution of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.), and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each implementation scenario of the present application.
[0163] Based on the above Figure 1 The method shown in the figure, and the virtual device embodiment, in order to achieve the above purpose, the embodiment of the present application also provides a computer device, which can be a personal computer, a server, a network device, etc., and the computer device includes a storage medium and a processor; the storage medium is used to store a computer program; the processor is used to execute the computer program to achieve the above Figure 1 The encrypted search method for medical data is shown.
[0164] Optionally, the computer device may further include a user interface, a network interface, a camera, a radio frequency (RF) circuit, a sensor, an audio circuit, a WI-FI module, etc. The user interface may include a display, an input unit such as a keyboard, etc., and the optional user interface may also include a USB interface, a card reader interface, etc. The network interface may optionally include a standard wired interface, a wireless interface (such as a Bluetooth interface, a WI-FI interface), etc.
[0165] Those skilled in the art will appreciate that the computer device structure provided in this embodiment does not limit the computer device, and may include more or fewer components, or a combination of certain components, or different component arrangements.
[0166] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages and saves the hardware and software resources of the computer device, and supports the operation of information processing programs and other software and / or programs. The network communication module is used to realize communication between the components inside the storage medium, and communication with other hardware and software in the physical device.
[0167] Through the description of the above implementation methods, those skilled in the art can clearly understand that the present application can be implemented by means of software plus a necessary general hardware platform, or by hardware.
[0168] Those skilled in the art will appreciate that the accompanying drawings are only schematic diagrams of a preferred implementation scenario, and the modules or processes in the accompanying drawings are not necessarily necessary for implementing the present application. Those skilled in the art will appreciate that the modules in the devices in the implementation scenario can be distributed in the devices of the implementation scenario according to the description of the implementation scenario, or can be changed accordingly and located in one or more devices different from the present implementation scenario. The modules of the above-mentioned implementation scenario can be combined into one module, or can be further split into multiple submodules.
[0169] The above serial numbers of this application are only for description and do not represent the advantages and disadvantages of the implementation scenarios. The above disclosure is only a few specific implementation scenarios of this application, but this application is not limited to them, and any changes that can be thought of by technicians in this field should fall within the scope of protection of this application.
Claims
1. A method for searching medical data by encryption, applicable to a first client, wherein the first client is in communication connection with the server, It is characterized in that The method comprises: Encrypting the medical data using the authorization key of the second client to generate encrypted medical data; Processing the keyword vector of the encrypted medical data to determine index information of the encrypted medical data, wherein the index information includes an identification value of the keyword vector of the encrypted medical data, an index vector corresponding to the identification value of the keyword vector, and a first fingerprint vector; The encrypted medical data and the index information are sent to the server for storage, so that the server calculates a second fingerprint vector of the target word vector indicated by the second client according to a preset hash function and the index vector, and when the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client.
2. The encrypted search method for medical data according to claim 1, It is characterized in that The processing of the keyword vector of the encrypted medical data to determine the index information of the encrypted medical data includes: Initialize the strip filter, obtain a preset identification function, the preset hash function and a preset fingerprint function; Calculating the identification value of the keyword vector according to the preset identification function; Calculate a first hash value of the keyword vector according to the preset hash function; Determine a first selected row vector of the keyword vector according to the first Hash value; Determine a first fingerprint vector of the keyword vector according to the preset fingerprint function; Solving the index vector according to the first fingerprint vector and the first selected row vector; The identification value of the associated keyword vector, the first selected row vector, the first fingerprint vector and the index vector are associated to form the index information.
3. The encrypted search method for medical data according to claim 2, It is characterized in that The number of the keyword vectors is multiple, and before the identification value of the associated keyword vector, the first selected row vector, the first fingerprint vector and the index vector, the method further includes: If the identification value of any keyword vector is the same as the identification values of other keyword vectors in the multiple keyword vectors, the first hash value and the first fingerprint vector of the any keyword vector are XORed, and the identification value of the any keyword vector is updated to make the identification value of the any keyword vector different from the identification values of the other keyword vectors.
4. The encrypted search method for medical data according to claim 2, It is characterized in that The method further comprises: Obtaining the error rate of the strip filter; Determining the matrix length of the strip filter according to the number of the keyword vectors and the error rate; The number of the preset hash functions is determined according to the matrix length and the number of the keyword vectors.
5. The encrypted search method for medical data according to claim 1, It is characterized in that The method further comprises: randomly extracting a plurality of first candidate words from the medical data according to a word segmentation algorithm; Obtaining the relevance of each first candidate word to the medical data; Inputting the medical data into a keyword prediction model to obtain a second candidate word, wherein the keyword prediction model is trained based on sample data and keyword labels; Screening a target candidate word, wherein the target candidate word is the first candidate word having a relevance greater than a preset relevance and a first similarity with the second candidate word greater than a first preset similarity; If there are multiple target candidate words, determine a second similarity between any target candidate word and other target candidate words in the multiple target candidate words; The target candidate words whose second similarity is greater than the second preset similarity are converted to determine the keyword vector.
6. A method for searching encrypted medical data, applicable to a server, wherein the server is in communication connection with a first client and a second client, It is characterized in that The method comprises: storing the encrypted medical data sent by the first client and index information of the encrypted medical data, wherein the index information includes an identification value of a keyword vector of the encrypted medical data, an index vector corresponding to the identification value of the keyword vector, and a first fingerprint vector; In response to a search token generated by the second client trigger, determining a target word vector indicated by the search token; Calculate a second hash value of the target word vector by using a preset hash function; Determine a second selected row vector of the target word vector according to the second Hash value; Determining a second fingerprint vector of the target word vector according to the index vector corresponding to the identification value of the target word vector and the second selection vector; If the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client, so that the second client decrypts the encrypted medical data according to the authorization key to obtain the target medical data.
7. An encrypted search device for medical data, It is characterized in that The device comprises: An encryption module, used to encrypt the medical data using the authorization key of the second client to generate encrypted medical data; a processing module, configured to process the keyword vector of the encrypted medical data to determine index information of the encrypted medical data, wherein the index information includes an identification value of the keyword vector of the encrypted medical data, an index vector corresponding to the identification value of the keyword vector, and a first fingerprint vector; A communication module is used to send the encrypted medical data and the index information to the server for storage, so that the server calculates a second fingerprint vector of the target word vector indicated by the second client according to a preset hash function and the index vector, and when the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs is sent to the second client.
8. An encrypted search device for medical data, It is characterized in that The device comprises: a storage module, configured to store the encrypted medical data sent by the first client and index information of the encrypted medical data, wherein the index information includes an identification value of a keyword vector of the encrypted medical data, a first Hash value, and a first fingerprint vector corresponding to the first Hash value; A search module, configured to determine a target word vector indicated by a search token in response to a search token generated by the second client trigger; and Calculate a second hash value of the target word vector by using a preset hash function; and Determine a second selected row vector of the target word vector according to the second Hash value; and Determining a second fingerprint vector of the target word vector according to the index vector corresponding to the identification value of the target word vector and the second selection vector; A communication module is used to send the encrypted medical data corresponding to the index information to which the first fingerprint vector belongs to to the second client if the second fingerprint vector is the same as the first fingerprint vector corresponding to the identification value of the target word vector, so that the second client decrypts the encrypted medical data according to the authorization key to obtain the target medical data.
9. A readable storage medium having a program or instruction stored thereon, It is characterized in that When the program or instruction is executed by a processor, the steps of the encrypted search method for medical data according to any one of claims 1 to 7 are implemented.
10. A computer device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, It is characterized in that When the processor executes the program, the encrypted search method for medical data according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Simhash-based fuzzy sequencing searching method for encrypted cloud data
CN106407447A
Medical data-oriented Chinese ciphertext multi-keyword fuzzy search method supporting privacy protection
CN114860888A
Cuckoo filter based on Feistel structure and data processing method thereof
CN116304238A
Cuckoo filter and data insertion, query and deletion method
CN116701440A
Cuckoo filters and cuckoo hash tables with biasing, compression, and decoupled logical sparsity
US20190266252A1
Cited By
Data encryption method and device and related equipment
CN120378230A
