Keyword Private Information Retrieval Method and Device Based on Hierarchical Dynamic Constant Weight Codes
By combining multi-dimensional hypercube storage units with anti-collision hashing functions with layered dynamic constant-privileges codes, the problem of low hash collision and update efficiency in dynamic databases is solved, efficient data retrieval and dynamic expansion are achieved, and waste of computing and storage resources is reduced.
Patent Information
- Application Number
- CN202510768061.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-10
AI Technical Summary
In the dynamic database scenario, the existing PIR technology has problems such as high hash conflict probability, difficult hash mapping to update dynamically, serious waste of computing and storage resources, and low query efficiency. Especially in large-scale databases, the probability of hash conflict is high, resulting in data retrieval ambiguity and update delay.
The multi-dimensional hypercube storage unit is used to map data with anti-collision hash function, combined with the hierarchical dynamic constant-privilege code to optimize the index update time complexity, reduce hash conflicts through anti-collision hash function, avoid global reconstruction, and optimize index updates through hierarchical mapping and dynamic programming algorithms to achieve dynamic incremental expansion.
Effectively reduce the probability of hash collision, improve storage accuracy and update efficiency, optimize the complexity of index update time, realize dynamic incremental expansion, improve resource utilization efficiency, and reduce calculation complexity and noise variance accumulation.
Smart Images

