Method and device for querying frequent items in distributed stream based on data security

CN117520412BActive Publication Date: 2026-10-30XI AN JIAOTONG UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311504183.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-10
Publication Date
2026-10-30
Estimated Expiration
2043-11-10

AI Technical Summary

Technical Problem

本地化差分隐发明内容虽然能够对用户数据隐私提供严格的理论保证,但是由于每个用户都在数据流中添加噪声,导致最后的查询结果会累计大量噪声、效用降低

Benefits of technology

[0065]首先,本发明实施例的查询方法适用于真实世界中的分布式数据流场景,该方法通过采用数据流压缩表示算法,将数据流的频繁项信息近似保存在固定大小的sketch数据结构中,避免了计算和通信开销。这使得该方法能够适用于真实世界中的分布式数据流场景,减小了资源消耗。其次,通过用户-计算方模型,用户将数据的秘密份额发送给计算方,计算方基于拥有的份额进行计算。采用中心化差分隐私对查询结果进行保护,仅需添加一次噪声即可。相比本地化差分隐私每个用户都添加噪声的方法,减小了结果中的噪声量,提高了频繁项查询结果的准确性。另外,通过计算方验证用户发送的布尔份额位数,判断用户的原始计数值是否符合范围要求。这样可以在不揭露用户原始值的情况下,实现对用户数据合理性的验证。因此本发明提供的查询方法具有高效、准确、安全的特点,适用于真实世界中的分布式数据流场景,并具有广泛的应用价值。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117520412B_ABST
    Figure CN117520412B_ABST
Patent Text Reader

Abstract

The application provides a query method and device for frequent items in distributed stream based on data security. The method comprises the following steps: a plurality of users and a computing party jointly determine an encoding and decoding scheme; the plurality of users generate respective sketches and distributed noise; the users encode the count values in the sketches and calculate Boolean shares, and calculate arithmetic shares of elements in the sketches and the distributed noise; the users send the Boolean shares and the arithmetic shares to corresponding computing parties; the computing parties verify the respective held Boolean shares to obtain a user list corresponding to the verification passing; the computing parties convert the Boolean shares into arithmetic shares based on the user list, combine the sketches of the plurality of users, and combine secret shares of the noise provided by the plurality of users; and elements with count values greater than a threshold value in the combined sketch are output to obtain a query result. By using the query method of the application, the security of user data during transmission is ensured, and the ability of an enemy to deduce user data from the query result is limited.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing, and in particular to a method and apparatus for querying frequent items in a distributed stream based on data security. Background Technology

[0002] With the increasing computing and storage capabilities of mobile devices, more and more complex and diverse applications are being developed and deployed on mobile devices, such as online shopping apps and short video apps. Users generate a large amount of usage data when using these applications. For example, when users shop online, they generate a series of browsing history and order data streams; when users use navigation software, they generate personal location data streams. Data analysis and mining of these data streams will bring significant benefits. Frequent item queries are an important and widely used data analysis task. For example, in urban road planning, finding locations with high pedestrian traffic is beneficial for road design; in network management, finding elephant flows exceeding a certain threshold can be used for network congestion control and anomaly detection; in marketing, analyzing products with sales exceeding a certain threshold can help formulate marketing strategies. However, user-generated data streams contain users' personal information, and directly analyzing these data streams can lead to privacy issues. For example, user trajectory data streams can expose sensitive location information such as home addresses. Therefore, it is crucial to efficiently complete frequent item query tasks while protecting user privacy. However, current secure frequent item query methods still have some shortcomings. First, most of these methods assume that users possess single data points, while in the real world, user-generated data is often in the form of data streams, making traditional methods inapplicable to practical scenarios. Second, most of these methods are based on localized differential privacy, where users add noise to their data locally before uploading it to an untrusted third party, which then aggregates the user-sent data and queries for frequent items. While localized differential privacy provides a strict theoretical guarantee for user data privacy, the accumulation of noise by each user in the data stream leads to a significant accumulation of noise in the final query results, reducing utility. Finally, to combat malicious data uploads, these methods employ zero-knowledge proofs to verify the legitimacy of user-sent data; however, zero-knowledge proofs incur additional computational and communication overhead, resulting in reduced efficiency. Summary of the Invention

[0003] Therefore, existing technologies do not provide users with a secure and efficient frequent item query solution that is suitable for real-world data scenarios.

[0004] Therefore, embodiments of the present invention provide a method and apparatus for querying frequent items in a distributed stream based on data security, aiming to solve the problems existing in the background art.

[0005] To solve the above-mentioned technical problems, the present invention is implemented as follows:

[0006] In a first aspect, embodiments of the present invention provide a method for querying frequent items in a distributed stream based on data security, including:

[0007] Multiple users and multiple computing parties jointly determine the encoding and decoding schemes;

[0008] Multiple users process their respective local data streams to generate their own sketch data structures and their own local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values.

[0009] The user encodes the count values ​​in the sketch data structure according to the encoding scheme and calculates the Boolean share. In addition, the user performs Shamir secret sharing on the distributed noise in the user's local environment and the elements in the user's sketch data structure, and calculates the Shamir arithmetic share.

[0010] According to the secret sharing protocol, the user sends the Boolean share and the Shamir arithmetic share to the corresponding computing party;

[0011] The computing parties verify their respective Boolean shares to obtain a list of users who have passed the verification.

[0012] Based on the verified user list, the computing party uses the B2A protocol to convert the Boolean shares into Shamir arithmetic shares. At the same time, based on the encoding and decoding schemes and the shares held, the computing party identifies and obtains the sketch data structures of multiple users, then merges the sketch data structures of multiple users, merges the distributed noise provided by multiple users, and adds the merged distributed noise to the count values ​​in the merged sketch data structure.

[0013] The calculator outputs elements in the merged sketch data structure whose count value is greater than the threshold, and uses these elements as the query results for frequent items.

[0014] Optionally, the encoding scheme is used by the user to encode the count value, and the encoding scheme is determined through the following steps:

[0015] Multiple users and multiple computing parties jointly determine a reasonable range of data values;

[0016] Based on the range c, select and store a binary digit t, where the value of t should satisfy 2. t -1≤c<2 t+1 -1;

[0017] If c-(2) t If -1) = 0, then stop selecting and storing t, output the stored t in order, and obtain a list about t. This list is then used as the encoding scheme.

[0018] If c-(2) t -1)≠0, then let c=c-(2 t -1), repeat the selection and storage of t iteratively until c-(2) is satisfied. t -1) until 0.

[0019] Optionally, the user encodes the count value by following these steps:

