A system for supporting range cardinality query in multi-party data scenario with privacy protection

By constructing a Bloom filter and a linear count bit array in the encrypted state, combined with homomorphic encryption and a proxy server, the distributed range cardinality query problem for privacy protection in multi-party data scenarios is solved, achieving efficient and accurate independent node cardinality estimation while protecting the privacy of both the querying party and the data party.

CN123158673APending Publication Date: 2026-11-24XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611322318.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-28
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

In multi-party data scenarios, existing technologies struggle to achieve efficient and accurate distributed range cardinality queries while protecting the privacy of both the querying party and the data provider. This is especially true when datasets may overlap, as existing solutions cannot effectively protect the location information of the querying party and the original location data of the data provider.

Method used

By defining two independent families of uniform hash functions, a Bloom filter and a linear count bit array are constructed to generate public parameters and a private key for homomorphic encryption. These parameters are distributed to each data party using a proxy server. In the ciphertext state, range determination and linear count bit array encoding are performed. The encrypted linear count bit arrays of each data party are aggregated to output the cardinality estimate of independent nodes within the target range.

Benefits of technology

It achieves bidirectional privacy protection for both the queryer and the data provider in encrypted form, while reducing the impact of duplicate nodes on cardinality statistics, thus achieving efficient and accurate estimation of the cardinality of independent nodes in multi-party data scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123158673A_ABST
    Figure CN123158673A_ABST
Patent Text Reader

Abstract

This application discloses a range cardinality query system for multi-party data scenarios that supports privacy protection, comprising: defining two independent families of uniform hash functions to construct Bloom filters for the horizontal and vertical coordinates respectively, and agreeing on a global hash function to construct a linear count bit array; generating homomorphically encrypted public parameters and a private key, wherein the public parameters include two different ciphertext zeros; storing the private key, and distributing the public parameters, the two independent families of uniform hash functions, and the global hash function to each data party through a proxy server; determining the ciphertext range of the coordinate nodes of each data party according to the target range of the query party, and generating a ciphertext status flag for each coordinate node; encoding the coordinate nodes within the target range into an encrypted linear count bit array through the ciphertext status flag, aggregating the encrypted linear count bit arrays of each data party, and outputting the cardinality estimate of the independent nodes within the target range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to, but is not limited to, the field of computer technology, and in particular to a range cardinality query system for multi-party data scenarios that supports privacy protection. Background Technology

[0002] With the rapid development of Geographic Information System (GIS) technology and the widespread adoption of mobile internet and IoT devices, location-based services have deeply penetrated numerous fields such as urban management, transportation, logistics scheduling, and public health. Range cardinality lookup, as a core fundamental operation in spatial analysis, aims to quickly count and return the number of independent entities contained within a given geographic area, providing crucial data support for various decision-making tasks. In practical applications, the required geographic data is often stored in distributed data silos across multiple different data holders, thus giving rise to the distributed range cardinality lookup problem—which requires statistical analysis on the union of data from all data holders. However, such cross-organizational data collaboration scenarios pose significant challenges to privacy protection: the original location data of the data holders constitutes core business assets or sensitive personal information, and its leakage would cause incalculable losses; simultaneously, the target range submitted by the querying party itself constitutes query privacy that needs protection. Major global data protection regulations impose strict restrictions on the processing and circulation of such data, making the achievement of efficient and accurate distributed range cardinality lookup while protecting the privacy of both parties a pressing technical challenge.

[0003] To address the aforementioned needs, several distributed range cardinality statistics schemes have been proposed in existing technologies. One type of scheme focuses on protecting the privacy of data providers by sending the target range of the query to each data provider in plaintext. The data providers then locally filter and return the number of records falling within the range, finally obtaining the global result through simple summation. This type of scheme has high computational efficiency, but the query's location information is completely exposed to the data providers, failing to protect query privacy. Another type of scheme introduces strong encryption methods such as secure multi-party computation or homomorphic encryption, using secure comparison protocols to determine points and ranges in the encrypted state, theoretically protecting the privacy of both the query and data providers. Furthermore, some schemes employ differential privacy or random perturbation techniques to add noise to the statistical results to reduce the risk of privacy leakage. These schemes alleviate the privacy protection problem to some extent, but all implicitly rely on an assumption that is significantly inconsistent with reality: the datasets of each data provider do not overlap. Summary of the Invention

[0004] In view of this, embodiments of this application provide at least one range cardinality query system for multi-party data scenarios that supports privacy protection.

[0005] The technical solution of this application embodiment is implemented as follows: On the one hand, embodiments of this application provide a range cardinality query method for multi-party data scenarios that supports privacy protection, the method comprising: Two independent families of uniform hash functions are defined to construct Bloom filters for the x and y axes, respectively, and a global hash function is defined to construct a linear count bit group. Generate a public parameter and a private key for homomorphic encryption, wherein the public parameter includes two distinct ciphertext zeros; The private key is stored, and the public parameters, the two independent uniform hash function families, and the global hash function are distributed to each data party through a proxy server. Based on the target range of the querying party, the ciphertext range of the coordinate nodes of each data party is determined, and the ciphertext status flag of each coordinate node is generated. The coordinate nodes within the target range are encoded into an encrypted linear count array using ciphertext status flags. The encrypted linear count arrays from each data source are aggregated, and the cardinality estimate of the independent nodes within the target range is output.

[0006] On the other hand, embodiments of this application provide a range cardinality query system for multi-party data scenarios that supports privacy protection, the method comprising: The processing module defines two independent families of uniform hash functions to construct Bloom filters for the horizontal and vertical axes, respectively, and specifies a global hash function to construct a linear count bit group. Generate a public parameter and a private key for homomorphic encryption, wherein the public parameter includes two distinct ciphertext zeros; The private key is stored, and the public parameters, the two independent uniform hash function families, and the global hash function are distributed to each data party through a proxy server. The query module is used to determine the ciphertext range of the coordinate nodes of each data party based on the target range of the query party, and generate the ciphertext status flag of each coordinate node. The coordinate nodes within the target range are encoded into an encrypted linear count array using ciphertext status flags. The encrypted linear count arrays from each data source are aggregated, and the cardinality estimate of the independent nodes within the target range is output.

[0007] In another aspect, embodiments of this application provide a computer device, including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method for range cardinality lookup in multi-party data scenarios that supports privacy protection.

[0008] In another aspect, embodiments of this application provide a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method for range cardinality lookup in a multi-party data scenario that supports privacy protection.

[0009] In another aspect, embodiments of this application provide a computer program including computer-readable code. When the computer-readable code is run in a computer device, the processor in the computer device executes some or all of the steps in the above-described method for range cardinality query in a multi-party data scenario that supports privacy protection.

[0010] In another aspect, embodiments of this application provide a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-mentioned method for range cardinality query in multi-party data scenarios that supports privacy protection.

[0011] This application embodiment defines a family of uniform hash functions and a global hash function, generates a homomorphic encryption key and distributes public parameters, completes range determination and linear count bit array encoding in ciphertext state, and then achieves bilateral privacy protection for the target range of the query party and the coordinate data of the data party through homomorphic aggregation and randomization processing. At the same time, it reduces the impact of duplicate nodes on cardinality statistics, and achieves the effect of efficiently and accurately estimating the cardinality of independent nodes in multi-party data scenarios.

[0012] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and are not intended to limit the technical solutions of this application. Attached Figure Description

[0013] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with this application and, together with the specification, serve to explain the technical solutions of this application.

