A data retrieval method, device, electronic device and storage medium based on a homomorphic encryption algorithm
By combining multi-level indexing and homomorphic encryption algorithms, encrypted index files are generated for data retrieval, which solves the problem of difficult to take into account both data retrieval efficiency and security in the prior art, and achieves efficient and secure data retrieval.
Patent Information
- Application Number
- CN202411919401.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2044-12-25
AI Technical Summary
The prior art is difficult to ensure data security while improving data retrieval efficiency, especially in industrial control systems, data security issues are becoming increasingly prominent.
By combining multi-level indexing and homomorphic encryption algorithms, encrypted index files are generated for data retrieval, ensuring the privacy of sensitive information of data and improving the efficiency of data retrieval.
It effectively improves the real-time and security of data retrieval, protects the privacy of sensitive data information, and greatly improves the efficiency of data retrieval.
Smart Images

Figure CN119358036B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the technical field of data retrieval, and in particular, to a data retrieval method, device, electronic device, and storage medium based on a homomorphic encryption algorithm. Background Art
[0002] With the rapid development of information and Internet technologies, modern society has entered a new era of increasing data. While the increasing data makes modern life more and more convenient, it also makes the storage, management, security, and analysis of data more and more difficult. Only by continuously optimizing and innovating data storage and retrieval technologies can these massive amounts of data be utilized efficiently. Currently, the main data index structures include arrays, AVL trees, B-trees, B+-trees, etc. The array as an index structure can minimize the space used by array indexing by predicting the size in advance or by using techniques such as virtual storage mapping to enable it to grow appropriately. Its disadvantage is that it cannot be dynamically maintained, and the amount of data movement caused by each maintenance operation is O(N). The disadvantage of using an AVL tree as the in-memory index structure is that the effective utilization rate of its memory is very low. The B-tree and B+-tree have good operation performance and can be dynamically maintained, but the memory utilization rate is relatively low. Moreover, in industrial control systems, the problem of data security is becoming increasingly prominent. Although strong encryption can alleviate data security problems by ensuring data confidentiality, once the data is encrypted, the availability of the data and the efficiency of data retrieval will be greatly reduced. Therefore, how to improve both the efficiency of data retrieval and ensure data security has become a technical problem that cannot be underestimated. Summary of the Invention
[0003] In view of this, the purpose of this application is to provide a data retrieval method, device, electronic device, and storage medium based on a homomorphic encryption algorithm. By combining multi-level indexing and a homomorphic encryption algorithm, the real-time performance and security of data retrieval are effectively improved, the privacy of sensitive information of the data is protected, and data retrieval is performed using the encrypted index file, which can greatly improve the efficiency of data retrieval.
[0004] The embodiment of this application provides a data retrieval method based on a homomorphic encryption algorithm. The data retrieval method includes:
[0005] Based on the multi-modal features of multiple data files in a database, determine the multi-level index structure corresponding to the multiple data files; wherein, the multi-level index structure includes a tag point index, a date index, and a time index;
[0006] Based on the multi-level index structure and the multiple data files, perform multi-level index storage processing to generate the index file corresponding to the database;
[0007] Encrypt the index file according to the homomorphic encryption algorithm, perform data retrieval on the encrypted index file for label point index, date index, and time index based on the retrieval data query requirements of the user, and determine the data address corresponding to the retrieval data query requirements, so as to obtain the target data based on the data address.
[0008] In a possible implementation manner, determining the multi-level index structure corresponding to the multiple data files based on the multi-modal features of the multiple data files in the database includes:
[0009] Analyze the multi-modal features of the multiple data files to determine the label features, date features, and time features of the data files;
[0010] Use the label feature as the label point index, the date feature as the date index, and the time feature as the time index;
[0011] Construct the multi-level index structure based on the nodes corresponding to the label point index, the date index, and the time index in the node order.
[0012] In a possible implementation manner, performing multi-level index storage processing based on the multi-level index structure and the multiple data files to generate the index file corresponding to the database includes:
[0013] Perform a hash value transformation on the label information of the data file, and store the label information after the hash value transformation in the label point index of the corresponding label point index node; wherein, each transformed hash value corresponds to a label point index node;
[0014] Perform a numerical transformation on the date information of the data file, and store the date information after the numerical transformation in the date index of the corresponding date index node; wherein, the date information after the numerical transformation is the integer corresponding to the date information in that year, and each integer corresponds to a date index node;
[0015] Store the time information of the data file in the time index of the time index node, and store the data file in the data packet under the time index node;
[0016] Generate the index file corresponding to the database based on the stored label point index, date index, and time index.
[0017] In a possible implementation manner, the data retrieval of performing label point indexing, date indexing, and time indexing on the encrypted index file according to the retrieval data query requirements of the user to determine the data address corresponding to the retrieval data query requirements includes:
[0018] Based on multiple label point indexes in the encrypted index file for the target label information in the retrieval data query requirements, determining a target label point index node corresponding to the target label information;
[0019] According to multiple date index files under the target label point index node, determining a target date index node corresponding to the target date information in the retrieval data query requirements;
[0020] According to multiple time index files under the target date index node, determining a target time index node corresponding to the target time information in the retrieval data query requirements, so as to obtain the data address under the target time index node.
[0021] In a possible implementation manner, the encrypting of the index file according to the homomorphic encryption algorithm includes:
[0022] An input key generation source generates an encrypted key;
[0023] Based on the key, selecting a random data seed and combining a pseudo-random function to encrypt each index node in the read index file to determine the encrypted index file.
[0024] In a possible implementation manner, before determining the multi-level index structure corresponding to multiple data files based on the multi-modal features of multiple data files in the database, the data retrieval method further includes:
[0025] Encrypting the data file according to the homomorphic encryption algorithm.
[0026] The embodiment of the present application further provides a data retrieval device based on the homomorphic encryption algorithm, and the data retrieval device includes:
[0027] A structure determination module, configured to determine a multi-level index structure corresponding to multiple data files based on the multi-modal features of multiple data files in the database; wherein, the multi-level index structure includes label point indexing, date indexing, and time indexing;
[0028] An index file generation module, configured to perform multi-level index storage processing based on the multi-level index structure and multiple data files to generate an index file corresponding to the database;
[0029] A retrieval module, configured to encrypt the index file according to a homomorphic encryption algorithm, perform data retrieval on the encrypted index file for tag point index, date index, and time index based on the retrieval data query requirements of a user, and determine a data address corresponding to the retrieval data query requirements, so as to obtain target data based on the data address.
[0030] In a possible implementation manner, when the structure determination module is used to determine a multi-level index structure corresponding to multiple data files based on multi-modal features of the multiple data files in a database, the structure determination module is specifically configured to:
[0031] Analyze the multi-modal features of the multiple data files to determine the tag feature, date feature, and time feature of the data files;
[0032] Use the tag feature as the tag point index, the date feature as the date index, and the time feature as the time index;
[0033] Construct the multi-level index structure based on the nodes corresponding to the tag point index, the date index, and the time index in the order of the nodes.
[0034] An embodiment of the present application further provides an electronic device, including: a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, the processor communicates with the memory through the bus. When the machine-readable instructions are executed by the processor, the steps of the data retrieval method based on the homomorphic encryption algorithm as described above are executed.
[0035] An embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the data retrieval method based on the homomorphic encryption algorithm as described above are executed.
[0036] A data retrieval method, device, electronic device and storage medium based on a homomorphic encryption algorithm provided by an embodiment of the present application. The data retrieval method includes: determining a multi-level index structure corresponding to multiple data files based on multi-modal features of the multiple data files in a database; wherein, the multi-level index structure includes a tag point index, a date index, and a time index; performing multi-level index storage processing based on the multi-level index structure and the multiple data files to generate an index file corresponding to the database; encrypting the index file according to the homomorphic encryption algorithm, and performing data retrieval on the encrypted index file for the tag point index, date index, and time index based on the retrieval data query requirements of a user to determine a data address corresponding to the retrieval data query requirements, so as to obtain target data based on the data address. By combining the use of multi-level indexing and the homomorphic encryption algorithm, the real-time performance and security of data retrieval are effectively improved, the privacy of sensitive information of the data is protected, and data retrieval is performed using the encrypted index file, which can greatly improve the efficiency of data retrieval.
[0037] To make the above objects, features and advantages of the present application more obvious and understandable, the following specifically enumerates preferred embodiments and, in conjunction with the accompanying drawings, makes the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present application, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.
[0039] Figure 1 A flowchart of a data retrieval method based on a homomorphic encryption algorithm provided by an embodiment of the present application;
[0040] Figure 2 A schematic diagram of a multi-level index structure of data provided by an embodiment of the present application;
[0041] Figure 3 A schematic diagram of an index file of data provided by an embodiment of the present application;
[0042] Figure 4 A schematic diagram of the structure of a data retrieval device based on a homomorphic encryption algorithm provided by an embodiment of the present application;
[0043] Figure 5 A schematic diagram of the structure of a data retrieval device based on a homomorphic encryption algorithm provided by an embodiment of the present application;
[0044] Figure 6A schematic structural diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0045] To make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Apparently, the described embodiments are only a part rather than all of the embodiments of the present application. Components of the embodiments of the present application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, every other embodiment obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.
[0046] First, an application scenario applicable to the present application will be introduced. The present application can be applied to the field of data retrieval technology.
[0047] Through research, it is found that with the rapid development of information and Internet technologies, modern society has entered a new era of increasing data. While the increasing data makes modern life more and more convenient, it also makes the storage, management, security and analysis of data become more and more difficult. Only by continuously optimizing and innovating data storage and retrieval technologies can these massive data be utilized efficiently. Currently, the main data index structures include arrays, AVL trees, B-trees, B+ -trees, etc. An array as an index structure makes the space used by the array index the smallest by predicting the size in advance or by means of technologies such as virtual storage mapping so that it can grow properly. Its disadvantage is that it cannot be dynamically maintained, and the amount of data movement caused by each maintenance operation is O(N). The disadvantage of using an AVL tree as the in-memory index structure is that the effective utilization rate of its memory is very low. The B-tree and B+ -tree have good operation performance and can be dynamically maintained, but the memory utilization rate is relatively low. Moreover, in industrial control systems, the problem of data security is becoming increasingly prominent. Although strong encryption can alleviate the data security problem by ensuring the confidentiality of data, once the data is encrypted, the availability of the data and the efficiency of data retrieval will be greatly reduced. Therefore, how to improve both the efficiency of data retrieval and the security of data has become a technical problem that cannot be underestimated.
[0048] Based on this, the embodiments of the present application provide a data retrieval method based on a homomorphic encryption algorithm. By combining the use of a multi-level index and a homomorphic encryption algorithm, the real-time performance and security of data retrieval are effectively improved, the privacy of sensitive information of data is protected, and data retrieval is performed using the encrypted index file, which can greatly improve the efficiency of data retrieval.
[0049] Please refer to Figure 1 ,Figure 1 This is a flowchart of a data retrieval method based on a homomorphic encryption algorithm provided by an embodiment of the present application. As Figure 1 shown in
[0050] S101: Based on the multi-modal features of multiple data files in a database, determine a multi-level index structure corresponding to the multiple data files; wherein, the multi-level index structure includes a tag point index, a date index, and a time index.
[0051] In this step, according to the multi-modal features of multiple data files in the database, determine a multi-level index structure corresponding to the multiple data files.
[0052] Among them, the multi-modal features include the tag feature, date feature, and time feature of the data file.
[0053] In a possible implementation manner, the determining, based on the multi-modal features of multiple data files in the database, a multi-level index structure corresponding to the multiple data files includes:
[0054] (1): Analyze the multi-modal features of the multiple data files to determine the tag feature, date feature, and time feature of the data file.
[0055] Here, analyze the multi-modal features of multiple data files to determine the tag feature, date feature, and time feature of the data file.
[0056] (2): Use the tag feature as the tag point index, use the date feature as the date index, and use the time feature as the time index.
[0057] Here, use the tag feature as the tag point index, use the date feature as the date index, and use the time feature as the time index.
[0058] (3): Based on the nodes corresponding to the tag point index, the date index, and the time index in the order of the nodes, construct the multi-level index structure.
[0059] Here, according to the nodes corresponding to the tag point index, the date index, and the time index in the order of the nodes, construct the multi-level index structure.
[0060] Further, please refer to Figure 2 , Figure 2 This is a schematic diagram of the multi-level index structure of the data provided by an embodiment of the present application. As Figure 2As shown in the figure, the index is divided into three levels. The label point index node serves as the root node, the time index node is the leaf node, and the remaining date index nodes are intermediate nodes. The leaf node is the disk data block, and each part corresponds to a different data file.
[0061] S102: Perform multi-level index storage processing based on the multi-level index structure and the multiple data files to generate the index file corresponding to the database.
[0062] In this step, perform multi-level index storage processing according to the multi-level index structure and multiple data files to generate the index file corresponding to the database.
[0063] In a possible implementation manner, the performing multi-level index storage processing based on the multi-level index structure and the multiple data files to generate the index file corresponding to the database includes:
[0064] A: Perform a hash value transformation on the label information of the data file, and store the label information after the hash value transformation in the label point index of the corresponding label point index node; wherein, each transformed hash value corresponds to a label point index node.
[0065] Here, perform a hash value transformation on the label information of the data file, and store the label information after the hash value transformation in the label point index of the corresponding label point index node.
[0066] Among them, in the database system, the names of label points are all named in the form of strings. If data is accessed by label point names throughout the database, the efficiency is very low because the search speed for strings is very slow, and at the same time, more storage space will be occupied. Therefore, the label point names are mapped to unique label point numbers through hash transformation, and all internal accesses are performed using label point numbers. The hash table resides in memory, reducing disk I / O operations, and its time complexity is determined by the hash algorithm.
[0067] B: Perform a numerical transformation on the date information of the data file, and store the date information after the numerical transformation in the date index of the corresponding date index node; wherein, the date information after the numerical transformation is the integer corresponding to the date information in that year, and each integer corresponds to a date index node.
[0068] Here, perform a numerical transformation on the date information of the data file, and store the date information after the numerical transformation in the date index of the corresponding date index node.
[0069] Among them, after the date is transformed, it is converted into an integer representing a certain day of the year, which is convenient for quickly finding the disk position where the specified date is located. This level of index is called a direct index. Therefore, the date index node can directly read the disk, and one I / O operation can complete it.
[0070] C: Store the time information of the data file in the time index of the time index node, and store the data file in the data packet under the time index node.
[0071] Here, the time index node can be found through the date index node, and the number of disk reads is determined by the number of its time index nodes. All time index nodes belonging to this day are read into the memory, and finally the position where the data packet is located is found.
[0072] D: Generate an index file corresponding to the database based on the stored tag point index, date index, and time index.
[0073] Here, an index file corresponding to the database is generated according to the stored tag point index, date index, and time index.
[0074] Further, please refer to Figure 3 , Figure 3 which is a schematic diagram of the index file of the data provided by the embodiment of the present application. As Figure 3 shown, perform a hash value transformation on the tag point name to determine the hash value corresponding to each punctuation name, and store the hash value in the tag point index of the corresponding tag point index node. There are multiple date index nodes under one tag point index node, and the date index stored in the date index node stores the date information after numerical transformation. There are multiple time index nodes under one date index node, and each time index node corresponds to a data packet, and the data packet corresponds to a data file.
[0075] In the present application, the tag point index nodes are stored in the tag point index file, each node occupies a fixed space, and they are stored in sequence according to their tag point numbers; the date index nodes correspond to the date index file, and the number of date index nodes of each tag index node in a year is fixed; the time index nodes correspond to the time index file, and there are several time index nodes corresponding to one date index node.
[0076] The present application should adopt different index methods for different types of data, give full play to the advantages of various algorithms, and improve the overall performance of the system. The present application proposes a brand-new data structure as Figure 3 shown. This structure is a multi-layer index structure that combines a tree index and a Hash index. The tree index among them is the index structure of a B-tree and is a clustered index structure, and the Hash index is used to organize the index key and the memory data object.
[0077] S103: Encrypt the index file according to the homomorphic encryption algorithm, perform data retrieval of label point index, date index, and time index on the encrypted index file based on the retrieval data query requirements of the user, and determine the data address corresponding to the retrieval data query requirements, so as to obtain the target data based on the data address.
[0078] In this step, encrypt the index file according to the homomorphic encryption algorithm, perform data retrieval of label point index, date index, and time index on the encrypted index file according to the retrieval data query requirements of the user, and determine the data address corresponding to the retrieval data query requirements, so as to obtain the target data according to the data address.
[0079] In a possible implementation manner, the performing data retrieval of label point index, date index, and time index on the encrypted index file based on the retrieval data query requirements of the user and determining the data address corresponding to the retrieval data query requirements includes:
[0080] a: Based on the multiple label point indexes of the target label information in the retrieval data query requirements in the encrypted index file, determine the target label point index node corresponding to the target label information.
[0081] Here, based on the multiple label point indexes of the target label information in the retrieval data query requirements in the encrypted index file, determine the target label point index node corresponding to the target label information.
[0082] Among them, perform a hash value transformation on the target label information to determine the target hash value, and determine the corresponding target label point index node according to the target hash value.
[0083] b: According to the multiple date index files under the target label point index node, determine the target date index node corresponding to the target date information in the retrieval data query requirements.
[0084] Here, according to the multiple date index files under the target label point index node, determine the target date index node corresponding to the target date information in the retrieval data query requirements.
[0085] Among them, perform an integer value transformation on the target date information to determine the integer value corresponding to the target information, and determine the corresponding target date index node according to the integer value corresponding to the target information in the multiple date index files under the target label point index node.
[0086] c: Determine the target time index node corresponding to the target time information in the retrieval data query requirement according to multiple time index files under the target date index node, so as to obtain the data address under the target time index node.
[0087] Here, according to multiple time index files under the target date index node, determine the target time index node corresponding to the target time information in the retrieval data query requirement, so as to obtain the data address under the target time index node.
[0088] In a possible implementation manner, the encrypting the index file according to the homomorphic encryption algorithm includes:
[0089] The input key generation source generates an encrypted key; based on the key, select a random data seed and combine a pseudorandom function to encrypt each index node in the read index file to determine the encrypted index file.
[0090] Here, let the integer Abelian group be ZN, the group order N>1, and the definition of the pseudorandom function F:{0,1}nx{0.1}n→ZN is Fk(x)=F(k,x), and its function is to map a string of length n to the Abelian group ZN, where n is the key length and can be set according to specific requirements. The homomorphic encryption method generally includes the following three parts: 1) Key generation CreateNewKey: Input the key generation source n=1n, and output the key for encryption, k=CreateNewKey(1n), k∈{0,1}n; 2) Encryption encrypt: According to the key k, select a random data seed r∈{0,1}n, and combine the pseudorandom function to encrypt each index node m∈ZN in the plaintext index file, and output the ciphertext c=<(m+Fk(r))mod N,[r],δ>; 3) Decryption decrypt: Decrypt the ciphertext message c according to the key k, m=decrypt(k,c). Among them, the ciphertext is the encrypted index file.
[0091] In a possible implementation manner, before determining the multi-level index structure corresponding to multiple data files based on the multi-modal features of multiple data files in the database, the data retrieval method further includes:
[0092] Encrypt the data file according to the homomorphic encryption algorithm.
[0093] This application encrypts index file information through the homomorphic encryption algorithm, which plays a role in security protection and privacy protection for the access of sensitive data. Because homomorphic encryption has the characteristic of not affecting the arithmetic and logical operations of index data, data visitors encrypt data and retrieval information through the homomorphic encryption algorithm and use ciphertext during the process of data access and retrieval.
[0094] A data retrieval method based on a homomorphic encryption algorithm provided by an embodiment of the present application, the data retrieval method comprising: determining a multi-level index structure corresponding to a plurality of data files based on multi-modal features of the plurality of data files in a database; wherein, the multi-level index structure includes a tag point index, a date index, and a time index; performing multi-level index storage processing based on the multi-level index structure and the plurality of data files to generate an index file corresponding to the database; encrypting the index file according to the homomorphic encryption algorithm, and performing data retrieval on the encrypted index file for the tag point index, the date index, and the time index based on a retrieval data query requirement of a user, to determine a data address corresponding to the retrieval data query requirement, so as to obtain target data based on the data address. By combining the use of the multi-level index and the homomorphic encryption algorithm, the real-time performance and security of data retrieval are effectively improved, the privacy of sensitive information of the data is protected, and data retrieval is performed using the encrypted index file, which can greatly improve the efficiency of data retrieval.
[0095] Please refer to Figure 4 、 Figure 5 , Figure 4 which is one of the structural schematic diagrams of a data retrieval device based on a homomorphic encryption algorithm provided by an embodiment of the present application; Figure 5 which is the second structural schematic diagram of a data retrieval device based on a homomorphic encryption algorithm provided by an embodiment of the present application. As Figure 4 shown in
[0096] A structure determination module 410, configured to determine a multi-level index structure corresponding to a plurality of data files based on multi-modal features of the plurality of data files in a database; wherein, the multi-level index structure includes a tag point index, a date index, and a time index;
[0097] An index file generation module 420, configured to perform multi-level index storage processing based on the multi-level index structure and the plurality of data files to generate an index file corresponding to the database;
[0098] A retrieval module 430, configured to encrypt the index file according to the homomorphic encryption algorithm, and perform data retrieval on the encrypted index file for the tag point index, the date index, and the time index based on a retrieval data query requirement of a user, to determine a data address corresponding to the retrieval data query requirement, so as to obtain target data based on the data address.
[0099] Further, when the structure determination module 410 determines a multi-level index structure corresponding to multiple data files based on multi-modal features in the database, the structure determination module 410 specifically is used for:
[0100] Analyze the multi-modal features of multiple data files to determine the label features, date features, and time features of the data files;
[0101] Use the label feature as the label point index, the date feature as the date index, and the time feature as the time index;
[0102] Based on the nodes corresponding to the label point index, the date index, and the time index in the order of the nodes, construct the multi-level index structure.
[0103] Further, when the index file generation module 420 performs multi-level index storage processing based on the multi-level index structure and multiple data files to generate an index file corresponding to the database, the index file generation module 420 specifically is used for:
[0104] Perform a hash value transformation on the label information of the data file, and store the label information after the hash value transformation in the label point index of the corresponding label point index node; wherein, each transformed hash value corresponds to a label point index node;
[0105] Perform a numerical transformation on the date information of the data file, and store the date information after the numerical transformation in the date index of the corresponding date index node; wherein, the date information after the numerical transformation is the integer corresponding to the date information in a year, and each integer corresponds to a date index node;
[0106] Store the time information of the data file in the time index of the time index node, and store the data file in the data packet under the time index node;
[0107] Generate an index file corresponding to the database based on the stored label point index, date index, and time index.
[0108] Further, when the retrieval module 430 performs data retrieval on the encrypted index file based on the retrieval data query requirements of the user for the label point index, date index, and time index to determine the data address corresponding to the retrieval data query requirements, the retrieval module 430 specifically is used for:
[0109] Query multiple tag point indexes of the target tag information in the encrypted index file based on the target tag information in the retrieval data query requirement, and determine the target tag point index node corresponding to the target tag information;
[0110] Determine the target date index node corresponding to the target date information in the retrieval data query requirement according to multiple date index files under the target tag point index node;
[0111] Determine the target time index node corresponding to the target time information in the retrieval data query requirement according to multiple time index files under the target date index node, so as to obtain the data address under the target time index node.
[0112] Further, as Figure 5 shown, the data retrieval device 400 further includes an encryption module 440, and the encryption module is used for:
[0113] An input key generation source generates an encrypted key;
[0114] Based on the key, select a random data seed and combine it with a pseudo-random function to encrypt each index node in the read index file, and determine the encrypted index file.
[0115] Further, the encryption module 440 is further used for:
[0116] Encrypt the data file according to the homomorphic encryption algorithm.
[0117] A data retrieval device based on a homomorphic encryption algorithm provided by an embodiment of the present application, the data retrieval device includes: a structure determination module, configured to determine a multi-level index structure corresponding to multiple data files based on multi-modal features of multiple data files in a database; wherein, the multi-level index structure includes tag point indexes, date indexes, and time indexes; an index file generation module, configured to perform multi-level index storage processing based on the multi-level index structure and multiple data files, and generate an index file corresponding to the database; a retrieval module, configured to encrypt the index file according to the homomorphic encryption algorithm, perform data retrieval of tag point indexes, date indexes, and time indexes on the encrypted index file based on a user's retrieval data query requirement, and determine a data address corresponding to the retrieval data query requirement, so as to obtain target data based on the data address. By combining the use of multi-level indexes and the homomorphic encryption algorithm, the real-time performance and security of data retrieval are effectively improved, the privacy of sensitive information of the data is protected, and data retrieval is performed using the encrypted index file, which can greatly improve the efficiency of data retrieval.
[0118] Please refer to Figure 6 , Figure 6The following is a schematic structural diagram of an electronic device provided by an embodiment of the present application. As Figure 6 shown in the figure, the electronic device 600 includes a processor 610, a memory 620, and a bus 630.
[0119] The memory 620 stores machine-readable instructions executable by the processor 610. When the electronic device 600 runs, the processor 610 communicates with the memory 620 through the bus 630. When the machine-readable instructions are executed by the processor 610, the steps of the data retrieval method based on the homomorphic encryption algorithm in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here. Figure 1 shown in the figure, the steps of the data retrieval method based on the homomorphic encryption algorithm in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here.
[0120] The embodiment of the present application further provides a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of the data retrieval method based on the homomorphic encryption algorithm in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here. Figure 1 shown in the figure, the steps of the data retrieval method based on the homomorphic encryption algorithm in the method embodiment as described above can be executed. For the specific implementation manner, reference can be made to the method embodiment, which will not be elaborated here.
[0121] Those skilled in the art can clearly understand that for the convenience and brevity of description, the specific working processes of the systems, devices, and units described above can refer to the corresponding processes in the foregoing method embodiments, which will not be elaborated here.
[0122] In several embodiments provided by the present application, it should be understood that the disclosed systems, devices, and methods can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed mutual coupling or direct coupling or communication connection can be through some communication interfaces. The indirect coupling or communication connection of the devices or units can be in an electrical, mechanical, or other form.
[0123] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0124] In addition, in each embodiment of the present application, the functional units can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.
[0125] When the above functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0126] Finally, it should be noted that the above embodiments are only specific implementation manners of this application, used to illustrate the technical solutions of this application, rather than limiting them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: any person skilled in the art within the technical scope disclosed by this application can still modify the technical solutions recorded in the foregoing embodiments, or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes, or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of this application, and should all be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
Claims
1. A data retrieval method based on a homomorphic encryption algorithm, characterized in that: The data retrieval method comprises: Based on the multimodal features of multiple data files in the database, a multi-level index structure corresponding to the multiple data files is determined; wherein the multi-level index structure includes a tag point index, a date index, and a time index; Performing multi-level index storage processing based on the multi-level index structure and the plurality of data files to generate an index file corresponding to the database; The index file is encrypted according to a homomorphic encryption algorithm, and data retrieval is performed on the encrypted index file by label point indexing, date indexing, and time indexing based on the user's retrieval data query requirements, and the data address corresponding to the retrieval data query requirements is determined, so that the target data can be obtained based on the data address; The performing multi-level index storage processing based on the multi-level index structure and the plurality of data files to generate an index file corresponding to the database includes: Performing a hash value transformation on the label information of the data file, and storing the label information after the hash value transformation in the label point index of the corresponding label point index node; wherein each transformed hash value corresponds to a label point index node; Performing numerical conversion on the date information of the data file, and storing the numerically converted date information in the date index of the corresponding date index node; wherein the numerically converted date information is an integer corresponding to the date information in a year, and each integer corresponds to a date index node; The time information of the data file is stored in the time index of the time index node, and the data file is stored in the data packet under the time index node; Based on the stored label point index, the date index and the time index, an index file corresponding to the database is generated; wherein, there are multiple date index nodes under one label point index node, and there are multiple time index nodes under one date index node, each time index node corresponds to a data packet, and the data packet corresponds to a data file.
2. The data retrieval method according to claim 1, characterized in that: The step of determining a multi-level index structure corresponding to a plurality of data files based on multimodal features of the plurality of data files in the database comprises: Analyzing the multimodal features of the plurality of data files to determine label features, date features, and time features of the data files; Using the tag feature as the tag point index, using the date feature as the date index, and using the time feature as the time index; The multi-level index structure is constructed based on the nodes corresponding to the tag point index, the date index and the time index in a node order.
3. The data retrieval method according to claim 1, characterized in that: The step of performing data retrieval based on the user's retrieval data query requirements on the encrypted index file by using the tag point index, date index, and time index to determine the data address corresponding to the retrieval data query requirements includes: Based on multiple label point indexes of the target label information in the retrieval data query requirement in the encrypted index file, determine the target label point index node corresponding to the target label information; Determine the target date index node corresponding to the target date information in the retrieval data query requirement according to the multiple date index files under the target tag point index node; According to the multiple time index files under the target date index node, the target time index node corresponding to the target time information in the retrieval data query requirement is determined, so as to obtain the data address under the target time index node.
4. The data retrieval method according to claim 1, characterized in that: The encrypting the index file according to the homomorphic encryption algorithm includes: Input the key generation source to generate the encrypted key; A random data seed is selected based on the key and combined with a pseudo-random function to encrypt each index node in the read index file to determine the encrypted index file.
5. The data retrieval method according to claim 1, characterized in that: Before determining the multi-level index structure corresponding to the plurality of data files based on the multimodal features of the plurality of data files in the database, the data retrieval method further includes: The data file is encrypted according to a homomorphic encryption algorithm.
6. A data retrieval device based on a homomorphic encryption algorithm, characterized in that: The data retrieval device comprises: A structure determination module, used to determine a multi-level index structure corresponding to a plurality of data files in a database based on multi-modal features of the plurality of data files; wherein the multi-level index structure includes a tag point index, a date index, and a time index; An index file generating module, used for performing multi-level index storage processing based on the multi-level index structure and the plurality of data files, and generating an index file corresponding to the database; A retrieval module is used to encrypt the index file according to a homomorphic encryption algorithm, perform data retrieval of the encrypted index file by label point indexing, date indexing, and time indexing based on the user's retrieval data query requirements, and determine the data address corresponding to the retrieval data query requirements, so as to obtain the target data based on the data address; When the index file generation module is used to perform multi-level index storage processing based on the multi-level index structure and the plurality of data files to generate an index file corresponding to the database, the index file generation module is specifically used to: Performing a hash value transformation on the label information of the data file, and storing the label information after the hash value transformation in the label point index of the corresponding label point index node; wherein each transformed hash value corresponds to a label point index node; Performing numerical conversion on the date information of the data file, and storing the numerically converted date information in the date index of the corresponding date index node; wherein the numerically converted date information is an integer corresponding to the date information in a year, and each integer corresponds to a date index node; The time information of the data file is stored in the time index of the time index node, and the data file is stored in the data packet under the time index node; Based on the stored label point index, the date index and the time index, an index file corresponding to the database is generated; wherein, there are multiple date index nodes under one label point index node, and there are multiple time index nodes under one date index node, each time index node corresponds to a data packet, and the data packet corresponds to a data file.
7. The data retrieval device according to claim 6, characterized in that: When the structure determination module is used to determine the multi-level index structure corresponding to the multiple data files based on the multimodal features of the multiple data files in the database, the structure determination module is specifically used to: Analyzing the multimodal features of the plurality of data files to determine label features, date features, and time features of the data files; Using the tag feature as the tag point index, using the date feature as the date index, and using the time feature as the time index; The multi-level index structure is constructed based on the nodes corresponding to the tag point index, the date index and the time index in a node order.
8. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the processor and the memory communicate through the bus. When the processor is running, the machine-readable instructions execute the steps of the data retrieval method based on the homomorphic encryption algorithm as described in any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the data retrieval method based on the homomorphic encryption algorithm as described in any one of claims 1 to 5 are executed.
Citation Information
Patent Citations
Block chain-based big data security protection method
CN118797743A