[0020] The user subtracts the offset from the count value, where the offset is the minimum value within a reasonable range of values ​​for the data.

[0021] The user determines whether the count value is within the interval [0, ...]. Within ], t1 is the first bit in the encoding scheme:

[0022] If the count value is within the range, the user encodes the count value using t1 bits of binary code and pads the remaining bits of the encoded result with zeros.

[0023] If the count value is not within the range, the user sets all bits of t1 to 1 and subtracts the count value. As a new value, t2 is then used to process this new value, where t2 is the second bit in the encoding scheme;

[0024] Repeat the above steps until the count value is fully encoded.

[0025] Optionally, the decoding scheme includes the following steps:

[0026] The computer divides the bit string sent by the user into segments t1, t2, ..., t3. l The bit string is a binary string obtained by encoding data according to an encoding scheme, where l is the number of elements in the encoding scheme list;

[0027] The bit strings are converted into decimal numbers and added together, then the offset is added to obtain the original decoded value.

[0028] Optionally, the step of the multiple users processing their respective local data streams to generate their respective sketch data structures includes:

[0029] The user uses the Misra-Gries algorithm to define a sketch data structure of fixed size k;

[0030] For each element in the local data stream, perform the following operation:

[0031] Determine if the element exists in the sketch data structure. If it does, increment the corresponding count value of the element by 1.

[0032] If the element is not in the sketch data structure, then compare the number of elements in the current sketch data structure with k:

[0033] If the number of elements in the current sketch data structure is less than k, add the element to the sketch data structure and set its count value to 1;

[0034] When the number of elements in the current sketch data structure is equal to k, the count of all elements in the sketch data structure is decremented by 1. If the count of an element is 0, the element is deleted.

[0035] Optionally, the step of the user generating local distributed noise includes:

[0036] The user generates two k-dimensional random vectors locally, each of which follows a pOlya distribution with distribution parameters as follows: n is the number of users among the multiple users, and α represents the parameters of the polya distribution;

[0037] The subtraction of the two vectors is used as the user-generated local distributed noise.

[0038] Optionally, the step of the user encoding the count value in the sketch data structure and calculating the Boolean share includes:

[0039] The user selects the count value to be encoded;

[0040] For each encoded count value c, the user randomly selects m-1 random numbers r1, r2, ..., r of the same bit length. m-1 m is the number of computational methods among the plurality of computational methods;

[0041] calculate These random numbers and the calculated shares are sent to the corresponding calculator.

[0042] Optionally, the user performs Shamir secret sharing on the elements and distributed noise in the sketch data structure, and the step of calculating the Shamir arithmetic share includes:

[0043] For each value x to be shared, the user randomly selects β domain elements. in Representation domain;

[0044] Using the Lagrange interpolation formula, a polynomial f of degree β is generated by the β field elements x1,x2,...,xβ and the value x to be shared, satisfying x=f(0);

[0045] Substituting 1 to m into the polynomial f, the result is taken as the Shamir arithmetic share for each computational side.

[0046] Optionally, the steps for the computing parties to verify their respective Boolean shares and obtain the corresponding list of verified users include:

[0047] The calculator receives the Boolean share sent by the user;

[0048] The calculator observes whether the number of bits in each share matches the number of bits output by the coding scheme specification module. If it matches, the user is marked as an honest user; otherwise, all of the user's shares are discarded, and the user is marked as a malicious user.

[0049] The calculation team uses the list of honest users as the corresponding list of verified users.

[0050] Optionally, the step of merging the sketch data structures of multiple users includes:

[0051] The computer creates an empty sketch data structure of size 2k as a new sketch data structure;

[0052] The calculator evaluates each element in the sketch data structure for both users:

[0053] If the element exists in both sketch data structures, the counts of the element in the two sketch data structures are added together, and the result is saved to the new sketch data structure.

[0054] If an element exists in only one sketch data structure, then the element and its count value are saved to the new sketch data structure.

[0055] After processing all elements in the two users' sketch data structures, sort the elements in the new sketch data structure from largest to smallest according to their count values, and retain the first k elements.

[0056] Repeat the above steps until the sketch data structures of multiple users are completely merged pairwise. The final merged sketch data structure is then taken as the result of merging the sketch data structures of multiple users.

[0057] Optionally, the step of merging secret shares of noise provided by multiple users includes:

[0058] The calculator adds the secret shares of noise from multiple users to obtain the merged noise vector;

[0059] The computer adds the merged noise vector to the count value in the merged sketch data structure and discards elements with count values ​​less than the threshold.

[0060] Secondly, embodiments of the present invention provide a query device for frequent items in a distributed stream based on data security, comprising: an encoding scheme formulation module configured to execute multiple users and multiple computing parties to jointly determine the encoding scheme and the decoding scheme;

[0061] The user-local computing module is configured to process the local data streams of multiple users, generating their respective sketch data structures and local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values. Users encode the count values ​​in the sketch data structure according to an encoding scheme and calculate Boolean shares. They also perform Shamir secret sharing on the user-local distributed noise and the elements in the user's sketch data structure to calculate Shamir arithmetic shares. Users send the Boolean shares and Shamir arithmetic shares to the corresponding computing parties according to the secret sharing protocol.

[0062] The computational verification module is configured to perform computational verification of each party's Boolean share and obtain a list of users who have passed the verification.

[0063] The computation module is configured to perform the following: based on the verified user list, the computation module converts the Boolean shares of the verified users into Shamir arithmetic shares using the B2A protocol. Simultaneously, based on the encoding and decoding schemes and the shares held, the computation module identifies and obtains the sketch data structures of multiple users, then merges the sketch data structures of multiple users, and merges the distributed noise provided by multiple users. The merged distributed noise is then added to the count values ​​in the merged sketch data structure. The computation module outputs the elements in the merged sketch data structure whose count values ​​are greater than a threshold, and uses these elements as the query results for frequent items.

[0064] The technical solutions provided by the embodiments of this disclosure have at least the following beneficial effects:

[0065] First, the query method of this invention is applicable to real-world distributed data stream scenarios. This method employs a data stream compression representation algorithm to approximately store frequent item information of the data stream in a fixed-size sketch data structure, avoiding computational and communication overhead. This makes the method applicable to real-world distributed data stream scenarios and reduces resource consumption. Second, through a user-computer model, users send a secret share of their data to the computer, who then performs calculations based on their share. Centralized differential privacy is used to protect the query results, requiring only one noise addition. Compared to localized differential privacy, where noise is added for each user, this reduces the amount of noise in the results and improves the accuracy of frequent item query results. Furthermore, the computer verifies the number of Boolean share bits sent by the user to determine if the user's original count value meets the range requirements. This allows for verification of the user's data validity without revealing the original value. Therefore, the query method provided by this invention is efficient, accurate, and secure, applicable to real-world distributed data stream scenarios, and has broad application value. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0067] Figure 1 This is a flowchart of the overall method for querying frequent items in a distributed stream based on data security, as described in an embodiment of the present invention.