[0014] Figure 1 A schematic diagram illustrating the implementation process of a range cardinality query method in a multi-party data scenario that supports privacy protection, provided in an embodiment of this application; Figure 2 This application provides a schematic diagram of the composition structure of a range cardinality query system in a multi-party data scenario that supports privacy protection, as provided in an embodiment of the present application. Figure 3 This is a schematic diagram of the hardware entity of a computer device provided in an embodiment of this application. Detailed Implementation

[0015] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application are further described in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0016] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0017] The terms “first / second / third” are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that “first / second / third” may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains. The terminology used herein is for descriptive purposes only and is not intended to be limiting of this application.

[0019] This application provides a method for range cardinality lookup in a multi-party data scenario that supports privacy protection. This method can be executed by the processor of a computer device. The computer device can refer to a server, laptop, tablet, desktop computer, smart TV, set-top box, mobile device (such as a mobile phone, portable video player, personal digital assistant, dedicated messaging device, portable gaming device), or other similar computer equipment. Figure 1 This application provides a schematic diagram illustrating the implementation process of a range cardinality query method in a privacy-preserving multi-party data scenario, as illustrated in the embodiments of this application. Figure 1 As shown, the method includes: Step 101: Define two independent families of uniform hash functions to construct Bloom filters for the horizontal and vertical axes, respectively, and agree on a global hash function to construct a linear count bit group.

[0020] In this embodiment, the uniform hash function family is a set of hash functions that uniformly map input values ​​to a fixed range of output values. The uniformity ensures that each output position has an equal probability of being selected, avoiding deviations caused by mapping conflicts. A Bloom filter is a probabilistic data structure that maps elements into a bit array using multiple hash functions, used to quickly determine whether an element belongs to a set. A linear counting bit array is a bit array of fixed length used to estimate the number of independent elements in a set by counting the number of zero-value counters. A global hash function is a single, uniformly agreed-upon hash function used to map coordinate nodes to specific positions in the linear counting bit array.

[0021] Two independent families of uniform hash functions are defined: one family is dedicated to constructing Bloom filters for the x-axis, and the other family is dedicated to constructing Bloom filters for the y-axis. Each family contains multiple independent uniform hash functions. A global hash function is also agreed upon, which is used to map the value of each coordinate node to a specific position in the linear count array during subsequent construction. These hash functions are exposed to all data providers and query providers, ensuring that all parties can use the same mapping rules in subsequent operations, thereby supporting consistent processing of multi-party data.

[0022] Step 102: Generate homomorphic encryption public parameters and a private key, wherein the public parameters include two distinct ciphertext zeros.

[0023] In this embodiment, the querying party is the entity that initiates the range cardinality query request, holds the target range information, and ultimately obtains the query result. Homomorphic encryption is an encryption technique that supports direct addition or multiplication operations on ciphertext, and the decrypted result is consistent with the plaintext operation result. Public parameters are publicly disclosed configuration information in the homomorphic encryption algorithm, used by all participants for encryption and ciphertext calculation. The private key is the decryption key secretly stored in the homomorphic encryption algorithm, held only by the querying party. Ciphertext zero is the ciphertext form generated after homomorphically encrypting the plaintext value zero; two different ciphertext zeros are used for subsequent ciphertext determination operations on the horizontal and vertical axes, respectively.

[0024] The querying party generates public parameters and a private key according to the requirements of the homomorphic encryption algorithm. The public parameters contain two distinct ciphertext zeros, which correspond to the encryption baseline values ​​of the x and y axes, respectively. After generating these parameters locally, the querying party prepares the public parameters for distribution, while the private key is kept secret and not disclosed. The generated public parameters and private key form the basis of the cryptographic calculation, ensuring that all subsequent ciphertext operations can be performed while protecting data privacy.

[0025] Step 103: Save the private key and distribute the public parameters, the two independent uniform hash function families, and the global hash function to each data party through a proxy server.

[0026] In this embodiment, the proxy server is an intermediary node responsible for forwarding and aggregating data. It does not hold a private key and only performs specified ciphertext operations and distribution tasks. Data parties are entities that hold coordinate node data; each data party has an independent set of nodes and participates in range determination and cardinality calculation processes. Distribution is the operation of passing public parameters and hash function information to each data party, ensuring that all participants receive a consistent configuration.

[0027] The querying party stores the generated private key in local secure storage for subsequent decryption of the aggregated results. The querying party distributes the public parameters, two independent families of uniform hash functions, and the global hash function to all data parties through a proxy server. The proxy server, acting as an intermediary node, receives the querying party's distribution request and forwards these parameters and function information to each data party. Upon receiving the information, each data party uses the same parameters and hash function for subsequent ciphertext range determination and linear counter array construction, ensuring operational consistency and comparability of results.

[0028] Step 104: Determine the ciphertext range of the coordinate nodes of each data party according to the target range of the query party, and generate the ciphertext status flag of each coordinate node.

[0029] In this embodiment, the target range is a rectangular area specified by the querying party, defined by a horizontal coordinate interval and a vertical coordinate interval, used to filter coordinate nodes falling within this range. A coordinate node is specific location data held by the data provider, represented in horizontal and vertical coordinate form. The ciphertext range determination is the process of judging whether a coordinate node falls within the target range while in an encrypted state, without exposing the plaintext coordinates or range boundaries. The ciphertext status flag is a ciphertext value used to identify whether a coordinate node is within the target range; subsequent operations rely on this flag for encoding.

[0030] Based on the queryer's target range, it is quantized into x-coordinate and y-coordinate intervals. Two families of uniform hash functions are used to construct Bloom filters for the x-coordinate and y-coordinate respectively, mapping integers within the interval to their corresponding positions and setting them to 1. Homomorphic encryption is then performed to generate ciphertext Bloom filters. The proxy server sends these ciphertext Bloom filters to each data party. Each data party calculates the hash position for each coordinate node using the same family of hash functions, extracts the ciphertext value for the corresponding position from the ciphertext Bloom filter, performs homomorphic multiplication to obtain the ciphertext determination results for the x-coordinate and y-coordinate, and then performs homomorphic multiplication on these two results to generate the ciphertext status flag for that node. Throughout the entire process, the data party's coordinate nodes and target range are processed in ciphertext state, and plaintext information is not exposed.

[0031] Step 105: Encode the coordinate nodes within the target range into an encrypted linear count bit array using the encrypted status flag, aggregate the encrypted linear count bit arrays of each data party, and output the cardinality estimate of the independent nodes within the target range.

[0032] In this embodiment, the encrypted linear counting bit array is a bit array of fixed length, with each position initialized to ciphertext zero. It is used to map and update the distribution of coordinate nodes. Aggregation involves performing homomorphic addition on each position of the encrypted linear counting bit arrays from multiple data parties, merging them into a unified bit array. The cardinality estimate of independent nodes is calculated using a linear counting algorithm; it is an approximation of the number of non-repeating coordinate nodes within the target range, reflecting the total number of independent entities within the range.

