Data ciphertext query method for attribute-based multi-keyword similarity ranking search
By using attribute-based encryption, leveraging trusted authoritative institutions to manage user attributes and vectorization technology, the problem of lax data user permission management in cloud storage is solved. This enables secure and efficient encrypted data querying and sorting, adapting to complex access scenarios and reducing resource waste.
Patent Information
- Application Number
- CN202211139017.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-09-19
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-09-19
AI Technical Summary
In existing cloud storage environments, data user access control is not strict enough, leading to data security risks and resource waste. At the same time, it is difficult to adapt to complex access scenarios and the high computational overhead of large-scale users.
It adopts an attribute-based encryption method, manages user attributes through a trusted authority, and uses vectorized formulas and searchable encryption technology to generate data vectors and query matrices. The cloud server calculates the similarity of encrypted documents and sorts them, returning the most similar encrypted document.
It implements an efficient attribute sharing access mechanism and keyword sorting query for encrypted data, ensuring data security and flexible access control of resources, and reducing search time.
Smart Images

Figure CN115510463B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of data encryption processing technology and relates to a method for querying encrypted data based on attribute-based multi-keyword similarity ranking search. Specifically, it is a method for querying encrypted data based on attribute access permissions for multi-keyword similarity search. It can be used in the context of cloud storage to set access settings for data user attribute authentication by a trusted authoritative institution. Only authorized data users can perform multi-keyword similarity search queries on encrypted data received by the cloud server. Background Technology
[0002] With the development of cloud storage technology, more and more users are outsourcing their heavy data and work management to "honest but curious" cloud servers. To ensure that data is only searchable by authorized users and that it is not leaked during storage and retrieval, data owners typically encrypt their data. Traditional encryption and decryption techniques require data owners to first identify users, grant them access, and then download all the encrypted data from the cloud to their local machine for decryption. Users then need to search for the decrypted data they need, which undoubtedly wastes network and local storage resources and poses a risk of privacy breaches, rendering the encryption process meaningless. While techniques for retrieving encrypted data have been proposed, these techniques have limitations in encrypted data retrieval applications. Therefore, this paper proposes an attribute-based encryption method to restrict user access to cloud servers based on user attributes. By combining various richer attribute information to form access control conditions, this method can flexibly adapt to different resource access scenarios, allowing users meeting certain attribute requirements to query data, thus achieving multi-user sharing and ensuring data security.
[0003] Xiaofeng Ding et al., in their paper "Privacy-Preserving Multi-Keyword Top-k Similarity Search Over Encrypted Data" (IEEE Transactions on Dependable and Secure Computing, vol.16, no.2, 2019:334-357), proposed a privacy-preserving multi-keyword top-k query method for encrypted cloud data. This method first uses a vector space model and the TF-IDF criterion to transform outsourced documents and queries into data vectors and query vectors, respectively. Then, it uses a secure RTRA algorithm to set access requirements. Next, it uses a secure k-nn algorithm to transform the data vectors and query vectors into indexes and trapdoors, respectively. Finally, it uses the inner product of the index and trapdoors to measure the relevance between documents and queries, and returns the k most relevant encrypted documents to the data user based on the relevance. The shortcomings of this method are: if the data user's access period expires, the user can still continue searching, creating a security risk. Furthermore, this method is difficult to adapt to resource-rich access scenarios; if the number of data users is large and the access requirements are complex, its operation and maintenance costs are high, and the computational overhead is significant.
[0004] Therefore, this invention proposes an attribute-based encryption method, which allows setting corresponding attribute requirements using attributes. For example, when an attribute refers to a permission time period, data users can only query data if their attributes meet the permission time period requirements. This avoids data security risks and also solves the problem of complex access requirements due to a large number of data users. In addition, this invention proposes to sort the query results by similarity and provide the most similar document to the search, thereby reducing search time.
[0005] Terminology Explanation:
[0006] Trusted authority: Any entity with the authority to determine whether software can be executed on a computing device. Summary of the Invention
[0007] The first objective of this invention is to address the problems of the prior art by proposing a data encryption query method based on attribute-based multi-keyword similarity search. This method can simultaneously achieve an efficient attribute sharing access mechanism and keyword-ordered query of encryption data.
[0008] The approach to achieving the objective of this invention is as follows: First, the data owner uploads an accessible user attribute access structure to a trusted authority. Data users submit their personal attributes to the trusted authority to obtain query permissions. The data owner then uses a weighted vectorization formula to convert each document into a data vector, encrypts this data vector using a searchable encryption key, and obtains an index for each electronic document. Authorized data users decrypt the data using a private key generated by the trusted authority and calculate the required query request. The query request is then converted into a query matrix, which is encrypted using a searchable encryption key to obtain a trapdoor for the query request. The cloud server calculates the trace of the product of each electronic document index and the trapdoor, sorts the ciphertexts from largest to smallest according to the trace value, and returns the ciphertexts with the most prominent data to the data user.
[0009] The specific steps of this invention are as follows:
[0010] Step (1): The data user obtains the searchable encryption key, symmetric encryption key, total keyword dictionary, and data vector of keyword inverse file frequencies:
[0011] (1a) A trusted authority distributes a public key to the data owner, who uses the distributed public key to encrypt an accessible attribute data structure, a searchable encryption key, a symmetric encryption key, and a keyword dictionary and the inverse file frequency data vector corresponding to the keywords.
[0012] (1b) Data users upload personal attributes to a trusted authority to obtain the key generated by the authority for that attribute;
[0013] (1c) The data owner sends the data user who submits the attribute with the encrypted searchable encryption key, the symmetric encryption key, the keyword dictionary and the inverse file frequency data vector corresponding to the keywords;
[0014] (1d) If the data user's attributes are in the set access structure, the searchable encryption key, symmetric encryption key, keyword dictionary and its corresponding inverse file frequency data vector can be decrypted; if the data user's attributes are not in the access structure, they cannot be obtained.
[0015] Step (2): Generate TF data vector sets and IDF data vectors:
[0016] (2a) The data owner uses an algorithm to extract all the keywords from the electronic document collection, removes all the keywords to form a dictionary, and groups all the keywords in the dictionary into b groups, with d keywords in each group;
[0017] (2b) The data owner converts each electronic document into a TF data vector and then integrates all the electronic documents to generate a TF data vector group. The calculation of a certain TF data vector is obtained by following these steps: First, the dimension of the data vector of a certain document is the dimension of the entire keyword dictionary. Second, each component of the data vector corresponds to the keyword element at the same position in the dictionary. Finally, the value of each component is the word frequency of the corresponding element in the document, which is calculated by the TF formula.
[0018] (2c) The data owner performs keyword IDF calculation on the entire electronic document to generate an IDF data vector. The calculation steps are as follows: First, the dimension of the IDF data vector is the dimension of the keyword dictionary; second, each component of the IDF data vector represents the keyword element at the same position in the keyword dictionary; finally, the value of each component of the IDF data vector is the inverse document frequency of that element in the entire electronic document, calculated by the IDF formula.
[0019] Step (3): Establish an electronic document index;
[0020] (3a) The data owner randomly generates four invertible matrices with dimensions (d+3)*(d+3) and uses them to form a searchable encryption key;
[0021] (3b) The data owner generates a symmetric key for a traditional symmetric encryption algorithm;
[0022] (3c) The data owner first performs the same operation on each component of the TF vector, then adds three virtual values to the vector. Afterward, the vector is converted into a diagonal matrix, and the diagonal elements are filled sequentially. Then, using a data matrix splitting method, the TF data matrix corresponding to each electronic document is randomly split into two main diagonal matrices:
[0023] (3d) The data owner multiplies the four invertible matrices and two randomly generated diagonal matrices in the searchable encryption key respectively, and combines all the results into an electronic document index.
[0024] (3e) The data owner uses a symmetric key to encrypt each electronic document and index to obtain ciphertext;
[0025] Step (4): Generate query vector group;
[0026] (4a) Data users can obtain a keyword dictionary and the IDF value of each keyword by uploading their personal attributes, provided that the attribute query is found.
[0027] (4b) The steps for data users to extract all keywords from the query request and generate query vector groups are as follows: First, the dimension of the query vector is the dimension of the keyword dictionary; then, each component of the query vector corresponds to the element at the same position in the keyword dictionary, and the IDF value of the element in the dictionary is calculated and filled into the component; finally, the query vector is grouped according to the grouping method of keywords in the dictionary, and finally b query vectors of d are obtained.
[0028] (4c) If all query vectors are zero, that is, the element corresponding to the query vector does not appear in the keyword dictionary, the query vector is deleted directly, but the sorting number of the group in the dictionary corresponding to the subsequent query vectors is not changed, and finally the query vector group is obtained.
[0029] Step (5): Generate the trapdoor:
[0030] (5a) First, group each query vector and perform related operations to change the value of each component. Then, add three dimension settings on this basis. Then, convert the query vector group into multiple diagonal matrices. Next, using the matrix splitting method, the data user splits each query matrix into two random diagonal matrices.
[0031] (5b) The data user multiplies the inverses of the four invertible matrices in the searchable encryption key with the query matrix respectively, and finally uses the results to form the trapdoor T of the query request.
[0032] (5c) The trapdoor through which data users submit query requests to the cloud server;
[0033] Step (6): Query the ciphertext:
[0034] (6a) The cloud server calculates the product of each electronic index matrix and the trapdoor matrix;
[0035] (6b) The cloud server sorts the ciphertext from largest to smallest based on the size of the product from all electronic document indexes and trapdoor products;
[0036] (6c) The cloud server selects the first k ciphertexts from the sorted ciphertexts and sends them to the data user, where k is a positive integer;
[0037] Step (7): Decrypt the returned ciphertext:
[0038] The data user uses the symmetric key described in the steps to decrypt the k ciphertexts received by the data user, and obtains the plaintext corresponding to each ciphertext.
[0039] A second object of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described thereon.
[0040] A third object of the present invention is to provide a computing device including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method.
[0041] Compared with the prior art, the present invention has the following advantages:
[0042] First, all access processes in this invention are authorized by a trusted authority before access to the cloud server is permitted, and a symmetric encryption key is required during the data decryption process, thereby further ensuring the data security of the data owner.
[0043] Second, since the present invention uses attribute encryption, it can combine a variety of richer attribute information to form access control conditions, thereby flexibly adapting to various resource access scenarios.
[0044] Third, since this invention is mainly for attribute access and result ranking, it realizes fine-grained access control of encrypted data, that is, the data owner can specify a certain group of people who can access the encrypted data, and the data owner has complete control over the data. Attached Figure Description
[0045] Figure 1 This is a flowchart of the present invention. Detailed Implementation
[0046] The present invention will be further analyzed below with reference to specific embodiments.
[0047] A method for encrypted data query based on attribute-based multi-keyword similarity search, such as Figure 1 Specifically, it includes the following:
[0048] Step S1: The data user obtains the searchable encryption key, the symmetric encryption key, the total keyword dictionary, and the inverse file frequency data vectors corresponding to the keywords.
[0049] 1-1 A trusted authority distributes public keys to data owners. Data owners use the distributed public keys to encrypt accessible attribute data structures, searchable encryption keys, symmetric encryption keys, and keyword dictionaries and their corresponding inverse file frequency data vectors.
[0050] 1-2 Data users upload personal attributes to a trusted authority. The trusted authority generates a private key based on the personal attributes and distributes it to the data user who uploaded the personal attributes.
[0051] The personal attributes refer to the necessary personal information that data users need to provide in order to meet the access and query conditions preset by the data owner, such as age, gender, and job title, in order to conduct access and queries.
[0052] 1-3 The data owner sends the data user who submits personal attributes an encrypted searchable encryption key, a symmetric encryption key, a keyword dictionary, and the inverse file frequency data vector corresponding to the keywords;
[0053] 1-4 Determine whether the data user's personal attributes meet the preset attribute access conditions (i.e., the data user's attributes are in the set access structure). If they are met, the current data user can receive and decrypt the encrypted searchable encryption key, symmetric encryption key, keyword dictionary and the inverse file frequency data vector corresponding to the keywords sent by the data owner. If they are not met (i.e., the data user's attributes are not in the access structure), the current data user cannot obtain them.
[0054] Step S2: Generate TF data vector set, second IDF data vector
[0055] 2-1 The data owner used a Python algorithm to extract all keywords from the electronic document collection, and then deduplicated all keywords to form a keyword dictionary W = {ω1, ω2, ..., ω...} n The keywords in the keyword dictionary are grouped into b groups, each containing d keywords, denoted as GW = {G1, G2, ..., G...}. b}, where G i ={ω (i-1)*d+1 ,ω (i-1)*d+2 ,...,ω i*d}, calculate the term frequency (TF) value of each keyword in each electronic document according to formula (1):
[0056]
[0057] Where TF(ω) i D j ) represents the keyword ω i In electronic document D j The term frequency TF value, f(ω) i D j ) represents the keyword ω i In electronic document D j The number of times it appears, |D j | Represents electronic document D j The total number of words in the text;
[0058] Based on the term frequency (TF) value of each keyword in each electronic document from the keyword dictionary, a TF data vector is constructed for each electronic document, thus obtaining a TF data vector group consisting of all electronic documents. The dimension of the TF data vector of the i-th electronic document is the same as the dimension of the keyword dictionary. Each component of the TF data vector corresponds to the element at the same position in the keyword dictionary; that is, the j-th component of the TF data vector of the i-th electronic document is the j-th element ω in the keyword dictionary W. j In electronic document D i The term frequency TF value;
[0059] 2-2 The data owner calculates the inverse document frequency (IDF) value of each keyword in the keyword dictionary across all electronic documents according to formula (2):
[0060]
[0061] Where f(D) j ,ω i ∈D j This indicates that all electronic documents contain the keyword ω. i The number of documents, where |D| represents the total number of electronic documents;
[0062] Based on the inverse document frequency (IDF) value of each keyword in the keyword dictionary within its corresponding electronic document, a first IDF data vector is constructed for each electronic document. The dimension of the first IDF data vector is the same as the dimension of the keyword dictionary, and each component of the first IDF data vector corresponds to the element at the same position in the keyword dictionary. That is, the j-th component of the first IDF data vector is the j-th element ω in the keyword dictionary W. j Inverse document frequency in all electronic documents;
[0063] 2-3 Multiply the first IDF data vector by any integer multiple of ten. Then, add the result of the vector multiplication to a vector composed of any integer. Next, add γ dimensions to the vector after addition, where the added vector component γ can be any real number. Here, γ is 3, and finally the second IDF data vector is obtained.
[0064] Step S3: Create an electronic document index
[0065] 3-1 The data owner randomly generates four (d+3)*(d+3) invertible matrices {M1,M2,M3,M4} and uses them to form a searchable encryption key K, i.e., K={M1,M2,M3,M4}.
[0066] 3-2 The data owner generates a symmetric key sk for a traditional symmetric encryption algorithm;
[0067] 3-3 The data owner groups the TF data vector corresponding to each electronic document according to the keywords in the keyword dictionary. That is, the i-th group of the TF data vector of a certain electronic document is G. i If the element in the document has a TF value, then the dimension of each TF data vector group is G. i The number of elements in the vector is d, and each TF data vector is divided into b groups;
[0068] For example, in the context of class division, the homeroom teacher divides a group of students into classes with equal numbers of students. That is, the TF data vector corresponding to each electronic document of the data owner is grouped according to the keywords in the keyword dictionary. Then, the students in a certain class are divided into groups with the same number of students in each group. That is, the i-th group in a certain class corresponds to the i-th group of the TF data vector of a certain electronic document. Then the dimension of each TF data vector group can be understood as the number of students in the class, and how many classes are there in total.
[0069] 3-4 The data owner performs an inverse file search on each element in each group of the keyword dictionary to find the electronic documents with high word frequency. The TF data vector of the electronic documents with high word frequency is used to construct a binary tree. The same steps are performed on each group to construct a total of b binary trees.
[0070] 3-5 Transform each TF data vector in the binary tree into a data diagonal matrix. The data owner uses the data matrix splitting method to split the data matrix A corresponding to each electronic document into two random diagonal matrices A1 and A2, i.e., A = A1A2 = A2A1.
[0071] 3-6 The data owner multiplies the four invertible matrices in the searchable encryption key K in the following way, i.e., A' = (M1A1M2)(M3A2M4), and combines all the results into electronic document index I.
[0072] 3-7 The data owner uses the symmetric key sk to encrypt each electronic document, obtaining ciphertext C.
[0073] 3-8 The data owner packages the ciphertext C and index I and sends them to the cloud server.
[0074] Step S4: Generate query vector grouping
[0075] 4-1 Data users upload their personal attributes to a trusted authority. The trusted authority checks whether the data user's personal attributes meet the preset attribute access conditions. If they do, the data user uses their private key to decrypt the encrypted searchable encryption key, symmetric encryption key, keyword dictionary, and the inverse file frequency data vector corresponding to each keyword, thereby obtaining the keyword dictionary and the second IDF data vector for each keyword.
[0076] 4-2 Data users extract all keywords from the query request and generate a query vector, where the query vector has the same dimensions as the keyword dictionary; then, the query keywords are reordered according to the sorting method of the keywords in the keyword dictionary, and the query vector is grouped according to the grouping method in the dictionary, into a total of b groups, each with d dimensions;
[0077] 4-3 For each query vector group, determine whether all query keywords in the current group are not in the dictionary group. If so, all element values in the current group are zero, but the index of the query vector group is not changed. Otherwise, continue to determine whether all query keywords are in the dictionary. If so, fill the second IDF data vector of each keyword. If some query keywords are in the keyword dictionary, fill the second IDF data vector component of the keyword in the corresponding query vector group of the partially indicative keyword. For keywords that are not indicative, fill the corresponding query vector group with a value of zero.
[0078] Step S5: Generate the trapdoor.
[0079] 5-1 Add a preset incremental dimension a (a can be 3) to each query vector group, and then transform the incrementally grouped query vectors into multiple diagonal matrices to obtain the query matrix; using the matrix splitting method, the data user splits each query matrix into two random diagonal matrices to obtain subquery matrices A3 and A4.
[0080] 5-2 The data user calculates the matrix B' of a certain query vector group by combining the inverses {M1, M2, M3, M4} of the four invertible matrices in the searchable encryption key with the subquery matrix according to the following formula;
[0081]
[0082] The matrix B', which groups all query vectors, forms the trapdoor T of the query request.
[0083] 5-3 Trapdoor T where data users submit query requests to the cloud server.
[0084] Step S6: Query the encrypted text and select the top-k electronic documents.
[0085] 6-1 The cloud server calculates the sum of the matrix traces of the product of each electronic document index and trapdoor in each binary tree of the keyword group, sorts them from largest to smallest, and selects the electronic documents corresponding to the top n1 best results as similar electronic documents in the current keyword group. The number of electronic documents in the current keyword group is > n1 ≥ 1.
[0086] The 6-2 cloud server forms a candidate set of similar electronic documents in each keyword group, filters them again, calculates the sum of the matrix traces of the electronic document index and trapdoor product results of these candidate sets, sorts them from largest to smallest, and selects the electronic documents corresponding to the top k best results as similar electronic documents for this query request, where n1*b>k≥1.
[0087] 6-3 The cloud server will send the k similar electronic documents of this query request as encrypted text to the data user who made the query request;
[0088] Step S7: Decrypt the returned ciphertext.
[0089] Data users use the symmetric encryption key sk to decrypt the received k ciphertexts, obtaining the plaintext corresponding to each ciphertext.
Claims
1. A method for encrypted data query based on attribute-based multi-keyword similarity ranking search, characterized in that... The method includes the following steps: Step S1: The data user obtains the searchable encryption key, the symmetric encryption key, the total keyword dictionary, and the inverse file frequency data vector corresponding to each keyword. Step S2: The data owner generates a TF data vector group and a second IDF data vector for the electronic document; specifically: 2-1 The data owner extracts all keywords from the electronic document collection, removes duplicate keywords, and constructs a keyword dictionary W = {ω1, ω2, ..., ω...} n The keywords in the keyword dictionary are grouped into b groups, each containing d keywords, denoted as GW = {G1, G2, ..., G...}. b }, where G i ={ω (i-1)*d+1 ,ω (i-1)*d+2 ,…,ω i*d } Calculate the term frequency (TF) value for each keyword in each electronic document; 2-2 The data owner converts each electronic document into a TF data vector, and then integrates all the electronic documents to generate a TF data vector group; 2-3 The data owner performs keyword IDF calculations on the entire electronic document to generate the first IDF data vector; 2-4 Multiply the first IDF data vector by any integer multiple of ten to obtain the vector scalar multiplication result; then add the above vector scalar multiplication result to a vector composed of any integer to obtain the vector after addition; then add γ dimensions to the vector after addition to finally obtain the second IDF data vector. Step S3: Create an electronic document index; specifically: 3-1 The data owner randomly generates four invertible matrices {M1,M2,M3,M4} with dimensions (d+3)*(d+3) and uses them to form a searchable encryption key K, i.e., K = {M1,M2,M3,M4}. 3-2 The data owner generates a symmetric key sk for a traditional symmetric encryption algorithm; 3-3 The data owner groups the TF data vector corresponding to each electronic document according to the keywords in the keyword dictionary. That is, the i-th group of the TF data vector of a certain electronic document is G. i If the element in the document has a TF value, then the dimension of each TF data vector group is G. i The number of elements in the vector is d, and each TF data vector is divided into b groups; 3-4 The data owner performs an inverse file search on each element in each group of the keyword dictionary to find the electronic documents with high word frequency. The TF data vector of the electronic documents with high word frequency is used to construct a binary tree. The same steps are performed on each group to construct a total of b binary trees. 3-5 Transform each TF data vector in the binary tree into a data diagonal matrix. The data owner uses the data matrix splitting method to split the data matrix A corresponding to each electronic document into two random diagonal matrices A1 and A2, i.e., A = A1A2 = A2A1. 3-6 The data owner multiplies the four invertible matrices in the searchable encryption key K as follows, i.e., A' = (M1A1M2)(M3A2M4), to form the electronic document index I; 3-7 The data owner uses the symmetric key sk to encrypt each electronic document and index I, obtaining ciphertext C and index I; 3-8 The data owner packages the ciphertext C and index I and sends them to the cloud server; Step S4: Generate query vector groupings; Step S5: Generate the trapdoor; specifically: 5-1 Add a preset incremental dimension 'a' to each query vector group, and then transform the incremented query vector group into multiple diagonal matrices to obtain the query matrix; using the matrix splitting method, the data user splits each query matrix into two random diagonal matrices to obtain subquery matrices A3 and A4; 5-2 The data user calculates the query vector grouping matrix B' by combining the inverses {M1, M2, M3, M4} of the four invertible matrices in the searchable encryption key with the subquery matrix according to formula (3); The matrix B', which groups all query vectors, forms the trapdoor T of the query request; 5-3 The trapdoor T where data users submit query requests to the cloud server; Step S6: Query the encrypted text and select the top-k electronic documents; Step S7: Decrypt the returned ciphertext; specifically: Data users use the symmetric encryption key sk to decrypt the received k ciphertexts, obtaining the plaintext corresponding to each ciphertext.
2. The method as described in claim 1, characterized in that... Step S1 is specifically: 1-1 A trusted authority distributes a public key to the data owner, and the data owner uses the distributed public key to encrypt the accessible attribute data structure, the searchable encryption key, the symmetric encryption key, and the keyword dictionary and the inverse file frequency data vector corresponding to the keywords; 1-2 Data users upload personal attributes to a trusted authority. The trusted authority generates a private key based on the personal attributes and distributes it to the data user who uploaded the personal attributes. 1-3 The data owner sends the data user who submits personal attributes an encrypted searchable encryption key, a symmetric encryption key, a keyword dictionary, and the inverse file frequency data vector corresponding to the keywords; 1-4 Determine whether the data user's personal attributes meet the preset attribute access conditions. If they do, the current data user can receive and decrypt the encrypted searchable encryption key, symmetric encryption key, keyword dictionary, and the inverse file frequency data vector corresponding to the keywords sent by the data owner. If they do not meet the conditions, the current data user cannot obtain them.
3. The method as described in claim 1, characterized in that... The formula for calculating the term frequency (TF) value of each keyword in each electronic document in step 2-1 is as follows: Where TF(ω) i D j ) represents the keyword ω i In electronic document D j The term frequency TF value, f(ω) i D j ) represents the keyword ω i In electronic document D j The number of times it appears, |D j | Represents electronic document D j The total number of words in the text.
4. The method as described in claim 1, characterized in that... Step 2-2 specifically involves: Based on the term frequency (TF) value of each keyword in each electronic document from the keyword dictionary, a TF data vector is constructed for each electronic document, thus obtaining a TF data vector group consisting of all electronic documents. The dimension of the TF data vector of the i-th electronic document is the dimension of the keyword dictionary, and each component of the TF data vector corresponds to the element at the same position in the keyword dictionary. That is, the j-th component of the TF data vector of the i-th electronic document is the j-th element ω in the keyword dictionary W. j In electronic document D i The word frequency (TF) value.
5. The method as described in claim 1, characterized in that... Steps 2-3 are as follows: The data owner calculates the inverse document frequency (IDF) value of each keyword in the keyword dictionary across all electronic documents using formula (2): Where f(D) j ,ω i ∈D j This indicates that all electronic documents contain the keyword ω. i The number of documents, where |D| represents the total number of electronic documents; Based on the inverse document frequency (IDF) value of each keyword in the keyword dictionary within its corresponding electronic document, a first IDF data vector is constructed for each electronic document. The dimension of the first IDF data vector is the same as the dimension of the keyword dictionary, and each component of the first IDF data vector corresponds to the element at the same position in the keyword dictionary. That is, the j-th component of the first IDF data vector is the j-th element ω in the keyword dictionary W. j Inverse document frequency in all electronic documents.
6. The method as described in claim 1, characterized in that... Step S4 is as follows: 4-1 Data users upload their personal attributes to a trusted authority. The trusted authority checks whether the data user's personal attributes meet the preset attribute access conditions. If they do, the data user uses their private key to decrypt the encrypted searchable encryption key, symmetric encryption key, keyword dictionary, and the inverse file frequency data vector corresponding to each keyword, thereby obtaining the keyword dictionary and the second IDF data vector for each keyword. 4-2 Data users extract all keywords from the query request and generate a query vector, where the query vector has the same dimensions as the keyword dictionary; then, the query keywords are reordered according to the sorting method of the keywords in the keyword dictionary, and the query vector is grouped according to the grouping method in the dictionary, into a total of b groups, each with d dimensions; 4-3 For each query vector group, determine whether all query keywords in the current group are not in the dictionary group. If all query keywords are not in the dictionary group, then all element values in the current group are zero, but the index of the query vector group is not changed. Otherwise, continue to determine whether all query keywords are in the dictionary. If all are, then fill the second IDF data vector of each keyword. If some are in the keyword dictionary, then fill the second IDF data vector component of the corresponding keyword in the query vector group of the partially present keywords. For keywords that are not present, fill the corresponding query vector group with a value set to zero.
7. The method as described in claim 1, characterized in that... Step S6 is as follows: 6-1 The cloud server calculates the sum of the matrix traces of the product of each electronic document index I and trapdoor T in each binary tree of the keyword group, and then sorts them from largest to smallest, and selects the electronic documents corresponding to the top n1 best results as similar electronic documents in the current keyword group. The number of electronic documents in the current keyword group is > n1 ≥ 1. The 6-2 cloud server forms a candidate set of similar electronic documents in each keyword group, filters them again, calculates the sum of the matrix traces of the electronic document index and trapdoor product results of these candidate sets, sorts them from largest to smallest, and selects the electronic documents corresponding to the top k best results as similar electronic documents for this query request, where n1*b>k≥1. 6-3 The cloud server will send the k similar electronic documents of this query request as encrypted text to the data user who issued the query request.
8. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method according to any one of claims 1-7.
9. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-7.