A cuckoo filter based on feistel structure and a data processing method thereof
By introducing the Feistel structure and the tag bit matrix into the cuckoo filter, the calculation methods for fingerprints and candidate buckets are improved, solving the problem of balancing the false positive rate and storage space of the cuckoo filter, and achieving more efficient data processing.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- QUAN CHENG LABORATORY
- Filing Date
- 2023-03-29
- Publication Date
- 2026-05-29
AI Technical Summary
Existing cuckoo filters cannot effectively balance the relationship between false positive rate and storage space in privacy protection scenarios, resulting in poor query performance and storage efficiency.
A cuckoo filter based on the Feistel structure is adopted. By setting the marker bit matrix and improving the calculation methods of fingerprint and candidate bucket, the insertion, search and deletion algorithms are optimized. The Feistel structure is used to implicitly compare the values of candidate buckets to reduce the false positive rate.
It significantly reduces the false positive rate without increasing storage space, improving the query performance and storage efficiency of the Cuckoo filter.
Smart Images

Figure CN116304238B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of cuckoo filter technology, and in particular to a cuckoo filter based on a Feistel structure and its data processing method. Background Technology
[0002] The statements in this section are merely background information related to the present invention and do not necessarily constitute prior art.
[0003] The era of big data has given rise to numerous applications and services based on big data. Efficiently preprocessing each piece of data within a large dataset has become a significant challenge. This relates to both the storage space and utilization efficiency of the large dataset itself, and the computational efficiency of subsequent algorithms designed based on big data. Therefore, designing a space- and computationally efficient representation structure and membership determination algorithm for large datasets is crucial. For example, a social application uses private set intersection (PSI) to accurately push information to contacts in the address book, and an efficient set representation structure is a fundamental component for executing the PSI protocol. In cloud storage systems, to achieve efficient space utilization, cloud servers need to save user-uploaded files and employ deduplication techniques to ensure that file data blocks are saved exactly once. Therefore, it is necessary to quickly detect whether the file data blocks to be saved already exist in the cloud storage system.
[0004] To improve space utilization and accelerate the determination of set members, Approximate Set Membership Data Structures (ASMDs) have received widespread attention in academia. ASMDs store "approximate values" of elements (e.g., fingerprints obtained through hash calculations) rather than the element's actual value. Therefore, two different elements may have the same value mapped to this structure, leading to a false positive rate during the search process. ASMDs save significant storage space by achieving an adjustable and relatively low false positive rate.
[0005] Bloom filters are standard approximate set representation structures that support element lookup and insertion operations, but not the simplest form of element deletion. Although researchers have proposed many improvements to support element deletion and optimize storage overhead, Bloom filters generally suffer from weak query performance and low space utilization. To further improve the performance of element insertion, lookup, and deletion, the Cuckoo filter was proposed. Extensive research has optimized the insertion and query performance of the Cuckoo filter, reducing the probability of relocation during element insertion and memory usage.
[0006] However, in privacy protection scenarios, the false positive rate of cuckoo filters is crucial to the correctness of subsequent protocols. Due to the inherent characteristics of the cuckoo filter structure, simply reducing the false positive rate increases memory consumption. Therefore, the construction of cuckoo filters needs to comprehensively consider both the false positive rate and the required memory space. Although cuckoo filters have many advantages over Bloom filters, existing cuckoo filters cannot effectively balance the relationship between the false positive rate and storage space. Therefore, how to provide a cuckoo filter that can balance storage space and false positive rate has become an urgent problem to be solved. Summary of the Invention
[0007] To address the shortcomings of existing technologies, the present invention aims to provide a cuckoo filter based on the Feistel structure and its data processing method. Besides setting a marker bit matrix during the construction of the cuckoo filter, the invention also improves the fingerprint and candidate bucket calculation methods based on the Feistel structure and optimizes the insertion, search, and deletion algorithms. It can implicitly compare candidate bucket values during the search process, thereby significantly reducing the false positive rate without increasing storage space.
[0008] To achieve the above objectives, the present invention is implemented through the following technical solution:
[0009] The first aspect of the present invention provides a cuckoo filter based on a Feistel structure. The cuckoo filter includes several buckets, each bucket including several slots, and a marker bit matrix composed of marker bits is set, with a one-to-one correspondence between the slots and the marker bits. The slots store fingerprints, and the marker bit matrix identifies the candidate buckets corresponding to the fingerprint elements. The corresponding tags are calculated based on the elements to be operated on, and the fingerprints and candidate buckets are calculated using the Feistel structure based on the tags.
[0010] Furthermore, the corresponding label is calculated based on the element to be operated on; the formula for calculating the label is:
[0011] tag = hash(x) mod 2 n
[0012] Where tag represents the label corresponding to the element, hash(·) is the consistent hashing algorithm function, x is the element to be operated on, and n is the label length.
[0013] Furthermore, fingerprints and candidate buckets are calculated using a Feistel structure based on the tags; the fingerprint calculation formula is as follows:
[0014] f = tag mod2 l ,
[0015] Where f represents the fingerprint, tag represents the tag corresponding to the element, and l represents the fingerprint length.
[0016] Furthermore, fingerprints and candidate buckets are calculated using a Feistel structure based on the tags; the formula for calculating the candidate buckets is as follows:
[0017]
[0018]
[0019] Where p1 and p2 represent the two candidate buckets corresponding to the element, tag represents the label corresponding to the element, l represents the fingerprint length, hash(·) is the consistent hashing algorithm function, f represents the fingerprint, and β represents the number of buckets.
[0020] Furthermore, the size of the marker matrix is β×b, where β represents the number of buckets and b represents the number of slots in each bucket. The initial value is a zero matrix, and the value of the marker is either 0 or 1.
[0021] Furthermore, the specific steps for the marker bit matrix to identify the candidate buckets of the corresponding fingerprint element are as follows: if the bucket where the fingerprint is located is calculated from the candidate bucket p1 of the corresponding element, then the corresponding marker bit value is 0, otherwise it is 1.
[0022] The second aspect of the present invention provides a data processing method based on the cuckoo filter based on the Feistel structure of the first aspect, wherein the data processing process includes element insertion, searching and deletion;
[0023] The element insertion steps include: inserting the element according to the slot availability, and using a flag bit value to identify the candidate bucket for insertion;
[0024] The element search steps include: searching for elements based on the comparison of fingerprints in the slot, and determining whether the element exists in the cuckoo filter based on the marker bit value;
[0025] The deletion steps for an element include: searching for the element based on the comparison of fingerprints in the slot; deleting the fingerprint after a successful search; and setting the corresponding flag value to 0.
[0026] Furthermore, the specific steps for inserting elements based on the slot availability and identifying the inserted candidate buckets using a flag value are as follows:
[0027] Calculate the label corresponding to the element to be inserted, and calculate the fingerprint and two candidate buckets corresponding to the element to be inserted based on the label. If both candidate buckets have empty slots, randomly select a bucket to store the fingerprint corresponding to the element to be inserted, and mark the inserted candidate bucket with a flag value. If only one of the two candidate buckets has an empty slot, place the fingerprint corresponding to the element to be inserted into any empty slot, and mark the inserted candidate bucket with a flag value. If neither candidate bucket has an empty slot, randomly select a slot in a bucket to evict the fingerprint, place the element to be inserted into the slot of the evict fingerprint, and update the flag value of the slot of the evict fingerprint and the flag value of the new position of the evict fingerprint. If the new position of the evict fingerprint does not have an empty slot, continue to evict the fingerprint at the new position until there is an empty slot at the new position or the number of evicts reaches a preset value.
[0028] Furthermore, the specific steps for element lookup based on the comparison of fingerprints within the slot, and for determining whether an element exists in the cuckoo filter based on the marker bit value, are as follows:
[0029] Calculate the label corresponding to the element to be searched. Based on the label, calculate the fingerprint of the element to be searched and two candidate buckets. Compare all the fingerprints stored in the candidate buckets with the fingerprint of the element to be searched. If there is a fingerprint in the candidate bucket that is the same as the fingerprint of the element to be searched, then determine whether the tag value corresponding to the fingerprint is i-1, i=1 or i=2, where i is the candidate bucket number. If it is i-1, the search is successful, that is, the element exists in the Cuckoo Filter. Otherwise, the search fails, that is, the element does not exist in the Cuckoo Filter.
[0030] Furthermore, based on the comparison of fingerprints within the slot, an element search is performed. Upon successful search, the fingerprint is deleted, and the corresponding marker value is set to 0. The specific steps are as follows:
[0031] Calculate the label corresponding to the element to be deleted. Based on the label, calculate the fingerprint of the element to be deleted and two candidate buckets. Compare all fingerprints stored in the candidate buckets with the fingerprint of the element to be searched. If there is a fingerprint in the candidate bucket that is the same as the fingerprint of the element to be searched, determine whether the flag value corresponding to the fingerprint is i-1, i=1 or i=2, where i is the candidate bucket number. If it is i-1, the search is successful, the fingerprint is deleted, and the corresponding flag value is set to 0. If the search is unsuccessful, it means that the element to be deleted is not in the Cuckoo Filter and cannot be deleted.
[0032] The above one or more technical solutions have the following beneficial effects:
[0033] This invention discloses a cuckoo filter based on the Feistel structure. In addition to setting a marker bit matrix during the construction process, it also improves the fingerprint and candidate bucket calculation methods based on the Feistel structure. With the same storage space as existing cuckoo filters, the false positive rate of this invention's cuckoo filter is significantly lower. The false positive rate is determined by the fingerprint length and the size of the bucket. A larger bucket stores more fingerprints, increasing the probability of a false positive during the search. Longer fingerprints result in a lower collision probability but significantly increase storage space. Existing methods to reduce the false positive rate adjust the number of buckets and the fingerprint length, which also increases storage space. Experiments show that when the cuckoo filter of this invention stores 10 million data points and has an 8-bit fingerprint length, it achieved a 0% false positive rate in 931 out of 1000 repeated experiments, whereas existing cuckoo filters never had a 0% false positive rate. Therefore, the cuckoo filter of this application reduces the false positive rate without increasing fingerprint length (storage space).
[0034] This invention discloses a data processing method for a cuckoo filter based on the Feistel structure. Compared to existing cuckoo filter data processing methods with the same false positive rate, the cuckoo filter data processing method of this invention occupies less storage space. This is because the method of this invention implicitly compares the values of candidate buckets; therefore, with the same false positive rate (i.e., the same data length compared during the search process), the cuckoo filter data processing method of this invention occupies less storage space.
[0035] This invention can simultaneously reduce the false positive rate and storage space. When the fingerprint length in the existing cuckoo filter is |f|, and the fingerprint length in the cuckoo filter of this invention is |f|-α, the false positive rate of the existing cuckoo filter is still twice that of the cuckoo filter of this invention. logβ-α The false positive rate of the present invention's cuckoo filter was 0 in 930 out of 1000 independent experiments when the fingerprint length was 8 bits, while the false positive rate of the existing cuckoo filter was 0 in every single experiment when the fingerprint length was 16 bits.
[0036] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0037] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an improper limitation of the invention.
[0038] Figure 1This is an overall structural diagram of the cuckoo filter based on the Feistel structure in Embodiment 1 of the present invention;
[0039] Figure 2 This is a schematic diagram of the Feistel structure in Embodiment 1 of the present invention;
[0040] Figure 3 This is a flowchart of the fingerprint calculation method and candidate bucket calculation method in Embodiment 1 of the present invention;
[0041] Figure 4 This is a flowchart of the element insertion process in Embodiment 2 of the present invention;
[0042] Figure 5 This is a schematic diagram illustrating the displacement of an element in a slot during element insertion in Embodiment 2 of the present invention.
[0043] Figure 6 This is a flowchart of the element search process in Embodiment 2 of the present invention;
[0044] Figure 7 This is a flowchart of the element deletion process in Embodiment 2 of the present invention. Detailed Implementation
[0045] It should be noted that the following detailed descriptions are exemplary and intended to provide further illustration of the invention. Unless otherwise specified, 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 invention pertains.
[0046] It should be noted that the embodiments of the present invention involve data related to elements in the cuckoo filter. When the above embodiments of the present invention are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0047] It should be noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the scope of exemplary embodiments according to the invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. Furthermore, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.
[0048] Terminology Explanation:
[0049] Hash functions: A hash function transforms an input of arbitrary length into a fixed-length output, called a hash value. This transformation is a compression mapping, meaning the space of hash values is usually much smaller than the space of inputs, and different inputs may hash to the same output. Simply put, it's a function that compresses a message of arbitrary length into a message digest of a fixed length. Hash algorithms have an unavoidable problem—hash collisions. Since hash values are fixed-length strings, the same output hash value may correspond to multiple inputs. If two input strings have the same hash function value, they are said to have collided. Because it transforms strings of arbitrary length into strings of fixed length, there must be one output string corresponding to an infinite number of input strings, making collisions inevitable. There are generally two methods to handle collisions: open addressing and chaining.
[0050] Example 1:
[0051] Embodiment 1 of the present invention provides a cuckoo filter based on a Feistel structure, such as Figure 1 As shown, the cuckoo filter includes several buckets, each bucket containing several slots. Slots are the basic storage units in the filter. A flag matrix (FLAG) composed of flag bits is set up, where each element is called a flag bit. There is a one-to-one correspondence between slots and flag bits. Fingerprints are stored in the slots, and the flag matrix identifies the candidate buckets corresponding to the fingerprint elements. For example, the second slot in bucket 6 corresponds to the flag bit in the 6th row and 2nd column of the FLAG. In this embodiment, the size of the buckets in the filter is set to b, and the number of buckets is set to β.
[0052] The Feistel structure is a symmetric structure used in block ciphers, characterized by high cryptographic strength and near-identical encryption and decryption processes. The first two rounds of the Feistel structure are as follows: Figure 2 As shown, the remaining rounds repeat this structure: the plaintext information is divided into left and right parts (L0, R0), and the following calculations are performed in each round:
[0053] L j+1 =R j
[0054]
[0055] Where j is the current round number, fun is the round function, and K1,…,K n These are the subkeys for rounds 1, ..., n, respectively.
[0056] Inspired by the Feistel structure, this embodiment improves the calculation method for candidate bucket p1 and fingerprint f by dividing the label of element x into two parts: the left part is p1, and the right part is the fingerprint f, as follows: Figure 3As shown. Specifically, the corresponding label is calculated based on the element to be operated on (insertion, search, deletion), and the fingerprint and candidate bucket are calculated using the Feistel structure based on the label.
[0057] More specifically, such as Figure 3 As shown, firstly, the corresponding label is calculated based on the element to be operated on; the label calculation is as shown in formula (1):
[0058] tag = hash(x) mod 2 n (1)
[0059] Here, `tag` represents the label corresponding to the element, `hash(·)` is a 128-bit consistent hashing algorithm (Murmurhash3) function, `x` is the element to be operated on, and `n` is the label length. The left part of the label (`tag_left`) is used to calculate the candidate bucket `p1`, and its length is `logβ`; the right part of the label (`tag_right`) is stored in the filter as the fingerprint `f`, and its length is represented as `l`. Obviously, `n = logβ + l`.
[0060] Secondly, fingerprints and candidate buckets are calculated using the Feistel structure based on the tags; the fingerprint calculation is shown in formula (2):
[0061] f = tag mod2 l (2),
[0062] Where f represents the fingerprint, tag represents the tag corresponding to the element, and l represents the fingerprint length.
[0063] The calculation of the candidate bucket is shown in formulas (3) and (4):
[0064]
[0065]
[0066] Where p1 and p2 represent the two candidate buckets corresponding to the element, tag represents the label corresponding to the element, l represents the fingerprint length, hash(·) is the consistent hashing algorithm function, f represents the fingerprint, and β represents the number of buckets.
[0067] In this embodiment, the size of the flag matrix FLAG is designed to be β×b, where β represents the number of buckets and b represents the number of slots in each bucket. The initial value is a zero matrix, and the value of the flag bit is either 0 or 1.
[0068] The cuckoo filter is actually a matrix structure, where there is a one-to-one correspondence between the slots and the elements in the marker matrix. The marker matrix is used to identify whether the bucket containing the fingerprint was calculated from the candidate bucket p1 or p2 of its corresponding element. If it was calculated from candidate bucket p1, the corresponding marker value is 0; otherwise, it is 1. For example, if the fingerprint corresponding to element x is in the second slot of bucket 5 in the cuckoo filter, where bucket 5 was calculated from the candidate bucket p2 corresponding to element x, then FLAG[5,2] = 1.
[0069] In this embodiment, when searching for element y in the cuckoo filter, if candidate bucket p i (i=1 or i=2) Middle tank b j If the stored fingerprint is the same as the fingerprint a of element y, then check the flag matrix FLAG[p]. i ,b j The search is performed to determine if the median is i-1. If it is i-1, the search is successful; otherwise, the search fails. Clearly, the cuckoo filter in this embodiment not only compares the fingerprint values corresponding to two elements during the search process but also implicitly compares the candidate bucket values, i.e., compares the label values corresponding to two elements, thereby significantly reducing the false positive rate without increasing storage space.
[0070] Example 2:
[0071] Embodiment 2 of the present invention provides a data processing method based on the cuckoo filter based on the Feistel structure of Embodiment 1. The data processing process includes element insertion, searching and deletion.
[0072] (1) Insertion of elements
[0073] Elements are inserted based on the availability of slots, and the candidate buckets for insertion are identified using a flag bit value.
[0074] Calculate the label corresponding to the element to be inserted, and calculate the fingerprint and two candidate buckets corresponding to the element to be inserted based on the label. If both candidate buckets have empty slots, randomly select a bucket to store the fingerprint corresponding to the element to be inserted, and mark the inserted candidate bucket with a flag value. If only one of the two candidate buckets has an empty slot, place the fingerprint corresponding to the element to be inserted into any empty slot, and mark the inserted candidate bucket with a flag value. If neither candidate bucket has an empty slot, randomly select a slot in a bucket to evict the fingerprint, place the element to be inserted into the slot of the evict fingerprint, and update the flag value of the slot of the evict fingerprint and the flag value of the new position of the evict fingerprint. If the new position of the evict fingerprint does not have an empty slot, continue to evict the fingerprint at the new position until there is an empty slot at the new position or the number of evicts reaches a preset value.
[0075] Taking the insertion of element x as an example, the insertion process is as follows: Figure 4 As shown: First, calculate the tag corresponding to x. x Then calculate the fingerprint f of x. x and two candidate buckets The calculation method is shown in formulas (2), (3), and (4) in Example 1. If the candidate bucket... and If each container has an empty slot, then randomly select a bucket, let this bucket be p, and set f... x Stored in any empty slot of bucket p, if Then set the corresponding flag value to 1. If the bucket and If only one bucket (let's call this bucket p) has an empty slot, then f x Stored in any empty slot of bucket p, if p = Then set the corresponding flag value to 1. If the bucket and There are no empty slots in any of them. We randomly select one of the buckets, let's call this bucket p. Then, we randomly select slot b from bucket p. j Storing fingerprint f y Perform the expulsion and store the corresponding flag value in the variable `flag`. y The corresponding new bucket location is like Then set the corresponding flag value to 1. If there is an empty slot in bucket p', then put f in. y And set the corresponding flag value to 1-flag; if there is no empty slot, continue to evict the fingerprint in bucket p'. During the evictment process, according to The algorithm calculates the position of another candidate pass corresponding to the expelled fingerprint. If, after a preset upper limit (MaxNumKicks) of expulsions has been reached and there are still elements that cannot be stored, the algorithm terminates. The expulsion process is as follows: Figure 5 As shown, neither bucket 3 nor bucket 5 has an empty slot. The fingerprint f' stored in the second slot (randomly selected) of bucket 5 is expelled, and the other candidate bucket position corresponding to f' is bucket 8. Bucket 8 has an empty slot, so f' is placed in its fourth slot, and FLAG[8,4] = 1 - FLAG[5,2]. The fingerprint f corresponding to element x is... x Place it into the second slot of bucket 5, and set FLAG[5,2] = 1.
[0076] (2) Element search
[0077] Element search is performed based on the comparison of fingerprints in the slot, and the existence of the element in the cuckoo filter is determined based on the marker bit value.
[0078] Taking finding element x as an example, the search process is as follows: Figure 6 As shown: Calculate the tag corresponding to the element x to be searched. x Calculate the fingerprint of the element to be searched and two candidate buckets based on the label. Compare all fingerprints stored in the candidate bucket with the fingerprint f of the element to be searched. x Compare the candidate buckets. (i=1 or i=2) contains fingerprints that match the fingerprint of the element to be searched. x If they are the same, then determine whether the tag value corresponding to the fingerprint is i-1, i=1 or i=2, where i is the candidate bucket number; if it is i-1, then the search is successful, that is, element x exists in the cuckoo filter; otherwise, the search fails, that is, element x does not exist in the cuckoo filter.
[0079] (3) Deletion of elements
[0080] The element is searched based on the comparison of fingerprints in the slot. Once the search is successful, the fingerprint is deleted and the corresponding marker value is set to 0.
[0081] Taking the deletion of element x as an example, the deletion process is as follows: Figure 7 As shown: Calculate the tag corresponding to the element x to be deleted. x Calculate the fingerprint of the element to be deleted and two candidate buckets based on the label. Compare all fingerprints stored in the candidate bucket with the fingerprint f of the element to be searched. x Compare the candidate buckets. If a fingerprint in (i=1 or i=2) is the same as the fingerprint of the element to be searched, then determine whether the flag value corresponding to the fingerprint is i-1, i=1 or i=2, where i is the candidate bucket number; if it is i-1, the search is successful, the corresponding fingerprint is deleted, and the corresponding flag value is set to 0. If the search is unsuccessful, it means that the element to be deleted x is not in the Cuckoo Filter and cannot be deleted.
[0082] The steps and methods involved in the apparatus of Embodiment 2 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1.
[0083] Those skilled in the art will understand that the modules or steps of the present invention described above can be implemented using general-purpose computer devices. Optionally, they can be implemented using computer-executable program code, thereby allowing them to be stored in a storage device for execution by a computer device, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. The present invention is not limited to any particular combination of hardware and software.
[0084] While the specific embodiments of the present invention have been described above in conjunction with the accompanying drawings, this is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art without creative effort based on the technical solutions of the present invention are still within the scope of protection of the present invention.
Claims
1. A cuckoo filter based on a Feistel structure, characterized in that, The cuckoo filter includes several buckets, each bucket containing several slots, and a marker matrix consisting of marker bits, with a one-to-one correspondence between slots and marker bits. Fingerprints are stored in the slots, and the marker matrix identifies the candidate bucket for each fingerprint element. A corresponding tag is calculated based on the element to be operated on, and the fingerprint and candidate bucket are calculated using a Feistel structure based on the tag. The formula for calculating the fingerprint is: , in, Represents fingerprints, tag This indicates the tag corresponding to the element. Indicates fingerprint length; The formula for calculating the candidate bucket is: in, , These represent the two candidate buckets corresponding to the element, and tag represents the tag corresponding to the element. Indicates fingerprint length. For consistent hashing algorithm functions, Represents fingerprints, This indicates the number of buckets.
2. The cuckoo filter based on the Feistel structure as described in claim 1, characterized in that, Calculate the corresponding label based on the element to be operated on; the formula for calculating the label is: in, tag This indicates the tag corresponding to the element. For consistent hashing algorithm functions, The element to be operated on. This is the label length.
3. The cuckoo filter based on the Feistel structure as described in claim 1, characterized in that, The size of the marker bit matrix is , represents the number of buckets, b represents the number of slots in each bucket, the initial value is a zero matrix, and the value of the flag bit is either 0 or 1.
4. The cuckoo filter based on the Feistel structure as described in claim 3, characterized in that, The specific steps for using the marker bit matrix to identify the candidate buckets of the corresponding elements of the fingerprint are as follows: If the bucket containing the fingerprint contains candidate buckets of the corresponding elements... If the calculation is successful, the corresponding flag value is 0; otherwise, it is 1.
5. A data processing method based on the cuckoo filter with a Feistel structure as described in any one of claims 1-4, characterized in that, Data processing includes the insertion, searching, and deletion of elements; The element insertion steps include: inserting the element according to the slot availability, and using a flag bit value to identify the candidate bucket for insertion; The element search steps include: searching for elements based on the comparison of fingerprints in the slot, and determining whether the element exists in the cuckoo filter based on the marker bit value; The deletion steps for an element include: searching for the element based on the comparison of fingerprints in the slot; deleting the fingerprint after a successful search; and setting the corresponding flag value to 0.
6. The data processing method as described in claim 5, characterized in that, The specific steps for inserting elements based on slot availability and identifying candidate buckets using flag values are as follows: Calculate the label corresponding to the element to be inserted, and calculate the fingerprint and two candidate buckets corresponding to the element to be inserted based on the label. If both candidate buckets have empty slots, randomly select a bucket to store the fingerprint corresponding to the element to be inserted, and mark the inserted candidate bucket with a flag value. If only one of the two candidate buckets has an empty slot, place the fingerprint corresponding to the element to be inserted into any empty slot, and mark the inserted candidate bucket with a flag value. If neither candidate bucket has an empty slot, randomly select a slot in a bucket to evict the fingerprint, place the element to be inserted into the slot of the evict fingerprint, and update the flag value of the slot of the evict fingerprint and the flag value of the new position of the evict fingerprint. If the new position of the evict fingerprint does not have an empty slot, continue to evict the fingerprint at the new position until there is an empty slot at the new position or the number of evicts reaches a preset value.
7. The data processing method as described in claim 5, characterized in that, The specific steps for finding elements based on the comparison of fingerprints within the slot, and determining whether an element exists in the cuckoo filter based on the marker bit value, are as follows: Calculate the label corresponding to the element to be searched. Based on the label, calculate the fingerprint of the element to be searched and two candidate buckets. Compare all fingerprints stored in the candidate buckets with the fingerprint of the element to be searched. If a fingerprint in a candidate bucket matches the fingerprint of the element to be searched, determine whether the tag value corresponding to that fingerprint is [value missing]. , or , The candidate bucket number; if it is If the search is successful, the element exists in the Cuckoo Filter; otherwise, the search fails, meaning the element does not exist in the Cuckoo Filter.
8. The data processing method as described in claim 5, characterized in that, The specific steps for searching for elements based on the comparison of fingerprints within the slot, deleting the fingerprint after a successful search, and setting the corresponding marker value to 0 are as follows: Calculate the label corresponding to the element to be deleted. Based on the label, calculate the fingerprint of the element to be deleted and two candidate buckets. Compare all fingerprints stored in the candidate buckets with the fingerprint of the element to be deleted. If a fingerprint in a candidate bucket matches the fingerprint of the element to be deleted, determine whether the tag value corresponding to that fingerprint is [value missing]. , or , The candidate bucket number; if it is If the search is successful, the fingerprint will be deleted, and the corresponding flag value will be set to 0. If the search is unsuccessful, it means that the element to be deleted is not in the Cuckoo Filter and cannot be deleted.