[0033] Each data party initializes a linear counter array of fixed length, with each position initialized to ciphertext zero. For each coordinate node, the data party calculates its hash position using a global hash function and updates the corresponding position based on the node's ciphertext status flag. If the ciphertext status flag indicates the node is within the target range, the ciphertext value at that position is incremented by 1; otherwise, it remains unchanged. After processing all nodes, each data party obtains an encrypted linear counter array and sends it to the proxy server. The proxy server performs homomorphic addition aggregation on each position of the encrypted linear counter array of each data party, generating an aggregated ciphertext bit array. Subsequently, the proxy server randomly shuffles the positions of the aggregated ciphertext bit array and independently generates a random non-zero integer for each position, performs homomorphic multiplication for masking, and then sends the processed bit array to the query party. The query party uses its private key to decrypt the plaintext bit array, counts the number of counters with a value of 0, and calculates the cardinality estimate of the independent nodes within the target range according to the formula of the linear counter estimator.

[0034] This application embodiment defines a family of uniform hash functions and a global hash function, generates a homomorphic encryption key and distributes public parameters, completes range determination and linear count bit array encoding in ciphertext state, and then achieves bilateral privacy protection for the target range of the query party and the coordinate data of the data party through homomorphic aggregation and randomization processing. At the same time, it reduces the impact of duplicate nodes on cardinality statistics, and achieves the effect of efficiently and accurately estimating the cardinality of independent nodes in multi-party data scenarios.

[0035] Optionally, step 104 includes: Step 1041: Quantize the target range into horizontal and vertical coordinate intervals, and establish horizontal and vertical Bloom filters with preset lengths respectively.

[0036] In this embodiment, the target range is a geographical area specified by the querying party. This area is defined by the boundary values ​​of the horizontal and vertical coordinates, which are used to limit the spatial range of subsequent queries. Quantization is the process of converting continuous coordinate values ​​into integer values ​​according to a preset precision, where the preset precision is a pre-determined coordinate transformation granularity. The horizontal coordinate interval is the set of integer values ​​of the target range along the horizontal axis, and the vertical coordinate interval is the set of integer values ​​of the target range along the vertical axis. A Bloom filter is a probabilistic data structure used to efficiently determine whether an element belongs to a certain set. The horizontal coordinate Bloom filter is dedicated to storing integer value information of the horizontal coordinate interval, and the vertical coordinate Bloom filter is dedicated to storing integer value information of the vertical coordinate interval. The preset length is the size of the bit array determined during the initialization of the Bloom filter.

[0037] After receiving the target range submitted by the querying party, the target range is quantized according to a preset precision. Specifically, the x-coordinate boundary values ​​and y-coordinate boundary values ​​of the target range are converted into integer forms, thus obtaining the x-coordinate interval and y-coordinate interval. Then, two Bloom filters are initialized according to preset lengths, one for the x-coordinate interval and the other for the y-coordinate interval. Each Bloom filter contains a bit array of preset length, with all positions of the bit array initialized to zero values ​​to prepare for subsequent mapping operations.

[0038] Step 1042: Using the two independent families of uniform hash functions, the integers in the horizontal coordinate interval and the vertical coordinate interval are mapped to the horizontal coordinate Bloom filter and the vertical coordinate Bloom filter, and the mapped position is set to the first value to obtain the horizontal coordinate binarized Bloom filter and the vertical coordinate binarized Bloom filter.

[0039] In this embodiment, a uniform hash function family is a set of hash functions, each of which uniformly maps the input value to the position index of the Bloom filter. Two independent uniform hash function families mean that the horizontal and vertical coordinates use different sets of hash functions, and there is no correlation between the two sets of functions. The integer is the quantized coordinate value. Mapping is the process of calculating the position index of the bit array from the integer through the hash function. The first value is the flag value in the Bloom filter that indicates the existence of the element, usually 1. The binarized Bloom filter is a Bloom filter that contains only zero values ​​or the first value at all positions after mapping.

[0040] The hash function family corresponding to the horizontal axis is invoked, and hash calculations are performed sequentially on each integer within the horizontal axis range. Each integer is processed by multiple hash functions to obtain multiple position indices. The positions corresponding to these position indices in the horizontal axis Bloom filter are then set to the first value. Simultaneously, the hash function family corresponding to the vertical axis is invoked, and the same hash calculation and position setting operations are performed on each integer within the vertical axis range, completing the mapping in the vertical axis Bloom filter. After the above processing, all positions in the horizontal and vertical axis Bloom filters contain only zero values ​​or the first value, resulting in a horizontal axis binarized Bloom filter and a vertical axis binarized Bloom filter. These two filters completely store the set of integer values ​​for the target range in the horizontal and vertical axes, respectively.

[0041] Step 1043: Homomorphic encryption is performed on the binarized Bloom filter for the horizontal axis and the binarized Bloom filter for the vertical axis to obtain the ciphertext Bloom filter for the horizontal axis and the ciphertext Bloom filter for the vertical axis, and then sent to each data party through the proxy server.

[0042] In this embodiment, homomorphic encryption is an encryption technique that allows operations such as addition or multiplication to be performed directly in ciphertext, and the result of the operation is consistent with the result of the operation in plaintext after decryption; the horizontal axis ciphertext Bloom filter is the ciphertext form of the horizontal axis binarized Bloom filter after homomorphic encryption, and the vertical axis ciphertext Bloom filter is the ciphertext form of the vertical axis binarized Bloom filter after homomorphic encryption; the proxy server is an intermediary node responsible for forwarding data, used to isolate direct communication between the query party and the data party.

[0043] Using the homomorphic encryption public parameters generated during the parameter initialization phase, a homomorphic encryption operation is performed on each position value in the horizontal axis binarized Bloom filter, converting each plaintext value into a ciphertext value, thus generating a horizontal axis ciphertext Bloom filter. The same homomorphic encryption operation is performed on the vertical axis binarized Bloom filter, generating a vertical axis ciphertext Bloom filter. Both the horizontal and vertical axis ciphertext Bloom filters are sent to the proxy server, which then distributes these ciphertext filters to all data parties participating in the query, ensuring that each data party receives the query request without knowing the plaintext boundaries of the target range.

[0044] This application embodiment transforms the queryer's target range into a ciphertext Bloom filter through three stages of processing: quantization, hash mapping, and homomorphic encryption. This filter is then securely distributed to the data provider. By replacing the traditional secure comparison operation with a set membership test mechanism for the Bloom filter, the technical effect of significantly reducing the computational overhead of range queries and protecting the privacy of the queryer's target range is achieved.

[0045] Optionally, step 104 further includes: Step 201: For the x-coordinate of any node in any data set, use one of the two independent uniform hash function families to calculate multiple first hash positions of the x-coordinate of the node.

[0046] In this embodiment, a node is a specific spatial location record held by the data provider, such as the coordinates of a user; the x-coordinate is the horizontal coordinate value of the node in two-dimensional space; the two independent clusters of uniform hash functions are two sets of unrelated sets, each containing multiple uniformly distributed hash functions, each set used to map coordinate values ​​in different dimensions; a cluster of hash functions is a set of hash functions used for mapping in a specific dimension; multiple first hash positions are multiple index values ​​obtained by calculating the x-coordinate value using each hash function in the cluster.

[0047] For any node in any data source, extract the x-coordinate value of that node, and then select the corresponding cluster of hash functions from two independent uniform hash function families. This cluster contains multiple hash functions. Use each hash function in the cluster to map and calculate the x-coordinate value to obtain multiple first hash positions. These positions are used to find the corresponding ciphertext value in the ciphertext Bloom filter of the x-coordinate in the subsequent process.

[0048] Step 202: Obtain multiple ciphertext bit values ​​corresponding to the multiple first hash positions from the horizontal coordinate ciphertext Bloom filter, and perform homomorphic multiplication on the multiple ciphertext bit values ​​to obtain the horizontal coordinate ciphertext determination result.