Figure CN120277104B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of information retrieval, and in particular to a keyword private information retrieval method and device based on hierarchical dynamic constant weight codes. Background Art
[0002] Private Information Retrieval (PIR) is one of the important protocols in the field of cryptography. This technology allows users to retrieve specific data items from a server while ensuring that the server cannot know the specific content of the user's query. This technology can effectively protect user privacy and has wide application needs in fields such as medical record query, financial data acquisition, and anonymous network access.
[0003] PIR technology requires replicating the database to at least two non-collusive servers. In the information theory security framework, in order to prevent the adversary from snooping on the user's retrieval privacy, the user has to download all the data on the server, which makes the communication complexity as high as This solution, which relies on a multi-copy storage architecture, not only has extremely low communication efficiency, but also causes great waste of storage resources, severely limiting its practical application. In order to reduce communication complexity, the existing technology has designed a scheme to implement PIR (Comutational PIR, abbreviated as CPIR) through two cryptographic principles: homomorphic encryption and oblivious transfer. In the homomorphic encryption scheme, the user encrypts the query index and sends it to the server. The server calculates and returns the encrypted result on the encrypted data. The user then decrypts the encrypted result to obtain the target data. In the oblivious transfer scheme, efficiency is further improved by batch obliviously disguising random functions. The cryptographic principles can greatly reduce the number of PIR queries.
[0004] Although CPIR has reduced a lot of query volume, existing private information retrieval schemes based on constant weight codes still have some problems when dealing with dynamic databases. For example, keywords are usually mapped to one-dimensional or low-dimensional space through simple hash functions, and the probability of hash collision is as high as 0. , which can easily lead to data retrieval ambiguity and make it impossible to accurately obtain the target data. Moreover, when the database scales up, the traditional mapping method is difficult to efficiently support dynamic updates, and often requires global reconstruction of the mapping structure, resulting in huge computational and storage overhead. The traditional constant weight code construction relies on a single global combination number and cannot achieve incremental expansion in dynamic update scenarios. When the database scale changes, the entire codebook needs to be recalculated and fully replaced, with a time complexity of up to This not only causes storage redundancy, but also leads to serious update delays. The current query vector compression method also fails to fully consider the non-zero bit distribution characteristics of constant weight codes and uses fixed segmentation parameters for compression, which does not match the actual data distribution, resulting in a large amount of storage and computing resources wasted. In the ciphertext expansion process, there are limitations in the generation of rotation factors and the control of hierarchical complexity. The existing algorithm dynamically generates rotation factors in each layer of operation, and the computational complexity increases significantly with the number of levels. At the same time, the global modulus switching strategy will lead to the accumulation of noise variance, affecting system performance, which may cause decryption failure or distortion of results, reducing the reliability and effectiveness of private information retrieval. The above problems seriously restrict the application and development of PIR technology in dynamic database scenarios. Summary of the Invention
[0005] The embodiments of the present application provide a keyword private information retrieval method and device based on hierarchical dynamic constant weight codes, which performs data mapping storage through multi-dimensional hypercube storage units and collision-resistant hash functions, reduces hash conflicts and avoids global reconstruction, and optimizes the index update time complexity through hierarchical dynamic constant weight codes to achieve dynamic incremental expansion.
[0006] In a first aspect, an embodiment of the present application provides a keyword private information retrieval method based on hierarchical dynamic constant weight codes, the method comprising:
[0007] On the server side, a multi-dimensional hypercube storage unit and a collision-resistant hash function are constructed. The collision-resistant hash function is used to map the key-value pair of each data keyword in the database to be retrieved to a unique location in the hypercube storage unit. The coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code in a hierarchical mapping manner.
[0008] The client obtains the key of the keyword of the data to be retrieved, uses a collision-resistant hash function to map the key of the data to be retrieved into a multidimensional indicator vector, maps the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compresses each indicator constant weight code into multiple query polynomials, homomorphically encrypts each query polynomial to obtain a ciphertext polynomial, combines all the ciphertext polynomials to obtain a query vector, and sends the query vector to the server;
[0009] The server expands the query vector to obtain an extended query vector, performs an equality check on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, performs an ordered homomorphic dot product operation on the selection vector to obtain a query result, and returns the query result to the client;
[0010] The client performs homomorphic decryption on the query result to obtain the value of the keyword of the data to be retrieved, and obtains the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
[0011] In a second aspect, an embodiment of the present application provides a keyword private information retrieval method based on hierarchical dynamic constant weight codes, comprising:
[0012] Obtaining a key for a keyword of data to be retrieved, mapping the key for the data to be retrieved into a multidimensional indicator vector using a collision-resistant hash function, mapping the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compressing each indicator constant weight code into multiple query polynomials, homomorphically encrypting each query polynomial to obtain a ciphertext polynomial, combining all ciphertext polynomials to obtain a query vector, and sending the query vector to a server; wherein a multidimensional hypercube storage unit mapping the database to be retrieved is constructed in the server, a key-value pair of each data keyword in the database to be retrieved is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code;
[0013] Obtain the query results from the server, perform homomorphic decryption on the query results to obtain the value of the keyword of the data to be retrieved, and obtain the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
[0014] In a third aspect, an embodiment of the present application provides a keyword private information retrieval method based on hierarchical dynamic constant weight codes, comprising:
[0015] Constructing a multi-dimensional hypercube storage unit that maps the database to be searched, wherein the key-value pair of each data keyword in the database to be searched is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code;
[0016] A query vector mapping a keyword of the data to be detected is obtained from the client, the query vector is expanded to obtain an extended query vector, an equality check is performed on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, an ordered homomorphic dot product operation is performed on the selection vector to obtain a query result, and the query result is returned to the client, wherein the query vector is obtained by mapping the key of the data to be retrieved to a multidimensional indicator vector, and the indicator vector of each dimension in the multidimensional indicator vector is mapped to an indicator constant weight code in a hierarchical mapping manner, each indicator constant weight code is compressed into multiple query polynomials, each query polynomial is homomorphically encrypted to obtain a ciphertext polynomial, and all ciphertext polynomials are combined to obtain a query vector.
[0017] In a fourth aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute a keyword private information retrieval method based on a hierarchical dynamic constant weight code.
[0018] The main contributions and innovations of the present invention are as follows:
[0019] The embodiments of the present application use multidimensional hypercube storage units and collision-resistant hash functions to process data keyword key-value pairs in a hierarchical mapping manner, which can greatly reduce the probability of hash collisions, avoid global reconstruction overhead, and improve storage accuracy and update efficiency. In terms of constant weight code construction, the embodiments of the present application determine the code length and Hamming weight by setting relevant rules, and use a dynamic programming algorithm to optimize the index update time complexity and achieve dynamic incremental expansion. When compressing query vectors, the embodiments of the present application adopt a dynamic segmentation algorithm, comprehensively considering various factors to determine the number of segments, etc., to improve resource utilization efficiency. In the ciphertext expansion stage, the embodiments of the present application reduce the time complexity by pre-calculating the rotation factor and optimize the modulus switching strategy, thereby effectively controlling the accumulation of noise variance.
[0020] The details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] 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:
[0022] Figure 1 This is a flowchart of a keyword private information retrieval method based on hierarchical dynamic constant weight codes according to an embodiment of the present application;
[0023] Figure 2 Schematic diagram of the hardware structure of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0024] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0025] It should be noted that in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down into multiple steps for description in other embodiments, and multiple steps described in this specification may be combined into a single step for description in other embodiments.
[0026] Example 1
[0027] The embodiment of the present application provides a keyword private information retrieval method based on hierarchical dynamic constant weight code, which performs data mapping storage through multi-dimensional hypercube storage unit and anti-collision hash function, reduces hash conflicts and avoids global reconstruction, and optimizes the index update time complexity through hierarchical dynamic constant weight code, and realizes dynamic incremental expansion. Specifically, reference Figure 1 , the method comprising:
[0028] On the server side, a multi-dimensional hypercube storage unit and a collision-resistant hash function are constructed. The collision-resistant hash function is used to map the key-value pair of each data keyword in the database to be retrieved to a unique location in the hypercube storage unit. The coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code in a hierarchical mapping manner.
[0029] The client obtains the key of the keyword of the data to be retrieved, uses a collision-resistant hash function to map the key of the data to be retrieved into a multidimensional indicator vector, maps the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compresses each indicator constant weight code into multiple query polynomials, homomorphically encrypts each query polynomial to obtain a ciphertext polynomial, combines all the ciphertext polynomials to obtain a query vector, and sends the query vector to the server;
[0030] The server expands the query vector to obtain an extended query vector, performs an equality check on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, performs an ordered homomorphic dot product operation on the selection vector to obtain a query result, and returns the query result to the client;
[0031] The client performs homomorphic decryption on the query result to obtain the value of the keyword of the data to be retrieved, and obtains the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
[0032] In some specific embodiments, the BLAKE3 algorithm is used as a collision-resistant hash function. The collision-resistant hash function can ensure that each data keyword in the database to be retrieved is uniquely mapped to a unique position in the multidimensional hypercube storage unit, thereby avoiding hash conflicts.
[0033] For example, the collision-resistant hash function can be used to reduce the probability of hash collision from reduced to negligible , while avoiding the global reconstruction overhead.
[0034] In the step of "using a collision-resistant hash function to map the key-value pair of each data keyword in the database to be retrieved to a hypercube storage unit", a collision-resistant hash function is used to calculate the coordinate value of the key of each data keyword in each dimension of the hypercube storage unit, and the coordinate position of each data keyword is obtained based on the coordinate value in each dimension, and the key-value pair of each data keyword is stored in the corresponding coordinate position of the cube storage unit.
[0035] Specifically, the size of each dimension of the hypercube storage unit in this solution is different. For example, the dimension of the hypercube storage unit is , and the size of each dimension is , 2 ,...,z , then for the key-value pairs of the data keywords in the database to be detected , the coordinate value of k in each dimension of the hypercube storage unit is calculated as follows:
[0036]
[0037] in, represents the dimension of the hypercube storage unit, Indicates string concatenation, is the key corresponding to the data keyword, is the total dimension of the hypercube storage unit, is the coordinate value of the key corresponding to the data keyword in dimension i, and BLAKE3 is a collision-resistant hash function.
[0038] That is, if there are any two different keys , the hash value BLAKE obtained by the collision-resistant hash function BLAKE3 ( ) and BLAKE( ) will not be mapped to the same location, that is, there is no possibility of hash collision in practice.
[0039] In the step of "mapping the coordinates of each data in the hypercube storage unit into coordinate constant weight codes in a hierarchical mapping manner", the server sets the corresponding code length and Hamming weight for each dimension of the hypercube storage unit as constant weight parameters, and converts the coordinate value of the key of each data keyword in the corresponding dimension of the hypercube storage unit into a first constant weight code based on the constant weight parameters under each dimension of the hypercube storage unit, and integrates the first constant weight codes under each dimension to obtain the coordinate constant weight code.
[0040] Furthermore, the server sets an objective function and a constraint formula for the code length and the Hamming weight, and sets a corresponding code length and Hamming weight for each dimension of the hypercube storage unit based on the objective function and the constraint conditions.
[0041] Specifically, the objective function is expressed as follows:
[0042]
[0043] in, For the Dimension The code length of the layer, Hypercube storage unit The number of levels of dimension.
[0044] Specifically, the constraint formula is expressed as follows:
[0045] :
[0046] in, is the current dimension, j is the current layer number, For the hypercube storage unit The total number of layers under the dimension, For the Dimension The code length of the layer, For the Dimension The Hamming weight of the layer, To satisfy the total Hamming weight conservation Covering a given database size under the premise of
[0047] Specifically, the server estimates the number of all possible combinations using dynamic programming methods under the objective function and constraints. , and stored in the lookup table to speed up subsequent queries. In each dimension of the hypercube storage unit, different code lengths and Hamming weights are traversed, and the Hamming weights are selected from small to large during the traversal process until the constraints are met to determine the code length and Hamming weight of each dimension.
[0048] Specifically, obtain the coordinate value of each data keyword key in each dimension of the hypercube storage unit , and then calculate the first constant weight based on the code length and Hamming weight under the corresponding dimension , integrating the first constant weight code under each dimension Get the coordinate constant weight code.
[0049] Specifically, the total Hamming weight conservation constraint is obtained by the hierarchical mapping scheme in this scheme. Under the dynamic programming algorithm, the number of layers is adaptively selected. , code length and Hamming weight , the index update time complexity is changed from Optimized to , significantly reducing the number of combinations.
[0050] In some embodiments, since the database to be detected is updated in real time, if a new data keyword is added to the current database to be detected, and the dimensional capacity of the current hypercube storage unit is unable to store the data content in the database to be retrieved due to the addition of the new data keyword, the hypercube is dimensionally expanded, and the new keyword is mapped to the expanded dimension of the hypercube storage unit. The formula is expressed as follows:
[0051] .
[0052] in, is the coordinate position of the new data in the hypercube, It is the dimensional size of the hypercube storage unit after dimensional expansion.
[0053] That is to say, for the original data keywords in the database to be detected, the search is still based on the original dimensions of the hypercube, while for the new data, the detection is performed based on the extended dimensions of the hypercube storage unit without the need for global reconstruction.
[0054] Specifically, for any dimension in the hypercube storage unit , in ensuring the dimension Code length With Hamming weight Under the premise of no change, replace The content of the dimension thus adapts to the dynamic update of the database to be detected.
[0055] In some specific embodiments, the specific implementation method of the client mapping the key of the data to be retrieved to a multi-dimensional indicator vector is the same as the server using a collision-resistant hash function to map the key-value pair of each data keyword in the database to be retrieved to the hypercube storage unit, which will not be repeated here. Similarly, the specific implementation method of the client mapping the indicator vector of each dimension to an indicator constant weight code in a hierarchical mapping manner is the same as the processing method of the first constant weight code above, which will not be repeated here.
[0056] Example 2
[0057] The present application provides a keyword private information retrieval method based on hierarchical dynamic constant weight codes, including:
[0058] Obtaining a key for a keyword of data to be retrieved, mapping the key for the data to be retrieved into a multidimensional indicator vector using a collision-resistant hash function, mapping the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compressing each indicator constant weight code into multiple query polynomials, homomorphically encrypting each query polynomial to obtain a ciphertext polynomial, combining all ciphertext polynomials to obtain a query vector, and sending the query vector to a server; wherein a multidimensional hypercube storage unit mapping the database to be retrieved is constructed in the server, a key-value pair of each data keyword in the database to be retrieved is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code;
[0059] Obtain the query results from the server, perform homomorphic decryption on the query results to obtain the value of the keyword of the data to be retrieved, and obtain the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
[0060] In some embodiments, a dynamic segmentation algorithm is set to divide each indicator constant weight code into Segments are formed, and polynomials are constructed for each segment to obtain multiple query polynomials. The formula of the dynamic segmentation algorithm is as follows:
[0061]
[0062]
[0063] in, is the number of segments, To indicate the total length of the constant weight code, is the compression constant, is the weight of the impact of the number of segments on the computational complexity, is the weight of the impact of each segment size on memory usage, is the influence weight of the constant weight code distribution characteristics on the computational efficiency, Indicates constant weight code The variance of the non-zero distribution in .
[0064] Specifically, in practical applications, It is used to measure the sparsity of data. That is, according to the above formula, if If the distribution is uniform, The value will increase if If the distribution is uneven, you need The value decreases to accommodate local sparsity.
[0065] Furthermore, the formula for constructing each segment into a query polynomial is expressed as follows:
[0066]
[0067] in, For the current segment , To indicate the dimension of the constant weight code, is the compression parameter, To indicate the constant weight code, is the dimension of the hypercube storage unit, Indicates the number of constant weight codes under the current dimension.
[0068] Furthermore, the modulus of the constructed query polynomial is dynamically determined based on the current noise level and computing requirements. The modulus refers to the ciphertext modulus of homomorphic encryption, which is used to define the coefficient range of the ciphertext polynomial. When the ciphertext modulus is larger, the calculation accuracy is higher, but at the same time the calculation will be more complex and the noise will grow faster. Therefore, after encryption here, the modulus conversion technology is used to select a smaller ciphertext modulus to reduce the computational complexity and the speed of noise growth.
[0069] Specifically, during the polynomial construction phase, a larger modulus is used To ensure the calculation accuracy. However, a larger modulus will also bring higher computational complexity and the risk of noise growth. Therefore, gradually switch to a smaller modulus , in order to reduce the complexity of subsequent calculations and control the growth of noise. The formula for analog-to-digital switching is as follows:
[0070]
[0071] in, It is The modulus reduction factor of the stage is determined dynamically based on the current noise level and computational requirements.
[0072] In some embodiments, each query polynomial is encrypted using the BFV homomorphic encryption algorithm with the minimum modulus Output can not only reduce the computational complexity, but also control the growth of noise, ensuring the security and integrity of the encryption results.
[0073] In some specific embodiments, the ciphertext polynomials corresponding to all multidimensional indicator vectors are Combine them to get the query vector.
[0074] In the step of "expanding the query vector to obtain an extended query vector", the rotation factor of each dimension of the hypercube storage unit is calculated and stored, the number of segments is initialized and a global ciphertext set is created, each ciphertext polynomial in the query vector is loaded into a temporary array in turn, and each ciphertext polynomial in the temporary array is expanded one by one, and the expansion result is saved in the global ciphertext set. After the expansion of all ciphertext polynomials is completed, the global ciphertext set is output to obtain the extended query vector.
[0075] Specifically, the global ciphertext set is initially an empty set. First, the rotation factors of each dimension are pre-calculated and stored. ,in , and initialize the number of blocks , the outer loop processes each block in turn , the current ciphertext polynomial Load into temporary array , parameters in the hierarchical loop Increment from 0 to , each layer Correspondingly, the number of blocks is expanded to , for each level , block operation loop traverses the index , extract the current block and perform modular reduction Then, using the pre-existing factors Calculate the rotation term and shift blocks , and update the block value through linear combination: and , ensuring the independence of blocks after expansion.
[0076] Specifically, by pre-calculating and storing the rotation factors of each dimension, the time complexity can be reduced from down to .
[0077] In some specific embodiments, equality detection is performed by finding the coordinate constant weight code corresponding to each item in the extended query vector in each dimension of the hypercube storage unit. The equality detection formula is expressed as follows:
[0078]
[0079] in, is the coordinate constant weight code in ciphertext form, for Expand the items in the query vector under the dimension.
[0080] That is, the query vector will be expanded Through the above formula and the corresponding dimension of the hypercube coordinate constant weight code Perform equality check and generate a selection vector in each dimension ,in Only one of them is 1, and the others are 0.
[0081] In the step of "performing an ordered homomorphic dot product operation on the selection vector to obtain a query result", the hypercube storage unit is used as a plaintext database, and homomorphic dot products are performed on items of different dimensions in the selection vector and the plaintext database in sequence to obtain an intermediate database. The intermediate database is then used to perform a homomorphic dot product with the selection vector to obtain a new intermediate database, until the intermediate database only contains query results corresponding to the selection vector, wherein the plaintext database / intermediate database is reshaped before each round of homomorphic dot product.
[0082] In other words, this solution selects items of different dimensions in the vector and performs homomorphic dot products with the plaintext database / intermediate database, thereby filtering out target items that meet the conditions step by step.
[0083] Specifically, the formula for obtaining the query result by performing an ordered homomorphic dot product operation on the selection vector is expressed as follows:
[0084]
[0085] Among them, the selection vector in ciphertext form Plaintext database Start with dot product and generate an intermediate database , then, for each step i, choose the vector The intermediate database obtained in the previous step will be reshaped into Perform dot product operation to form a new intermediate database , plaintext database The size is At each step, the intermediate database Before participating in the dot product, it will be reshaped into a new two-dimensional matrix with a size of .
[0086] In some specific embodiments, the query result is decrypted using the BFV homomorphically encrypted key to obtain the key-value pair of the keyword of the data to be retrieved, and the corresponding data is obtained using the key-value pair of the keyword.
[0087] Example 3
[0088] This application also proposes a keyword private information retrieval method based on hierarchical dynamic constant weight codes, including:
[0089] Constructing a multi-dimensional hypercube storage unit that maps the database to be searched, wherein the key-value pair of each data keyword in the database to be searched is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code;
[0090] Obtain a query vector from the client that maps a keyword of the data to be detected, expand the query vector to obtain an extended query vector, perform an equality check on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector. Perform an ordered homomorphic dot product operation on the selection vector to obtain a query result, which is returned to the client. The query vector is obtained by mapping the key of the data to be retrieved to a multidimensional indicator vector, and mapping the indicator vector of each dimension in the multidimensional indicator vector to an indicator constant weight code in a hierarchical mapping manner. Each indicator constant weight code is compressed into multiple query polynomials, and each query polynomial is homomorphically encrypted to obtain a ciphertext polynomial. All ciphertext polynomials are combined to obtain a query vector.
[0091] Example 4
[0092] This embodiment also provides an electronic device, referring to Figure 2 , includes a memory 404 and a processor 402, wherein the memory 404 stores a computer program, and the processor 402 is configured to run the computer program to perform the steps in any of the above method embodiments.
[0093] Specifically, the processor 402 may include a central processing unit (CPU), or an application-specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.
[0094] Memory 404 may include a large-capacity memory 404 for data or instructions. By way of example, and not limitation, memory 404 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, memory 404 may include removable or non-removable (or fixed) media. Where appropriate, memory 404 may be internal or external to the data processing device. In certain embodiments, memory 404 is non-volatile memory. In certain embodiments, memory 404 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable ROM (PROM), an erasable PROM (EPROM), an electrically erasable PROM (EEPROM), an electrically alterable ROM (EAROM) or a flash memory (FLASH), or a combination of two or more of these. In appropriate circumstances, the RAM may be a static random access memory (SRAM) or a dynamic random access memory (DRAM), wherein the DRAM may be a fast page mode dynamic random access memory 404 (FPMDRAM), an extended data output dynamic random access memory (EDODRAM), a synchronous dynamic random access memory (SDRAM), etc.
[0095] The memory 404 may be used to store or cache various data files required for processing and / or communication, as well as possible computer program instructions executed by the processor 402 .
[0096] The processor 402 reads and executes the computer program instructions stored in the memory 404 to implement any one of the keyword private information retrieval methods based on hierarchical dynamic constant weight codes in the above embodiments.
[0097] Optionally, the electronic device may further include a transmission device 406 and an input / output device 408 , wherein the transmission device 406 is connected to the processor 402 , and the input / output device 408 is connected to the processor 402 .
[0098] Transmission device 406 can be used to receive or transmit data via a network. Specific examples of such networks may include wired or wireless networks provided by the electronic device's communications provider. In one embodiment, the transmission device includes a network interface controller (NIC), which can be connected to other network devices via a base station to enable communication with the Internet. In another embodiment, transmission device 406 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0099] The input and output device 408 is used to input or output information. In this embodiment, the input information may be a hypercube storage unit, a constant weight code, etc., and the output information may be a keyword of the data to be retrieved, etc.
[0100] Optionally, in this embodiment, the processor 402 may be configured to execute the following steps through a computer program:
[0101] On the server side, a multi-dimensional hypercube storage unit and a collision-resistant hash function are constructed. The collision-resistant hash function is used to map the key-value pair of each data keyword in the database to be retrieved to a unique location in the hypercube storage unit. The coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code in a hierarchical mapping manner.
[0102] The client obtains the key of the keyword of the data to be retrieved, uses a collision-resistant hash function to map the key of the data to be retrieved into a multidimensional indicator vector, maps the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compresses each indicator constant weight code into multiple query polynomials, homomorphically encrypts each query polynomial to obtain a ciphertext polynomial, combines all the ciphertext polynomials to obtain a query vector, and sends the query vector to the server;
[0103] The server expands the query vector to obtain an extended query vector, performs an equality check on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, performs an ordered homomorphic dot product operation on the selection vector to obtain a query result, and returns the query result to the client;
[0104] The client performs homomorphic decryption on the query result to obtain the value of the keyword of the data to be retrieved, and obtains the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
[0105] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be repeated here.
[0106] In general, various embodiments may be implemented in hardware or dedicated circuitry, software, logic, or any combination thereof. Some aspects of the invention may be implemented in hardware, while other aspects may be implemented in firmware or software executed by a controller, microprocessor, or other computing device, but the invention is not limited thereto. Although various aspects of the invention may be shown and described as block diagrams, flow charts, or using some other graphical representation, it should be understood that, as non-limiting examples, the blocks, devices, systems, techniques, or methods described herein may be implemented in hardware, software, firmware, dedicated circuitry or logic, general-purpose hardware or a controller or other computing device, or some combination thereof.
[0107] The embodiments of the present invention may be implemented by computer software that is executable by a data processor of a mobile device, such as in a processor entity, or by hardware, or by a combination of software and hardware. Computer software or programs (also referred to as program products) including software routines, applets and / or macros may be stored in any device-readable data storage medium, and they include program instructions for performing specific tasks. A computer program product may include one or more computer executable components that are configured to perform an embodiment when the program is run. One or more computer executable components may be at least one software code or a portion thereof. In addition, it should be noted at this point that, for example, Figure 2 Any block of the logic flow in the program may represent program steps, or interconnected logic circuits, blocks and functions, or a combination of program steps and logic circuits, blocks and functions. The software may be stored on physical media such as memory chips or memory blocks implemented within the processor, magnetic media such as hard disks or floppy disks, and optical media such as, for example, DVDs and their data variants, CDs, etc. Physical media are non-transitory media.
[0108] Those skilled in the art should understand that the technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0109] The above embodiments merely illustrate several embodiments of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A keyword private information retrieval method based on hierarchical dynamic constant weight code, characterized in that: The following steps are involved: On the server side, a multi-dimensional hypercube storage unit and a collision-resistant hash function are constructed. The collision-resistant hash function is used to map the key-value pair of each data keyword in the database to be retrieved to a unique location in the hypercube storage unit. The coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code in a hierarchical mapping manner. The client obtains the key of the keyword of the data to be retrieved, uses a collision-resistant hash function to map the key of the data to be retrieved into a multidimensional indicator vector, maps the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compresses each indicator constant weight code into multiple query polynomials, homomorphically encrypts each query polynomial to obtain a ciphertext polynomial, combines all the ciphertext polynomials to obtain a query vector, and sends the query vector to the server; The server expands the query vector to obtain an extended query vector, performs an equality check on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, performs an ordered homomorphic dot product operation on the selection vector to obtain a query result, and returns the query result to the client; The client performs homomorphic decryption on the query result to obtain the value of the keyword of the data to be retrieved, and obtains the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
2. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 1 is characterized in that: In the step of "using a collision-resistant hash function to map the key-value pair of each data keyword in the database to be retrieved to a unique position in the hypercube storage unit", a collision-resistant hash function is used to calculate the coordinate value of the key of each data keyword in each dimension of the hypercube storage unit, and the coordinate position of each data keyword is obtained based on the coordinate value in each dimension, and the key-value pair of each data keyword is stored in the corresponding coordinate position of the cube storage unit.
3. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 1 is characterized in that: In the step of "mapping the coordinates of each data in the hypercube storage unit into coordinate constant weight codes in a hierarchical mapping manner", the server sets the corresponding code length and Hamming weight for each dimension of the hypercube storage unit as constant weight parameters, and converts the coordinate value of the key of each data keyword in the corresponding dimension of the hypercube storage unit into a first constant weight code based on the constant weight parameters under each dimension of the hypercube storage unit, and integrates the first constant weight codes under each dimension to obtain the coordinate constant weight code.
4. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 3 is characterized in that: The server sets an objective function and constraint formula for the code length and Hamming weight. Based on the objective function and constraint conditions, the server sets the corresponding code length and Hamming weight for each dimension of the hypercube storage unit. The formula of the objective function is as follows: ; in, For the Dimension The code length of the layer, Hypercube storage unit The number of layers of dimension; The constraint condition is expressed as follows: : in, is the current dimension, is the current layer number, For the hypercube storage unit The total number of layers under the dimension, For the Dimension The code length of the layer, For the Dimension The Hamming weight of the layer, To satisfy the total Hamming weight conservation Covering a given database size under the premise of 5. A keyword private information retrieval method based on hierarchical dynamic constant weight code, characterized in that: The following steps are involved: Obtaining a key for a keyword of data to be retrieved, mapping the key for the data to be retrieved into a multidimensional indicator vector using a collision-resistant hash function, mapping the indicator vector of each dimension in the multidimensional indicator vector into an indicator constant weight code in a hierarchical mapping manner, compressing each indicator constant weight code into multiple query polynomials, homomorphically encrypting each query polynomial to obtain a ciphertext polynomial, combining all ciphertext polynomials to obtain a query vector, and sending the query vector to a server; wherein a multidimensional hypercube storage unit mapping the database to be retrieved is constructed in the server, a key-value pair of each data keyword in the database to be retrieved is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code; Obtain the query results from the server, perform homomorphic decryption on the query results to obtain the value of the keyword of the data to be retrieved, and obtain the corresponding data to be retrieved using the key-value pair of the keyword of the data to be retrieved.
6. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 5 is characterized in that: A dynamic segmentation algorithm is set. Each indicator constant weight code is divided into S segments based on the dynamic segmentation algorithm. A polynomial is constructed for each segment to obtain multiple query polynomials. The formula of the dynamic segmentation algorithm is as follows: ; ; in, is the number of segments, To indicate the total length of the constant weight code, is the compression constant, is the weight of the impact of the number of segments on the computational complexity, is the weight of the impact of each segment size on memory usage, is the weight of the influence of the constant weight code distribution characteristics on the computational efficiency, Indicates constant weight code The variance of the non-zero distribution in .
7. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 6 is characterized in that: The formula for constructing each segment into a query polynomial is as follows: ; in, For the current segment , To indicate the dimension of the constant weight code, is the compression parameter, To indicate the constant weight code, is the dimension of the hypercube storage unit, Indicates the number of constant weight codes under the current dimension.
8. The keyword private information retrieval method based on hierarchical dynamic constant weight code according to claim 5 is characterized in that: In the step of "expanding the query vector to obtain an extended query vector," a rotation factor for each dimension of a hypercube storage unit is calculated and stored, the number of segments is initialized, and a global ciphertext set is created. Each ciphertext polynomial in the query vector is sequentially loaded into a temporary array, and each ciphertext polynomial in the temporary array is expanded one by one, and the expansion results are saved in the global ciphertext set. After the expansion of all ciphertext polynomials is completed, the global ciphertext set is output to obtain the extended query vector.
9. A keyword private information retrieval method based on hierarchical dynamic constant weight code, characterized in that: The following steps are involved: Constructing a multi-dimensional hypercube storage unit that maps the database to be searched, wherein the key-value pair of each data keyword in the database to be searched is mapped to a unique position in the hypercube storage unit, and the coordinates of each data in the hypercube storage unit are mapped to a unique coordinate constant weight code; A query vector mapping a keyword of the data to be detected is obtained from the client, the query vector is expanded to obtain an extended query vector, an equality check is performed on the coordinate constant weight code in the hypercube storage unit and the extended query vector to obtain a selection vector, an ordered homomorphic dot product operation is performed on the selection vector to obtain a query result, and the query result is returned to the client, wherein the query vector is obtained by mapping the key of the data to be retrieved to a multidimensional indicator vector, and the indicator vector of each dimension in the multidimensional indicator vector is mapped to an indicator constant weight code in a hierarchical mapping manner, each indicator constant weight code is compressed into multiple query polynomials, each query polynomial is homomorphically encrypted to obtain a ciphertext polynomial, and all ciphertext polynomials are combined to obtain a query vector.
10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to run the computer program to execute a keyword private information retrieval method based on a hierarchical dynamic constant weight code as described in any one of claims 1-4, or a keyword private information retrieval method based on a hierarchical dynamic constant weight code as described in any one of claims 5-8, or a keyword private information retrieval method based on a hierarchical dynamic constant weight code as described in claim 9.
Citation Information
Patent Citations
Anonymous search system suitable for large-scale multi-valued mapping database
CN119622787A
Homomorphic keyword privacy information retrieval method and system based on polynomial link
CN119918088A