[0068] Figure 2 This is a flowchart of the coding scheme formulation module in an embodiment of the present invention;

[0069] Figure 3 This is a user coding flowchart in an embodiment of the present invention;

[0070] Figure 4 This is a flowchart of the decoding process in an embodiment of the present invention;

[0071] Figure 5 This is a flowchart of the user's local computing process in an embodiment of the present invention;

[0072] Figure 6 This is a flowchart of the calculation method verification in an embodiment of the present invention;

[0073] Figure 7 This is a flowchart of the calculation process in an embodiment of the present invention;

[0074] Figure 8This is a block diagram of a frequent item query device in a distributed stream based on data security, according to an embodiment of the present invention. Detailed Implementation

[0075] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0076] This invention provides a method for querying frequent items in a distributed stream based on data security. This method is applicable to data leakage prevention terminals set up between the requesting and responding ends. Application scenarios for this invention include frequent item query tasks in fields such as data analysis, marketing, urban construction, and network monitoring. In data analysis, frequent item querying is an important and widely used task. For example, in urban road planning, identifying locations with high pedestrian traffic is beneficial for road design; in network management, finding large flows exceeding a certain threshold can be used for network congestion control and anomaly detection; in marketing, analyzing products with sales exceeding a certain threshold can help in developing marketing strategies. The method of this invention can be applied to frequent item query tasks in these real-world scenarios. By using user data streams as input and setting a threshold for frequent item queries, the method can output frequent item query results for the corresponding scenario. In the marketing field, the method of this invention can be used to analyze products with sales exceeding a certain threshold to help develop marketing strategies. By validating the reasonableness of user-sent data, unreasonable data sent by malicious users can be excluded, ensuring the accuracy and reliability of the query results, thereby providing accurate sales analysis results to aid marketing decisions. In the field of urban construction, the method of this invention can be used to analyze locations with high pedestrian traffic, which is helpful for road planning and urban design. By verifying the reasonableness of data sent by users, unreasonable data sent by malicious users can be excluded, ensuring the accuracy and reliability of query results, thereby providing accurate pedestrian flow analysis results and providing a scientific basis for urban construction. In the field of network monitoring, the method of this invention can be used to find elephant flows exceeding a certain threshold for network congestion control, anomaly detection, etc. By verifying the reasonableness of data sent by users, unreasonable data sent by malicious users can be excluded, ensuring the accuracy and reliability of query results, thereby providing accurate elephant flow analysis results and helping network monitoring and management. In summary, the method of this invention is applicable to frequent item query tasks in various practical scenarios, providing accurate and reliable data analysis results, and has broad application value. See also Figure 1 , Figure 1This diagram illustrates an overall flowchart of a method for querying frequent items in a distributed stream based on data security, according to an embodiment of the present invention. The method includes:

[0077] Step S101: Multiple users and multiple computing parties jointly determine the encoding scheme and the decoding scheme.

[0078] In this implementation, "user" refers to the owner of the data stream, that is, the producer of the data or the source of the data stream. Users are different individuals, such as consumers of goods in a marketing scenario. "Computing party" refers to the service provider that provides computing resources, which can be a third-party server, etc. There can be multiple users and computing parties. Multiple users upload their respective local data streams, which are processed in their local operating systems. In a marketing application scenario, assuming multiple users use an e-commerce platform to shop online, each user generates a series of local browsing history and order data streams during the shopping process. These data streams can contain information such as the user's purchasing preferences and browsing habits. Multiple computing parties can be simulated as a trusted third party, thus enabling centralized differential privacy to protect query results. Furthermore, the cooperation of multiple computing parties can also achieve the sharing of processing and query tasks for distributed data streams, reducing computational and communication overhead and improving processing efficiency.

[0079] Step S102: Multiple users process their respective local data streams to generate their respective sketch data structures and their respective local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values.

[0080] In this implementation, we can view the sketch data structure as a compact summary that helps us understand frequent items in a data stream without storing the complete data stream. By approximating the data stream, the sketch data structure can store important features of the data stream within a fixed space, such as frequently occurring elements and their counts. Furthermore, the sketch data structure supports merging operations, allowing multiple users' sketch data structures to be combined, further reducing resource consumption. Distributed noise, on the other hand, refers to noise added to the query results during frequent item queries in a distributed data stream to protect user data privacy. Adding distributed noise helps protect user data privacy, ensuring that the query results do not directly expose the user's original data. By adding noise to the query results, the true value of the data can be obscured. For example, suppose there is a frequent item query task in a distributed data stream involving the shopping records of multiple users. Each user's shopping record contains the purchased items and their quantities. To protect user privacy, users process their shopping records locally and generate distributed noise. This distributed noise contains some random values ​​to obscure the true quantity of items in the shopping records, thereby protecting user privacy.

[0081] Step S103: The user encodes the count value in the sketch data structure according to the encoding scheme and calculates the Boolean share. The user also performs Shamir secret sharing on the distributed noise in the user's local environment and the elements in the user's sketch data structure, and calculates the Shamir arithmetic share.

[0082] In this implementation, Shamir secret sharing is a method of secret sharing where users share secret values. A Shamir share refers to the share generated for each user in the Shamir secret sharing process. Here, both the distributed noise and the elements in the sketch data structure can be considered as secret values ​​to be shared, and corresponding Shamir arithmetic shares can be generated through Shamir secret sharing.

[0083] Step S104: The user sends the Boolean share and the Shamir arithmetic share to the corresponding computing party according to the secret sharing protocol.

[0084] Secret sharing protocols involve sending distributed shares to each computational party using a secret sharing method. Boolean secret sharing and Shamir secret sharing are different rules or methods of secret sharing protocols. Boolean secret sharing is a secret sharing protocol that breaks down secret information into shares of Boolean values ​​(0 or 1) and distributes these shares to different participants, i.e., the computational parties in this embodiment of the invention. Only when certain conditions are met can these Boolean value shares be combined to recover the original secret information. As explained earlier, Shamir secret sharing is also a secret sharing protocol that breaks down secret information into multiple polynomial coefficient shares and distributes these shares to different computational parties. Only when certain conditions are met can these polynomial coefficient shares be combined to recover the original secret information. In this embodiment of the invention, a Boolean share refers to the share generated by the user through Boolean secret sharing of the count values ​​in the sketch data structure. Shamir shares and Boolean shares are used in different applications in this invention. Shamir shares are used to distribute secret values ​​into multiple shares, while Boolean shares are obtained by encoding the count values ​​in the sketch data structure according to the encoding scheme and then performing Boolean sharing on the encoded bit strings. The computer can determine whether the data sent by the user is reasonable based on the Boolean shares, which will be explained in detail below.