[0049] In this embodiment, the horizontal coordinate ciphertext Bloom filter is an encrypted data structure generated by the querying party to store the integer mapping results within the target horizontal coordinate range, with each position storing a ciphertext bit value; multiple ciphertext bit values ​​are encrypted values ​​stored at multiple first hash positions in the Bloom filter; homomorphic multiplication is a multiplication operation performed in ciphertext state, and the result of the operation is equivalent to the result of plaintext multiplication after decryption; the horizontal coordinate ciphertext determination result is the ciphertext value obtained after homomorphic multiplication operation, used to indicate whether the horizontal coordinate is within the target range.

[0050] Based on the calculated first hash positions, the corresponding ciphertext bit values ​​are extracted one by one from the ciphertext Bloom filter of the horizontal coordinate. Then, a homomorphic multiplication operation is performed on these ciphertext bit values. This operation multiplies multiple values ​​in the ciphertext state to obtain a ciphertext result, namely the ciphertext determination result of the horizontal coordinate. If the result is zero after decryption, it means that the horizontal coordinate is not within the target range. If it is non-zero, it means that it is within the range.

[0051] Step 203: For the ordinate of any node, use one of the hash functions of the two independent uniform hash function families corresponding to the ordinate to calculate multiple second hash positions of the ordinate of any node.

[0052] In this embodiment, the ordinate is the vertical coordinate value of a node in two-dimensional space; the cluster of hash functions corresponding to the ordinate is another set of hash functions used to map the ordinate value in two independent uniform hash function families; the multiple second hash positions are multiple index values ​​obtained after the ordinate value is calculated by each hash function in the cluster.

[0053] For the ordinate value of the same node, select the corresponding hash function from two independent uniform hash function families. This family contains multiple hash functions. Use each hash function in the family to map and calculate the ordinate value to obtain multiple second hash positions. These positions are used to find the corresponding ciphertext value in the ciphertext Bloom filter of the ordinate later.

[0054] Step 204: Obtain multiple ciphertext bit values ​​corresponding to the multiple second hash positions from the ciphertext Bloom filter of the vertical coordinate, and perform homomorphic multiplication on the multiple ciphertext bit values ​​to obtain the ciphertext determination result of the vertical coordinate.

[0055] In this embodiment, the y-coordinate ciphertext Bloom filter is an encrypted data structure generated by the querying party to store the integer mapping results within the target y-coordinate range. Each position stores a ciphertext bit value. The y-coordinate ciphertext determination result is a ciphertext value obtained after homomorphic multiplication, which is used to indicate whether the y-coordinate is within the target range.

[0056] Based on the calculated second hash positions, the corresponding ciphertext bit values ​​are extracted one by one from the ciphertext Bloom filter of the ordinate. Then, a homomorphic multiplication operation is performed on these ciphertext bit values. This operation multiplies multiple values ​​in the ciphertext state to obtain a ciphertext result, namely the ciphertext determination result of the ordinate. If the result is zero after decryption, it means that the ordinate is not within the target range. If it is non-zero, it means that it is within the range.

[0057] Step 205: Perform homomorphic multiplication on the ciphertext determination results of the horizontal coordinate and the ciphertext determination results of the vertical coordinate to generate the ciphertext state flag of any node.

[0058] In this embodiment of the application, the ciphertext status flag is an encrypted value used to indicate whether a node completely falls within the target range, and its value is either zero or non-zero after decryption.

[0059] The ciphertext determination results of the horizontal and vertical axes are subjected to homomorphic multiplication. This operation multiplies the two determination results in the ciphertext state to generate a final ciphertext value, which is the ciphertext state flag. If the flag is zero after decryption, it means that the node is not within the target range; if it is non-zero, it means that the node is within the target range. Throughout the process, the determination information of the horizontal and vertical axes is processed in ciphertext form without exposing any plaintext data.

[0060] This application embodiment uses a Bloom filter to transform coordinate range determination into hash location verification and homomorphic multiplication in encrypted state, avoiding computationally intensive operations such as security comparison, thus reducing the computational overhead of privacy protection range query, while ensuring bidirectional privacy protection for both the queryer's target range and the data provider's node coordinates.

[0061] Optionally, after step 205, the method further includes: Step 206: When the x-coordinate of any node is within the x-coordinate interval and the y-coordinate of any node is within the y-coordinate interval, the ciphertext status flag of any node is the first encrypted value.

[0062] In this embodiment, the horizontal coordinate is the coordinate value of the node along the horizontal direction in the two-dimensional coordinate system, representing the projection of the node's position onto the horizontal axis; the vertical coordinate is the coordinate value of the node along the vertical direction in the two-dimensional coordinate system, representing the projection of the node's position onto the vertical axis; the horizontal coordinate interval is a continuous integer range on the horizontal axis of the target range set by the querying party, used to limit the allowed values ​​of the horizontal coordinate; the vertical coordinate interval is a continuous integer range on the vertical axis of the target range set by the querying party, used to limit the allowed values ​​of the vertical coordinate; the ciphertext status flag is an encrypted binary value indicating whether the node is within the target range, and this value exists in ciphertext form to protect the node's position information and the query range information; the first value is a plaintext value representing a logical truth value, which is used to identify whether the node is within the target range after encryption.

[0063] Obtain the x-coordinate and y-coordinate of any node, and compare the x-coordinate with the x-coordinate interval, and simultaneously compare the y-coordinate with the y-coordinate interval. When both the x-coordinate and y-coordinate fall within the x-coordinate interval, the node is determined to be completely within the target range. At this point, the corresponding ciphertext status flag of the node is set to the first encrypted value. This first value represents a logical truth value in the plaintext domain. The encrypted ciphertext status flag is used for the bit array update operation in the subsequent cardinality calculation sub-operation. By determining the interval assignment results of the x-coordinate and y-coordinate, the range assignment of the node is confirmed in the ciphertext state without exposing the node's plaintext coordinates and the query range boundary.

[0064] Step 207: When the x-coordinate of any node is not within the x-coordinate interval or the y-coordinate of any node is not within the y-coordinate interval, the ciphertext status flag of any node is the encrypted second value, and the encrypted second value is the same as either of the two different ciphertext zeros.

[0065] In this embodiment, the second value is a plaintext value representing a logical false value, which is used to identify that the node is not within the target range after encryption; the two different ciphertext zeros are homomorphic encrypted ciphertexts generated by the query party during the parameter initialization phase, which are used to represent the encrypted value zero. One is used for the construction of the Bloom filter in the range query sub-sub ...

[0066] Obtain the x-coordinate and y-coordinate of any node, and compare the x-coordinate with the x-coordinate interval, and the y-coordinate with the y-coordinate interval. If either the x-coordinate or y-coordinate does not fall within the x-coordinate interval, meaning at least one coordinate does not meet the interval condition, the node is determined not to be completely within the target range. In this case, the ciphertext status flag corresponding to the node is set to an encrypted second value, which represents a logical false value in the plaintext domain. Either ciphertext zero is selected from two different ciphertext zeros as the encrypted second value, ensuring that the ciphertext status flag matches the ciphertext zero in the ciphertext domain. This prevents the bit array update operation in the subsequent cardinality calculation from changing the zero value state of the bit array. This method ensures that nodes not falling within the target range do not affect the final cardinality estimation result, while protecting the privacy information of node coordinates and the query range.

