A data privacy query method, device, equipment and medium
By generating the target matrix and query product vector within a specified finite domain, and combining them with the reference matrix to calculate the comparison product vector, the problem of high computational and communication overhead in stealth queries is solved, achieving an efficient data query process and ensuring data privacy.
Patent Information
- Application Number
- CN202411954917.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2044-12-27
AI Technical Summary
Existing anonymous query processes are burdened by significant computational and communication overhead, especially due to the need to configure public and private key pairs for both the data queryer and the data provider, resulting in a waste of computational and communication resources.
The data querying party generates a target matrix within a specified finite domain, and determines the query product vector based on this matrix and the data to be queried. This vector is then sent to the data provider to obtain the reference product vector and the comparison product vector. By utilizing the special properties of the target matrix and the reference matrix, the public and private key pairs are avoided, and the query answer is calculated directly through matrix multiplication.
It effectively reduces the computational and communication overhead of the anonymous query process, ensures the invisibility and untraceability of data, and reduces the number of data interactions between the two parties.
Smart Images

Figure CN119884464B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to the technical field of data security, and specifically discloses a data private information retrieval (PIR) query method and device, equipment and a medium. BACKGROUND
[0002] Private information retrieval (PIR), also known as privacy information retrieval, is a very practical technology and application in secure multi-party computation, which can be used to protect the query privacy of users and further protect the query results of users. In a traditional information retrieval task, a query party usually needs to send a query request in plaintext to a server, which may expose the identity and sensitive information of the user. Private information retrieval refers to hiding the queried information by the query party, and the data provider can provide a matching query result, but cannot know the query content of the query party.
[0003] At present, the private information retrieval task is mainly realized based on an oblivious transfer algorithm or a homomorphic encryption algorithm. In the query process, a public-private key pair needs to be configured in advance for at least one of the data query party and the data provider, and the two parties need to perform multiple encryption and decryption operations and interactions on the data based on the public key and the private key, which has a large burden in terms of computing and communication overhead. SUMMARY
[0004] The embodiments of the application provide a data private information retrieval query method, device, equipment and medium, which are used to reduce the computing and communication overhead of the private information retrieval query process.
[0005] To achieve the above purpose, the technical scheme of the embodiments of the application is as follows:
[0006] In a first aspect, the embodiments of the application provide a data query method, which comprises the following steps:
[0007] Based on a target matrix and at least one piece of to-be-queried data, a query moment vector corresponding to the at least one piece of to-be-queried data is determined; the target matrix is generated by a data query party in a specified finite field;
[0008] A private information retrieval query request carrying the query moment vector is sent to a data provider, and a reference moment vector and a comparison moment vector are obtained; the reference moment vector is determined by the data provider based on a reference matrix and at least one piece of reference data, the data structure of the reference data is the same as that of the to-be-queried data, and the reference matrix is generated by the data provider in the specified finite field; the comparison moment vector is determined based on the product of the reference matrix and the query moment vector;
[0009] determine a target product vector based on a product of the target matrix and the reference product vector;
[0010] determine a query answer of the at least one piece of data to be queried based on the target product vector and the comparison product vector; the query answer represents whether there is reference data with the same content as the data to be queried.
[0011] In the embodiments of the present application, a data querying party determines a query product vector corresponding to the data to be queried based on a target matrix generated in a specified finite field and the data to be queried, and sends the query product vector to a data providing party to obtain a reference product vector and a comparison product vector from the data providing party; the reference product vector is determined by the data providing party based on a reference matrix and reference data, the reference data has the same data structure as the data to be queried; the reference matrix is generated by the data providing party in the specified finite field; the comparison product vector is determined based on a product of the reference matrix and the query product vector; the data querying party can determine a target product vector based on a product of the target matrix and the reference product vector, and then determine a query answer of the data to be queried based on a relationship between the target product vector and the comparison product vector. The above process utilizes the feature that the left multiplication and the right multiplication of two special matrices can be equal, and the generation of the matrices has randomness and unpredictability, so as to guarantee the invisibility and traceability of the data to be queried during the anonymous query, and the data querying party and the data providing party do not need to be configured with a public-private key pair, which can effectively save the computing and communication overheads of the anonymous query process.
[0012] In some embodiments, the determining of the query product vector corresponding to the at least one piece of data to be queried based on the target matrix and the at least one piece of data to be queried comprises:
[0013] calculating each piece of data to be queried by using a preset function algorithm to obtain a query factor corresponding to each piece of data to be queried;
[0014] For each piece of data to be queried, a query product vector corresponding to the data to be queried is determined based on a product of the target matrix and the query factor corresponding to the data to be queried; the preset function algorithm is shared by the data querying party, and is used to make the data providing party calculate a reference factor corresponding to each piece of reference data by using the preset function algorithm, and determine the reference product vector based on a product of the reference matrix and the reference factor.
[0015] In the embodiments of the present application, the data querying party calculates the query factor corresponding to the to-be-queried data by using a preset function algorithm, and takes the product of the target matrix and the query factor as the query product vector of the to-be-queried data. The preset function algorithm is shared with the data providing party, and is used to make the data providing party process the reference data in the same way. Since the data structures of the reference data and the to-be-queried data are the same, the query factor and the reference factor with the same data structure, and the query product vector and the reference product vector with the same data structure can be solved. According to the characteristic that the left multiplication is equal to the right multiplication when the special matrix is multiplied, whether the data providing party has the reference data with the same content as the to-be-queried data can be verified by calculating the product between the matrix and the vector.
[0016] In some embodiments, the number of bytes in the query factor is consistent with the number of rows of the target matrix, and the data structure of the query factor is the same as that of the reference factor.
[0017] In the embodiments of the present application, the number of bytes in each query factor is set to be consistent with the number of rows of the target matrix to meet the requirement of matrix multiplication, so as to realize the multiplication of the target matrix and the query factor to solve the query product vector.
[0018] In some embodiments, the target matrix is generated in the following way:
[0019] A first primitive matrix is generated in the specified finite field, and a first random number with a specified length is generated based on the matrix size. The power of the first primitive matrix is calculated by using the first random number to obtain the target matrix. The specified length is shared by the data providing party and the data querying party, so that the data providing party generates a second random number with the specified length, and generates a second primitive matrix in the specified finite field. The power of the second primitive matrix is calculated by using the second random number to obtain the reference matrix.
[0020] In the embodiments of the present application, the data querying party calculates the power of the first primitive matrix generated in the specified finite field by using the first random number to obtain the target matrix, and the data providing party calculates the power of the second primitive matrix generated in the specified finite field by using the second random number to obtain the reference matrix. The above process uses the random numbers generated by both parties to calculate the power of the primitive matrix, so as to guarantee the randomness and unpredictability of the target matrix and the reference matrix, and the size of the target matrix is the same as that of the reference matrix.
[0021] In some embodiments, the to-be-queried data represents the answer prediction result of a target problem; the query answer represents whether the answer prediction result is correct; and the determination of the query answer of the to-be-queried data based on the target product vector and the comparison product vector comprises:
[0022] If the target product vector is the same as the comparison product vector, it is determined that the answer prediction result of the to-be-queried data to the target question is correct; otherwise, it is determined that the answer prediction result of the to-be-queried data to the target question is incorrect.
[0023] In the embodiments of the present application, the to-be-queried data is set as the answer prediction result to the target question. Since the data structure of the to-be-queried data and the reference data is the same, and the matrix size of the target matrix and the reference matrix and the finite field where they are located are the same, the special matrix multiplication can satisfy the characteristic that left multiplication is equal to right multiplication. The product between the matrix and the vector is calculated, and the target product vector and the comparison product vector are compared. When they are the same, it indicates that the answer prediction result of the to-be-queried data to the target question is correct, thereby realizing the anonymous query of the to-be-queried data.
[0024] In some embodiments, the method further comprises:
[0025] If the number of the to-be-queried data is greater than the number threshold, the at least one to-be-queried data is split into a plurality of to-be-queried data groups, so that the number of the query data in each group is not greater than the number threshold; wherein the number threshold is determined according to the number of rows of the target matrix; each to-be-queried data group contains M to-be-queried data, and M≤ the number threshold.
[0026] The anonymous query request carrying the query product vector is sent to the data provider, comprising:
[0027] For each to-be-queried data group, based on the M to-be-queried data corresponding to the query product vector in the to-be-queried data group, an anonymous query request carrying the M to-be-queried data corresponding to the query product vector is generated and sent to the data provider.
[0028] In the embodiments of the present application, when the number of to-be-queried data is too large, the to-be-queried data can be divided into multiple groups, and the intermediate product vector corresponding to each group of to-be-queried data is sent as an anonymous query request. Since the comparison product vector in the embodiments of the present application is obtained based on the product of the reference matrix and the intermediate product vector, by limiting the number of query product vectors carried in each anonymous query request through the above process, the risk of the matrix being solved when the communication is stolen can be effectively reduced. If the attacker has enough comparison product vectors and intermediate product vectors, the reference matrix can be solved in the form of equation set.
[0029] In some embodiments, the preset function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
[0030] In the embodiments of the present application, the data querying party agrees with the data providing party on a set of preset function algorithms to operate on the to-be-queried data and the reference data, which can not only ensure that the to-be-queried data is invisible in the anonymous query process, but also ensure that the data structures of the query factor and the reference factor are the same, and can satisfy the characteristic that left multiplication is equal to right multiplication when special matrix multiplication is performed, and whether the data providing party has the reference data with the same content as the to-be-queried data is verified by calculating the product between the matrix and the vector.
[0031] In a second aspect, the embodiments of the present application further provide a data anonymous query device, the device comprising:
[0032] a matrix configuration unit configured to perform: determining a query vector corresponding to at least one to-be-queried data based on a target matrix and the at least one to-be-queried data; the target matrix is generated by a data querying party in a specified finite field;
[0033] a query request unit configured to perform: sending an anonymous query request carrying the query vector to a data providing party, and obtaining a reference vector and a comparison vector; the reference vector is determined by the data providing party based on a reference matrix and at least one reference data, the data structure of the reference data is the same as that of the to-be-queried data, and the reference matrix is generated by the data providing party in the specified finite field; the comparison vector is determined based on the product of the reference matrix and the query vector;
[0034] a data processing unit configured to perform: determining a target vector based on the product of the target matrix and the reference vector;
[0035] an anonymous query unit configured to perform: determining a query answer of the at least one to-be-queried data based on the target vector and the comparison vector; the query answer represents whether there is reference data with the same content as the to-be-queried data.
[0036] In some embodiments, the determining of the query vector corresponding to the at least one to-be-queried data based on the target matrix and the at least one to-be-queried data is performed by the matrix configuration unit, which is specifically configured to:
[0037] calculating each to-be-queried data by using a preset function algorithm to obtain a query factor corresponding to each to-be-queried data;
[0038] for each to-be-queried data, determining a query vector corresponding to the to-be-queried data based on the product of the target matrix and the query factor corresponding to the to-be-queried data; the preset function algorithm is shared with the data querying party, and is used to make the data providing party calculate a reference factor corresponding to each reference data by using the preset function algorithm, and determine the reference vector based on the product of the reference matrix and the reference factor.
[0039] In some embodiments, the number of bytes in the query factor is consistent with the number of rows of the target matrix, and the data structure of the query factor is the same as that of the reference factor.
[0040] In some embodiments, the target matrix is generated by:
[0041] generating a first primitive matrix in the specified finite field, and generating a first random number of a specified length based on the matrix size;
[0042] calculating the power of the first primitive matrix using the first random number to obtain the target matrix; the specified length is shared by the data provider and the data query party, and is used to enable the data provider to generate a second random number of the specified length, and generate a second primitive matrix in the specified finite field, and calculate the power of the second primitive matrix using the second random number to obtain the reference matrix.
[0043] In some embodiments, the data to be queried represents the answer prediction result of a target problem; the query answer represents whether the answer prediction result is correct; and the anonymous query unit is specifically configured to:
[0044] if the target product vector and the comparison product vector are the same, it is determined that the answer prediction result of the target problem by the data to be queried is correct; otherwise, it is determined that the answer prediction result of the target problem by the data to be queried is incorrect.
[0045] In some embodiments, the query request unit is further configured to:
[0046] if the number of the data to be queried is greater than a number threshold, the data to be queried is split into a plurality of data groups to be queried, so that the number of query data in each group is not greater than the number threshold; wherein the number threshold is determined according to the number of rows of the target matrix; each data group to be queried contains M data to be queried, and M is less than the number threshold;
[0047] sending an anonymous query request carrying the query product vector to the data provider, comprising:
[0048] for each data group to be queried, generating an anonymous query request carrying the query product vector corresponding to the M data to be queried in the data group to be queried based on the query product vector corresponding to the M data to be queried in the data group to be queried, and sending to the data provider.
[0049] In some embodiments, the preset function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
[0050] In a third aspect, an embodiment of the present application provides an electronic device, comprising:
[0051] a memory configured to store program instructions;
[0052] a processor configured to invoke the program instructions stored in the memory and perform steps included in the method according to any one of the first aspect.
[0053] In a fourth aspect, an embodiment of the present application provides a computer readable storage medium, which stores a computer program, the computer program comprising program instructions, the program instructions causing a computer to perform the method according to any one of the first aspect when the computer program is executed by the computer.
[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, which comprises computer program code, the computer program code causing a computer to perform the method according to any one of the first aspect when the computer program code is executed on the computer.
[0055] Other features and advantages of the present application will be set forth in the following description, and in part will be apparent from the description, or can be learned by practice of the present application. The objects and other advantages of the present application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings. BRIEF DESCRIPTION OF DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following will briefly introduce the drawings needed to be used in the embodiments description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained from these drawings without any creative labor.
[0057] Figure 1 An application scenario schematic diagram provided by an embodiment of the present application;
[0058] Figure 2 An execution timing diagram of a data anonymous tracking query method provided by an embodiment of the present application;
[0059] Figure 3 A calculation flowchart of a query accumulation vector and a reference accumulation vector provided by an embodiment of the present application;
[0060] Figure 4 A calculation flowchart of a target accumulation vector and a comparison accumulation vector provided by an embodiment of the present application;
[0061] Figure 5A flowchart of a process of sending a plurality of anonymous query requests is provided for the embodiments of the present application.
[0062] Figure 6 A flowchart of a process of sending a plurality of anonymous query requests is provided for the embodiments of the present application. Figure 2 A flowchart of a process of sending a plurality of anonymous query requests is provided for the embodiments of the present application.
[0063] Figure 7 A flowchart of a process of sending a plurality of anonymous query requests is provided for the embodiments of the present application.
[0064] Figure 8 A flowchart of a process of sending a plurality of anonymous query requests is provided for the embodiments of the present application. DETAILED DESCRIPTION
[0065] In order to make the objects, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the present application.
[0066] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all the embodiments consistent with the present application. Rather, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0067] In order to facilitate understanding of the technical solutions provided by the present application, the technical background of the present application will be described in detail as follows:
[0068] Anonymous query refers to that a querying party hides the queried information, and a data providing party can provide a matching query result, but cannot know the query content of the querying party. The querying party can only query a specific result related to the query condition, and cannot obtain other additional information from the data. Anonymous query is widely applied in information checking scenarios. Information checking refers to that a data querying party has at least one answer guess or answer prediction result for a certain target problem, but if the data querying party directly inquires the data providing party, the answer guess or answer prediction result of the data querying party will be directly exposed in the inquiry stage.
[0069] For example, the public security-related personnel need to investigate whether Zhang San purchased a large amount of stock funds in a certain transaction institution. If the name of the person being queried is directly given to the transaction institution to help query whether Zhang San holds a large amount of stock funds, although an accurate answer can be quickly obtained from the transaction institution, whether Zhang San holds a large amount of stock funds or not, the information that Zhang San is being investigated will be directly exposed when querying the transaction institution, that is, at least the transaction institution knows.
[0070] If the anonymous query can effectively avoid the above information exposure problem, the current anonymous query task is mainly implemented based on the oblivious transfer algorithm or the homomorphic encryption algorithm. In the query process, at least one of the data query party and the data provider needs to be configured with a public-private key pair in advance. Both parties need to perform multiple encryption and decryption operations and interactions on the data based on the shared public key and their own private key, which has a large burden on the calculation and communication overhead.
[0071] Taking the anonymous query process based on the Paillier homomorphic encryption algorithm commonly used in the industry as an example, assuming that the data query party wants to query from K reference data of the data provider whether there is a piece of to-be-queried data that meets the specified condition. At this time, the data query party needs to generate confusion data containing the to-be-queried data. The confusion data requires the same number of reference data (that is, K pieces of confusion data are generated, including 1 piece of to-be-queried data and K-1 pieces of virtual data).
[0072] The data query party encrypts the to-be-queried data using its own private key and encrypts the virtual data using the public key shared with the data provider. Then the data provider performs inner product operation on the K pieces of confusion data and the K pieces of reference data stored by itself based on the shared public key, and then the inner product operation result is given to the data query party for decryption using its own private key, so as to obtain the query answer corresponding to the to-be-queried data. It can be seen that the process needs to configure a public-private key pair for the data query party, and the data query party needs to perform multiple homomorphic encryption and decryption operations and interactions on the data based on the public key shared with the data provider and its own private key, which has a large burden on the calculation and communication overhead.
[0073] To solve the above problems, the application concept is that: a data querying party determines a query accumulation vector corresponding to the to-be-queried data based on a target matrix generated in a specified finite field and the to-be-queried data, and sends the query accumulation vector to a data providing party, so as to obtain a reference accumulation vector and a comparison accumulation vector from the data providing party; the reference accumulation vector is determined by the data providing party based on a reference matrix and reference data, the reference data has the same data structure as the to-be-queried data; the reference matrix is generated by the data providing party in the specified finite field; the comparison accumulation vector is determined based on the product of the reference matrix and the query accumulation vector; the data querying party can determine a target accumulation vector based on the product of the target matrix and the reference accumulation vector, and then determine the query answer of the to-be-queried data based on the relationship between the target accumulation vector and the comparison accumulation vector. Since the target matrix and the reference matrix are generated according to random private parameters, they have privacy and randomness, and thus, according to the feature that the left multiplication and the right multiplication of special matrices can be equal, the product between the matrix and the vector is calculated to guarantee the invisibility and the non-traceability of the to-be-queried data and the reference data in the anonymous query process, the data querying party and the data providing party only have one data interaction during the anonymous query, and there is no need to configure a public-private key pair for both parties, thereby effectively saving the calculation overhead and the communication overhead of the anonymous query process.
[0074] The scheme provided by the embodiments of the application can be applied to an interaction scenario of a terminal device and a server. As shown in FIG. 1, it is a schematic diagram of an application scenario provided by the embodiments of the application, in which the scenario can include a terminal device 101, a server 102, and a network 103. Figure 1
[0075] The terminal device 101 can be a mobile phone, a tablet computer (PAD), a notebook computer, a desktop computer, a smart television, a smart vehicle device, a smart wearable device, or the like.
[0076] The server 102 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN), and basic cloud computing services such as big data and artificial intelligence platforms, but is not limited thereto. The server 102 can deploy multiple processors 103 for providing processing resources.
[0077] In the embodiments of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, a wireless network can be a mobile cellular network, or can be a wireless fidelity (WIFI) network, and of course can be other possible networks, which are not limited in the embodiments of the present application.
[0078] In some embodiments, the data query party can generate a target matrix in a specified finite field through the terminal device 101, and generate a query accumulation vector based on the target simulation and the data to be queried, and then send an anonymous query request carrying the query accumulation vector to the server 102. The server 102 can respond to the request and issue a reference accumulation vector and a comparison accumulation vector to the terminal device 101. The terminal device 101 can determine a target accumulation vector based on the product of the target matrix and the reference accumulation vector, and then determine the query answer of the data to be queried based on the difference between the target accumulation vector and the comparison accumulation vector.
[0079] The data anonymous query method provided by the exemplary embodiments of the present application will be described below in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above-mentioned application scenarios are only shown for the purpose of facilitating the understanding of the present application, and the embodiments of the present application are not limited in this respect.
[0080] Figure 2 The timing interaction flow of the data query party and the data provider in executing the data anonymous query method provided by the embodiments of the present application is shown as follows: Figure 2 The timing interaction flow of the data query party and the data provider in executing the data anonymous query method provided by the embodiments of the present application is shown as follows:
[0081] Step 201: The data query party determines a query accumulation vector corresponding to the data to be queried based on a target matrix and the data to be queried.
[0082] For the purpose of illustration, steps 201 to 207 are all illustrated by the information verification example of investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution mentioned above. It should be understood that the example is only used for facilitating the description of the technical scheme of the present application, and is not a limitation on the scheme itself.
[0083] In the example of investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution, the public security investigation personnel are the data query party, and the trading institution is the data provider. The account data of the user in the trading institution usually includes name, ID number, contact number, address, account opening time, last transaction time, stock fund holding market value, password verification value and other data information.
[0084] The data querying party can require the data providing party to provide only part of the items, for example, only the name, the ID number, and the market value of the stock fund held. That is,
name, ID number, market value of stock fund held
[0085] In some embodiments, to improve communication security and save data transmission volume, the market value of the stock fund held can be represented by one English letter, such as A for less than 100,000 yuan, B for reaching 100,000 yuan and less than 1,000,000 yuan, C for reaching 1,000,000 yuan and less than 5,000,000 yuan, and D for equal to or greater than 5,000,000 yuan. The data querying party can, under the premise of authorization, require the data providing party to generate corresponding reference data in the data structure of
name, ID number, market value of stock fund held
Li Si, 123***598, B
Wang Wu, 123****386, C
[0086] The data querying party and the data providing party of the embodiments of the present application agree on the data structure of the data to be queried and the reference data in advance, that is, the aforementioned
name, ID number, market value of stock fund held
Zhang San, 123****456, D
[0087] The primitive matrix is also called the prime matrix. There is a minimum positive integer i greater than 1 (usually referred to as the order of the primitive matrix) in the primitive matrix, and i reaches the maximum value when T i = unit matrix E. The data querying party and the data providing party of the embodiments of the present application agree to specify a finite field, and the data querying party can randomly generate a primitive matrix T1 in the specified finite field. The selection of the finite field and the size of the primitive matrix can be set according to the actual demand, which is not limited in the present application. For example, a 160x160 or 128x128 primitive matrix can be randomly generated on the binary finite field GF(2), or a 20x20 or 16x16 primitive matrix can be generated on the Galois GF(2 8 ) finite field. It is only required to ensure that the data querying party and the data providing party generate the same size of the primitive matrix in the specified finite field. The data querying party and the data providing party of the embodiments of the present application agree to specify a finite field, and the data querying party can randomly generate a primitive matrix T1 in the specified finite field. The selection of the finite field and the size of the primitive matrix can be set according to the actual demand, which is not limited in the present application. For example, a 160x160 or 128x128 primitive matrix can be randomly generated on the binary finite field GF(2), or a 20x20 or 16x16 primitive matrix can be generated on the Galois GF(2
[0088] As shown in Figure 3 , the data querying party can generate a random number P of a specified length L, and use the random number P to calculate the primitive matrix T1 P generated before to the power of P to obtain a target matrix Tx=T1 P . The purpose of introducing the random number P to calculate the target matrix is to make the target matrix of the data querying party satisfy certain properties, and have privacy, randomness and difficulty in prediction. If the matrix is to be obtained, the most effective method is to exhaust the value of the random number P, which is not realistic when the size of the random number P is large enough. The specified length L is determined according to the maximum value of the order of the primitive matrix. Since the primitive matrix is a square matrix with the same number of elements in the row vector and the column vector, taking a 20*20 primitive matrix on the aforementioned Galois GF(2 8 ) finite field as an example, the maximum value of the order i is 2 160 -1. That is, the result of multiplying the matrix by itself (2 160 -1) times is still the matrix, so the specified length L of the random number P can be set to 160 bits or about 160 bits.
[0089] In step 201, the data querying party can use a preset function algorithm to calculate each piece of data to be queried to obtain a query factor X corresponding to each piece of data to be queried; for each piece of data to be queried, the data querying party can determine a query product vector U corresponding to the data to be queried based on the product of the target matrix Txand the query factor X corresponding to the data to be queried. For the data to be queried 1-n, each piece of data to be queried corresponds to a query factor, i.e., the data to be queried 1-n corresponds to the query factors X1-X n , each piece of data to be queried corresponds to a query product vector, i.e., the data to be queried 1-n corresponds to the query product vectors U1-U n .
[0090] In some embodiments, the preset function algorithm can be any one of a message authentication algorithm, a hash function algorithm and a compression function algorithm.
[0091] When the data querying party calculates the query factor corresponding to each piece of data to be queried using the preset function algorithm, the number of bytes in each query factor should be the same as the number of rows of the target matrix, i.e., the same as the number of elements in the row vector (or column vector) of the target matrix, which is the algorithm requirement of matrix multiplication.
[0092] Taking the GF(2 8) is taken as an example, when the matrix left multiplies a certain data, the byte number of the data needs to be the same as the element number of the row vector of the matrix, and when the matrix right multiplies a data vector, the byte number of the data needs to be the same as the element number of the column vector of the matrix. Since the above matrices are square matrices, i.e., the number of rows is equal to the number of columns, therefore, when the matrix and the vector are left multiplied or right multiplied, the bit number of the data vector needs to be the same as the number of rows of the matrix if the GF(2) field matrix is used.
[0093] In some embodiments, if the byte number in the query factor and the reference factor is inconsistent with the number of rows of the target matrix, it can be agreed that the byte number of the query factor and the reference factor is kept consistent with the number of rows of the target matrix by data loop filling, data repetition filling, 0 filling or reduction, etc.
[0094] Taking a 20*20 primitive matrix on Galois GF(2 8 ) field as an example, the number of rows of the target matrix is 20, and the byte number in each query factor should also be 20 during implementation. For example, the preset function algorithm is a message authentication algorithm, and then the data to be queried
Zhang San, 123****456, D
[0095] For example, the 32-byte message authentication code is obtained after the data to be queried is converted. At this time, 12 bytes of the 32-byte message authentication code are cut off from the specified position, and then a 20-byte query factor is obtained. For another example, a 16-byte message authentication code is obtained after the data to be queried is converted. At this time, 4 null bytes are supplemented to the 16-byte message authentication code from the specified position, and then a 20-byte query factor is obtained. In this way, the 20-dimensional query product vector U can be obtained after the query factor is multiplied with the target matrix factor. Thus, the query product vector U and the query vector X have the same byte number, which is convenient for subsequent matrix action, and the effect is that the order of matrix action can be exchanged, which guarantees that the data to be queried is invisible and traceable during the anonymous query.
[0096] Step 202: The data query direction data provider sends an anonymous query request carrying the query product vector;
[0097] Step 203: The data provider determines the reference product vector corresponding to the reference data based on the reference matrix and the reference data;
[0098] The reference data has been described in the foregoing step 201, and will not be described here.
[0099] In step 203, the data provider determines the calculation flow of the reference accumulated vector corresponding to the reference data based on the reference matrix and the reference data, which is the same as the calculation of the query accumulated vector corresponding to the query data based on the target matrix and the query data in step 201, and can be specifically as shown in the foregoing Figure 3 As the data query party and the data provider of the embodiment of the present application have agreed on a specified finite field in advance, the data query party can randomly generate a first primitive matrix T1 in the specified finite field, and correspondingly, the data provider randomly generates a second primitive matrix T2 in the specified finite field, and requires that there is an integer n satisfying T2=(T1) n .
[0100] The data query party can generate a first random number P of a specified length L, and calculate the P-th power of the previously generated first primitive matrix T1 using the first random number P to obtain a target matrix Tx=T1 P . Correspondingly, the data provider can generate a second random number Q of a specified length L, and calculate the Q-th power of the previously generated second primitive matrix T2 using the second random number Q to obtain a reference matrix Ty=T2 Q .
[0101] To adapt to more application scenarios, the data query party and the data provider can be pre-configured with a plurality of selectable primitive matrices of different sizes in the specified finite field, and the data query party and the data provider can agree to select the same primitive matrix T (i.e., T1=T2). In this way, when the target matrix and the reference matrix are calculated, the data query party can generate a first random number P of a specified length L, and calculate the P-th power of the primitive matrix T using the first random number P to obtain a target matrix Tx=T P , and the data provider can generate a second random number Q of a specified length L, and calculate the Q-th power of the primitive matrix T using the second random number Q to obtain a reference matrix Ty=T Q . In this way, the data query party and the data provider can save the generation of the primitive matrix (i.e., T1 and T2) in the specified finite field.
[0102] As shown in FIG. 3, Figure 3 The data provider can calculate each reference data using a preset function algorithm agreed on by the data query party in advance to obtain a reference factor Y corresponding to each reference data; for each reference data, the data provider can calculate the product of the reference matrix Ty and the reference factor Y corresponding to the reference data to determine the reference accumulated vector Z=Ty*Y corresponding to the reference data. For the reference data 1 to m, each reference data corresponds to a reference factor, i.e., the reference data 1 to m correspond to the reference factors Y1 to Y m , and each reference data corresponds to a reference accumulated vector, i.e., the reference data 1 to m correspond to the reference accumulated vectors Z1 to Z m .
[0103] It should be noted that when multiplying the reference matrix Ty and the reference factor Y to obtain the reference product vector Z, the multiplication manner of the reference matrix Ty and the reference factor Y is the same as that of the target matrix Tx and the query factor X. The multiplication manner herein can be agreed by the data querying party and the data providing party in advance, for example, both left multiplication or right multiplication. Specifically, assuming that the target matrix Tx right multiplies the query factor X when obtaining the query product vector U, the reference matrix Ty right multiplies the reference factor Y when obtaining the reference product vector Z. Correspondingly, the target matrix Tx left multiplies the query factor X when obtaining the query product vector U, and the reference matrix Ty left multiplies the reference factor Y when obtaining the reference product vector Z. In this way, the reference product vector Z and the query product vector U can have the same data structure.
[0104] Step 204: The data providing party determines a comparison product vector based on the product of the reference matrix and the query product vector;
[0105] As shown in FIG. 2, in implementation, the data providing party can take the product of the reference matrix Ty and the query product vector U as the comparison product vector V = Ty * U. Figure 4 As shown in FIG. 2, in implementation, the data providing party can take the product of the reference matrix Ty and the query product vector U as the comparison product vector V = Ty * U. Figure 3 As shown in FIG. 2, in implementation, the data providing party can take the product of the reference matrix Ty and the query product vector U as the comparison product vector V = Ty * U. n .
[0106] It should be noted that when multiplying the reference matrix Ty and the query product vector U to obtain the comparison product vector V, the multiplication manner of the reference matrix Ty and the query product vector U needs to be the same as that of the target matrix Tx and the query factor X, so as to ensure that the comparison product vector V and the query product vector U have the same data structure.
[0107] Step 205: The data providing party sends the reference product vector and the comparison product vector to the data querying party;
[0108] Step 206: The data querying party determines a target product vector based on the product of the target matrix and the reference product vector;
[0109] As shown in FIG. 2, in implementation, the data querying party can take the product of the target matrix Tx and the reference product vector Z as the target product vector C = Tx * Z. Figure 4 As shown in FIG. 2, in implementation, the data querying party can take the product of the target matrix Tx and the reference product vector Z as the target product vector C = Tx * Z. Figure 3 As shown in FIG. 2, in implementation, the data querying party can take the product of the target matrix Tx and the reference product vector Z as the target product vector C = Tx * Z. m .
[0110] It should be understood that the multiplication manner of the target matrix Tx and the reference vector Z when multiplying the target matrix Tx with the reference vector Z to obtain the target vector C should be the same as the multiplication manner of the target matrix Tx and the query factor X, so as to ensure that the target vector C and the query vector U have the same data structure.
[0111] Step 207: The data query party determines the query answer of the to-be-queried data based on the target vector and the comparison vector.
[0112] It has been mentioned above that the to-be-queried data of the embodiment of the application represents the answer prediction result of the target question, and the query answer represents whether the answer prediction result is correct. When step 207 is performed, if the relationship between the target vector and the comparison vector satisfies a specific threshold, it is determined that the answer prediction result of the to-be-queried data to the target question is correct; otherwise, it is determined that the answer prediction result of the to-be-queried data to the target question is incorrect.
[0113] It can be known in combination with the foregoing Figure 3 and Figure 4 The target vector C = Tx * Z = Tx * Ty * Y. The comparison vector V = Ty * U = Ty * Tx * X. If Tx = T P , Ty = T Q , then Tx * Ty = T P * T Q = T P+Q = T Q * T P = Ty * Tx. Unlike the multiplication operation of ordinary matrices, because the target matrix and the reference matrix are both powers of the primitive matrix T, it can be ensured that the multiplication of the two matrices has commutativity. In this way, when two matrices act on a vector, the effect is the same regardless of which matrix acts first. Or, when a vector is multiplied by two matrices, the final product is the same regardless of which matrix is multiplied first.
[0114] Since the query factor X is calculated by the data query party from the to-be-queried data by using a preset function algorithm, and the reference factor Y is calculated by the data provider from the reference data by using a preset function algorithm, and the data structure of the to-be-queried data and the reference data is the same, the query factor and the reference factor calculated by the data query party and the data provider by using the preset function algorithm also have the same data structure.
[0115] Based on this, for the to-be-queried data 1-n, if the target vector C n corresponding to a to-be-queried data n is the same as a comparison vector V1-V m corresponding to the reference data 1-m, that is, C i = V j, 1≤i≤n, 1≤j≤m, means that there is a reference data identical to the jth to-be-queried data in the data provider, and means that the to-be-queried data is correct in predicting the result of the target problem.
[0116] Still taking the aforementioned information verification example of investigating whether Zhang San purchased a large amount of stock funds in a certain trading institution as an example, assuming that the to-be-queried data n = [Zhang San, 123 **** 456, D], if the reference data extracted from the account information of Zhang San in the trading institution (i.e., the data provider) is [Zhang San, 123 **** 456, D], the content of the query data X and the reference data Y should be identical. Therefore, if the difference between the target vector corresponding to the to-be-queried data n and a certain comparison vector is 0, it means that the data provider has the reference data [Zhang San, 123 **** 456, D], that is, the stock funds held by Zhang San in the trading institution are indeed more than 5 million, that is, the case that Zhang San holds a large amount of stock funds is true.
[0117] In some embodiments, if the number of to-be-queried data is greater than a number threshold, the to-be-queried data is split into a plurality of to-be-queried data groups; wherein the number threshold is determined according to the number of rows of the target matrix; each to-be-queried data group contains M to-be-queried data, and M≤the number threshold.
[0118] Since the comparison vector V = Ty*U, if there are multiple to-be-queried data, each to-be-queried data corresponds to a comparison vector and a query vector U, therefore, when there are enough U and V (for example, 20 pairs of U and V are obtained from a 20x20 matrix), the reference matrix Ty can be solved by solving the equation group. If Ty is leaked, the reference factor of the data provider will be leaked, which may lead to the leakage of the reference data of the data provider.
[0119] Therefore, when the data query side sends an anonymous query request carrying a query vector to the data provider through the aforementioned step 202, the number of to-be-queried data should be limited, that is, the number of query vectors carried in the anonymous query request should be limited, for example, when a 20x20 matrix is selected, the number of query vectors carried in the request should be less than 20, and specifically can be set to not more than 20 / 2 = 10.
[0120] Specifically as Figure 5As shown, assuming that the target matrix size is 20x20, the number threshold is 20 / 2 = 10. If there are currently 25 pieces of data to be queried, since the number of pieces of data to be queried is 25, which is greater than the number threshold 10. Therefore, the data to be queried can be split into multiple data groups to be queried, and each data group to be queried contains a number M of data to be queried ≤ the number threshold. For example, it can be split into 3 groups, group 1 includes 10 pieces of data to be queried, i.e. 1-10, group 2 includes 10 pieces of data to be queried, i.e. 11-20, and group 3 includes 5 pieces of data to be queried, i.e. 21-25.
[0121] Therefore, when performing the foregoing step 202, the data querying party can generate an anonymous query request carrying the M query vector corresponding to the M pieces of data to be queried for each data group to be queried based on the M query vector corresponding to the M pieces of data to be queried in the data group to be queried, and send it to the data provider.
[0122] In implementation, the foregoing steps can be continued as Figure 5 As shown, for each data group to be queried, the corresponding anonymous query request is generated, i.e. the 25 query vectors corresponding to the 25 pieces of data to be queried are divided into: anonymous query request 1 carrying the query vectors U1-U10 corresponding to the data 1-10 in group 1, anonymous query request 2 carrying the query vectors U11-U20 corresponding to the data 11-20 in group 2, and anonymous query request 3 carrying the query vectors U21-U25 corresponding to the data 21-25 in group 3. Therefore, it can be prevented that the reference matrix Ty is leaked due to too many query vectors U carried in a single request, and the data information of the data provider is prevented from being leaked. 10 11 20 21 25
[0123] Figure 6 As shown in the schematic diagram of the anonymous query process Figure 2 , as shown in the schematic diagram of the anonymous query process Figure 6 , the data querying party of the embodiment of the application can calculate the query factor X by using a preset function algorithm on the data to be queried, generate a random number P of a specified length L, generate a target matrix Tx=T based on the random number P and the primitive matrix T on the specified finite field. The product of the target matrix Tx and the query factor X is taken as the query vector U=Tx*X, and the query vector U is sent to the data provider. P
[0124] The data provider can calculate the reference factor Y by using a preset function algorithm on the reference data, generate a random number Q of a specified length L, and generate a reference matrix Ty=T based on the random number Q and the primitive matrix T on the specified finite field. Q The product of the reference matrix Ty and the reference data corresponding reference factor Y is taken as a reference data corresponding reference product vector Z = Ty*Y, and the product of the reference matrix Ty and the query product vector U is taken as a comparison product vector V = Ty*U, and the reference product vector Z and the comparison product vector V are sent to the data querying party. The data querying party can take the product of the target matrix Tx and the reference product vector Z as a target product vector C = Tx*Z, and then determine the query answer of the data to be queried based on the relationship between the target product vector and the comparison product vector.
[0125] The above process can meet the characteristic that left multiplication is equal to right multiplication when special matrices are multiplied. Since the target matrix and the reference matrix are generated based on random private parameters, they have privacy and randomness, and therefore, by calculating the product between the matrix and the vector, the invisibility and non-traceability of the data to be queried during the anonymous query can be guaranteed. The data querying party and the data providing party only have one data interaction during the anonymous query, and there is no need to configure a public-private key pair for both parties, which can greatly save the calculation and communication overhead of the anonymous query process.
[0126] To further improve communication security, the number of matrices participating in the operation in the anonymous query process shown in Figure 2 may be increased, that is, multiple target matrices and multiple reference matrices are included, and the number of target matrices and the number of reference matrices are the same.
[0127] For ease of understanding, the following will take the data querying party having two target matrices Tx1 and Tx2 and the data providing party having two reference matrices Ty1 and Ty2 as an example for illustration; it should be understood that the generation mode of Tx1 and Tx2 is the same as that of the target matrix Tx described in the foregoing Figure 3 , and the generation mode of Ty1 and Ty2 is the same as that of the reference matrix described in the foregoing Figure 3 .
[0128] In specific implementation, Tx1 and Ty1 can be agreed to belong to the same finite field, for example, a finite field 1: Z2[x] / (x 8 +x 8 +x 6 +x 5 +x+1) is selected from the GF(2 8 ) field; wherein Z2[x] is the set of polynomials with coefficients belonging to {0, 1}, and x is the base element. Tx1 and Ty1 are powers of a primitive matrix in the finite field 1. Correspondingly, Tx2 and Ty2 are agreed to belong to another finite field, for example, a finite field 2: Z2[x] / (x 8 +x 4 +x 3 +x 2+1); Tx2 and Ty2 are the square of a primitive matrix in the finite field 2. Through the above setting, in the process of matrix and vector multiplication, the corresponding finite field operation rules can be used according to the matrix properties.
[0129] In some embodiments, the data query party can multiply the target matrix Tx1 and the query factor X to obtain a query product vector U = Tx1 * X, and then send the query product vector U to the data provider.
[0130] The data provider multiplies the reference matrix Ty2 and the product of the reference matrix Ty1 and the query product vector U (Ty1 * U) to obtain a first intermediate vector ∈1 = Ty2 (Ty1 * U) = Ty2 * Ty1 * Tx1 * X, multiplies the reference matrix Ty1 and the reference factor Y to obtain a reference product vector Z = Ty1 * Y, and sends the first intermediate vector ∈1 and the reference product vector Z to the data query party.
[0131] The data query party multiplies the target matrix Tx2 and the first intermediate vector ∈1 to obtain a target product vector C = Tx2 * ∈1 = Tx2 * Ty2 * Ty1 * Tx1 * X, multiplies the target matrix Tx2 and the product of the target matrix Tx1 and the reference product vector Z (Tx1 * Z) to obtain a second intermediate vector ∈2 = Tx2 * Tx1 * Z = Tx2 * Tx1 * Ty1 * Y, and sends the second intermediate vector ∈2 to the data provider.
[0132] The data provider multiplies the reference matrix Ty2 and the second intermediate vector ∈2 to obtain a comparison product vector V = Ty2 * ∈ = Ty2 * Tx2 * Tx1 * Ty1 * Y, and then sends the comparison product vector V to the data query party, so that the data query party determines the query answer of the to-be-queried data based on the target product vector C and the comparison product vector V.
[0133] If the data provider has a reference data with the same content as the to-be-queried data, the query factor X corresponding to the to-be-queried data should be the same as a reference factor Y. Since the comparison product vector C = Ty2 * Tx2 * Tx1 * Ty1 * Y and the target product vector V = Tx2 * Ty2 * Ty1 * Tx1 * X, whether the target product vector and the comparison product vector are the same is used as a judgment condition, and thus the query result of the to-be-queried data can be obtained. The above process further increases security by introducing more target matrices and reference matrices on the basis of the anonymous query process shown in Figure 2 and Figure 6
[0134] Based on the same inventive concept, the embodiments of the present application also provide a data anonymous query device, as shown in Figure 7 The device can include:
[0135] The matrix configuration unit 701 is configured to perform: determining a query product vector corresponding to the at least one piece of data to be queried based on a target matrix and the at least one piece of data to be queried; the target matrix is generated by a data querying party in a specified finite field;
[0136] The query request unit 702 is configured to perform: sending an anonymous query request carrying the query product vector to a data providing party, and obtaining a reference product vector and a comparison product vector; the reference product vector is determined by the data providing party based on a reference matrix and at least one piece of reference data, the reference data has the same data structure as the data to be queried, and the reference matrix is generated by the data providing party in the specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector;
[0137] The data processing unit 703 is configured to perform: determining a target product vector based on the product of the target matrix and the reference product vector;
[0138] The anonymous query unit 704 is configured to perform: determining a query answer of the at least one piece of data to be queried based on the target product vector and the comparison product vector; the query answer represents whether there is reference data with the same content as the data to be queried.
[0139] In some embodiments, the matrix configuration unit 701 is specifically configured to perform the determination of the query product vector corresponding to the at least one piece of data to be queried based on the target matrix and the at least one piece of data to be queried by:
[0140] calculating each piece of data to be queried by using a preset function algorithm to obtain a query factor corresponding to each piece of data to be queried;
[0141] For each piece of data to be queried, determining a query product vector corresponding to the data to be queried based on the product of the target matrix and the query factor corresponding to the data to be queried; the preset function algorithm is shared with the data querying party, and is used to make the data providing party calculate a reference factor corresponding to each piece of reference data by using the preset function algorithm, and determine the reference product vector based on the product of the reference matrix and the reference factor.
[0142] In some embodiments, the number of bytes in the query factor is consistent with the number of rows of the target matrix, and the data structure of the query factor is the same as that of the reference factor.
[0143] In some embodiments, the target matrix is generated by:
[0144] generating a first primitive matrix in the specified finite field, and generating a first random number with a specified length based on the matrix size;
[0145] The first primitive matrix is calculated to the power of the first random number to obtain the target matrix; the specified length is shared by the data provider and the data query party, used to make the data provider generate the second random number of the specified length, and generate the second primitive matrix in the specified finite field, and the second primitive matrix is calculated to the power of the second random number to obtain the reference matrix.
[0146] In some embodiments, the data to be queried represents an answer prediction result of a target question; the query answer represents whether the answer prediction result is correct; and the anonymous query unit 704 is specifically configured to:
[0147] If the target product vector and the comparison product vector are the same, it is determined that the answer prediction result of the target question by the data to be queried is correct; otherwise, it is determined that the answer prediction result of the target question by the data to be queried is incorrect.
[0148] In some embodiments, the query request unit 702 is further configured to:
[0149] If the number of the data to be queried is greater than a number threshold, the at least one piece of data to be queried is split into a plurality of data groups to be queried, so that the number of query data in each group is not greater than the number threshold; wherein the number threshold is determined according to the number of rows of the target matrix; each data group to be queried contains M pieces of data to be queried, and M is less than or equal to the number threshold.
[0150] The anonymous query request carrying the query product vector is sent to the data provider, including:
[0151] For each data group to be queried, an anonymous query request carrying the query product vector corresponding to the M pieces of data to be queried in the data group to be queried is generated based on the query product vector corresponding to the M pieces of data to be queried in the data group to be queried, and is sent to the data provider.
[0152] In some embodiments, the preset function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
[0153] The electronic device 830 according to this embodiment of the present application will be described below with reference to Figure 8 The electronic device 830 is only an example, and should not limit the functions and use range of the embodiments of the present application. Figure 8 The electronic device 830 is only an example, and should not limit the functions and use range of the embodiments of the present application.
[0154] As Figure 8As shown, the electronic device 830 is in the form of a general electronic device. The components of the electronic device 830 can include, but are not limited to, the at least one processor 831 described above, the at least one memory 832 described above, and a bus 833 that connects the different system components, including the memory 832 and the processor 831.
[0155] The bus 833 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor or local bus using any of a variety of bus architectures, and the like.
[0156] The memory 832 can include a read-only memory (ROM) 8323 in the form of a volatile memory, such as a random access memory (RAM) 8321 and / or a cache memory 8322, and can further include a read-only memory (ROM) 8323.
[0157] The memory 832 can also include a program / utility 8325 having a set (at least one) of program modules 8324, including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which can include an implementation of a network environment, or some combination thereof.
[0158] The electronic device 830 can also communicate with one or more external devices 834 (such as a keyboard or a pointing device, among others) that can be used to interact with at least one of the electronic device 830 and / or one or more devices that enable a user to interact with the electronic device 830 and / or any devices (e.g., a router, a modem, and so forth) that enable the electronic device 830 to communicate with one or more other electronic devices. Such communication can occur via an input / output (I / O) interface 835. Still yet, the electronic device 830 can communicate with one or more networks, such as a local area network (LAN), a wide area network (WAN), and / or the Internet, through a network adapter 836. As depicted, the network adapter 836 communicates with the other components of the electronic device 830 via the bus 833. It should be appreciated that although the network adapter 836 is depicted as a separate component of the electronic device 830, the network adapter 836 can be integrated with one or more of the other components of the electronic device 830, such as the processor 831.
[0159] In some embodiments, a computer-readable storage medium is also provided, such as the memory 832 including instructions, which can be executed by the processor 831 of the above-described apparatus to complete the above-described method. Alternatively, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, and an optical data storage device, and the like.
[0160] In some embodiments, a computer program product including a computer program / instructions which, when executed by the processor 831, implements any one of the data de-identification query methods provided in the present application is also provided.
[0161] In some embodiments, various aspects of the data de-identification query method provided in the present application can also be implemented as a program product, which includes a program code, when the program product is run on a computer device, the program code is used to make the computer device execute the steps of the data de-identification query method according to various exemplary embodiments of the present application described above in the specification.
[0162] The program product can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination of the above. More specific examples (non-exhaustive list) of the readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.
[0163] The program product for data de-identification query of the embodiments of the present application can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on an electronic device. However, the program product of the present application is not limited to this, and in this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used or combined with an instruction execution system, device or apparatus.
[0164] The readable signal medium can include a data signal carried in a baseband or as a part of a carrier wave, in which readable program code is borne. Such a propagated data signal can take on many forms, including but not limited to electro-magnetic signal, optical signal or any suitable combination thereof. The readable signal medium can also be any readable medium that is not a readable storage medium and that can transmit, propagate or transport program for use by or in connection with an instruction execution system, apparatus or device.
[0165] The program code contained in the readable medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination thereof.
[0166] The program code may, through the use of program components, be implemented in any of various ways, including procedure-based execution, object-oriented execution, and / or virtual machine-based execution. A program component or other component may, for example, be implemented in hardware or software in combination with off-the-shelf components, or custom components. Additionally or alternatively, the program code may be implemented in transitory or non-transitory forms.
[0167] It should be noted that, although the above detailed description refers to several units or sub-units of the apparatus, such a division is merely illustrative and not mandatory. Indeed, according to an embodiment of the application, features and functions of two or more units described above can be embodied in one unit. Conversely, features and functions of one unit described above can be split into several units.
[0168] Moreover, while operations of the methods of the present application are described in a particular order in the figures, this is not required or implied in any particular order for performing the operations to achieve the desired results. Additionally or alternatively, certain steps can be omitted, combined into fewer steps, and / or split into multiple steps.
[0169] Those skilled in the art will appreciate that embodiments of the present application can be devised for a method, a system, or a computer program product. Accordingly, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage devices, and the like) embodying computer readable program code.
[0170] The computer program instructions can also be loaded onto a computer or other programmable image processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0171] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable image processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0172] The computer program instructions can also be loaded onto a computer or other programmable image processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure 1 one or more flow or blocks Figure 1 one or more flow or blocks
[0173] While the preferred embodiments of the application have been described, additional variations and modifications can be employed by those skilled in the art. Therefore, the appended claims intend to cover all such modifications and variations as fall within the true spirit and scope of the application. Further, the appended claims can be construed to cover all alternatives falling within the equivalent of the groups recited.
[0174] It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the scope or spirit of the application. Thus, it is intended that the present application cover the modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
Claims
1. A method for data anonymized query, characterized in that, The method comprises: determining a query product vector corresponding to the at least one piece of data to be queried based on a target matrix and the at least one piece of data to be queried; the target matrix is generated by a data querying party in a specified finite field; sending an anonymous query request carrying the query product vector to a data providing party to obtain a reference product vector and a comparison product vector; the reference product vector is determined by the data providing party based on a reference matrix and at least one piece of reference data, the reference data has the same data structure as the data to be queried, and the reference matrix is generated by the data providing party in the specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector; determining a target product vector based on the product of the target matrix and the reference product vector; determining a query answer of the at least one piece of data to be queried based on the target product vector and the comparison product vector; the query answer represents whether there is reference data with the same content as the data to be queried; the target matrix is generated by the following method: generating a first primitive matrix in the specified finite field, and generating a first random number with a specified length based on the matrix size; calculating the power of the first primitive matrix using the first random number to obtain the target matrix; the specified length is shared by the data providing party and the data querying party, which is used to make the data providing party generate a second random number with the specified length, and generate a second primitive matrix in the specified finite field, and calculate the power of the second primitive matrix using the second random number to obtain the reference matrix.
2. The method of claim 1, wherein, The method comprises: calculating each piece of data to be queried using a preset function algorithm to obtain a query factor corresponding to each piece of data to be queried; for each piece of data to be queried, determining a query product vector corresponding to the data to be queried based on the product of the target matrix and the query factor corresponding to the data to be queried; the preset function algorithm is shared by the data querying party, which is used to make the data providing party calculate a reference factor corresponding to each piece of reference data using the preset function algorithm, and determine the reference product vector based on the product of the reference matrix and the reference factor.
3. The method of claim 2, wherein, The number of bytes in the query factor is consistent with the number of rows of the target matrix, and the data structure of the query factor is the same as that of the reference factor.
4. The method according to any one of claims 1 to 3, characterized in that, The data to be queried represents the answer prediction result of a target problem; the query answer represents whether the answer prediction result is correct; The method comprises: if the target product vector is the same as the comparison product vector, it is determined that the answer prediction result of the target problem by the data to be queried is correct; otherwise, it is determined that the answer prediction result of the target problem by the data to be queried is incorrect.
5. The method according to any one of claims 1 to 3, characterized in that, The method further comprises: If the number of the to-be-queried data is greater than the number threshold, the at least one to-be-queried data is split into a plurality of to-be-queried data groups, so that the number of the to-be-queried data in each group is not greater than the number threshold; wherein the number threshold is determined according to the number of rows of the target matrix; each to-be-queried data group contains M to-be-queried data, and M is less than or equal to the number threshold; The data provider is sent an anonymous query request carrying the query vector, including: For each to-be-queried data group, an anonymous query request carrying the query vector corresponding to the M to-be-queried data in the to-be-queried data group is generated based on the query vector corresponding to the M to-be-queried data in the to-be-queried data group, and is sent to the data provider.
6. The method according to claim 2 or 3, characterized in that, The preset function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
7. A data anonymized query apparatus characterized by comprising: The device includes: A matrix configuration unit configured to determine a query vector corresponding to at least one to-be-queried data based on a target matrix and the at least one to-be-queried data; the target matrix is generated by a data querying party in a specified finite field; A query request unit configured to send an anonymous query request carrying the query vector to a data provider, obtain a reference vector and a comparison vector; the reference vector is determined by the data provider based on a reference matrix and at least one reference data, the reference data has the same data structure as the to-be-queried data, and the reference matrix is generated by the data provider in the specified finite field; the comparison vector is determined based on the product of the reference matrix and the query vector; A data processing unit configured to determine a target vector based on the product of the target matrix and the reference vector; An anonymous query unit configured to determine a query answer of the at least one to-be-queried data based on the target vector and the comparison vector; the query answer represents whether there is reference data with the same content as the to-be-queried data; The target matrix is generated by: A first primitive matrix is generated in the specified finite field, and a first random number of a specified length is generated based on the matrix size; The first random number is used to calculate the power of the first primitive matrix to obtain the target matrix; the specified length is shared by the data provider and the data querying party, and is used to make the data provider generate a second random number of the specified length, generate a second primitive matrix in the specified finite field, and calculate the power of the second random number to obtain the reference matrix.
8. The apparatus of claim 7, wherein, The matrix configuration unit is specifically configured to: A preset function algorithm is used to calculate each to-be-queried data to obtain a query factor corresponding to each to-be-queried data; For each piece of to-be-queried data, a query product vector corresponding to the to-be-queried data is determined based on a product of the target matrix and a query factor corresponding to the to-be-queried data; the preset function algorithm is shared with the data querying party, and is used to make the data providing party calculate a reference factor corresponding to each piece of reference data by using the preset function algorithm on each piece of reference data, and determine the reference product vector based on a product of a reference matrix and the reference factor.
9. The apparatus of claim 8, wherein, The number of bytes in the query factor is consistent with the number of rows of the target matrix, and the data structure of the query factor is the same as that of the reference factor.
10. The apparatus of any one of claims 7-9, wherein, The to-be-queried data represents an answer prediction result of a target problem; the query answer represents whether the answer prediction result is correct; and the performing of the determining of the query answer of the to-be-queried data based on the target product vector and the comparison product vector comprises: determining that the answer prediction result of the to-be-queried data to the target problem is correct if the target product vector is the same as the comparison product vector; or determining that the answer prediction result of the to-be-queried data to the target problem is incorrect if the target product vector is not the same as the comparison product vector. The query request unit is further configured to:
11. The apparatus of any one of claims 7-9, wherein, if the number of pieces of to-be-queried data is greater than a number threshold, split the at least one piece of to-be-queried data into a plurality of to-be-queried data groups, so that the number of pieces of query data in each group is not greater than the number threshold; wherein the number threshold is determined according to the number of rows of the target matrix; each to-be-queried data group contains M pieces of to-be-queried data, and M is less than the number threshold; sending an anonymous query request carrying the query product vector to the data providing party, comprising: for each to-be-queried data group, generating an anonymous query request carrying the query product vectors corresponding to the M pieces of to-be-queried data in the to-be-queried data group based on the query product vectors corresponding to the M pieces of to-be-queried data in the to-be-queried data group, and sending the anonymous query request to the data providing party. The preset function algorithm is any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
12. The apparatus of claim 8 or 9, wherein, comprising:
13. An electronic device, comprising: a memory for storing program instructions; a processor for calling the program instructions stored in the memory and executing the steps included in the method according to any one of claims 1-6 according to the obtained program instructions. The computer readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a computer, cause the computer to execute the method according to any one of claims 1-6.
14. A computer readable storage medium characterized by: The computer readable storage medium stores a computer program, and the computer program includes program instructions, which, when executed by a computer, cause the computer to execute the method according to any one of claims 1-6.
Citation Information
Patent Citations
Hidden trace query method, device and system and storage medium
CN115688167A
Two-stage anonymous trace query method and system, electronic equipment and computer readable medium
CN118606349A