[0085] Step S105: The calculator verifies its own Boolean share and obtains the corresponding list of verified users.

[0086] In this embodiment, an honest user refers to someone who performs each step according to the protocol specified in the method, while a malicious user refers to someone who intends to profit by uploading unreasonable data that could influence the frequent item query results. For example, when analyzing the sales of high-volume products, a malicious user could modify the count value of a specific product in their sketch data structure to far exceed a reasonable range, causing that product to be included in the final frequent item query results. To prevent this from happening, the method proposed in this invention requires validation of the reasonableness of the data sent by the user.

[0087] Step S106: Based on the verified user list, the computer uses the B2A protocol to convert the Boolean share into a Shamir arithmetic share. At the same time, based on the encoding scheme, decoding scheme and the share held, the computer identifies and obtains the sketch data structure of multiple users, then merges the sketch data structures of multiple users, merges the distributed noise provided by multiple users, and adds the merged distributed noise to the count value in the merged sketch data structure.

[0088] Boolean shares have already been explained; they represent secret information split into Boolean values ​​(0 or 1). However, the binary representation of Boolean shares can be inconvenient for the computer in subsequent merging calculations. To address this, the B2A protocol is used to convert Boolean shares into Shamir arithmetic shares. The B2A protocol is a protocol that converts Boolean values ​​into arithmetic values. Through the B2A protocol, Boolean shares can be converted into Shamir arithmetic shares, allowing the computer to directly operate on the Shamir arithmetic shares in subsequent merging calculations without needing to process the binary representation of the Boolean shares again. This simplifies the calculation process and improves computational efficiency. Furthermore, the computer does not need to actively "receive" the sketch data structure. Taking Shamir shares as an example, the computer cuts the bit string sent by the user according to the bit list of the encoding scheme, obtaining t1, t2, ..., t... l The algorithm first generates a string of bits. Then, it converts these bits into decimal numbers and adds them together to obtain each user's Shamir arithmetic share. Finally, based on the Shamir arithmetic share held, the algorithm can obtain the sketch data structure for multiple users. Essentially, it uses an encoding-decoding scheme to "identify" the sketch data structure based on the share.

[0089] Step S107: The calculation method outputs elements in the merged sketch data structure whose count value is greater than the threshold, and uses these elements as the query results for frequent items.

[0090] The concept of threshold in the embodiments of the present invention will be explained in detail here.

[0091] First, we define elements that exceed a certain threshold as frequent items. By iterating through all elements and recording their counts, we filter out those elements that are greater than the threshold as frequent items. Assuming there are 100 elements in the data stream, we count the occurrences of different elements (i.e., their counts). Setting the threshold to 20, elements with counts greater than 20 are considered frequent items.

[0092] In the differential privacy algorithm applied in this invention, the algorithm itself carries a threshold. The purpose of this threshold is to prevent the output of frequent items from leaking user privacy. If no threshold is set, and all elements in the sketch are output as frequent items, it may lead to the leakage of elements in the user's distributed data stream. In this step, "threshold" is the definition corresponding to the second description.

[0093] Figure 2 This is a flowchart of the encoding scheme formulation module in an embodiment of the present invention, such as... Figure 2 As shown:

[0094] Step S201: Multiple users and multiple computing parties jointly determine a reasonable range of data values.

[0095] Step S202: Based on the value range c, select and store a binary number t, where the value of t should satisfy 2. t -1≤c<2 t+1 -1.

[0096] Step S203, if c-(2 t If -1) = 0, then stop selecting and storing t, output the stored t in order, and obtain a list about t. This list is then used as the encoding scheme.

[0097] If c-(2) t -1)≠0, then let c=c-(2 t -1), repeat the selection and storage of t iteratively until c-(2) is satisfied. t -1) until 0.

[0098] This involves step S201.

[0099] Multiple users and multiple computing parties jointly determine a reasonable range of data values.

[0100] A reasonable range of data values ​​refers to data values ​​falling within a reasonable interval, conforming to actual conditions and application requirements. For example, regarding sales volume of a product, assuming that a product typically sells a maximum of 100 units within a fixed time period, the reasonable range of data values ​​is 0-100. The purpose of defining a reasonable range of data values ​​is to ensure the validity and reliability of the data and to enable verification of its reasonableness.

[0101] By defining a reasonable range of data values, data that does not conform to the actual situation or application requirements can be excluded. Only data within a reasonable range can be considered valid and truly reflect the characteristics and attributes of the data. At the same time, a reasonable range of data values ​​helps filter out outliers and erroneous data, improving data credibility. Only data that has passed reasonableness verification can be considered trustworthy and used for subsequent analysis and decision-making. Furthermore, defining a reasonable range of data values ​​ensures consistency in values ​​across different data sources or uploaded by different users. This avoids data confusion and inconsistency, improving data consistency and comparability. It also prevents malicious users from uploading unreasonable data, thereby protecting data security and privacy. Only verified data can be recognized and used, ensuring data security and confidentiality.

[0102] This involves step S202.

[0103] Based on the range c, select and store a binary digit t, where the value of t should satisfy 2. t -1≤c<2 t+1 -1.

[0104] Through 2 t -1≤c<2 t+1 The inequality condition of -1 can limit the value of t based on the size of the range c. Choosing an appropriate value for t can control the complexity of the encoding scheme. A smaller value for t means fewer bits need to be encoded, thus reducing the computational load and storage space required for encoding and decoding. At the same time, choosing an appropriate value for t can improve the accuracy of data validity verification. By encoding the data's count value as a t-bit binary number, a finer-grained judgment can be made on whether the data is within a reasonable range, thereby improving the accuracy of data validity verification.

[0105] This involves step S203.

[0106] If c-(2) t If -1) = 0, then stop selecting and storing t, output the stored t in order, and obtain a list about t. This list is then used as the encoding scheme.

[0107] If c-(2) t -1)≠0, then let c=c-(2 t -1), repeat the selection and storage of t iteratively until c-(2) is satisfied. t -1) until 0.