[0067] This application embodiment achieves bidirectional privacy protection for both the query range and data node coordinates by setting a ciphertext status flag, thus accurately filtering nodes within the target range without disclosing sensitive information. By setting the flag of nodes that do not fall within the range to ciphertext zero, interference from invalid nodes to subsequent cardinality calculations is avoided, thereby reducing computational redundancy and improving the accuracy of cardinality estimation.

[0068] Optionally, step 105 includes: Step 1051: Each data party initializes a linear counting bit array of a preset length, and uses the common parameter to encrypt each position of the linear counting bit array into either of the two different ciphertext zeros, thus obtaining an initial encrypted linear counting bit array.

[0069] In this embodiment, the data party is an independent entity holding coordinate node information, such as multiple travel platforms or logistics platforms; the linear counter bit array is a data structure used for cardinality estimation, consisting of multiple counter positions, each position recording the number of nodes mapped to that position; the common parameter is the homomorphic encryption parameter generated by the query party, containing two different ciphertext zeros; the ciphertext zero is the result of homomorphically encrypting the plaintext value zero, used as the initial state for ciphertext operations.

[0070] The length of the linear counting bit array is determined to be a preset number of bits. Each data party initializes a bit array of this length locally, with all positions initialized to plaintext value zero. Using the homomorphic encryption algorithm in the common parameters, each position in the bit array is encrypted with either of two different ciphertext zeros, thus placing each position in an encrypted state, forming the initial encrypted linear counting bit array. It is ensured that each position is initialized with either ciphertext zero so that subsequent ciphertext operations can be performed correctly.

[0071] Step 1052: For each node in each data party, use the global hash function to calculate the third hash position corresponding to the coordinates of each node, and use the ciphertext state flag of each node to update the ciphertext value corresponding to the third hash position in the initial encrypted linear counter array according to homomorphic addition, so as to obtain the encrypted linear counter array of each data party.

[0072] In this embodiment, a node is a coordinate record held by the data provider, such as the spatial location of a user or resource; the global hash function is a pre-defined hash function used to map coordinates to positions in a bit array; the third hash position is the bit array index obtained after the coordinates are calculated by the global hash function; and the ciphertext status flag is an encrypted value indicating whether the node is within the target range, calculated through homomorphic multiplication.

[0073] For each node in each data square, calculate the hash value of the node's coordinates using a global hash function to obtain the third hash position. Check the node's ciphertext status flag, which indicates whether the node is within the target range. Using homomorphic addition, add the ciphertext value corresponding to the ciphertext status flag to the third hash position of the initial encrypted linear counter bit array, updating the ciphertext value at that position. Repeat this operation for all nodes in the data square, mapping each node to the corresponding position and updating it, ultimately obtaining the encrypted linear counter bit array for that data square.

[0074] Step 1053: Each data party sends its encrypted linear counter bit array to the proxy server.

[0075] In this embodiment, the proxy server is an intermediary entity responsible for aggregating data, coordinating multi-party data interaction and protecting the privacy of all parties; the encrypted linear counter bit array is a ciphertext bit array after node mapping and updating, containing the encoded information of nodes within the target range.

[0076] After each data party completes the construction of its encrypted linear counter bit array, it sends this array to the proxy server via a secure communication channel. The proxy server receives the encrypted linear counter bit arrays from all data parties, preparing for subsequent aggregation processing. During this process, the data parties do not disclose plaintext coordinate information, and the proxy server processes the data only in encrypted form.

[0077] This application embodiment achieves the effect of efficiently encoding node information within the target range in ciphertext state and supporting secure aggregation of multi-party data by initializing an encrypted linear counter array, mapping nodes using a global hash function and updating ciphertext values, and sending the encrypted array to a proxy server, thus laying the foundation for subsequent deduplication cardinality estimation.

[0078] Optionally, step 105 further includes: Step 301: Receive the encrypted linear count bit arrays sent by all data parties, and perform homomorphic addition aggregation on each identical position of all encrypted linear count bit arrays to obtain an aggregated ciphertext bit array.

[0079] In this embodiment, the data party is an entity holding coordinate node data, such as multiple travel platforms or logistics platforms; the encrypted linear counter bit array is a ciphertext bit array of length L generated locally by each data party, where each position stores an encrypted counter value to record the number of nodes mapped to that position; homomorphic addition aggregation is to perform an addition operation on multiple ciphertext values ​​so that the decrypted result is equal to the sum of the plaintext values ​​without exposing any plaintext; the aggregated ciphertext bit array is a ciphertext array of length L obtained by adding the encrypted linear counter bit arrays of all data parties position by position.

[0080] The system receives encrypted linear counting bit arrays sent over the network by all data parties. Each array has a length of L, and all positions are in ciphertext. Position-by-position processing is performed on all received arrays. For the first position, a homomorphic addition operation is performed on the first ciphertext values ​​of all arrays to obtain the first position value of the aggregated ciphertext bit array; for the second position, the same operation is performed on the second ciphertext values ​​of all arrays to obtain the second position value, and so on, until all L positions have been processed. After homomorphic aggregation of all positions, a complete aggregated ciphertext bit array is generated. Each position value in this array reflects the total number of nodes mapped to that position from all data parties. The entire process is completed in ciphertext, without exposing any plaintext node information from any data party.

[0081] Step 302: Randomly shuffle the position order of the aggregated ciphertext bit array to obtain a randomly permuted aggregated ciphertext bit array.

[0082] In this embodiment of the application, random shuffling is to rearrange the order of each position in the aggregated ciphertext bit array randomly. For example, the ciphertext value originally located at the 1st position is moved to the 5th position, and the ciphertext value at the 2nd position is moved to the Lth position. The aggregated ciphertext bit array is the position-by-position homomorphic addition aggregation result obtained in step 301. The aggregated ciphertext bit array after random permutation is the ciphertext array after the order shuffling process. The content of each position is the same as the original aggregated ciphertext bit array but the order is different.

[0083] A random permutation operation is performed on the aggregated ciphertext bit array generated in step 301, producing a random permutation sequence of length L. This sequence determines the new position index for each original position. Following this random permutation sequence, the ciphertext value at each position in the aggregated ciphertext bit array is moved to the new position, resulting in the randomly permuted aggregated ciphertext bit array. This operation severs the association between the position index and the coordinate hash position, preventing the subsequent receiver from associating a specific position in the bit array with a specific coordinate hash value, thereby reducing the risk of inferring specific node information based on the decryption result.

[0084] Step 303: Generate a random non-zero integer independently for each position in the randomly permuted aggregated ciphertext bit array, and perform homomorphic multiplication between the ciphertext value at each position and the corresponding random non-zero integer to obtain the final aggregated ciphertext bit array.

[0085] In this embodiment, the aggregated ciphertext bit array after random permutation is the ciphertext array obtained by shuffling the order in step 302; the random non-zero integer is a non-zero random value generated independently for each position, for example, the value 3 is generated for the first position and the value 7 is generated for the second position; homomorphic multiplication is the multiplication operation performed on the ciphertext value and the random non-zero integer, so that the decrypted result is equal to the product of the plaintext value and the random non-zero integer; the final aggregated ciphertext bit array is the ciphertext array after being processed by the random non-zero integer mask.

