Data anonymous trace query method and device, equipment and medium
By generating the target matrix and reference matrix within a specified finite domain, calculating the query product vector and reference product vector, the problem of large calculation and communication overhead of existing anonymous query technologies is solved, and efficient and secure anonymous query is achieved.
Patent Information
- Application Number
- CN202411954917.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing anonymous query technology is large in terms of computational overhead and communication overhead, and it is necessary to configure public-private key pairs for data queryers and data providers, which increases complexity and resource consumption.
By generating the target matrix and reference matrix within a specified finite domain, the data queryer and the data provider calculate the query product vector and the reference product vector respectively, and determine the query answers of the data to be queried by aligning the product vectors to realize an anonymous query.
This method reduces the calculation overhead and communication overhead of the anonymous query process, avoids the configuration of public and private key pairs, and improves query efficiency and security.
Smart Images

Figure CN119884464A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data security technology, and specifically discloses a data anonymization query method, device, equipment and medium. Background Art
[0002] Private Information Retrieval (PIR), also known as "private information retrieval", is a very practical technology and application in secure multi-party computing. It can be used to protect the user's query privacy and thus protect the user's query results. In traditional information retrieval tasks, the query party usually needs to send a plaintext query request to the server, which is likely to expose the user's identity and sensitive information. Anonymous query means that the query party hides the queried information, and the data provider can provide matching query results, but cannot know the query content of the query party.
[0003] At present, anonymous query tasks are mainly implemented based on the Oblivious Transfer algorithm or the Homomorphic Encryption algorithm. In the query process, it is necessary to pre-configure a public-private key pair for at least one of the data query party and the data provider. Both parties need to perform multiple encryption and decryption operations and interactions on the data based on the public key and private key, which imposes a heavy burden on both computing and communication overheads. Summary of the invention
[0004] The embodiments of the present application provide a data anonymity query method, apparatus, device and medium for reducing the computational overhead and communication overhead of the anonymity query process.
[0005] To achieve the above purpose, the technical solution of the embodiment of the present application is implemented as follows:
[0006] In a first aspect, an embodiment of the present application provides a data query method, including:
[0007] Determine a query product vector corresponding to at least one piece of data to be queried based on a target matrix and at least one piece of data to be queried; the target matrix is generated by the data query party in a specified finite field;
[0008] Sending an anonymous query request carrying the query product vector to a data provider to obtain a reference product vector and a comparison product vector; the reference product 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 data to be queried, and the reference matrix is generated by the data provider within the specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector;
[0009] determining a target product vector based on the product of the target matrix and the reference product vector;
[0010] Based on the target product vector and the comparison product vector, a query answer for the at least one piece of data to be queried is determined; the query answer indicates whether there is reference data with the same content as the data to be queried.
[0011] In an embodiment of the present application, the data query party determines the query product vector corresponding to the data to be queried based on the target matrix generated in a specified finite field and the data to be queried, and sends the query product vector to the data provider to obtain the reference product vector and the comparison product vector from the data provider; the reference product vector is determined by the data provider based on the reference matrix and the reference data, and the reference data has the same data structure as the data to be queried; the reference matrix is generated by the data provider in a specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector; the data query party can determine the target product vector based on the product of the target matrix and the reference product vector, 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. The above process utilizes the characteristic that when two special matrices are multiplied, the left multiplication and the right multiplication can be equal, and the generation of the matrix is random and unpredictable to ensure the invisibility and untraceability of the data to be queried during the anonymous query, and there is no need to configure a public-private key pair for the data query party and the data provider, which can effectively save the computational overhead and communication overhead of the anonymous query process.
[0012] In some embodiments, determining 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 includes:
[0013] Use a preset function algorithm to calculate each piece of data to be queried 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 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 query party, and is used to enable the data provider to use the preset function algorithm to calculate each reference data to obtain the reference factor corresponding to each reference data, and to determine the reference product vector based on the product of the reference matrix and the reference factor.
[0015] In an embodiment of the present application, the data query party uses a preset function algorithm to calculate the query factor corresponding to the data to be queried, and uses the product of the target matrix and the query factor as the query product vector of the data to be queried. The preset function algorithm is shared with the data provider to enable the data provider to process the reference data in the same way. Since the reference data and the data to be queried have the same data structure, the query factor and reference factor with the same data structure, as well as the query product vector and reference product vector with the same data structure can be solved. According to the characteristic that the left multiplication and the right multiplication are equal when special matrices are multiplied, the product between the matrix and the vector is calculated to verify whether the data provider has reference data with the same content as the data to be queried.
[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 an embodiment 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 matrix multiplication requirements, so that the query product vector is solved by multiplying the target matrix and the query factor.
[0018] In some embodiments, the target matrix is generated by:
[0019] 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 query party, and is used to enable the data provider to generate a second random number of the specified length, and a second primitive matrix is generated in the specified finite field, and the second random number is used to calculate the power of the second primitive matrix to obtain the reference matrix.
[0020] In the embodiment of the present application, the data query party uses the first random number to calculate the power of the first primitive matrix generated in the specified finite field to obtain the target matrix, and the data provider uses the second random number to calculate the power of the second primitive matrix generated in the specified finite field to obtain the reference matrix. The above process ensures the randomness and unpredictability of the target matrix and the reference matrix by allowing both parties to calculate the power of the primitive matrix using the random numbers generated by each party, and the size of the target matrix and the reference matrix is the same.
[0021] In some embodiments, the to-be-queried data represents a predicted answer result of a target question; the query answer represents whether the predicted answer result is correct; and determining the query answer of the to-be-queried data based on the target product vector and the comparison product vector includes:
[0022] If the target product vector is the same as the comparison product vector, it is determined that the prediction result of the answer of the to-be-queried data to the target question is correct; otherwise, it is determined that the prediction result of the answer of the to-be-queried data to the target question is wrong.
[0023] In the embodiment of the present application, by setting the data to be queried as the predicted answer result for the target question, since the data structure of the data to be queried is the same as that of the reference data, and the matrix size and finite field of the target matrix and the reference matrix are the same, the characteristic that the left multiplication and the right multiplication are equal when the special matrix is multiplied can be utilized, by calculating the product between the matrix and the vector, and comparing the target product vector and the comparison product vector, when they are the same, it indicates that the predicted answer result of the data to be queried for the target question is correct, thereby realizing the anonymous query of the data to be queried.
[0024] In some embodiments, the method further comprises:
[0025] If the number of the data to be queried is greater than the number threshold, the at least one data to be queried is split into multiple 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, M≤the number threshold;
[0026] Sending an anonymous query request carrying the query product vector to the data provider includes:
[0027] For each data group to be queried, based on the query product vectors corresponding to the M data to be queried in the data group to be queried, an anonymous query request carrying the query product vectors corresponding to the M data to be queried is generated and sent to the data provider.
[0028] In the embodiment of the present application, when the amount of data to be queried is too large, the data to be queried can be divided into multiple groups, and the intermediate product vector corresponding to each group of data to be queried is sent as a stealth query request. Since the comparison product vector in the embodiment of the present application is obtained based on the product of the reference matrix and the intermediate product vector, the number of query product vectors carried in each stealth query request is limited by the above process, which can effectively reduce the risk of the matrix being obtained when the communication is stolen. If the attacker has enough comparison product vectors and intermediate product vectors, the reference matrix may be obtained by solving a system of equations.
[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 embodiment of the present application, the data query party and the data provider agree on a set of preset function algorithms to operate on the query data and reference data, which can not only ensure that the data to be queried is invisible in the anonymous query process, but also ensure that the data structure of the query factor and the reference factor is the same. According to the property that the left multiplication and the right multiplication are equal when the special matrix is multiplied, the product between the matrix and the vector is calculated to check whether the data provider has reference data with the same content as the data to be queried.
[0031] In a second aspect, the embodiment of the present application further provides a data anonymization query device, the device comprising:
[0032] The matrix configuration unit is configured to execute: determining a query product vector corresponding to at least one piece of data to be queried based on a target matrix and at least one piece of data to be queried; the target matrix is generated by a data query party in a specified finite field;
[0033] The query request unit is configured to execute: sending a hidden query request carrying the query product vector to a data provider, and obtaining a reference product vector and a comparison product vector; the reference product 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 data to be queried, and the reference matrix is generated by the data provider within the specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector;
[0034] A data processing unit is configured to perform: determining a target product vector based on the product of the target matrix and the reference product vector;
[0035] The anonymous query unit is configured to execute: based on the target product vector and the comparison product vector, determine the query answer of the at least one piece of data to be queried; the query answer represents whether there is reference data with the same content as the data to be queried.
[0036] In some embodiments, the step of determining 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 is performed, and the matrix configuration unit is specifically configured as follows:
[0037] Use a preset function algorithm to calculate each piece of data to be queried to obtain a query factor corresponding to each piece of data to be queried;
[0038] For each piece of data to be queried, a query product vector corresponding to the data to be queried is determined 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 query party, and is used to enable the data provider to use the preset function algorithm to calculate each reference data to obtain the reference factor corresponding to each reference data, and to determine the reference product 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] Generate a first primitive matrix in the specified finite field, and generate a first random number of a specified length based on the matrix size;
[0042] The first primitive matrix is exponentially calculated 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 within the specified finite field, and the second primitive matrix is exponentially calculated using the second random number to obtain the reference matrix.
[0043] In some embodiments, the data to be queried represents the predicted answer result of the target question; the query answer represents whether the answer prediction result is correct; performing the step of determining the query answer of the data to be queried based on the target product vector and the comparison product vector, the anonymous query unit is specifically configured as follows:
[0044] If the target product vector is the same as the comparison product vector, it is determined that the prediction result of the answer of the to-be-queried data to the target question is correct; otherwise, it is determined that the prediction result of the answer of the to-be-queried data to the target question is wrong.
[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 the number threshold, the data to be queried is split into multiple 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, M≤the number threshold;
[0047] Sending an anonymous query request carrying the query product vector to the data provider includes:
[0048] For each data group to be queried, based on the query product vectors corresponding to the M data to be queried in the data group to be queried, an anonymous query request carrying the query product vectors corresponding to the M data to be queried is generated and sent 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, including:
[0051] A memory for storing program instructions;
[0052] The processor is used to call the program instructions stored in the memory, and execute the steps included in any one of the methods in the first aspect according to the obtained program instructions.
[0053] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes any one of the methods described in the first aspect.
[0054] In a fifth aspect, an embodiment of the present application provides a computer program product, comprising: a computer program code, when the computer program code is run on a computer, the computer executes any one of the methods described in the first aspect.
[0055] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0057] Figure 1 A schematic diagram of an application scenario provided for an embodiment of the present application;
[0058] Figure 2 An execution sequence diagram of a data anonymization query method provided in an embodiment of the present application;
[0059] Figure 3 A schematic diagram of the calculation process of the query product vector and the reference product vector provided in the embodiment of the present application;
[0060] Figure 4 A schematic diagram of the calculation process of the target product vector and the comparison product vector provided in the embodiment of the present application;
[0061] Figure 5A schematic diagram of a process of sending multiple anonymous query requests provided in an embodiment of the present application;
[0062] Figure 6 Provided for the embodiments of this application Figure 2 The flowchart of the data anonymization query process is shown;
[0063] Figure 7 A schematic diagram of the structure of a data anonymization query device provided in an embodiment of the present application;
[0064] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0065] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0066] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the attached claims.
[0067] To facilitate understanding of the technical solution provided by this application, the technical background of this application is described in detail below:
[0068] Anonymous query means that the query party hides the queried information. The data provider can provide matching query results, but cannot know the query content of the query party. The query party can only query specific results related to the query conditions and cannot obtain other additional information from the data. It is widely used in information verification scenarios. The so-called information verification means that the data query party has at least one guess or predicted answer to a certain target question, but if it directly inquires the data provider, it will directly expose its own guess or predicted answer during the inquiry stage.
[0069] For example, public security and judicial personnel need to investigate whether Zhang San has purchased a large number of stock funds in a certain trading institution. If the name of the person being investigated is directly handed over to the trading institution, and the trading institution is asked to help investigate whether Zhang San holds a large number of stock funds, although an accurate answer can be obtained quickly from the trading institution, regardless of whether Zhang San holds a large number of stock funds, the information that Zhang San is being investigated will be directly exposed when inquiring with the trading institution, that is, at least known by the trading institution.
[0070] If anonymous query can effectively avoid the above-mentioned 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, it is necessary to pre-configure a public-private key pair for at least one of the data query party and the data provider. 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 imposes a heavy burden on both computing and communication overheads.
[0071] Taking the common anonymous query process based on the Paillier homomorphic encryption algorithm as an example, suppose the data query party wants to query whether there is a piece of data to be queried that meets the specified conditions from the K reference data of the data provider. At this time, the data query party needs to generate obfuscated data containing the data to be queried, and the obfuscated data must be the same as the reference data (that is, generate K obfuscated data, including 1 piece of data to be queried and K-1 virtual data).
[0072] The data query party uses its own private key to encrypt the data to be queried, and uses the public key shared with the data provider to encrypt the virtual data. The data provider then performs an inner product operation on the K obfuscated data and the K reference data stored by itself based on the shared public key, and then gives the inner product operation result to the data query party to decrypt using its own private key, so as to obtain the query answer corresponding to the data to be queried. It can be seen that this process requires the configuration of a public-private key pair for the data query party. 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 both computing and communication overheads.
[0073] To solve the above problems, the invention concept of the present application is as follows: the data query party determines the query product vector corresponding to the data to be queried based on the target matrix generated in a specified finite field and the data to be queried, and sends the query product vector to the data provider so as to obtain the reference product vector and the comparison product vector from the data provider; the reference product vector is determined by the data provider based on the reference matrix and the reference data, and the reference data has the same data structure as the data to be queried; the reference matrix is generated by the data provider in a specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector; the data query party can determine the target product vector based on the product of the target matrix and the reference product vector, and then determine the query answer for the data to be queried based on the relationship between the target product vector and the comparison product vector. Since the target matrix and the reference matrix are generated based on random private parameters, they are private and random. Therefore, when the special matrices are multiplied, the left multiplication and the right multiplication are equal. By calculating the product between the matrix and the vector, the invisibility and non-traceability of the data to be queried and the reference data in the anonymous query process are guaranteed. During the anonymous query, the data query party and the data provider only have one data interaction, and there is no need to configure a public-private key pair for both parties, which can effectively save the computational overhead and communication overhead of the anonymous query process.
[0074] The solution provided in the embodiment of the present application can be applied to the interaction scenario between the terminal device and the server. Figure 1 As shown, it is a schematic diagram of an application scenario provided by an embodiment of the present application. In this scenario, a terminal device 101, a server 102, and a network 103 may be included.
[0075] The terminal device 101 may be a mobile phone, a tablet computer (PAD), a laptop computer, a desktop computer, a smart TV, a smart vehicle-mounted device, a smart wearable device, or the like.
[0076] The server 102 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, i.e., content delivery networks (CDNs), and big data and artificial intelligence platforms, but is not limited thereto. Multiple processors 103 for providing processing resources may be deployed on the server 102.
[0077] In the embodiment of the present application, the terminal device 101 and the server 102 can be directly or indirectly connected to each other through one or more networks 103. The network 103 can be a wired network or a wireless network, for example, the wireless network can be a mobile cellular network, or a wireless fidelity (Wireless-Fidelity, WIFI) network, and of course, it can also be other possible networks, which are not limited in the embodiment of the present application.
[0078] In some embodiments, the data querying party may generate a target matrix in a specified finite field through the terminal device 101, and generate a query product vector based on the target simulation and the data to be queried, and then send a hidden query request carrying the query product vector to the server 102. In response to the request, the server 102 may send a reference product vector and a comparison product vector to the terminal device 101. The terminal device 101 may determine the target product vector based on the product of the target matrix and the reference product vector, and then determine the query answer of the data to be queried based on the difference between the target product vector and the comparison product vector.
[0079] The following describes the data anonymization query method provided by the exemplary embodiment of the present application in combination with the application scenario described above and with reference to the accompanying drawings. It should be noted that the above application scenario is only shown to facilitate the understanding of the present application scheme, and the implementation method of the present application is not limited in this regard.
[0080] Figure 2 The following is a time sequence interaction flow between a data query party and a data provider when executing a data anonymization query method provided in an embodiment of the present application. Figure 2 As shown, the following steps may be included:
[0081] Step 201: The data querying party determines a query product vector corresponding to the data to be queried based on the target matrix and the data to be queried;
[0082] For the convenience of explanation, 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 explanation using this example is only for the convenience of describing the technical solution of this application, rather than limiting the solution itself.
[0083] In the example of "investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution", the relevant public security personnel are the data query party, and the trading institution is the data provider. The user's account data in the trading institution usually includes name, ID number, contact number, address, account opening time, last transaction time, market value of stock funds held, password verification value and other data information.
[0084] The data query party can ask the data provider to provide only some items, for example, only the name, ID number, and the market value of the stock funds held. That is, [name, ID number, market value of the stock funds held] is the data structure agreed upon in advance by the data query party and the data provider.
[0085] In some embodiments, in order to improve communication security and save data transmission volume, the "market value of stock funds held" can be represented by an English letter, such as A is less than 100,000 yuan, B is 100,000 yuan and less than 1 million yuan, C is 1 million and less than 5 million yuan, and D is greater than or equal to 5 million yuan. The data query party can, under the premise of authorization, send an anonymous query request in step 201 to the data provider, requiring the data provider to generate corresponding reference data with the data structure of [name, ID number, market value of stock funds held] for all users' account information. For example, [Li Si, 123***598, B], [Wang Wu, 123****386, C], each user corresponds to a reference data generated by his own account.
[0086] The data query party and the data provider of the embodiment of the present application pre-agree on the data structure of the data to be queried and the reference data, namely, the [name, ID number, market value of stock funds held] mentioned above. The data to be queried refers to the predicted answer result of the data query party to the target question. In the example of "investigating whether Zhang San has purchased a large number of stock funds in a certain trading institution", "whether Zhang San holds a large number of stock funds" is the target question, and the answer prediction result can be set according to actual needs. Assuming that the judgment standard is that the stock funds purchased are considered to be purchased in large quantities if the market value is more than 5 million, then the stock funds purchased by Zhang San with a market value of more than 5 million can be used as the answer prediction result. Therefore, the data query party can generate the data to be queried [Zhang San, 123****456, D] representing the answer prediction result based on the data structure.
[0087] The primitive matrix is also called a prime matrix. There is a minimum positive integer i greater than 1 in the primitive matrix (usually called the order of the primitive matrix). i = unit matrix E, i reaches a maximum value. The data query party and the data provider of the embodiment of the present application pre-agree on a specified finite field, and the data query 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 actual needs, and the present application does not limit this. For example, a 160×160 or 128×128 primitive matrix can be randomly generated on the binary finite field GF(2), or on the Galois GF(2 8 ) generates a primitive matrix of 20×20 or 16×16 on a finite field. Here, it is only necessary to ensure that the data query party and the data provider generate primitive matrices of the same size in the specified finite field.
[0088] like Figure 3 As shown, the data query party can generate a random number P of a specified length L, and use the random number P to calculate the Pth power of the original matrix T1 generated previously, and obtain the target matrix Tx = T1 P The purpose of introducing random number P to obtain the target matrix is to make the target matrix of the data query party meet specific properties and have privacy, randomness and unpredictability. If you want to obtain this matrix, the most effective way is to exhaust the value of random number P, which is unrealistic when the scale of random number P is large enough. Among them, 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 column vector, the above Galois GF (2 8 ) Take the 20×20 primitive matrix over the finite field as an example, the maximum value of its order i is 2 160 -1. This means that the matrix is multiplied 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] When executing step 201, the data query party may 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 query party may determine the query product vector U=Tx*X corresponding to the data to be queried based on the product of the target matrix Tx and 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, that is, 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, that is, the data to be queried 1 to n correspond to query product vectors U1 to U n .
[0090] In some embodiments, the preset function algorithm may be any one of a message authentication algorithm, a hash function algorithm, and a compression function algorithm.
[0091] When the data query party uses the preset function algorithm to calculate the query factor corresponding to each piece of data to be queried, it should ensure that the number of bytes in each query factor is the same as the number of rows of the target matrix, that is, the same as the number of elements in the row vector (or column vector) of the target matrix. This is the algorithm requirement of matrix multiplication.
[0092] Using GF(2 8) finite field matrix as an example, when the matrix is left-multiplied by a certain data, the number of bytes of the data must be the same as the number of elements in the matrix row vector, and when the matrix is right-multiplied by a data vector, the number of bytes of the data must be the same as the number of elements in the matrix column vector. Since the above matrices are all square matrices, that is, the number of rows and columns is equal, if a matrix over the GF(2) field is used, when the matrix is left-multiplied or right-multiplied by a vector, the number of bits of the data vector must be the same as the number of rows in the matrix.
[0093] In some embodiments, if the number of bytes 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 number of bytes of the query factor and the reference factor can be kept consistent with the number of rows of the target matrix through methods such as data loop filling, data repetition filling, filling with 0 or reduction.
[0094] The target matrix is Galois GF(2 8 ) finite field as an example. The number of rows of the target matrix is 20. When implementing, the number of bytes in each query factor should also be 20. For example, if the preset function algorithm is a message authentication algorithm, the query data [Zhang San, 123****456, D] can be converted into a message authentication code with a specified number of bytes, such as taking the message authentication code length as 20 bytes.
[0095] For example, after the data to be queried is converted, a 32-byte message authentication code is obtained. At this time, 12 bytes of the 32-byte message authentication code are cut from the specified position, and then a 20-byte query factor is obtained. For another example, after the data to be queried is converted, a 16-byte message authentication code is obtained. At this time, 4 empty bytes are added to the 16-byte message authentication code from the specified position, and then a 20-byte query factor is obtained. In this way, after multiplying the query factor with the target matrix factor, a 20-dimensional query product vector U can be obtained. In this way, the query product vector U and the query vector X can have the same number of bytes, which is convenient for subsequent matrix operations, and the effect produced is that the order of matrix operations can be exchanged, ensuring that the data to be queried is invisible and untraceable during the anonymous query.
[0096] Step 202: The data query party sends an anonymous query request carrying a query product vector to the data provider;
[0097] Step 203: The data provider determines a 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 aforementioned step 201 and will not be described again here.
[0099] In step 203, the data provider determines the calculation process of the reference product vector corresponding to the reference data based on the reference matrix and the reference data, which is the same as the calculation process of the data query party determining the query product vector corresponding to the to-be-queried data based on the target matrix and the to-be-queried data in step 201. Figure 3 As shown, since the data query party and the data provider of the embodiment of the present application have agreed in advance on a specified finite field, 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, requiring that there exists an integer n that satisfies T2=(T1) n .
[0100] The data query party can generate a first random number P of a specified length L, and use the first random number P to calculate the Pth power of the first primitive matrix T1 generated previously, and obtain the target matrix Tx = T1 P Correspondingly, the data provider may generate a second random number Q of a specified length L, and use the second random number Q to calculate the Q-th power of the second primitive matrix T2 generated previously, to obtain a reference matrix Ty=T2 Q .
[0101] In order to adapt to more application scenarios, the data query party and the data provider can also pre-configure a variety of optional primitive matrices of various sizes within a specified finite field, and the data query party and the data provider can agree to select the same primitive matrix T (that is, T1=T2). In this way, when obtaining the target matrix and the reference matrix, the data query party can generate a first random number P of a specified length L, and use the first random number P to calculate the Pth power of the primitive matrix T, and obtain the target matrix Tx=T P , the data provider can generate a second random number Q of a specified length L, and use the second random number Q to calculate the Q-th power of the original matrix T to obtain a reference matrix Ty = T Q Thus, it is possible to save the data query party and the data provider from generating the original matrix (ie, the aforementioned T1 and T2) on the specified finite field.
[0102] Continue as Figure 3 As shown, the data provider can use the preset function algorithm agreed in advance with the data query party to calculate each reference data to obtain the 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 product vector Z = Ty*Y corresponding to the reference data. For reference data 1~m, each reference data corresponds to a reference factor, that is, reference data 1~m corresponds to reference factors Y1~Y m , each reference data corresponds to a reference product vector, that is, reference data 1~m corresponds to reference product vectors Z1~Z m .
[0103] It should be noted that when the reference matrix Ty is multiplied by the reference factor Y to obtain the reference product vector Z, the multiplication method of the reference matrix Ty and the reference factor Y is the same as the multiplication method of the target matrix Tx and the query factor X. The multiplication method here can be agreed upon in advance by the data query party and the data provider, for example, both use left multiplication or right multiplication. Specifically, assuming that when obtaining the query product vector U, the target matrix Tx is right-multiplied by the query factor X, then when obtaining the reference product vector Z, the reference matrix Ty needs to be right-multiplied by the reference factor Y. Correspondingly, when obtaining the query product vector U, the target matrix Tx is left-multiplied by the query factor X, then when obtaining the reference product vector Z, the reference matrix Ty needs to be left-multiplied by the reference factor Y. This ensures that the reference product vector Z and the query product vector U have the same data structure.
[0104] Step 204: The data provider determines a comparison product vector based on the product of the reference matrix and the query product vector;
[0105] like Figure 4 As shown, during implementation, the data provider may multiply the reference matrix Ty by the query product vector U as the comparison product vector V=Ty*U. Figure 3 As shown in the figure, since each piece of data to be queried corresponds to a query product vector, each piece of data to be queried corresponds to a comparison product vector, that is, the data to be queried 1 to n corresponds to the comparison product vectors V1 to V n .
[0106] It should be understood that when multiplying the reference matrix Ty with the query product vector U to obtain the comparison product vector V, the multiplication method of the reference matrix Ty and the query product vector U must be the same as the multiplication method of the target matrix Tx and the query factor X to ensure that the comparison product vector V and the query product vector U have the same data structure.
[0107] Step 205: The data provider sends a reference product vector and a comparison product vector to the data query 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] Continue as Figure 4 As shown, during implementation, the data query can multiply the target matrix Tx and the reference product vector Z as the target product vector C = Tx*Z. Figure 3 As shown in the reference data 1 to m, since each reference data corresponds to a reference product vector, each reference data corresponds to a target product vector here, that is, the reference data 1 to m corresponds to the target product vectors C1 to C m .
[0110] It should be understood that when multiplying the target matrix Tx with the reference product vector Z to obtain the target product vector C, the multiplication method of the target matrix Tx and the reference product vector Z must be the same as the multiplication method of the target matrix Tx and the query factor X to ensure that the target product vector C and the query product vector U have the same data structure.
[0111] Step 207: The data querying party determines the query answer for the data to be queried based on the target product vector and the comparison product vector;
[0112] As mentioned above, the query data of the embodiment of the present application represents the predicted answer result of the target question, and the query answer represents whether the predicted answer result is correct. When executing step 207, if the relationship between the target product vector and the comparison product vector meets a specific threshold, it is determined that the predicted answer result of the query data for the target question is correct; otherwise, it is determined that the predicted answer result of the query data for the target question is wrong.
[0113] Combined with the above Figure 3 and Figure 4 It can be seen that the target product vector C = Tx*Z = Tx*Ty*Y. The comparison product 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. Different from the product operation of ordinary matrices, because both the target matrix and the reference matrix are square powers of the original matrix T, it can be guaranteed that the multiplication of the two matrices is commutative. In this way, when two matrices are applied to a vector, the effect is the same no matter which matrix is applied first. In other words, when a vector is multiplied by two matrices, no matter which matrix is multiplied first, the final product is the same.
[0114] Since the query factor X is calculated by the data query party using a preset function algorithm on the query data, and the reference factor Y is calculated by the data provider using a preset function algorithm on the reference data, and the data to be queried and the reference data have the same data structure, the query factor and reference factor calculated by the data query party and the data provider using the preset function algorithm also have the same data structure.
[0115] Based on this, for the query data 1 to n, if there is a target product vector C corresponding to the query data n n , and the comparison product vectors V1~V corresponding to the reference data 1~m m The same as one of the C i =V j, 1≤i≤n, 1≤j≤m, it means that there is a reference data that is the same as the j-th piece of data to be queried on the data provider, indicating that the prediction result of the answer to the target question for this piece of data to be queried is correct.
[0116] Still taking the aforementioned information verification example of "investigating whether Zhang San has purchased a large amount of stock funds in a certain trading institution" as an example, assuming that the data to be queried n = [Zhang San, 123****456, D], if the reference data extracted from Zhang San's account information in the trading institution (i.e., the data provider) is [Zhang San, 123****456, D], then the content of the query data X and the reference data Y should be the same. Therefore, if the difference between the target product vector corresponding to the data to be queried n and a certain comparison product vector is 0, it means that the data provider has the reference data of [Zhang San, 123****456, D], that is, the market value of the stock funds held by Zhang San in the trading institution is indeed more than 5 million, that is, Zhang San's large holdings of stock funds are true.
[0117] In some embodiments, if the number of data to be queried is greater than the number threshold, the data to be queried is split into multiple data groups to be queried; 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, M≤the number threshold.
[0118] Since the comparison product vector V = Ty*U, if there are multiple pieces of data to be queried, each piece of data to be queried corresponds to a comparison product vector and a query product vector U. Therefore, when there are enough U and V (for example, a 20×20 matrix obtains 20 pairs of U and V), the reference matrix Ty can be obtained 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] Based on this, when the data query party sends a hidden query request carrying a query product vector to the data provider through the aforementioned step 202, the number of data to be queried should be limited, that is, the number of query product vectors carried in the hidden query request should be limited. For example, when a 20×20 matrix is selected, the number of query product vectors carried in the request can be required to be less than 20, and can be specifically set to not exceed 20 / 2=10.
[0120] Specific as Figure 5As shown, assuming that the target matrix size is 20×20, 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 25 is greater than the number threshold 10. Therefore, the data to be queried can be divided into multiple groups of data to be queried, requiring that the number of data to be queried contained in each group of data to be queried M ≤ the number threshold. For example, it can be divided into 3 groups, group 1 includes 10 pieces of data to be queried, namely the 1st to 10th, group 2 includes 10 pieces of data to be queried, namely the 11th to 20th, and group 3 includes 5 pieces of data to be queried, namely the 21st to 25th.
[0121] Therefore, when executing the aforementioned step 202, the data query party can generate an anonymous query request carrying the query product vectors corresponding to the M data to be queried in each data group to be queried based on the query product vectors corresponding to the M data to be queried in the data group to be queried, and send it to the data provider.
[0122] When implementing, you can continue as Figure 5 As shown, a corresponding anonymous query request is generated for each data group to be queried, that is, the 25 query product vectors corresponding to the 25 data to be queried are divided into: query product vectors U1~U2 corresponding to the data 1~10 to be queried in group 1 10 The anonymous query request 1 and the query product vector U corresponding to the query data 11-20 in the carrying group 2 11 ~U 20 The anonymous query request 2 carries the query product vector U corresponding to the query data 21-25 in the group 3. 21 ~U 25 Anonymous query request 3. This can prevent the reference matrix Ty from being leaked due to too many query product vectors U being carried in a single request, and prevent the data information of the data provider from being leaked.
[0123] Figure 6 for Figure 2 The schematic diagram of the anonymous query process is shown in FIG. Figure 6 As shown, the data query method of the embodiment of the present application can use a preset function algorithm to calculate the query data to obtain the query factor X, generate a random number P of a specified length L, and generate a target matrix Tx=T based on the random number P and the primitive matrix T on the specified finite field. P The product of the target matrix Tx and the query factor X is taken as the query product vector U=Tx*X, and the query product vector U is sent to the data provider.
[0124] The data provider can use a preset function algorithm to calculate the reference data to obtain a reference factor Y, 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. QThe product of the reference matrix Ty and the reference factor Y corresponding to the reference data is used as the reference product vector Z=Ty*Y corresponding to the reference data, and the product of the reference matrix Ty and the query product vector U is used as the comparison product vector V=Ty*U, and the reference product vector Z and the comparison product vector V are sent to the data query party. The data query party can use the product of the target matrix Tx and the reference product vector Z as the 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 satisfy the property that the left multiplication and the right multiplication are equal when multiplying special matrices. Because the target matrix and the reference matrix are generated based on random private parameters, they are private and random. 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. During the anonymous query, the data query party and the data provider only generate one data interaction, and there is no need to configure public-private key pairs for both parties, which can greatly save the computational overhead and communication overhead of the anonymous query process.
[0126] To further improve communication security, Figure 2 The number of matrices involved in the operation in the anonymous query process shown is increased, that is, it includes multiple target matrices and multiple reference matrices, and the number of target matrices and reference matrices can be the same.
[0127] For ease of understanding, the following example is taken as follows: the data query party has two target matrices Tx1 and Tx2, and the data provider has two reference matrices Ty1 and Ty2; it should be understood that the generation method of Tx1 and Tx2 is the same as the above Figure 3 The target matrix Tx is generated in the same way as described above, and Ty1 and Ty2 are generated in the same way as described above. Figure 3 The reference matrices shown are generated in the same way.
[0128] In the specific implementation, it can be agreed that Tx1 and Ty1 belong to the same finite field, for example, from GF(2 8 ) field, select a finite field 1: Z2[x] / (x 8 +x 6 +x 5 +x+1); where Z2[x] is the set of all polynomials with coefficients in {0, 1}, and x is a primitive. Tx1 and Ty1 are the square powers of a primitive matrix in the finite field 1. Correspondingly, it is agreed that Tx2 and Ty2 belong to another finite field, for example, from GF(2 8 ) domain selects a finite field 2: Z2[x] / (x 8 +x 4 +x 3 +x 2+1); Tx2 and Ty2 are the square powers of a primitive matrix in the finite field 2. Through the above-mentioned convention setting, in the process of matrix and vector multiplication, the corresponding finite field operation rules can be adopted according to the matrix properties.
[0129] In some embodiments, the data query party may obtain the product of the target matrix Tx1 and the query factor X as 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 by the product of the reference matrix Ty1 and the query product vector U (Ty1*U) to obtain the first intermediate vector ∈1=Ty2(Ty1*U)=Ty2*Ty1*Tx1*X, and uses the product of the reference matrix Ty1 and the reference factor Y as the 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 uses the product of the target matrix Tx2 and the first intermediate vector ∈1 as the target product vector C=Tx2*∈1=Tx2*Ty2*Ty1*Tx1*X, and multiplies the target matrix Tx2 by the product of the target matrix Tx1 and the reference product vector Z (Tx1*Z) to obtain the 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 uses the product of the reference matrix Ty2 and the second intermediate vector ∈2 as the 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 can determine the query answer to the data to be queried 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 data to be queried, the query factor X corresponding to the data to be queried should be the same as the reference factor Y. Since the comparison product vector C = Ty2 Tx2*Tx1*Ty1*Y, the target product vector V = Tx2*Ty2*Ty1*Tx1*X, the query result of the data to be queried can be obtained by using whether the target product vector is the same as the comparison product vector as the judgment condition. Figure 2 and Figure 6 Introducing more target matrices and reference matrices based on the anonymous query process shown can further increase security.
[0134] Based on the same inventive concept, the present application also provides a data anonymization query device, specifically as follows: Figure 7 As shown, the device may include:
[0135] The matrix configuration unit 701 is configured to execute: determining a query product vector corresponding to at least one piece of data to be queried based on a target matrix and at least one piece of data to be queried; the target matrix is generated by the data query party in a specified finite field;
[0136] The query request unit 702 is configured to execute: sending a hidden query request carrying the query product vector to the data provider, and obtaining a reference product vector and a comparison product vector; the reference product 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 data to be queried, and the reference matrix is generated by the data provider within 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 execute: 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 execute: based on the target product vector and the comparison product vector, determine the query answer of the at least one piece of data to be queried; the query answer indicates whether there is reference data with the same content as the data to be queried.
[0139] In some embodiments, the step of determining the query product vector corresponding to at least one piece of data to be queried based on the target matrix and at least one piece of data to be queried is performed, and the matrix configuration unit 701 is specifically configured as follows:
[0140] Use a preset function algorithm to calculate each piece of data to be queried to obtain a query factor corresponding to each piece of data to be queried;
[0141] For each piece of data to be queried, a query product vector corresponding to the data to be queried is determined 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 query party, and is used to enable the data provider to use the preset function algorithm to calculate each reference data to obtain the reference factor corresponding to each reference data, and to 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] Generate a first primitive matrix in the specified finite field, and generate a first random number of a specified length based on the matrix size;
[0145] The first primitive matrix is exponentially calculated 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 within the specified finite field, and the second primitive matrix is exponentially calculated using the second random number to obtain the reference matrix.
[0146] In some embodiments, the data to be queried represents the predicted answer result of the 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 is the same as the comparison product vector, it is determined that the prediction result of the answer of the to-be-queried data to the target question is correct; otherwise, it is determined that the prediction result of the answer of the to-be-queried data to the target question is wrong.
[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 the number threshold, the at least one data to be queried is split into multiple 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, M≤the number threshold;
[0150] Sending an anonymous query request carrying the query product vector to the data provider includes:
[0151] For each data group to be queried, based on the query product vectors corresponding to the M data to be queried in the data group to be queried, an anonymous query request carrying the query product vectors corresponding to the M data to be queried is generated and 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] Refer to the following Figure 8 830 according to this embodiment of the present application is described. Figure 8 The electronic device 830 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0154] like Figure 8As shown, the electronic device 830 is in the form of a general electronic device. The components of the electronic device 830 may include but are not limited to: the at least one processor 831, the at least one memory 832, and a bus 833 connecting different system components (including the memory 832 and the processor 831).
[0155] 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 a local bus using any of a variety of bus architectures.
[0156] The memory 832 may include a readable medium in the form of a volatile memory, such as a random access memory (RAM) 8321 and / or a cache memory 8322 , and may further include a read-only memory (ROM) 8323 .
[0157] The memory 832 may also include a program / utility 8325 having a set (at least one) of program modules 8324, such 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 or some combination may include an implementation of a network environment.
[0158] The electronic device 830 may also communicate with one or more external devices 834 (e.g., keyboards, pointing devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 830, and / or communicate with any device that enables the electronic device 830 to communicate with one or more other electronic devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 835. Furthermore, the electronic device 830 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 836. As shown, the network adapter 836 communicates with other modules for the electronic device 830 via a bus 833. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 830, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0159] In some embodiments, a computer-readable storage medium including instructions is also provided, such as a memory 832 including instructions, and the instructions can be executed by the processor 831 of the above device to complete the above method. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0160] In some embodiments, a computer program product is also provided, including a computer program / instruction, which, when executed by the processor 831, implements any of the data anonymization query methods provided in the present application.
[0161] In some embodiments, various aspects of a data anonymity query method provided by the present application may also be implemented in the form of a program product, which includes a program code. When the program product is run on a computer device, the program code is used to enable the computer device to execute the steps of a data anonymity query method according to various exemplary embodiments of the present application described above in this specification.
[0162] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with 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 thereof.
[0163] The program product for data anonymization query of the embodiment 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. In this document, the readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0164] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, wherein readable program code is carried. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the foregoing. A readable signal medium may also be any readable medium other than a readable storage medium, which may transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0165] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0166] The program code for performing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and also conventional procedural programming languages such as language or similar programming languages. The program code can be executed entirely on the user electronic device, partially on the user device, as an independent software package, partially on the user electronic device and partially on the remote electronic device, or completely on the remote electronic device or server. In the case of a remote electronic device, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0167] It should be noted that, although several units or subunits of the device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more units described above can be embodied in one unit. Conversely, the features and functions of one unit described above can be further divided into multiple units to be embodied.
[0168] In addition, although the operations of the method of the present application are described in a specific order in the drawings, this does not require or imply that the operations must be performed in this specific order, or that all the operations shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0169] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0170] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable image scaling device to produce a machine, so that the instructions executed by the processor of the computer or other programmable image scaling device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0171] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable image scaling device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, the instruction device being implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0172] These computer program instructions may also be loaded onto a computer or other programmable image scaling device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, whereby the instructions executed on the computer or other programmable device provide for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0173] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.
[0174] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data anonymization query method, characterized in that: The method comprises: Determine a query product vector corresponding to at least one piece of data to be queried based on a target matrix and at least one piece of data to be queried; the target matrix is generated by the data query party in a specified finite field; Sending an anonymous query request carrying the query product vector to a data provider to obtain a reference product vector and a comparison product vector; the reference product 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 data to be queried, and the reference matrix is generated by the data provider within 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; Based on the target product vector and the comparison product vector, a query answer for the at least one piece of data to be queried is determined; the query answer indicates whether there is reference data with the same content as the data to be queried.
2. The method according to claim 1, characterized in that The step of determining a query product vector corresponding to at least one piece of data to be queried based on the target matrix and at least one piece of data to be queried includes: Use a preset function algorithm to calculate each piece of data to be queried to obtain a query factor corresponding to each piece of data to be queried; For each piece of data to be queried, a query product vector corresponding to the data to be queried is determined 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 query party, and is used to enable the data provider to use the preset function algorithm to calculate each reference data to obtain the reference factor corresponding to each reference data, and to determine the reference product vector based on the product of the reference matrix and the reference factor.
3. The method according to claim 2, characterized in that The number of bytes in the query factor is consistent with the number of rows in 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 claim 2, characterized in that: The target matrix is generated in the following way: Generate a first primitive matrix in the specified finite field, and generate a first random number of a specified length based on the matrix size; The first primitive matrix is exponentially calculated 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 within the specified finite field, and the second primitive matrix is exponentially calculated using the second random number to obtain the reference matrix.
5. The method according to any one of claims 1 to 4, characterized in that: The data to be queried represents the predicted result of the answer to the target question; The query answer represents whether the answer prediction result is correct; The determining the query answer of the to-be-queried data based on the target product vector and the comparison product vector includes: If the target product vector is the same as the comparison product vector, it is determined that the prediction result of the answer to the target question of the query data is correct; Otherwise, it is determined that the prediction result of the answer to the target question of the to-be-queried data is wrong.
6. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: If the number of the data to be queried is greater than the number threshold, the at least one data to be queried is split into multiple 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, M≤the number threshold; Sending an anonymous query request carrying the query product vector to the data provider includes: For each data group to be queried, based on the query product vectors corresponding to the M data to be queried in the data group to be queried, an anonymous query request carrying the query product vectors corresponding to the M data to be queried is generated and sent to the data provider.
7. The method according to any one of claims 1 to 4, characterized in that: The preset function algorithm is: any one of a message authentication algorithm, a hash function algorithm and a compression function algorithm.
8. A data anonymization query device, characterized in that: The device comprises: The matrix configuration unit is configured to execute: determining a query product vector corresponding to at least one piece of data to be queried based on a target matrix and at least one piece of data to be queried; the target matrix is generated by a data query party in a specified finite field; The query request unit is configured to execute: sending a hidden query request carrying the query product vector to a data provider, and obtaining a reference product vector and a comparison product vector; the reference product 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 data to be queried, and the reference matrix is generated by the data provider within the specified finite field; the comparison product vector is determined based on the product of the reference matrix and the query product vector; A data processing unit is configured to perform: determining a target product vector based on the product of the target matrix and the reference product vector; The anonymous query unit is configured to execute: based on the target product vector and the comparison product vector, determine the query answer of the at least one piece of data to be queried; the query answer represents whether there is reference data with the same content as the data to be queried.
9. An electronic device, characterized in that: include: A memory for storing program instructions; A processor is used to call the program instructions stored in the memory, and execute the steps included in any one of claims 1-7 according to the obtained program instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a computer, the computer executes the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Hidden trace query method and device
CN114860735A
Hidden trace query method, device and system and storage medium
CN115688167A
Multi-party data processing method, system and equipment capable of protecting privacy
CN115834018A
Entity recognition method and device, entity recognition model training method and device, electronic equipment and storage medium
CN117371448A
Data hiding query method and device, electronic equipment and storage medium
CN118551122A
Cited By
Hidden trace query method, device and equipment, medium and product
CN121301432A