[0108] Assuming the reasonable range of the data is [0, 15], and c = 15, according to the above rules, we choose t = 4 because 2 4 If -1 = 15, then t is chosen as 4 and stored in the list, and [4] is determined as the encoding scheme list. This satisfies c-(2 t An example of the case where -1) = 0, correspondingly for c-(2) t In the case where -1)≠0, we assume the reasonable range of the data is [0,200], c=200, and according to the above rules, because 2 7 -1 = 127 < 200 < 2 8 -1 = 255. First, select t as 7 and store it in the list. Then, c = 200 - 127 = 73. Since 2... 6 -1 = 63 < 73 < 2 7 -1 = 127, so choose t as 6 and store it in the list. The corresponding c = 73 - 63 = 10, because 2 3 -1 = 7 < 10 < 2 4 -1 = 15, so choose t as 3 and store it in the list. The corresponding 10 - 7 = 3. Because 2 2-1 = 3 = c, so we choose t as 2 and store it in the list. The final encoding scheme list is [7,6,3,2].

[0109] Figure 3 This is a user coding flowchart in an embodiment of the present invention, such as... Figure 3 As shown, based on the above list of encoding schemes, the user will encode the count value according to the following steps:

[0110] Step S301: The user subtracts the offset from the count value, where the offset is the minimum value within a reasonable range of values ​​for the data.

[0111] Step S302, the user determines whether the count value is within the interval [0, ..., ... Within ], t1 is the first bit in the encoding scheme:

[0112] If the count value is within the range, the user encodes the count value using t1 bits of binary code and pads the remaining bits of the encoded result with zeros.

[0113] If the count value is not within the range, the user sets all bits of t1 to 1 and subtracts the count value. As a new value, t2 is then used to process this new value, where t2 is the second bit in the encoding scheme.

[0114] Step S303: Repeat the above steps until the count value is fully encoded.

[0115] This involves step S301.

[0116] The user subtracts the offset from the count value, where the offset is the minimum value within a reasonable range of values ​​for the data.

[0117] The offset is used to transform the reasonable range of data values ​​into a reasonable range starting from 0, so that the reasonable range can be calculated in the form of [0, ba]. Assuming the reasonable range of data values ​​is [10, 30], then the value of the offset is equal to 10.

[0118] This involves step S302.

[0119] The user determines whether the count value is within the interval [0, ...]. Within ], t1 is the first bit in the encoding scheme:

[0120] If the count value is within the range, the user encodes the count value using t1 bits of binary code and pads the remaining bits of the encoded result with zeros.

[0121] If the count value is not within the range, the user sets all bits of t1 to 1 and subtracts the count value. As a new value, t2 is then used to process this new value, where t2 is the second bit in the encoding scheme.

[0122] We default Figure 3 Chinese i The value of i starts from 1. For example, following the previous rule, assuming t1 = 3, the count value is 5. Since 5 is in the interval [0, 2...] 3 Within the range [-1], the user converts the count value 5 into a 3-bit binary number 101, and pads the remaining bits of the encoded result with zeros, resulting in the encoded result 10100. Following the latter rule, assuming t1 = 3 and t2 = 2, the count value is 9. Since 9 is not in the interval [0, 2...],... 3 Within [-1], the user sets all bits to 1, resulting in the binary number 111. Then, the count value 9 is subtracted by 2. 3 -1 results in the new value 2. Next, the user processes the new value 2 with t2 = 2, converting it into a 2-bit binary number 10. The final encoded result is 11110.

[0123] Figure 4 This is a flowchart of the decoding process in an embodiment of the present invention, as shown below. Figure 4 As shown, the computer decodes according to the following steps:

[0124] Step S401: The calculator divides the bit string sent by the user into segments t1, t2, ..., t3 respectively. l The bit string is a binary string obtained by encoding data according to an encoding scheme, and the number of elements in the encoding scheme list is the number of elements in the encoding scheme list.

[0125] In step S402, these bit strings are converted into decimal numbers and added together, and then the offset is added to obtain the original decoded value.

[0126] Assuming the encoding scheme list is [4,3,2], and the user sends a bit string of 101001011 with an offset 'a' of 0, the calculator divides the bit string into 4-bit, 3-bit, and 2-bit segments, which are 1010, 010, and 11 respectively. Then, the calculator converts these bit strings into decimal numbers and adds them together, resulting in 10 + 2 + 3 = 15. Finally, the calculator adds the offset 'a' to obtain the decoded original value of 15.

[0127] Figure 5 This is a flowchart of the user local computing process in an embodiment of the present invention, such as... Figure 5 As shown, the steps for multiple users to process their respective local data streams and generate their respective sketch data structures include:

[0128] In step S501, the user uses the Misra-Gries algorithm to define a sketch data structure of fixed size k.

[0129] Step S502, perform the following operation on each element in the local data stream:

[0130] Determine if the element exists in the sketch data structure. If it does, increment the corresponding count value by 1.

[0131] If the element is not in the sketch data structure, then compare the number of elements in the current sketch data structure with k:

[0132] If the number of elements in the current sketch data structure is less than k, add the element to the sketch data structure and set its count value to 1;

[0133] When the number of elements in the current sketch data structure is equal to k, the count of all elements in the sketch data structure is decremented by 1. If the count of an element is 0, the element is deleted.

[0134] This involves step S501.

[0135] The user uses the Misra-Gries algorithm to define a sketch data structure of fixed size k.

[0136] The Misra-Gries algorithm is a streaming algorithm used to estimate the frequency of elements in a data stream. It can estimate the frequency of each element in the data stream within a given memory constraint. In this embodiment of the invention, the Misra-Gries algorithm is used to perform an approximate compressed representation of the data stream. The algorithm stores the information of frequent items in the data stream in a fixed-size sketch. Furthermore, the user will sample random variables from a polya distribution, i.e., generate a k-dimensional random vector based on this distribution, as detailed in step S601.

[0137] This involves step S502.

[0138] For each element in the local data stream, perform the following operation:

[0139] Determine if the element exists in the sketch data structure. If it does, increment the corresponding count value by 1.

[0140] If the element is not in the sketch data structure, then compare the number of elements in the current sketch data structure with k:

[0141] If the number of elements in the current sketch data structure is less than k, add the element to the sketch data structure and set its count value to 1;

[0142] When the number of elements in the current sketch data structure is equal to k, the count of all elements in the sketch data structure is decremented by 1. If the count of an element is 0, the element is deleted.

[0143] The following is a detailed explanation of this process rule. For the first case, where the number of elements in the sketch data structure is less than k, assuming the sketch data structure has a size k of 3, and currently contains two elements A and B with counts of 2 and 3 respectively. Now, a new element C is to be added to the sketch data structure. Since the number of elements in the sketch data structure is less than k, element C is added to the sketch data structure, and its count is set to 1. Ultimately, the elements in the sketch data structure are A, B, and C, with counts of 2, 3, and 1 respectively.