[0086] For each position in the aggregated ciphertext bit array after random permutation, an independent random non-zero integer is generated. These random non-zero integers are independent of each other and all are non-zero. Homomorphic multiplication is performed on the ciphertext value at each position with the corresponding random non-zero integer. For example, the ciphertext value at position 1 is multiplied by the first random non-zero integer, the ciphertext value at position 2 is multiplied by the second random non-zero integer, and so on, until all L positions have been processed. After completing the homomorphic multiplication for all positions, the final aggregated ciphertext bit array is obtained. The ciphertext values ​​at empty positions in this array remain zero after processing, while the ciphertext values ​​at non-zero positions are independently randomized. Neither the random permutation nor the independent non-zero mask changes the number of zero-value positions, thus not affecting the accuracy of subsequent cardinality estimation.

[0087] Step 304: Send the final aggregated ciphertext bit array to the querying party.

[0088] In this embodiment, the final aggregated ciphertext bit array is a ciphertext array processed by random permutation and random non-zero integer masking; the querying party is an entity that initiates a range cardinality query, such as a user who needs to count the number of vehicles in a specific area, or who holds a homomorphic encryption private key.

[0089] The final aggregated ciphertext bit array generated in step 303 is sent to the querying party securely via the network. After receiving the ciphertext array, the querying party uses its stored homomorphic encryption private key to decrypt the array to obtain the plaintext bit array, counts the number of counters with a value of 0, and then calculates the cardinality estimate of the independent nodes within the target range according to the principle of the linear counting estimator.

[0090] This application embodiment achieves the technical effect of deduplicating cardinality estimation in scenarios with overlapping data from multiple parties while protecting the privacy of both the data parties and the query party. This is achieved by receiving encrypted linear counter arrays from all data parties, performing homomorphic addition aggregation, randomly permuting and masking the aggregation results, and finally sending them to the query party.

[0091] Optionally, step 105 further includes: Step 401: Use the private key to decrypt the final aggregated ciphertext bit array to obtain the plaintext bit array.

[0092] In this embodiment, the private key is a key generated and secretly stored by the querying party in the parameter initialization sub-key. It is used to decrypt the ciphertext data generated by homomorphic encryption. The private key is held only by the querying party and cannot be accessed by other data parties or the proxy server. The final aggregated ciphertext bit array is the ciphertext result generated by the proxy server after performing homomorphic addition aggregation, random scrambling, and random non-zero masking on the encrypted linear count bit arrays of each data party. This array has a fixed length of L, and each position stores a ciphertext value representing the node count information mapped to that position by all data parties. The plaintext bit array is a readable array obtained after decrypting the private key. It has a length of L, and each position stores a plaintext integer, reflecting the counter value of each position after aggregation.

[0093] The querying party receives the final aggregated ciphertext bit array sent by the proxy server. This array is processed by homomorphic addition aggregation and two lightweight transformations. The querying party uses its private key locally to perform homomorphic decryption on each ciphertext value in the final aggregated ciphertext bit array. The decryption process is performed position by position, converting each ciphertext value into the corresponding plaintext integer, resulting in a plaintext bit array. The value at each position in this plaintext bit array represents the number of nodes in all data parties that are mapped to that position. After decryption, the querying party obtains the complete plaintext bit array for subsequent statistics.

[0094] Step 402: Count the number of counters with a value of zero in the plaintext bit array.

[0095] In this embodiment, the plaintext bit array is a readable array obtained through decryption, with a length of L, and each position stores a plaintext integer. The counter is the value at each position in the plaintext bit array, representing the number of nodes mapped to that position. The number of counters with a value of zero is the total number of positions in the plaintext bit array with a value of 0; this number is used for the cardinality calculation of the linear counting estimator, and a zero-value position represents that no node is mapped to that position.

[0096] Iterate through all L positions of the plaintext bit array, checking the counter value of each position one by one. When the counter value is equal to 0, record that position as a zero-value counter. After the iteration is completed, accumulate the number of all zero-value counters to obtain the number Z of counters with zero values. This statistical process does not involve any ciphertext operations and is performed directly in plaintext state. The statistical result Z is used as the input parameter of the subsequent cardinality estimation formula.

[0097] Step 403: Based on the length of the plaintext bit array and the number of counters with zero values, calculate the estimated number of independent nodes within the target range using a preset basis estimation formula.

[0098] In this embodiment, the length of the plaintext bit array is a fixed size of the decrypted array, denoted as L. This length is determined during the parameter initialization phase and is shared by all data providers and query providers. The number of zero-valued counters is the number of zero-valued locations obtained statistically, denoted as Z. The preset basis estimation formula is a mathematical expression based on a linear counting estimator, namely n = -L ln(Z / L), where n represents the estimated cardinality of independent nodes. This formula calculates the maximum likelihood estimate of the actual number of independent nodes using the proportion of zero-valued nodes. The target range is a rectangular area formed by the horizontal and vertical coordinate intervals specified by the query provider, used to filter data provider nodes.

[0099] Obtain the length L of the plaintext bit array and the number of zero-value counters Z obtained from the step statistics. Substitute L and Z into the preset basis estimation formula to calculate the ratio Z / L, which represents the proportion of zero-value positions in the bit array. Take the natural logarithm of this ratio and then multiply the result by the negative value of L to obtain the cardinality estimate n of the independent nodes. This estimate represents the number of independent nodes on the union of all data in the target range. Output this estimate as the final query result. This result completes the deduplication statistics while protecting the privacy of the query party and the data party.

[0100] This application embodiment decrypts the final aggregated ciphertext bit array using a private key, counts the number of zero-value counters, and calculates the cardinality using a linear counting estimation formula. This achieves the deduplication estimation of the cardinality of independent nodes after multi-party data aggregation in the ciphertext state. It achieves the effect of protecting the privacy of the target range of the query party and the data privacy of the data party nodes, while reducing the statistical error of duplicate nodes and outputting accurate cardinality estimates.

[0101] Based on the foregoing embodiments, this application provides a range cardinality query system for multi-party data scenarios that supports privacy protection. The system includes various units and modules included in each unit, which can be implemented by a processor in a computer device; of course, it can also be implemented by specific logic circuits. In the implementation process, the processor can be a central processing unit (CPU), a microprocessor unit (MPU), a digital signal processor (DSP), or a field-programmable gate array (FPGA), etc.

[0102] Figure 2 This application provides a schematic diagram of the composition structure of a range cardinality query system in a multi-party data scenario that supports privacy protection, as shown in the embodiments of this application. Figure 2 As shown, the range cardinality query system 50 supporting privacy protection in multi-party data scenarios includes: Processing module 501 is used to define two independent families of uniform hash functions to construct Bloom filters for the horizontal and vertical axes respectively, and to define a global hash function for constructing linear count bit groups; Generate a public parameter and a private key for homomorphic encryption, wherein the public parameter includes two distinct ciphertext zeros; The private key is stored, and the public parameters, the two independent uniform hash function families, and the global hash function are distributed to each data party through a proxy server. The query module 502 is used to determine the ciphertext range of the coordinate nodes of each data party according to the target range of the query party, and generate the ciphertext status flag of each coordinate node. The coordinate nodes within the target range are encoded into an encrypted linear count array using ciphertext status flags. The encrypted linear count arrays from each data source are aggregated, and the cardinality estimate of the independent nodes within the target range is output.

