Privacy data processing method and computing device
By mapping the hash values of privacy data to vertices of an undirected graph and utilizing parallel processing of vertex degrees, the efficiency problem of the Cuckoo Hash algorithm in large-scale scenarios is solved, achieving efficient hash table construction and privacy data processing.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
- Filing Date
- 2025-10-30
- Publication Date
- 2026-05-07
AI Technical Summary
The Cuckoo Hash algorithm cannot be scaled in parallel in large-scale scenarios, resulting in low efficiency in processing private data.
The hash value of the privacy data is mapped to the vertices in the undirected graph. The hash value is determined by the degree of the vertex. Multi-threaded parallel processing of vertex degree and edge allocation is used to avoid hash collisions.
It improves the efficiency of determining the hash value of privacy data, reduces memory overhead, and reduces the occurrence of low-probability errors, thus achieving efficient construction of hash tables.
Smart Images

Figure CN2025131199_07052026_PF_FP_ABST
Abstract
Description
Privacy data processing methods and computing devices
[0001] This application claims priority to Chinese patent application filed on October 31, 2024, with application number 202411549423.9 and entitled "Privacy Data Processing Method and Computing Device", the entire contents of which are incorporated herein by reference. Technical Field
[0002] The embodiments in this specification belong to the field of data processing technology, and in particular relate to a privacy data processing method and computing device. Background Technology
[0003] The Cuckoo Hash algorithm is a dynamic hash algorithm used to dynamically maintain a hash table where each hash value corresponds to multiple data items. This allows it to be applied in various scenarios where privacy needs to be protected, such as calculating the intersection of private data and performing covert queries on databases. The main idea of the Cuckoo Hash algorithm is to distribute the hash values corresponding to data across multiple buckets to avoid hash collisions. Specifically, the Cuckoo Hash algorithm uses, for example, two hash functions h1(x) and h2(x) as two hash buckets T1 and T2. When inserting element x, if either T1[h1(x)] or T2[h2(x)] is empty, then x is inserted; if both are empty, either one is randomly selected for insertion; if both T1[h1(x)] and T2[h2(x)] are full, either one is randomly selected (assuming the element in that bucket is y), y is removed, and x is inserted. This process is then repeated to insert element y into the hash table. Inserting an element refers to mapping the hash value in the hash table to that element. This mapping can be done by storing the element and its hash value in a corresponding manner or by other methods, which essentially determines the hash value of the element in the hash table. Since the Cuckoo Hash algorithm described above is inherently a serial computation and cannot be directly extended to a parallel algorithm, it lacks scalability for large-scale scenarios. Summary of the Invention
[0004] The purpose of this invention is to provide a method for processing privacy data in order to improve the efficiency of processing privacy data.
[0005] This specification provides a privacy data processing method, comprising: obtaining n hash values corresponding to m privacy data, wherein the n hash values are obtained based on two hash functions, and each privacy data corresponds to two hash values among the n hash values; determining the degree of each vertex by mapping the n hash values to n vertices and mapping the edges between each privacy data and its corresponding vertex; and determining a first hash value of each privacy data in a hash table based on the degree of each vertex, wherein each first hash value is used as a data identifier for its corresponding privacy data.
[0006] A second aspect of this specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.
[0007] A third aspect of this specification provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method described in the first aspect.
[0008] In the scheme provided in the embodiments of this specification, by cleverly assigning the hash value of an element (i.e., privacy data) to a vertex in an undirected graph and the element itself to an edge between vertices in the undirected graph, the hash value of an element in the hash table can be determined based on the degree of each vertex. Multiple steps in this method can be performed in parallel, thereby improving the efficiency of determining the hash value of privacy data. Attached Figure Description
[0009] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0010] Figure 1 is a flowchart of a privacy data processing method according to an embodiment of this specification;
[0011] Figure 2 is a schematic diagram of the process of processing privacy data in the embodiments of this specification;
[0012] Figure 3 illustrates an example process in which the hash value of each piece of privacy data in the hash table is determined based on the degree of each vertex in an embodiment of this specification. Detailed Implementation
[0013] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.
[0014] To address the problems of the aforementioned cuckoo hash algorithm, this specification provides a privacy data processing method. This method cleverly uses the hash values of elements (i.e., privacy data) (i.e., cuckoo buckets) as vertices in an undirected graph, and the elements themselves as edges between vertices in the undirected graph. This allows the cuckoo hash table to be determined based on the degree of each vertex. Multiple steps in this method can be performed in parallel, such as determining the degree of each vertex and assigning edges to preset vertices at their endpoints. Therefore, this method can be multi-threaded, improving the efficiency of obtaining the cuckoo hash table.
[0015] Figure 1 is a flowchart of a privacy data processing method according to an embodiment of this specification. This method can be executed by the data owner's device. The data owner uses this method to assign hash values as data indexes to multiple privacy data sets they own, thereby enabling them to find the intersection of privacy data with other data owners based on each data index. Alternatively, the hash values of the privacy data and their corresponding data can be stored in a database, allowing for covert queries of the privacy data.
[0016] As shown in Figure 1, in step S101, n hash values corresponding to m private data are obtained.
[0017] The n hash values are obtained by calculating the hash values of m pieces of privacy data using two hash functions. Each piece of privacy data corresponds to two hash values out of the n hash values, and these m pieces of privacy data are distinct from each other. The two hash functions can be determined, for example, based on the MD5 hash algorithm or the SHA-256 hash algorithm. The output of MD5 (Message-Digest Algorithm 5) is a 128-bit (16-byte) hash value, typically represented as a 32-bit hexadecimal number. The output of SHA-256 (Secure Hash Algorithm 256-bit) is a 256-bit (32-byte) hash value, typically represented as 64 hexadecimal characters.
[0018] The two hash functions are, for example, h1() and h2(), which can be represented by the following formulas (1) and (2): h1()=SHA256(s1+x)%p+1 (1) h2()=SHA256(s2+x)%p+1 (2)
[0019] Where s1 and s2 are randomly generated random seeds, and the symbol % represents the modulo operation. From formulas (1) and (2), it can be concluded that the output range of hash functions h1() and h2() is from 1 to p.
[0020] m private data points, for example, x1, x2, ... x mUsing these two hash functions, we can calculate the two hash values for each piece of privacy data in turn, resulting in [h1(x1),h2(x1)], [h1(x2),h2(x2)], ..., [h1(x1),h2(x1)], ... ...1),h2(x1)], ..., [h1 m ),h2(x m If there are no duplicate values among these hash values, then n = 2m; if there are duplicate values, then n < 2m.
[0021] In step S103, the degree of each vertex is determined by mapping n hash values to n vertices and mapping privacy data to the edges between vertices.
[0022] Figure 2 is a schematic diagram of the process of processing privacy data in an embodiment of this specification. The left side of Figure 2 shows a schematic diagram of the process of determining the degree of each vertex. As shown in the upper left of Figure 2, each point labeled with the numbers 1, 2, ... 19 (hereinafter referred to as vertex 1, vertex 2, ... vertex 19) corresponds to 19 hash values, respectively labeled with x1, x2, ... x... 16 Each labeled edge corresponds to one of the 16 privacy data points; that is, in this example, m = 16 and n = 19.
[0023] The degree of each vertex can be calculated by iterating through the hash values corresponding to each piece of privacy data. Specifically, an initial table as shown in Table 1 can be drawn:
[0024] Table 1
[0025] In Table 1, vertices 1, 2, 3, etc., correspond to a hash value in the hash table to be generated. The degree of each vertex is the degree of its corresponding hash value, and the degree of each hash value is initially set to 0. It is understandable that the vertex identifier can also be set to be equal to its hash value, i.e., the hash value of vertex 1 is 1, the hash value of vertex 2 is 2, and so on. It is also understandable that the vertex identifier can be set to be different from its corresponding hash value. For example, the vertex identifier can be set to the range of 1 to 19. According to formulas (1) and (2) above, the range of the hash values of these 19 vertices is [1, p], where p = 2.14 * m = 2.14 * 16 ≈ 34.
[0026] When calculating the degree of each vertex, for example, first obtain two hash values h1(x1) and h2(x1) for privacy data x1. In Table 1, increment the degree of the vertex corresponding to each of these two hash values h1(x1) and h2(x1) by 1. Then obtain two hash values h1(x2) and h2(x2) for privacy data x2. In Table 1, increment the degree of the vertex corresponding to each of these two hash values h1(x2) and h2(x2) by 1. Continue this process until all privacy data has been processed. The degree of each vertex can then be obtained from the updated Table 1. The lower left of Figure 2 shows the final obtained degree of each vertex in the form of a histogram. This histogram corresponds to Table 2 below:
[0027] Table 2
[0028] It can be understood that the degree of each vertex is the number of edges connected to each vertex in the upper left of Figure 2. For example, in the upper left of Figure 2, vertices 1, 19, 11, 2, and 12 form a pentagonal ring. Each vertex in this ring connects to two edges. Therefore, the degree of vertices 1, 19, 11, 2, and 12 is 2. Vertices 3 and 14 are only vertices of one edge, so the degree of vertices 3 and 14 is 1. Vertex 10 is a common vertex of the three edges, so the degree of vertex 10 is 3.
[0029] The process of calculating the degree of each vertex described above can be parallelized. For example, k threads can be set up, and each thread can be assigned a portion of the privacy data from m privacy data sets. These k threads can then iterate through their assigned privacy data sets and update Table 1 in parallel, thus accelerating the calculation of the degree of each vertex through parallelization. For instance, with m equal to 16, four threads can be set up, and each thread can be assigned four privacy data sets.
[0030] However, during the parallelization process described above, some errors may be introduced with a low probability. Specifically, when each thread traverses the hash value of the privacy data, if thread 1 and thread 2 simultaneously increment the degree of vertex 1 in table 1, they might simultaneously read the current degree of vertex 1 as "0" and write "1" into the degree of vertex 1. Assuming thread 1 writes "1" first, thread 2 might still write "1" later without accumulating the already written "1". This problem can be solved by using read-write locks, but using read-write locks will lead to performance degradation, thus preventing parallelization from achieving its intended speed-up effect. To solve this problem, the multiple threads can perform multiple counts of the degree of each vertex, i.e., construct multiple histograms, and take the maximum value among all possible degrees of the same vertex in the multiple histograms as the degree of each vertex, thereby solving the problem of low-probability errors. Furthermore, in the multiple counts of the degree of each vertex performed by multiple threads, the privacy data allocated to each thread can be different in different counts.
[0031] The aforementioned method of multiple statistics requires storing the degree of each vertex in multiple statistics, which also increases memory overhead. In the embodiments of this specification, as described above, by using the hash functions h1 and h2 shown in the above formulas (1) and (2), the range of the output values of the hash functions h1 and h2 (i.e., the length of the hash table or hash bucket) is p, where p can be determined based on the empirical value 2.14 and the amount of privacy data m, for example, p = 2.14 * m or p can be set to a positive integer greater than 2.14 * m. By setting the value of p in this way, the degree of each vertex is highly likely to be less than 16. In this case, the degree of the vertex can be represented by 4 bits (i.e., half a byte), thereby reducing the memory overhead by half; in addition, it can be ensured that there will usually be no cross cycles in the vertex relationship graph corresponding to any m privacy data, where a cross cycle refers to a ring formed by vertices in an undirected graph that has a common vertex.
[0032] In step S105, the hash value of each piece of privacy data in the hash table is determined based on the degree of each vertex.
[0033] Figure 3 illustrates an example process in which the hash value of each piece of privacy data in the hash table is determined based on the degree of each vertex in an embodiment of this specification.
[0034] As shown in Figure 3, in step S31, for a vertex with a degree of 1, the privacy data corresponding to the edge connected to the vertex is assigned to the vertex, and the degrees of the two vertices of the edge are reduced by 1 respectively.
[0035] Referring to the left side of Figure 2 and Table 2, the m vertices include vertices of degree 1, degree 2, degree 3, etc. We can first operate on any one of the m vertices of degree 1, allocating the privacy data corresponding to the edge connected to that degree vertex to that degree vertex. That is, we determine the hash value of the privacy data corresponding to the edge connected to that degree vertex in the hash table as the hash value corresponding to that degree vertex, and simultaneously decrement the degree of both vertices on that edge by 1. For example, based on the order of the degree vertices recorded in Table 2, we can first allocate privacy data for vertex 3:
[0036] Assign the privacy data x6 corresponding to the edge connected to vertex 3 to vertex 3. That is, associate the data x6 with vertex 3 in the hash table and use the hash value corresponding to vertex 3 as the index (or identifier) of data x6. At the same time, decrement the degree of both vertices 3 and 14 of the edge corresponding to privacy data x6 by 1.
[0037] At this point, Table 2 can be updated to Table 3:
[0038] Table 3
[0039] And the hash table shown in Table 4 can be obtained:
[0040] Table 4
[0041] It is understood that the hash table shown in Table 4 is merely an example, and this specification is not limited to it. For example, in scenarios involving the intersection of privacy computations, 1 or 0 can be written into the data row, where 1 indicates the existence of the data and 0 indicates its non-existence, without needing to write the data itself. Furthermore, as mentioned above, this hash table should include p = 34 hash values, i.e., all the output values of the hash function. Some of these hash values do not correspond to the privacy data; Table 4 only shows the 19 hash values (vertices) that correspond to the privacy data.
[0042] Then, in step S32, it is determined whether there is a vertex of degree 1. If so, step S31 is executed again.
[0043] Specifically, according to Table 3, vertex 5 is determined to be a point of degree 1. Then, step S31 is executed to transfer the privacy data x corresponding to the edge connected to vertex 5. 15 Assign to vertex 5, and store privacy data x 15 The degree of the two vertices 5 and 10 of the corresponding edge is reduced by 1.
[0044] At this point, Table 3 can be updated to Table 5:
[0045] Table 5
[0046] And the hash table shown in Table 6 can be obtained:
[0047] Table 6
[0048] Then, steps S32 and S31 are executed repeatedly, and according to Table 5, the privacy data x corresponding to the edges connected to vertex 6 is... 11 Assign to vertex 6, and store privacy data x 11 The degree of the two vertices 6 and 7 of the corresponding edge is reduced by 1.
[0049] At this point, Table 5 can be updated to Table 7:
[0050] Table 7
[0051] And the hash table shown in Table 8 can be obtained:
[0052] Table 8
[0053] Then, continue to execute steps S32 and S31 in a loop, and according to Table 7, transfer the privacy data x corresponding to the edges connected to vertex 7. 12 Assign to vertex 7, and transfer privacy data x 12 The degree of the two vertices 7 and 13 of the corresponding edge is reduced by 1.
[0054] At this point, Table 7 can be updated to Table 9:
[0055] Table 9
[0056] And the hash table shown in Table 10 can be obtained:
[0057] Table 10
[0058] Similarly, by iteratively removing edges containing 1-degree vertices, as shown in the middle of Figure 2, the degree of all vertices in the relational graph of each vertex, except for those forming a loop, can be reduced to 0, and these vertices that become 0-degree are assigned a private data.
[0059] The above process can also be parallelized. For example, for the histogram corresponding to Table 2, the above processing can be performed on the points with a degree of 1 in Table 2 in parallel by multiple threads. In this parallelized processing, there is a small probability of errors. In one error case, if threads 1 and 2 process vertices 3 and 14 in parallel, the data x6 might be assigned to both vertices 3 and 4 simultaneously. If this occurs, the data x6 can be assigned to either vertex 3 or vertex 14. In another error case, for example, if threads 1 and 2 process vertices 5 and 8 in parallel, thereby decrementing the degree of vertex 10 by 1 in parallel, the degree of vertex 10 might be decremented by 1 less than intended. This would result in the degree of each vertex being either 0, equal to 2, or greater than 2 at the end of the process. For vertices with a degree greater than 2, or vertices other than those forming a cycle with a degree equal to 2, the error can be considered a low-probability error caused by parallelization. For the unallocated data corresponding to these vertices with a degree greater than or equal to 2, the histogram can be reconstructed for these data in a single thread, and the edges containing vertices with a degree of 1 can be removed in a single thread based on the reconstructed histogram, thereby obtaining the correct allocation of data in the hash table.
[0060] After completing the above process, as mentioned above, by setting p / m≥2.14 or its approximate range, the vertex relationship graph corresponding to any m private data will usually not have intersecting cycles. That is, the relationship graph of multiple vertices should only have independent cycles and independent vertices, or the relationship graph should only have independent vertices.
[0061] Optionally, the existence of vertices with a degree greater than 2 can be checked based on the current histogram. If such vertices exist, the algorithm can be terminated, and the above process can be re-executed using updated hash functions h3() and h4(). These updated hash functions, for example, use different hash seeds s3 and s4 compared to the initial two hash functions h1() and h2(). These hash seeds are randomly generated, specifically: h3() = SHA256(s3+x)%p+1 h4() = SHA256(s4+x)%p+1
[0062] If the check determines that there are no vertices with a degree greater than 2 in the histogram, step S33 can be executed to determine whether there are vertices with a degree of 2.
[0063] If there are no vertices of degree 2 in the histogram, the algorithm can be terminated, which means that the allocation of each piece of privacy data in the hash table is complete.
[0064] In the case of vertices with a degree of 2 in the histogram, as shown in the middle of Figure 2, independent cycles exist in the relationship graph of each vertex. Therefore, step S34 can be executed: for the multiple vertices forming the cycle, each edge in the cycle is assigned to a vertex at a predetermined end of the cycle. For example, the privacy data corresponding to each edge in the cycle can be consistently assigned to either the left or right vertex. Thus, as shown on the right side of Figure 2, all m privacy data points have been assigned to the vertices to the left or right of their corresponding edges, and the degree of each vertex is zero. This ensures that the privacy data is assigned to a hash value in a hash table, avoiding hash collisions.
[0065] In the privacy data processing scheme of the embodiments of this specification, by mapping the hash values corresponding to multiple privacy data to vertices and mapping the privacy data to the edges between vertices, the hash value of the privacy data in the hash table can be determined based on the degree of each vertex. Compared with the existing hash table generation algorithms, this scheme can be executed in parallel, thereby improving the efficiency of data processing.
[0066] The methods for processing privacy data in the embodiments of this specification can be used in scenarios such as calculating the intersection of privacy data and performing hidden queries on data in a database.
[0067] In the scenario of calculating the intersection of privacy data, assume that participant A and participant B each hold their own privacy data set {S}. A and {S} B Participant A and Participant B may each perform the following operations:
[0068] The method shown in Figure 1 uses two hash functions (e.g., h1() and h2()) to insert each element in its private data set into a specific position in the hash table;
[0069] The data in the Cuckoo Hash Table is encrypted using a preset encryption method (such as isomorphic encryption), generating an encrypted hash table. This encryption operation ensures that participants A and B cannot access each other's data content, but can compare or match based on the ciphertext data.
[0070] Then, for example, participant A can send its encrypted hash table to participant B. Participant B can compare its encrypted hash table with participant A's encrypted hash table. If the ciphertext data at the same position in the two encrypted hash tables is equal, the element corresponding to that position can be determined to be the intersection element.
[0071] In scenarios involving concealed queries on data in a database, the database can store the hash values of fields (such as user ID and username) and their corresponding data. The field hash values are determined based on the method shown in Figure 1 in this embodiment. When a user queries the database, they can determine the hash value corresponding to the query field using the method shown in Figure 1 in this embodiment, and then query the database using that hash value. This allows them to retrieve the data corresponding to the field while concealing its specific meaning.
[0072] This specification provides a privacy data processing apparatus for performing the method shown in FIG1, the apparatus comprising:
[0073] The acquisition unit is used to acquire n hash values corresponding to m private data, wherein the n hash values are obtained based on two hash functions, and each private data corresponds to two hash values among the n hash values;
[0074] The determining unit is configured to determine the degree of each vertex by mapping the n hash values to n vertices and mapping the edges between each privacy data and its corresponding vertex; and to determine the first hash value of each privacy data in the hash table based on the degree of each vertex, wherein each first hash value is used as a data identifier for its corresponding privacy data.
[0075] In one embodiment, the determining unit is further configured to:
[0076] For a first vertex with a degree of 1, the first hash value of the first privacy data corresponding to the first edge connected to the first vertex is determined to be the hash value corresponding to the first vertex.
[0077] In one embodiment, the device further includes a degree processing unit for decrementing the degree of the first vertex and the second vertex connected to the first edge by 1.
[0078] In one embodiment, the device further includes:
[0079] The computing unit is used to calculate two hash values for each of the m private data using two hash functions, thereby obtaining n hash values corresponding to the m private data.
[0080] In one embodiment, the determining unit is further configured to:
[0081] The m pieces of privacy data are divided into multiple groups of privacy data;
[0082] The privacy data is processed in parallel as follows: For the k vertices corresponding to the privacy data, the privacy data is traversed to determine the degree of each of the k vertices.
[0083] In one embodiment, the determining unit is further configured to: process each set of privacy data in parallel multiple times as follows: for the k vertices corresponding to the set of privacy data, traverse the set of privacy data to determine the degree of each vertex among the k vertices; or perform the following operations multiple times: divide the m privacy data into multiple sets of privacy data; process each set of privacy data in parallel as follows: for the k vertices corresponding to the set of privacy data, traverse the set of privacy data to determine the degree of each vertex among the k vertices; and use the maximum value among the degrees of each vertex determined multiple times as the final degree of each vertex.
[0084] In one embodiment, the determining unit is further configured to:
[0085] For multiple first vertices with a degree of 1, the following processing is performed in parallel for each first vertex: the first hash value of the first privacy data corresponding to the first edge connected to the first vertex is determined to be the hash value corresponding to the first vertex, and the degree of the first vertex and the second vertex connected to the opposite end of the first edge are decremented by 1 respectively.
[0086] In one implementation, the ratio of the number of output values of the two hash functions to m is greater than or equal to a preset threshold. The determining unit is further configured to, in cases where there is no vertex with a degree of 1 and the current vertices include vertices with a degree greater than 2 or vertices other than those forming a cycle with a degree of 2, redetermine the degree of each vertex, and perform the following operations serially for each vertex based on the redetermined degree of each vertex: for a third vertex with a degree of 1, determine the first hash value of the second privacy data corresponding to the second edge connected to the third vertex as the hash value corresponding to the third vertex, and decrement the degree of the third vertex and the fourth vertex connected to the opposite end of the second edge by 1 respectively.
[0087] In one embodiment, the determining unit is further configured to: when there is no intersecting loop in the current vertex, for a plurality of fifth vertices constituting a loop, determine the first hash value of the third privacy data corresponding to each third edge in the loop as the hash value corresponding to the vertex at one end of the preset third edge.
[0088] In one embodiment, the apparatus includes a recording unit for recording the degree of each vertex using nibbles of data after the degree of each vertex has been determined.
[0089] In one implementation, the first hash value is used to perform a privacy intersection or a hidden query on the first privacy data.
[0090] This specification also provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method shown in FIG1.
[0091] This specification also provides a computing device, including a memory and a processor, wherein the memory stores executable code, and the processor executes the executable code to implement the method shown in FIG1.
[0092] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must also be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should also understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0093] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0094] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.
[0095] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes the elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.
[0096] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.
[0097] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in one or more blocks of the flowchart illustrations and / or one or more blocks of the block diagrams.
[0098] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means that implement the functions specified in one or more flowcharts and / or one or more block diagrams.
[0099] These computer program instructions may also be loaded onto a computer or other programmable data 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 one or more flowcharts and / or one or more block diagrams.
[0100] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0101] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0102] Computer-readable media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0103] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0104] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In a distributed computing environment, program modules can reside in local and remote computer storage media, including storage devices.
[0105] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0106] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of this specification. Various modifications and variations can be made to the one or more embodiments of this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.
Claims
1. A method for processing privacy data, comprising: Obtain n hash values corresponding to m private data points, wherein the n hash values are obtained based on two hash functions, and each private data point corresponds to two hash values among the n hash values; By mapping the n hash values to n vertices and mapping each piece of privacy data to the edges between them, the degree of each vertex is determined. Based on the degree of each vertex, the first hash value of each privacy data in the hash table is determined, wherein each first hash value is used as a data identifier for its corresponding privacy data.
2. The method according to claim 1, wherein determining the first hash value of each piece of privacy data in the hash table based on the degree of each vertex includes: For a first vertex with a degree of 1, the first hash value of the first privacy data corresponding to the first edge connected to the first vertex is determined to be the hash value corresponding to the first vertex.
3. The method according to claim 2, further comprising: The degree of the first vertex and the second vertex connected to the first edge are each reduced by 1.
4. The method according to claim 1, further comprising: For m pieces of privacy data, two hash functions are used to calculate two hash values for each piece of privacy data, resulting in n hash values corresponding to the m pieces of privacy data.
5. The method according to claim 1, wherein determining the degree of each vertex includes: The m pieces of privacy data are divided into multiple groups of privacy data; The privacy data is processed in parallel as follows: For the k vertices corresponding to the privacy data, the privacy data is traversed to determine the degree of each of the k vertices.
6. The method according to claim 5, wherein determining the degree of each vertex includes: The privacy data is processed in parallel multiple times as follows: For the k vertices corresponding to the privacy data, the privacy data is traversed to determine the degree of each vertex in the k vertices; Alternatively, the following operations can be performed multiple times: the m private data points are divided into multiple groups of private data; each group of private data is processed in parallel as follows: for the k vertices corresponding to the group of private data, the group of private data is traversed to determine the degree of each vertex in the group of k vertices; The maximum value among the degrees of each vertex determined multiple times is taken as the final degree of each vertex.
7. The method according to claim 6, wherein, The ratio of the number of output values of the two hash functions to m is greater than or equal to a preset threshold. The method also includes using half-byte data to record the degree of each vertex after determining the degree of each vertex.
8. The method according to claim 3, wherein for a first vertex with a degree of 1, determining the first hash value of the first privacy data corresponding to the first edge connected to the first vertex as the hash value corresponding to the first vertex, and decrementing the degree of the first vertex and the second vertex connected to the opposite end of the first edge by 1 respectively, comprises: For multiple first vertices with a degree of 1, the following processing is performed in parallel for each first vertex: the first hash value of the first privacy data corresponding to the first edge connected to the first vertex is determined to be the hash value corresponding to the first vertex, and the degree of the first vertex and the second vertex connected to the opposite end of the first edge are decremented by 1 respectively.
9. The method according to claim 8, wherein, The ratio of the number of output values of the two hash functions to m is greater than or equal to a preset threshold. The method further includes, in cases where it is determined that there is no vertex with a degree of 1, and the current vertex includes vertices with a degree greater than 2 or vertices other than those forming a cycle with a degree of 2, redetermining the degree of each vertex, and performing the following operations serially for each vertex based on the redetermined degree of each vertex: for a third vertex with a degree of 1, determining the first hash value of the second privacy data corresponding to the second edge connected to the third vertex as the hash value corresponding to the third vertex, and decrementing the degree of the third vertex and the fourth vertex connected to the opposite end of the second edge by 1 respectively.
10. The method of claim 9, further comprising: In the absence of intersecting cycles in the current vertices, for multiple fifth vertices forming a cycle, the first hash value of the third privacy data corresponding to each third edge in the cycle is determined to be the hash value corresponding to the vertex at a preset end of the third edge.
11. The method according to claim 1, wherein the first hash value is used to perform a privacy intersection or a hidden query on the first privacy data.
12. A computing device comprising a memory and a processor, wherein the memory stores executable code, and the processor, when executing the executable code, implements the method of any one of claims 1-11.
Citation Information
Patent Citations
Scalable-ot-based privacy set intersection method and device
CN113961961A
Efficient and extensible anti-collusion multi-party privacy set intersection method and device
CN117857028A
Private data processing method and computing device
CN119720266A
Window Blanking for Pan / Tilt / Zoom Camera
US20140152815A1