[0144] In the second scenario, where the number of elements in the sketch data structure equals k, assuming the sketch data structure has a size of k of 3, and currently contains three elements A, B, and C with counts of 1, 2, and 3 respectively, a new element D is to be added. Since the sketch data structure has 3 elements, which equals k, the counts of all elements in the sketch data structure are decremented by 1. After this decrement, the count of element A becomes 0, so element A is removed from the sketch data structure, and D is not retained. Ultimately, the elements in the sketch data structure are B and C, with counts of 1 and 2 respectively. Through this process, the complete and complex data flow is approximately represented by a sketch data structure of size k.

[0145] The step of generating local distributed noise by the user includes:

[0146] Step S601: The user generates two k-dimensional random vectors locally, each of which follows a polya distribution with distribution parameters as follows. n represents the number of users among the multiple users, and α represents the parameters of the polya distribution.

[0147] Step S602: Subtract the two vectors to obtain the user-generated local distributed noise.

[0148] This involves step S601.

[0149] The user generates two k-dimensional random vectors locally, each of which follows a polya distribution with the following parameters: n represents the number of users among the multiple users, and α represents the parameters of the polya distribution.

[0150] These are two user-generated k-dimensional random vectors, where k represents the size of the sketch data structure mentioned earlier. Each element in these vectors is randomly generated and can be viewed as a set of random numbers. Each random variable follows a polya distribution, a discrete probability distribution used to describe the probability distribution of the number of times an event occurs within a certain time or space. The parameters (1 / n, α) represent the expected value of the average random number generated by each user as 1 / n, while α is the parameter of the polya distribution, used to control the shape of the distribution.

[0151] This involves step S602.

[0152] The subtraction of the two vectors is used as the user-generated local distributed noise.

[0153] Suppose user A needs to generate 4-dimensional distributed noise. User A generates two random vectors: [1, 2, 4, 3] and [2, 1, 3, 1]. Then, user A subtracts these two random vectors, obtaining the result [-1, 1, 1, 2]. This result is the distributed noise generated by user A. The polya distribution has closure property, meaning that the subtraction of two random variables following a polya distribution still results in a polya distribution. This allows each user to generate their own noise vector locally, without relying on information from other users or third parties. This method ensures the privacy and security of user data.

[0154] The steps for the user to encode the count values ​​in the sketch data structure and calculate the Boolean share include:

[0155] Step S701: The user selects the count value to be encoded.

[0156] Step S702: For each encoded count value c, the user randomly selects m-1 random numbers r1, r2, ..., r of the same bit length. m-1 m is the number of computational methods among the plurality of computational methods.

[0157] Step S703, Calculate These random numbers and the calculated shares are sent to the corresponding calculator.

[0158] The encoding process has been explained in detail above and will not be repeated here. Boolean shares ensure the security of user data. Users encode the count value in Sketch locally and then share it via Boolean, splitting the count value into multiple shares, which are then sent to the computer. The computer can only perform calculations using the received Boolean shares and cannot obtain the user's original data. This protects user data privacy. Furthermore, Boolean shares can be used to verify the legitimacy of the data sent by the user, which will be explained in detail below.

[0159] The steps for users to perform Shamir secret sharing on elements and distributed noise in the sketch data structure and to calculate the Shamir arithmetic share include:

[0160] Step S801: For each value x to be shared, the user randomly selects β domain elements. in Representation field.

[0161] Step S802: Using the Lagrange interpolation formula, a polynomial f of degree β is generated through the β field elements x1, x2, ..., xβ and the value to be shared x, satisfying x = f(0).

[0162] Step S803: Substitute 1 to m into polynomial f respectively, and use the result as the Shamir arithmetic share of each computational party.

[0163] The Lagrange interpolation formula is a method for constructing polynomials. The following example illustrates the steps above. To distinguish the symbols in the formula, the field elements and secret values ​​are represented by 's'. Assume the user selects field elements s1 = 2, s2 = 4, and the secret value to be shared is s0 = 10. According to the Lagrange interpolation formula, we obtain a polynomial f(x) of degree 2, satisfying s0 = f(0): f(x) = s0(x-1)(x-2) / ((0-1)(0-2)) + s1(x-0)(x-2) / ((1-0)(1-2)) + 4(x-0)(x-1) / ((2-0)(2-1)). Assuming there are 3 calculations, i.e., m = 3, substituting m = 3 into this quadratic polynomial, we obtain:

[0164] f(3)=10(3-1)(3-2) / ((0-1)(0-2))+2(3-0)(3-2) / ((1-0)(1-2))+4(3-0)(3-1) / ((2-0)(2-1))=16;

[0165] Thus, we obtain the Shamir arithmetic share for each computational side: 2, 4, 16.

[0166] Figure 6 This is a flowchart of the calculation method verification in an embodiment of the present invention, such as... Figure 6 As shown, the steps for the computing parties to verify their respective Boolean shares and obtain the corresponding list of verified users include:

[0167] Step S901: The calculator receives the Boolean share sent by the user.

[0168] In step S902, the calculator observes whether the number of bits in each share matches the number of bits output by the encoding scheme specification module. If it matches, the user is marked as an honest user; if it does not match, all of the user's shares are discarded, and the user is marked as a malicious user.

[0169] In step S903, the calculator uses the list of honest users as the corresponding list of verified users.

[0170] Suppose we have 3 computation parties, each holding the following Boolean shares:

[0171] Boolean share received by Calculator 1: 101;

[0172] Boolean share received by Calculator 2: 110;

[0173] Boolean share received by Calculator 3: 0110;

[0174] The calculator needs to check whether the number of bits for each share matches the number of bits output by the encoding scheme specification module. Assume the encoding scheme specification module outputs 3 bits.

[0175] For Boolean share 101 received by computer 1, its number of bits is 3, which is consistent with the number of bits output by the encoding scheme specification module, so the Boolean share passes the verification.

[0176] For Boolean share 110 received by computer 2, its number of bits is 3, which is consistent with the number of bits output by the encoding scheme specification module, so the Boolean share passes the verification.

[0177] For the Boolean share 0110 received by the computing party 3, its number of bits is 4, which does not conform to the number of bits output by the encoding scheme specification module. Therefore, the Boolean share fails the verification and all shares of the user corresponding to the Boolean share will be discarded, and the user will be marked as a malicious user.