[0103] Optionally, the query module 502 is further configured to: The target range is quantified into horizontal and vertical coordinate intervals, and horizontal and vertical Bloom filters with preset lengths are established respectively. The two independent families of uniform hash functions are used to map the integers in the horizontal coordinate interval and the vertical coordinate interval to the horizontal coordinate Bloom filter and the vertical coordinate Bloom filter, and the mapping position is set to the first value to obtain the horizontal coordinate binarized Bloom filter and the vertical coordinate binarized Bloom filter. Homomorphic encryption is performed on the binarized Bloom filter for the horizontal axis and the binarized Bloom filter for the vertical axis to obtain ciphertext Bloom filters for the horizontal axis and vertical axis, which are then sent to the respective data parties via the proxy server.

[0104] Optionally, the query module 502 is further configured to: For the x-coordinate of any node in any data square, use one of the two independent uniform hash function families corresponding to the x-coordinate to calculate multiple first hash positions of the x-coordinate of the node. Multiple ciphertext bit values ​​corresponding to the multiple first hash positions are obtained from the ciphertext Bloom filter of the horizontal coordinate, and homomorphic multiplication is performed on the multiple ciphertext bit values ​​to obtain the ciphertext determination result of the horizontal coordinate. For the ordinate of any node, use one of the two independent uniform hash function families to calculate multiple second hash positions of the ordinate of any node. Multiple ciphertext bit values ​​corresponding to the multiple second hash positions are obtained from the ciphertext Bloom filter of the vertical coordinate, and homomorphic multiplication is performed on the multiple ciphertext bit values ​​to obtain the ciphertext determination result of the vertical coordinate. Perform a homomorphic multiplication on the ciphertext determination results of the horizontal axis and the vertical axis to generate the ciphertext state flag of any node.

[0105] Optionally, the query module 502 is further configured to: Each data party initializes a linear counting bit array of a preset length, and uses the common parameters to encrypt each position of the linear counting bit array into either of the two different ciphertext zeros, thus obtaining an initial encrypted linear counting bit array; For each node in each data side, the global hash function is used to calculate the third hash position corresponding to the coordinates of each node, and the ciphertext value corresponding to the third hash position in the initial encrypted linear counter array is updated using homomorphic addition with the ciphertext state flag of each node to obtain the encrypted linear counter array of each data side; Each data party sends an encrypted linear counter array of each data party to the proxy server.

[0106] Optionally, the query module 502 is further configured to: Receive the encrypted linear count bit arrays sent by all data parties, and perform homomorphic addition aggregation on each identical position of all encrypted linear count bit arrays to obtain an aggregated ciphertext bit array; The order of each position in the aggregated ciphertext bit array is randomly shuffled to obtain a randomly permuted aggregated ciphertext bit array; For each position in the aggregated ciphertext bit array after random permutation, generate a random non-zero integer independently, and perform homomorphic multiplication between the ciphertext value at each position and the corresponding random non-zero integer to obtain the final aggregated ciphertext bit array; The final aggregated ciphertext bit array is sent to the querying party.

[0107] Optionally, the query module 502 is further configured to: The final aggregated ciphertext bit array is decrypted using the private key to obtain the plaintext bit array; Count the number of counters with a value of zero in the plaintext bit array; Based on the length of the plaintext bit array and the number of counters with zero values, the estimated number of independent nodes within the target range is calculated using a preset basis estimation formula.

[0108] Optionally, the query module 502 is further configured to: When the x-coordinate of any node is within the x-coordinate interval and the y-coordinate of any node is within the y-coordinate interval, the ciphertext status flag of any node is the first encrypted value. When the x-coordinate of any node is not within the x-coordinate interval or the y-coordinate of any node is not within the y-coordinate interval, the ciphertext status flag of any node is the encrypted second value, and the encrypted second value is the same as either of the two different ciphertext zeros.

[0109] This application embodiment defines a family of uniform hash functions and a global hash function, generates a homomorphic encryption key and distributes public parameters, completes range determination and linear count bit array encoding in ciphertext state, and then achieves bilateral privacy protection for the target range of the query party and the coordinate data of the data party through homomorphic aggregation and randomization processing. At the same time, it reduces the impact of duplicate nodes on cardinality statistics, and achieves the effect of efficiently and accurately estimating the cardinality of independent nodes in multi-party data scenarios.

[0110] The descriptions of the system embodiments above are similar to those of the method embodiments above, and have similar beneficial effects. In some embodiments, the functions or modules included in the system provided by this application can be used to execute the methods described in the method embodiments above. For technical details not disclosed in the system embodiments of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0111] It should be noted that, in the embodiments of this application, if the above-mentioned range cardinality query method for supporting privacy protection in multi-party data scenarios is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application, or the part that contributes to the related technology, can be embodied in the form of a software product. This software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, mobile hard drives, read-only memory (ROM), magnetic disks, or optical disks. Thus, the embodiments of this application are not limited to any specific hardware, software, or firmware, or any combination of hardware, software, and firmware.

[0112] This application provides a computer device including a memory and a processor. The memory stores a computer program that can run on the processor. When the processor executes the program, it implements some or all of the steps in the above-described method.

[0113] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements some or all of the steps in the above-described method. The computer-readable storage medium can be transient or non-transient.

[0114] This application provides a computer program including computer-readable code, wherein when the computer-readable code is executed in a computer device, a processor in the computer device performs some or all of the steps in the above-described method.

[0115] This application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program. When the computer program is read and executed by a computer, it implements some or all of the steps in the above-described method. This computer program product can be implemented specifically through hardware, software, or a combination thereof. In some embodiments, the computer program product is specifically embodied as a computer storage medium; in other embodiments, the computer program product is specifically embodied as a software product, such as a software development kit (SDK), etc.

[0116] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between them, while their similarities or commonalities can be referred to interchangeably. The descriptions of the above embodiments of the device, storage medium, computer program, and computer program product are similar to the descriptions of the above method embodiments and have similar beneficial effects. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the descriptions of the method embodiments of this application for understanding.

[0117] It should be noted that, Figure 3 This is a schematic diagram of a hardware entity of a computer device in an embodiment of this application, such as... Figure 3 As shown, the hardware entity of the computer device 700 includes: one or more processors 701, a communication interface 702, and a memory 703, wherein: Processor 701 typically controls the overall operation of computer device 700.

[0118] Communication interface 702 enables computer devices to communicate with other terminals or servers over a network.

[0119] The memory 703 is configured to store instructions and applications executable by the processor 701, and can also cache data to be processed or already processed (e.g., image data, audio data, voice communication data, and video communication data) in the processor 701 and various modules in the computer device 700. It can be implemented using flash memory or random access memory (RAM). Data transfer between the processor 701, the communication interface 702, and the memory 703 can be performed via bus 704. Only one processor is shown in the figure; each processor 701 includes one or more cores.

[0120] It should be noted that the computer device may include multiple processors 701, and each processor 701 can interact with each other through aggregated communication methods such as all-to-all, all-gather, or all-reduce. The processors 701 may be central processing units (CPUs), graphics processing units (GPUs), embedded neural network processing units (NPUs), tensor processing units (TPUs), data processing units (DPUs), accelerated processing units (APUs), floating-point processing units (FPUs), or application-specific integrated circuits (ASICs). The processors may also be single-core or multi-core processors. The processor may consist of a CPU and hardware chips. The hardware chips may be ASICs, PLDs, or combinations thereof. The PLDs may be complex programmable logic devices (CPLDs), FPGAs, generic array logic (GALs), or any combination thereof. The processor can also be implemented using logic devices with built-in processing logic, such as FPGAs or digital signal processors (DSPs).

[0121] The communication interface 702 can be a wired interface or a wireless interface, used to communicate with other modules or devices. The wired interface can be an Ethernet interface, a local interconnect network (LIN), etc., and the wireless interface can be a cellular network interface or a wireless LAN interface, etc.