[0178] Malicious user behavior refers to users intentionally uploading unreasonable data to influence frequent item query results and thereby gain undue benefits. For example, in marketing, if a malicious user wants to promote their product, they can deliberately modify the count value of a certain product in their data stream, making it far exceed a reasonable range, thus causing the product to be included in the final frequent item query results, thereby increasing the product's exposure and sales. Therefore, this invention proposes a reasonableness verification method to verify the data sent by users. This ensures that only reasonable user data participates in subsequent calculations, improving data security and accuracy.

[0179] Figure 7 This is a flowchart of the calculation process in an embodiment of the present invention, such as... Figure 7 As shown, the above-mentioned sketch data structure can be merged. The steps for merging sketch data structures from multiple users include:

[0180] In step S1001, the calculator creates an empty sketch data structure with a size of 2k as a new sketch data structure.

[0181] Step S1002, the calculator performs a judgment on each element in the sketch data structure of the two users:

[0182] If the element exists in both sketch data structures, the counts of the element in the two sketch data structures are added together, and the result is saved to the new sketch data structure.

[0183] If an element exists in only one sketch data structure, then the element and its count value are saved to the new sketch data structure.

[0184] Step S1003: After processing all elements in the sketch data structures of the two users, sort the elements in the new sketch data structure from largest to smallest according to their count values, and retain the first k elements.

[0185] Step S1004: Repeat the above steps until the sketch data structures of multiple users are completely merged pairwise, and take the final merged sketch data structure as the result of merging the sketch data structures of multiple users.

[0186] In conjunction with the overall technical solution of this invention, merging the sketch data structures of multiple users has the following significance:

[0187] First, by merging the sketch data structures of multiple users, computational and communication overhead can be avoided without having to process the entire data stream.

[0188] Second, merging the sketch data structures of multiple users can reduce the amount of added noise, thereby improving the accuracy of frequent item query results.

[0189] Third, by simulating multiple untrusted computation parties as a trusted third party, centralized differential privacy can be used to protect query results. Only one noise needs to be added, which reduces the amount of noise in the results and protects the privacy of user data.

[0190] like Figure 7 As shown, secret shares of noise provided by multiple users can also be merged. The steps of merging secret shares of noise provided by multiple users include:

[0191] Step S1101: The calculator adds the secret shares of noise from multiple users to obtain the merged noise vector.

[0192] In step S1102, the calculator adds the merged noise vector to the count value in the merged sketch data structure and discards elements whose count value is less than the threshold.

[0193] After the computer merges the distributed noise from all users, the noise will follow a geometric distribution with parameter α. The definition of the "threshold" mentioned in the steps has been explained above and will not be repeated here. Assume there are two users, A and B, who generate secret shares na and nb of noise, respectively. The computer adds na and nb to obtain the merged noise vector nab. Then, utilizing the linear property of secret sharing, the computer adds the merged noise vector nab to the count value in the merged sketch data structure. If the count value of an element is less than the threshold, for example, 3, then that element will be discarded. Finally, the computer outputs the elements retained in the sketch as the results of frequent item queries.

[0194] In summary, the present invention provides a method for querying frequent items in a distributed data stream based on data security. This method uses a data stream compression representation algorithm to approximately store the frequent item information of the data stream in a fixed-size sketch data structure, avoiding computational and communication overhead. This makes the method applicable to real-world distributed data stream scenarios and reduces resource consumption. Secondly, through a user-computorineer model, users send a secret share of their data to the computer, who then performs calculations based on their share. Centralized differential privacy is used to protect the query results, requiring only one noise addition. Compared to the method of adding noise for each user in localized differential privacy, this reduces the amount of noise in the results and improves the accuracy of frequent item query results. Furthermore, the computer verifies the number of Boolean share bits sent by the user to determine whether the user's original count value meets the range requirements. This allows for verification of the user's data validity without revealing the user's original value. Therefore, the query method provided by this invention is efficient, accurate, and secure, applicable to real-world distributed data stream scenarios, and has broad application value.

[0195] Based on the above Figure 1 The present invention also provides a persistent query device for distributed streams, in addition to the method for querying frequent items in the distributed stream shown. Figure 8 This is a block diagram of a frequent item query device in a distributed stream based on data security, as described in an embodiment of the present invention. Figure 8 As shown, the device includes:

[0196] The encoding scheme determination module is configured to allow multiple users and multiple computing parties to jointly determine the encoding and decoding schemes.

[0197] The user-local computing module is configured to process the local data streams of multiple users, generating their respective sketch data structures and local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values. Users encode the count values ​​in the sketch data structure according to an encoding scheme and calculate Boolean shares. They also perform Shamir secret sharing on the user-local distributed noise and the elements in the user's sketch data structure to calculate Shamir arithmetic shares. Users send the Boolean shares and Shamir arithmetic shares to the corresponding computing parties according to the secret sharing protocol.

[0198] The computational verification module is configured to perform computational verification of each party's Boolean share and obtain a list of users who have passed the verification.

[0199] The computation module is configured to perform the following: based on the verified user list, the computation module converts the Boolean shares of the verified users into Shamir arithmetic shares using the B2A protocol. Simultaneously, based on the encoding and decoding schemes and the shares held, the computation module identifies and obtains the sketch data structures of multiple users, then merges the sketch data structures of multiple users, and merges the distributed noise provided by multiple users. The merged distributed noise is then added to the count values ​​in the merged sketch data structure. The computation module outputs the elements in the merged sketch data structure whose count values ​​are greater than a threshold, and uses these elements as the query results for frequent items.

[0200] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the following claims.

[0201] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.

Claims

1. A method for querying frequent items in a distributed stream based on data security, characterized in that, include: Multiple users and multiple computing parties jointly determine the encoding and decoding schemes; Multiple users process their respective local data streams to generate their own sketch data structures and their own local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values. The user encodes the count values ​​in the sketch data structure according to the encoding scheme and calculates the Boolean share. In addition, the user performs Shamir secret sharing on the distributed noise in the user's local environment and the elements in the user's sketch data structure, and calculates the Shamir arithmetic share. According to the secret sharing protocol, the user sends the Boolean share and the Shamir arithmetic share to the corresponding computing party; The computing parties verify their respective Boolean shares to obtain a list of users who have passed the verification. Based on the verified user list, the computing party uses the B2A protocol to convert the Boolean shares into Shamir arithmetic shares. At the same time, based on the encoding and decoding schemes and the shares held, the computing party identifies and obtains the sketch data structures of multiple users, then merges the sketch data structures of multiple users, merges the distributed noise provided by multiple users, and adds the merged distributed noise to the count values ​​in the merged sketch data structure. The calculation outputs elements in the merged sketch data structure whose count value is greater than the threshold, and uses these elements as the query results for frequent items; The encoding scheme is used by the user to encode the count value, and the encoding scheme is determined through the following steps: Multiple users and multiple computing parties jointly determine a reasonable range of data values; Based on the value range c, select and store a binary digit t, where the value of t should satisfy... - 1≤ c< -1; If c - ( If -1) = 0, then stop selecting and storing t, output the stored t in order, and obtain a list about t. Use this list as the encoding scheme. If c - ( - 1) ≠ 0, then let c = c - ( - 1), repeat the selection and storage of t iteratively until c -( -1) until 0; The decoding scheme includes the following steps: The calculator divides the bit string sent by the user into segments to obtain the results. , ... , A bit string, wherein the bit string is a binary string obtained by encoding data according to an encoding scheme. The number of elements in the encoding scheme list; The bit strings are converted into decimal numbers and added together, then the offset is added to obtain the original decoded value.

2. The method according to claim 1, characterized in that, Users encode the count value by following these steps: The user subtracts the offset from the count value, where the offset is the minimum value within a reasonable range of values ​​for the data. The user determines whether the count value is within the interval [0, ...]. ]Inside, It is the first bit in the encoding scheme: If the count value is within the range, the user will set the count value according to... Bit-by-bit binary encoding, with zeros padded to the remaining bits of the encoding result; If the count value is not within the range, the user will Set all bits to 1 and subtract the count value. As a new value, then use Go and process this new value. It is the second bit in the encoding scheme; Repeat the above steps until the count value is fully encoded.

3. The method according to claim 1, characterized in that, The steps for the multiple users to process their respective local data streams and generate their respective sketch data structures include: The user uses the Misra-Gries algorithm to define a sketch data structure of fixed size k; For each element in the local data stream, perform the following operation: Determine if the element exists in the sketch data structure. If it does, increment the corresponding count value of the element by 1. If the element is not in the sketch data structure, then compare the number of elements in the current sketch data structure with k: If the number of elements in the current sketch data structure is less than k, add the element to the sketch data structure and set its count value to 1; When the number of elements in the current sketch data structure is equal to k, the count of all elements in the sketch data structure is decremented by 1. If the count of an element is 0, the element is deleted.

4. The method according to claim 1, characterized in that, The step of generating local distributed noise by the user includes: The user generated two locally. A dimensional random vector, where each random variable follows a certain order. Distribution, distribution parameters are ( ), where n is the number of users among the plurality of users, and α represents Parameters of the distribution; The subtraction of the two vectors is used as the user-generated local distributed noise.

5. The method according to claim 1, characterized in that, The steps for the user to encode the count values ​​in the sketch data structure and calculate the Boolean share include: The user selects the count value to be encoded; For each encoded count value The user randomly selects m-1 random numbers of the same bit length. , , ... , m is the number of computational methods among the plurality of computational methods; calculate = ... These random numbers and the calculated shares are then sent to the corresponding calculator.

6. The method according to claim 5, characterized in that, The steps for users to perform Shamir secret sharing on elements and distributed noise in the sketch data structure and to calculate the Shamir arithmetic share include: For each value to be shared Users randomly select Domain elements 1, 2, ..., ∈ ,in Representation domain; Using the Lagrange interpolation formula, through the above Domain elements 1, 2, ..., and the value to be shared Generate a number of times polynomial ,satisfy = (0); 1~ Substituting into the polynomial respectively The result is used as the Shamir arithmetic share for each computational party.

7. The method according to claim 1, characterized in that, The steps for merging the sketch data structures of multiple users include: The computer creates an empty sketch data structure of size 2. , as a new sketch data structure; The calculator evaluates each element in the sketch data structure for both users: If the element exists in both sketch data structures, the counts of the element in the two sketch data structures are added together, and the result is saved to the new sketch data structure. If an element exists in only one sketch data structure, then the element and its count value are saved to the new sketch data structure. After processing all elements in the two users' sketch data structures, sort the elements in the new sketch data structure according to their count values ​​in descending order, and retain the top-ranked elements. One element; Repeat the above steps until the sketch data structures of multiple users are completely merged pairwise. The final merged sketch data structure is then taken as the result of merging the sketch data structures of multiple users.

8. A query device for frequent items in a distributed stream based on data security, characterized in that, include: The encoding scheme determination module is configured to allow multiple users and multiple computing parties to jointly determine the encoding and decoding schemes. The user-local computing module is configured to process the local data streams of multiple users, generating their respective sketch data structures and local distributed noise. The sketch data structure is a fixed-size data structure containing multiple elements and their count values. Users encode the count values ​​in the sketch data structure according to an encoding scheme and calculate Boolean shares. They also perform Shamir secret sharing on the user-local distributed noise and the elements in the user's sketch data structure to calculate Shamir arithmetic shares. Users send the Boolean shares and Shamir arithmetic shares to the corresponding computing parties according to the secret sharing protocol. The computational verification module is configured to perform computational verification of each party's Boolean share and obtain a list of users who have passed the verification. The computing module is configured to perform the calculation based on the verified user list, using the B2A protocol to convert the Boolean share into Shamir arithmetic share. At the same time, the computing module identifies and obtains the sketch data structure of multiple users based on the encoding and decoding schemes and the shares held. Then, it merges the sketch data structures of multiple users, merges the distributed noise provided by multiple users, and adds the merged distributed noise to the count value in the merged sketch data structure. The calculation outputs elements in the merged sketch data structure whose count value is greater than the threshold, and uses these elements as the query results for frequent items; The encoding scheme is used by the user to encode the count value, and the encoding scheme is determined through the following steps: Multiple users and multiple computing parties jointly determine a reasonable range of data values; Based on the value range c, select and store a binary digit t, where the value of t should satisfy... - 1≤ c< -1; If c - ( If -1) = 0, then stop selecting and storing t, output the stored t in order, and obtain a list about t. Use this list as the encoding scheme. If c - ( - 1) ≠ 0, then let c = c - ( - 1), repeat the selection and storage of t iteratively until c -( -1) until 0; The decoding scheme includes the following steps: The calculator divides the bit string sent by the user into segments to obtain the results. , ... , A bit string, wherein the bit string is a binary string obtained by encoding data according to an encoding scheme. The number of elements in the encoding scheme list; The bit strings are converted into decimal numbers and added together, then the offset is added to obtain the original decoded value.

Citation Information

Patent Citations

  • Leveraging multiple devices to enhance security of biometric authentication

    CN112889047A

  • Secure multi-party reach and frequency estimation

    US20210359836A1