[0122] Memory 703 can be non-volatile memory, such as read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), or flash memory. Memory 703 can also be volatile memory, which can be random access memory (RAM) used as an external cache. By way of example, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synclink dynamic random access memory (SLDRAM), and direct rambus RAM (DRRAM), direct rambus DRAM (DRDRAM), and rambus DRAM.

[0123] The 704 bus can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus can be divided into address bus, data bus, control bus, etc.

[0124] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of this application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. It should be understood that in the various embodiments of this application, the sequence numbers of the above steps / processes do not imply a sequential order of execution; the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application. The sequence numbers of the above embodiments of this application are merely descriptive and do not represent the superiority or inferiority of the embodiments.

[0125] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system 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, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0126] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0127] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0128] In addition, each functional unit in the various embodiments of this application can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0129] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the above method embodiments. The aforementioned storage medium includes various media that can store program code, such as mobile storage devices, read-only memory (ROM), magnetic disks, or optical disks.

[0130] Alternatively, if the integrated units described above are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, or the part that contributes to related technologies, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, magnetic disks, or optical disks.

[0131] The above description is merely an embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.

Claims

1. A method for range cardinality query in multi-party data scenarios supporting privacy protection, characterized in that, The method includes: Two independent families of uniform hash functions are defined to construct Bloom filters for the x and y axes, respectively, and a global hash function is defined to construct a linear count bit group. Generate a public parameter and a private key for homomorphic encryption, wherein the public parameter includes two distinct ciphertext zeros; The private key is stored, and the public parameters, the two independent uniform hash function families, and the global hash function are distributed to each data party through a proxy server. Based on the target range of the querying party, the ciphertext range of the coordinate nodes of each data party is determined, and the ciphertext status flag of each coordinate node is generated. The coordinate nodes within the target range are encoded into an encrypted linear count array using ciphertext status flags. The encrypted linear count arrays from each data source are aggregated, and the cardinality estimate of the independent nodes within the target range is output.

2. The method according to claim 1, characterized in that, The step of determining the ciphertext range of each data node's coordinates based on the queryer's target range and generating a ciphertext status flag for each coordinate node includes: The target range is quantified into horizontal and vertical coordinate intervals, and horizontal and vertical Bloom filters with preset lengths are established respectively. The two independent families of uniform hash functions are used to map the integers in the horizontal coordinate interval and the vertical coordinate interval to the horizontal coordinate Bloom filter and the vertical coordinate Bloom filter, and the mapping position is set to the first value to obtain the horizontal coordinate binarized Bloom filter and the vertical coordinate binarized Bloom filter. Homomorphic encryption is performed on the binarized Bloom filter for the horizontal axis and the binarized Bloom filter for the vertical axis to obtain ciphertext Bloom filters for the horizontal axis and vertical axis, which are then sent to the respective data parties via the proxy server.

3. The method according to claim 2, characterized in that, The method further includes: For the x-coordinate of any node in any data square, use one of the two independent uniform hash function families corresponding to the x-coordinate to calculate multiple first hash positions of the x-coordinate of the node. Multiple ciphertext bit values ​​corresponding to the multiple first hash positions are obtained from the ciphertext Bloom filter of the horizontal coordinate, and homomorphic multiplication is performed on the multiple ciphertext bit values ​​to obtain the ciphertext determination result of the horizontal coordinate. For the ordinate of any node, use one of the two independent uniform hash function families to calculate multiple second hash positions of the ordinate of any node. Multiple ciphertext bit values ​​corresponding to the multiple second hash positions are obtained from the ciphertext Bloom filter of the vertical coordinate, and homomorphic multiplication is performed on the multiple ciphertext bit values ​​to obtain the ciphertext determination result of the vertical coordinate. Perform a homomorphic multiplication on the ciphertext determination results of the horizontal axis and the vertical axis to generate the ciphertext state flag of any node.

4. The method according to claim 3, characterized in that, The process of encoding the coordinate nodes within the target range into an encrypted linear count bit array using ciphertext status flags, aggregating the encrypted linear count bit arrays from each data source, and outputting the cardinality estimate of independent nodes within the target range includes: Each data party initializes a linear counting bit array of a preset length, and uses the common parameters to encrypt each position of the linear counting bit array into either of the two different ciphertext zeros, thus obtaining an initial encrypted linear counting bit array; For each node in each data side, the global hash function is used to calculate the third hash position corresponding to the coordinates of each node, and the ciphertext value corresponding to the third hash position in the initial encrypted linear counter array is updated using homomorphic addition with the ciphertext state flag of each node to obtain the encrypted linear counter array of each data side; Each data party sends an encrypted linear counter array of each data party to the proxy server.

5. The method according to claim 4, characterized in that, The method further includes: Receive the encrypted linear count bit arrays sent by all data parties, and perform homomorphic addition aggregation on each identical position of all encrypted linear count bit arrays to obtain an aggregated ciphertext bit array; The order of each position in the aggregated ciphertext bit array is randomly shuffled to obtain a randomly permuted aggregated ciphertext bit array; For each position in the aggregated ciphertext bit array after random permutation, generate a random non-zero integer independently, and perform homomorphic multiplication between the ciphertext value at each position and the corresponding random non-zero integer to obtain the final aggregated ciphertext bit array; The final aggregated ciphertext bit array is sent to the querying party.

6. The method according to claim 5, characterized in that, The method further includes: The final aggregated ciphertext bit array is decrypted using the private key to obtain the plaintext bit array; Count the number of counters with a value of zero in the plaintext bit array; Based on the length of the plaintext bit array and the number of counters with zero values, the estimated number of independent nodes within the target range is calculated using a preset basis estimation formula.

7. The method according to claim 3, characterized in that, After performing a homomorphic multiplication on the ciphertext determination results of the horizontal and vertical coordinates to generate the ciphertext state flag of any node, the method further includes: When the x-coordinate of any node is within the x-coordinate interval and the y-coordinate of any node is within the y-coordinate interval, the ciphertext status flag of any node is the first encrypted value. When the x-coordinate of any node is not within the x-coordinate interval or the y-coordinate of any node is not within the y-coordinate interval, the ciphertext status flag of any node is the encrypted second value, and the encrypted second value is the same as either of the two different ciphertext zeros.

8. A range cardinality query system for multi-party data scenarios supporting privacy protection, characterized in that, The system includes: The processing module defines two independent families of uniform hash functions to construct Bloom filters for the horizontal and vertical axes, respectively, and specifies a global hash function to construct a linear count bit group. Generate a public parameter and a private key for homomorphic encryption, wherein the public parameter includes two distinct ciphertext zeros; The private key is stored, and the public parameters, the two independent uniform hash function families, and the global hash function are distributed to each data party through a proxy server. The query module is used to determine the ciphertext range of the coordinate nodes of each data party based on the target range of the query party, and generate the ciphertext status flag of each coordinate node. The coordinate nodes within the target range are encoded into an encrypted linear count array using ciphertext status flags. The encrypted linear count arrays from each data source are aggregated, and the cardinality estimate of the independent nodes within the target range is output.

9. A computer device comprising a memory and a processor, the memory storing a computer program executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the range cardinality query method for multi-party data scenarios that supports privacy protection as described in any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the steps of the range cardinality query method for privacy-preserving multi-party data scenarios as described in any one of claims 1 to 7.