String pre-filtering methods, apparatuses, electronic devices, storage media, and products
By determining the target bucket and configuration information to generate compressed entries, and performing accurate restoration during the restoration process, the problem of long string pre-filtering time is solved, and efficient string pre-filtering is achieved.
Patent Information
- Application Number
- CN202510592182.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-08
- Publication Date
- 2026-11-17
AI Technical Summary
In existing technologies, the string pre-filtering process is time-consuming and inefficient, failing to meet the demands of high-performance data processing.
By determining the target bucket for storing the string and generating and restoring compressed entries based on the configuration information of the target bucket, if the restored entry is consistent with the pre-stored entry, the string is pre-filtered out to reduce the amount of data and improve efficiency.
By compressing and grouping strings, the efficiency of pre-filtering is significantly improved, the amount of data processed is reduced, and the burden on the central processing unit or pre-programmed chip is reduced.
Smart Images

Figure CN123115479A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data processing, and more particularly to a string pre-filtering method, apparatus, electronic device, storage medium, and product. Background Technology
[0002] With the rapid development of data processing technology, electronic devices are processing more and more data. In order to reduce the burden on electronic devices when processing large amounts of data, the incoming data stream can be pre-filtered.
[0003] In related technologies, the Brute Force (BF) algorithm can be used to compare each character in each string with each character in a preset standard string, and perform pre-filtering based on the comparison results.
[0004] However, the above methods are time-consuming and have low pre-filtering efficiency. Summary of the Invention
[0005] This application provides a string pre-filtering method, apparatus, electronic device, storage medium, and product to solve the technical problems of long pre-filtering time and low efficiency in related technologies.
[0006] Firstly, this application provides a string pre-filtering method, including:
[0007] Obtain the pre-filtered string and determine the target bucket for storing the string;
[0008] Obtain the configuration information of the target bucket;
[0009] Based on the configuration information of the target bucket and the string, determine the compressed table entry corresponding to the compressed string;
[0010] Based on the configuration information of the target bucket, the compressed table entry is restored to obtain the table entry after the string is restored;
[0011] If the restored table entry matches the pre-stored string entry, then the string is pre-filtered out.
[0012] In this application, the target bucket for storing the string is determined, and the corresponding compressed entry for the compressed string is determined based on the configuration information of the target bucket. The compressed entry is then restored according to the configuration information of the target bucket. If the restored entry is the same as the pre-stored entry, the string is pre-filtered out. This application first compresses the string, reducing the amount of data. In the subsequent comparison process, the amount of data processed is significantly reduced, thereby significantly improving the efficiency of pre-filtering.
[0013] Optionally, in the method described above, the configuration information of the target bucket includes: the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket;
[0014] The step of determining the compression entry corresponding to the compressed string based on the configuration information of the target bucket and the string includes:
[0015] The string is grouped into multiple character groups by a preset number of bytes;
[0016] Determine the storage address corresponding to each character group based on the characters included in each character group and the order in which the characters are arranged.
[0017] Get the position information of each character group in the string;
[0018] Based on the storage address corresponding to each character group, the actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string, the compression table entry corresponding to the compressed string is determined.
[0019] In this application, by grouping strings and determining the corresponding storage address for each group, strings can be stored in a more compact manner, reducing redundant space by utilizing the mapping relationship of storage addresses. By combining the actual number of bits in the target bucket and the starting bit, storage resources are further precisely planned, making data storage more efficient. The configuration information of the target bucket provides a clear structural framework for data storage; the actual number of bits specifies the amount of data that each target bucket can hold; and the starting bit clarifies the starting position of the data in the storage medium, enabling the compressed entries to store data in an orderly manner, facilitating subsequent data retrieval, reading, and management operations.
[0020] Optionally, in the method described above, determining the storage address corresponding to each character group based on the characters included in each character group and their arrangement order includes:
[0021] For any character group, the characters included in the character group are converted to the target base to obtain the data corresponding to each character after conversion;
[0022] Select data with a preset number of bits from the data corresponding to each character after conversion;
[0023] Based on the order of the characters in the character group, a preset number of bits of data selected from each character are combined to determine the storage address corresponding to the character group.
[0024] In this application, by converting the characters in a character group to the target base and then selecting data of a preset number of digits to determine the storage address, the storage space required for each character group can be effectively reduced. Combining data of a preset number of digits according to the order of the characters gives the storage address a certain regularity and structure. This structured storage method helps improve the utilization rate of the storage device and facilitates subsequent data restoration.
[0025] Optionally, in the method described above, determining the compression entry corresponding to the compressed string based on the storage address corresponding to each character group, the actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string includes:
[0026] The actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string are input into a preset position calculation algorithm, and the position calculation algorithm is used to determine the effective bit position of each character group at the corresponding address.
[0027] The effective bits of each character group at the corresponding address are converted from the default initial value to the preset value to obtain the compression table entry corresponding to the compressed string.
[0028] In this application, by using a preset position calculation algorithm, combined with the actual number of bits, the starting bit of the target bucket, and the position information of the character group in the string, the effective bits of each character group at the corresponding address can be accurately determined. The effective bits of each character group at the corresponding address are converted from the default initial value to the preset value, and the compressed table entry corresponding to the compressed string is obtained, thereby saving storage space. Each character group can be compactly stored in a suitable location, improving the utilization rate of storage resources.
[0029] Optionally, in the method described above, the configuration information of the target bucket includes the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket;
[0030] The step of restoring the compressed table entry based on the configuration information of the target bucket to obtain the table entry after string restoration includes:
[0031] Obtain the position information of each character group in the string within the compressed table entry;
[0032] Based on the position information of each character group in the string in the compression table entry, the target byte corresponding to each character group in the preset bytes is determined, and the target byte includes a preset number of bits;
[0033] Obtain the identification information of the target bucket;
[0034] Based on the identification information of the target bucket, the valid identifier bits of each character group in the corresponding target byte are determined from the preset number of bits;
[0035] Based on the valid identifier bit of each character group in the corresponding target byte, the actual number of bits, the starting bit bit of the target bucket, and the position information of each character group in the string in the compression table entry, determine the data after restoration of each character group;
[0036] Based on the data restored from each character group, determine the table entry for the restored string.
[0037] In this application, by obtaining the position information of each character group in the string within the compressed entry, and based on this, determining the target byte corresponding to each character group and the valid identifier bits within the target byte, the position and specific data content of each character group in the original string can be accurately located. By combining information such as the actual number of bits in the target bucket and the starting bit, the data of each character group can be completely and accurately restored, thereby determining the entry in the restored string and improving the accuracy and completeness of data restoration.
[0038] Optionally, in the method described above, determining the restored data for each character group based on the valid identifier bit of each character group in the corresponding target byte, the actual number of bits, the starting bit bit corresponding to the target bucket, and the position information of each character group in the string in the compression table entry includes:
[0039] The actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string in the compression table entry are input into the preset restoration algorithm, and the restoration algorithm is used to determine the value corresponding to the effective bit position of each character group.
[0040] The valid identifier bits of each character group in the corresponding target byte are converted from their default initial values to the corresponding values on the valid bits of each character group, thus obtaining the restored data of each character group.
[0041] In this application, a preset restoration algorithm, combined with the actual number of bits, the starting bit of the target bucket, and the character group position information, can accurately determine the corresponding values of the valid bits in each character group. By converting the valid flag bits from their default initial values to their corresponding values, the data of each character group can be completely restored, ensuring that the information of each character group in the original string can be correctly restored, thereby improving the integrity of the string data.
[0042] Secondly, this application provides a string pre-filtering device, comprising:
[0043] The acquisition module is used to acquire the pre-filtered string and determine the target bucket for storing the string;
[0044] The acquisition module is also used to acquire the configuration information of the target bucket;
[0045] The determination module is used to determine the compressed table entry corresponding to the compressed string based on the configuration information of the target bucket and the string.
[0046] The processing module is used to restore the compressed table entry according to the configuration information of the target bucket to obtain the table entry after the string is restored;
[0047] The processing module is further configured to pre-filter out the string if the restored table entry is consistent with the pre-stored string table entry.
[0048] In this application, a string pre-filtering device distributes different functions among an acquisition module, a determination module, and a processing module. The acquisition module is responsible for quickly and accurately acquiring the string and the configuration information of the target bucket to provide basic data for subsequent processing. The determination module focuses on compressing the string according to the configuration information and generating compressed entries. The processing module is responsible for restoring and comparing the compressed entries to complete the pre-filtering operation. This clearly defined modular design allows each module to work efficiently in parallel or serially, greatly improving the processing efficiency of the entire string pre-filtering process.
[0049] Thirdly, this application provides an electronic device, including: a processor, and a memory communicatively connected to the processor;
[0050] The memory stores computer-executed instructions;
[0051] The processor executes computer execution instructions stored in the memory to implement the method as described in any of the first aspects.
[0052] In this application, an electronic device is provided to provide the hardware conditions for executing the string pre-filtering method of this application.
[0053] Fourthly, this application provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any of the first aspects.
[0054] In this application, a computer-readable storage medium is provided to provide storage medium conditions for executing the string pre-filtering method of this application.
[0055] Fifthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the method described in any of the first aspects.
[0056] In this application, a computer program product is provided to provide program product conditions for executing the string pre-filtering method of this application.
[0057] The string pre-filtering method, apparatus, electronic device, storage medium, and product provided in this application determine the target bucket for storing the string, and based on the configuration information of the target bucket, determine the corresponding compressed entry for the compressed string. The compressed entry is then restored according to the configuration information of the target bucket. If the restored entry is identical to a pre-stored entry, the string is pre-filtered. This application reduces the amount of data by compressing the string, and also reduces the amount of data processed during the subsequent restoration process, thereby significantly improving the efficiency of pre-filtering. Attached Figure Description
[0058] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0059] Figure 1 This is a schematic diagram illustrating an application scenario in an exemplary embodiment;
[0060] Figure 2 This is a flowchart illustrating a string pre-filtering method in an exemplary embodiment;
[0061] Figure 3 This is a schematic diagram illustrating the mapping of buckets in an exemplary embodiment;
[0062] Figure 4 This is a schematic diagram of a bucket design shown in an exemplary embodiment;
[0063] Figure 5A This is a schematic diagram illustrating an exemplary embodiment of obtaining the string "candlest" compressed table entry;
[0064] Figure 5B This is a schematic diagram illustrating an exemplary embodiment of obtaining a string include compressed entry;
[0065] Figure 5C This is a schematic diagram illustrating an exemplary embodiment of obtaining a compressed entry for the string "cat".
[0066] Figure 6 This is a flowchart illustrating a method for determining compressed entries in an exemplary embodiment;
[0067] Figure 7 This is a schematic diagram illustrating an exemplary embodiment of obtaining a table entry after string restoration;
[0068] Figure 8This is a flowchart illustrating an exemplary embodiment of a method for obtaining a table entry after string restoration;
[0069] Figure 9 This is a schematic diagram illustrating the reconstruction of a 32-bit table in an exemplary embodiment;
[0070] Figure 10 This is a schematic diagram illustrating the reconstruction of a 32-bit table in an exemplary embodiment;
[0071] Figure 11 This is a schematic diagram illustrating the reconstruction of a 24-bit table in an exemplary embodiment;
[0072] Figure 12 This is a flowchart illustrating a string pre-filtering method, as shown in yet another exemplary embodiment.
[0073] Figure 13 This is a schematic diagram of the structure of a string pre-filtering device shown in an exemplary embodiment;
[0074] Figure 14 This is a schematic diagram of the structure of an electronic device shown in an exemplary embodiment.
[0075] The accompanying drawings illustrate specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to particular embodiments. Detailed Implementation
[0076] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.
[0077] With the development of data processing technology, electronic devices are processing increasingly larger volumes of data. Network defense systems within these devices, in particular, face extremely high demands on data filtering performance when handling massive amounts of data and meeting other high-performance requirements. For example, when filtering Tbps-level data—specifically, performing full-packet floating signature string rule matching on traffic—pre-defined chips are typically used for storing and processing matching rules. However, these chips cannot achieve high-performance filtering for full-packet floating signature string rule matching. As current data processing requirements become increasingly stringent, demanding simultaneous searching of tens of thousands of floating string rules on 400Gbps / 800Gbps / 1.6Tbps traffic, this level of traffic cannot be handled by either directly supplying the central processing unit (CPU) for full-packet floating string matching or directly using a pre-defined chip. The CPU's processing power and TCAM query bandwidth cannot meet such high bandwidth and high rule volume requirements. Therefore, in order to reduce the load on the central processing unit or the query frequency of the preset chip, it is necessary to filter the input data, filter out the data that will not match the rules from the data stream, and send the data that may match to the central processing unit or preset chip for accurate matching, thereby reducing the burden on the central processing unit or preset chip.
[0078] In related technologies, the Black-Scholes (BF) algorithm can be used for string pre-filtering, with a time complexity of zero, making it suitable for string matching scenarios. Specifically, starting from the first character of the string to be filtered, it compares each character of the string with a preset standard string. If a mismatch is found, the starting position of the comparison in the string to be filtered is moved one position to the right, while the preset standard string restarts from its first character and the comparison is repeated character by character. This process is repeated until a matching standard string is found, at which point the string is pre-filtered. However, this pre-filtering method is time-consuming, resulting in low efficiency.
[0079] Therefore, addressing the problems in the aforementioned related technologies, the research process revealed that reasonable string compression can reduce the amount of data processed. By designing a target bucket-based storage and processing mechanism, strings can be allocated to different target buckets according to their characteristics, and specific configuration information can be set for each target bucket. During compression, compressed entries are generated using the target bucket configuration information. During restoration, the string is accurately restored based on this configuration information. If the restored entry is identical to a pre-stored entry, the string is pre-filtered out, thus achieving efficient string pre-filtering.
[0080] To facilitate a better understanding of the method in this application, the following examples illustrate its application scenarios, such as... Figure 1 As shown, Figure 1This is an exemplary embodiment illustrating an application scenario. The string pre-filtering system corresponding to this application scenario may include a client 10 and a server 11, which are connected via network communication.
[0081] Client 10 sends each pending task to server 11 via the network. Server 11 can then obtain the strings related to each pending task. After obtaining the pre-filtered string, server 11 determines the target bucket required to store the string, obtains the configuration information of the target bucket, and determines the corresponding compressed table entry after the string is compressed based on the configuration information of the target bucket and the string. Based on the configuration information of the target bucket, server 11 restores the compressed table entry to obtain the table entry after the string is restored. If the restored table entry is consistent with the table entry of the pre-stored string, the string is pre-filtered.
[0082] It is understood that this application does not limit the type and number of client 10 and server 11. In particular, client 10 may not need to send to server 11 and may directly execute the string pre-filtering method of this application. Therefore, the above scenario is only used for illustrative purposes and does not limit this application.
[0083] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.
[0084] Figure 2 This is a flowchart illustrating an exemplary embodiment of a string pre-filtering method. The execution entity of this method can be a string pre-filtering device, which can be implemented through a computer program, a medium storing the relevant computer program (such as a USB flash drive and / or optical disc), or a physical device integrating or installing the relevant computer program, such as a chip or electronic device. The electronic device can be a server, server cluster, smart terminal, etc. The method may include the following steps:
[0085] S201. Obtain the pre-filtered string and determine the target bucket for storing the string.
[0086] In this embodiment, the execution entity is a server. The network defense system in the server operates in the network, from receiving a large number of packets to processing these packets and performing full-packet floating rule pre-filtering and matching.
[0087] For example, the design can be based on 8 buckets, each bucket corresponding to the number of bytes stored and the actual number of bits. The mapping relationship between each bucket and the number of bytes stored and the actual number of bits can be as follows: Figure 3 As shown, Figure 3 This is a schematic diagram illustrating the mapping of buckets in an exemplary embodiment.
[0088] exist Figure 3 The system includes buckets 0 to 7. Bucket 0 stores 2 bytes (1 bit), bucket 1 stores 3 bytes (2 bits), bucket 2 stores 4 bytes (3 bits), bucket 3 stores 5 bytes (4 bits), bucket 4 stores 6 bytes (5 bits), ..., bucket 7 stores 9 bytes (8 bits). The total number of bits in the 8 buckets is 36.
[0089] To enable concurrent matching across multiple buckets, the byte length of each bucket must be consistent and aligned with the largest byte length. In the example above, the largest byte length is 9 bytes (8 bits), and the remaining bytes are padded. For instance, for a 2-byte entry, bits pos1 to pos7 are padded with 0s, and for a 3-byte entry, bits pos2 to pos7 are padded with 0s. Therefore, the bit width of an entry is 8 bits × 8 buckets, totaling 64 bits. Assuming a depth of 1k, this 64-bit width requires 4 M20K storage blocks.
[0090] An M20K storage block occupies 20 bits. Taking two M20K storage blocks as an example, out of the 36 bits of table entry content, 4 bits are wasted. Therefore, these 4 bits can be utilized when designing the buckets. Specifically, a separate 5-byte bucket can be used. Assuming the bucket design needs to store 10,000 rules, the additional 5-byte bucket plus the original 8-byte bucket still leaves a slightly insufficient storage capacity for 10,000 rules. Therefore, three M20K storage blocks totaling 60 bits can be used. After deducting the original 36 bits from the 8 buckets, 24 bits remain. These 24 bits can be used for various designs, such as eight 4-byte buckets or three 9-byte buckets, etc. Figure 4 As shown, Figure 4This is a schematic diagram illustrating the design of buckets in an exemplary embodiment. Taking three 9-byte buckets as an example, the 60 bits comprise a total of 11 buckets. Buckets 0 to 7 can be called regular byte buckets, corresponding to a 36-bit compressed table, while buckets 8 to 10 can be called extra byte buckets, corresponding to a 24-bit compressed table. Taking eight 4-byte buckets as an example, the 60 bits comprise a total of 16 buckets. Buckets 0 to 7 can be called regular byte buckets, while buckets 8 to 15 can be called extra byte buckets.
[0091] It is understood that the above bucket examples are for illustrative purposes only. This application does not limit the number of buckets, the number of bytes corresponding to each bucket, or the actual number of bits, etc., and can be flexibly designed according to actual application requirements.
[0092] In this embodiment, after obtaining the string, the target bucket for storing the string can be determined from the preset mapping relationship between the number of bytes and the bucket, based on the number of bytes in the string.
[0093] For example, with Figure 4 Taking the mapping relationship shown as an example, assuming the string is "candlest", it includes 8 bytes. Figure 4 In the mapping relationship shown, the target bucket for storing the string is determined to be bucket6. Assuming the string is "include" and contains 7 bytes, the target bucket for storing this string is determined to be bucket5. Assuming the string is "cat" and contains 3 bytes, the target bucket for storing this string is determined to be bucket1.
[0094] S202. Obtain the configuration information of the target bucket.
[0095] Optionally, the configuration information of the target bucket includes, but is not limited to: the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket.
[0096] by Figure 4For example, if bucket 0 contains 1 actual bit, its starting bit is bit 0; if bucket 1 contains 2 actual bits, its starting bit is bit 1; if bucket 2 contains 3 actual bits, its starting bit is bit 3; if bucket 3 contains 4 actual bits, its starting bit is bit 6; if bucket 4 contains 5 actual bits, its starting bit is bit 10; if bucket 5 contains 6 actual bits, its starting bit is bit 15; if bucket 6 contains 7 actual bits, its starting bit is bit 21; if bucket 7 contains 8 actual bits, its starting bit is bit 28; if bucket 8 contains 8 actual bits, its starting bit is bit 36; if bucket 9 contains 8 actual bits, its starting bit is bit 44; and if bucket 10 contains 8 actual bits, its starting bit is bit 52.
[0097] If the target bucket is determined to be bucket6, then the actual number of bits included in the configuration information of the target bucket is 7, and the corresponding starting bit is 21.
[0098] S203. Based on the configuration information of the target bucket and the string, determine the corresponding compression table entry after the string is compressed.
[0099] Based on the configuration information of the target bucket determined in the above steps, and the bytes included in the string, determine the compression entry corresponding to the compressed string.
[0100] For example, taking the above example, the resulting compressed table entry can be a 60-bit compressed table entry, which can include a 36-bit compressed table and a 34-bit compressed table.
[0101] S204. Based on the configuration information of the target bucket, restore the compressed table entries to obtain the table entries after string restoration.
[0102] In this embodiment, the compressed entry corresponding to the compressed string can also be restored according to the configuration information of the target bucket to obtain the restored entry of the string.
[0103] During concurrent matching, after reading the contents of the compressed table entry, the 60-bit content can be restored to two 64-bit original table entries, thus obtaining the table entry after string restoration.
[0104] S205. If the restored table entry matches the pre-stored string entry, then pre-filter out the string.
[0105] After obtaining the restored entry, if the restored entry is the same as the pre-stored character entry, the string is pre-filtered out, and the judgment of the string is completed before proceeding to the judgment of the next string.
[0106] In the above embodiments of this application, by determining the target bucket for storing the string and, based on the configuration information of the target bucket, determining the compressed entry corresponding to the compressed string, and restoring the compressed entry according to the configuration information of the target bucket, if the restored entry is the same as the pre-stored entry, then the string is pre-filtered out. This application reduces the amount of data by compressing the string, and also reduces the amount of data processed in the subsequent restoration process, thereby improving the pre-filtering efficiency of the string.
[0107] Furthermore, based on the above embodiments, combined with Figures 5A to 5C , Figure 5A This is a schematic diagram illustrating an exemplary embodiment of obtaining the string "candlest" compressed table entry. Figure 5B This is a schematic diagram illustrating an exemplary embodiment of obtaining a string include compressed entry. Figure 5C This is a schematic diagram illustrating an exemplary embodiment of obtaining a compressed entry for the string "cat", illustrating... Figure 6 The process of determining the corresponding compressed table entry after string compression based on the target bucket configuration information and the string.
[0108] Please see Figure 6 , Figure 6 This is a flowchart illustrating a method for determining compressed entries, as shown in an exemplary embodiment. The method may include the following steps:
[0109] S601. Group the string into groups of a preset number of bytes to obtain multiple character groups.
[0110] by Figure 5A Taking the string "candlest" shown as an example, it has 8 bytes in total. Figure 4 Based on the mapping relationship, the target bucket can be determined to be bucket6. If it is grouped into groups of two bytes, then 7 character groups can be obtained, namely "ca", "an", "nd", "dl", "le", "es" and "st".
[0111] S602. Determine the storage address corresponding to each character group based on the characters included in each character group and the order in which the characters are arranged.
[0112] One possible way to determine the storage address corresponding to each character group is:
[0113] For any character group, convert the characters in the character group to the target base to obtain the corresponding data for each character after conversion. Select data of a preset number of digits from the corresponding data of each character. According to the arrangement order of the characters in the character group, combine the data of the preset number of digits selected from each character to determine the storage address corresponding to the character group.
[0114] For the seven character groups mentioned above, each character in each group is converted to a target base, such as hexadecimal, to obtain the corresponding data for each character. For example, the hexadecimal number corresponding to the character "c" is 63, the hexadecimal number corresponding to the character "a" is 61, and the hexadecimal numbers corresponding to the other characters n, d, l, e, s, and t are 6e, 64, 6c, 65, 73, and 74, respectively.
[0115] Taking the character group "ca" as an example, the hexadecimal number corresponding to the character "c" is 63, and its binary value is 1100011. The hexadecimal number corresponding to the character "a" is 61, and its binary value is 1100001. Assuming that the preset number of bits selected is the first 6 bits from right to left, then 1100011 becomes 100011 after taking 6 bits, and 1100001 becomes 100001 after taking 6 bits. According to the order of the characters, the data of the preset number of bits selected from each character are combined to get 100001100011, which corresponds to 0x863 in hexadecimal. That is, the storage address Address = Key_0&0x3f<<6|key_1&0x3f=0x61&0x3f<<6|0x63&0x3f=0x863.
[0116] Accordingly, the storage addresses corresponding to other character groups can be determined using the above method. The storage addresses corresponding to "an", "nd", "dl", "le", "es", and "st" are as follows: Figure 5A As shown, they are “0xba1”, “0x92e”, “0xb24”, “0x96c”, “0xce5”, and “0xd33”, respectively.
[0117] S603. Obtain the position information of each character group in the string.
[0118] Get the position information of each character group "ca", "an", "nd", "dl", "le", "es", and "st" in the string. The obtained position information pos are 0, 1, 2, 3, 4, 5, and 6, respectively.
[0119] S604. Based on the storage address, actual number of bits, starting bit of the target bucket, and position information of each character group in the string, determine the compression table entry corresponding to the string after compression.
[0120] The actual number of bits, the starting bit of the target bucket, and the position information of each character group in the string are input into the preset position calculation algorithm. The position calculation algorithm is used to determine the effective bits of each character group at the corresponding address. The effective bits of each character group at the corresponding address are converted from the default initial value to the preset value to obtain the compressed table entry corresponding to the string compression.
[0121] Optionally, the preset position calculation algorithm is: bit = start bit of the target bucket + actual number of bits bitlen - 2 - pos. The actual number of bits of each character group, the start bit of the target bucket, and the position information of each character group in the string are input into the preset position calculation algorithm to determine the effective bits of each character group at the corresponding address.
[0122] Specifically, the effective bits corresponding to ca (0x863) are bit = 21 + 7 - 2 - 0 = bit 26, then as follows Figure 5A As shown, bit 26 is converted from its default initial value of 1 to the preset value of 0, where 0 indicates a valid bit. The valid bit for an (0xba1) is bit = 2¹ + 7 - 2 - 1 = bit 25, which is converted from its default initial value of 1 to the preset value of 0. The valid bit for nd (0x92e) is bit = 2¹ + 7 - 2 - 2 = bit 24, which is converted from its default initial value of 1 to the preset value of 0. The valid bit for dl (0xb24) is bit = 2¹ + 7 - 2 - 3 = bit 23, which is converted from its default initial value of 1 to the preset value of 0. The valid bit for le (0x96c) is bit = 2¹ + 7 - 2 - 4 = bit 22, which is converted from its default initial value of 1 to the preset value of 0. The valid bit for es (0xce5) is bit = 2¹ + 7 - 2 - 5 = bit 21, which is converted from its default initial value of 1 to the preset value of 0. The effective bits corresponding to st(0xd33) are bit = 21 + 7 - 2 - 6 = bit 20. Bit 20 is converted from its default initial value of 1 to the preset value of 0, ultimately resulting in... Figure 5A The table entries shown.
[0123] Accordingly, based on the steps described above, the compressed table entry corresponding to the string "include" can be determined, such as... Figure 5B As shown, the string "include" has a total of 7 bytes, according to Figure 4Based on the mapping relationship, the target bucket is determined to be bucket5. If grouped into two-byte groups, six character groups are obtained: "in", "nc", "cl", "lu", "ud", and "de". The hexadecimal numbers corresponding to the characters i, n, c, l, u, d, and e are 69, 6e, 63, 6c, 75, 64, and 65, respectively. According to the preset position calculation algorithm, the effective bits corresponding to the six character groups "in", "nc", "cl", "lu", "ud", and "de" are bit19, bit18, bit17, bit16, bit15, and bit14, respectively. The default initial value of 1 is converted to the preset value of 0 in the corresponding effective bits, resulting in the following: Figure 5B The table entries shown are similar in implementation to those of the string "candlest" mentioned above, and will not be repeated here to avoid redundancy.
[0124] Accordingly, based on the steps described above, the compressed table entry corresponding to the string "cat" can be determined, such as... Figure 5C As shown, the string "cat" has 3 bytes in total. Figure 4 Based on the mapping relationship, the target bucket is determined to be bucket1. If grouped into two-byte groups, two character groups are obtained: "ca" and "at". The hexadecimal numbers corresponding to the characters c, a, and t are 63, 61, and 74, respectively. According to the preset position calculation algorithm, the effective bits corresponding to the two character groups "ca" and "at" are bit1 and bit0, respectively. The default initial value of 1 in the corresponding effective bits is converted to the preset value of 0, resulting in the following: Figure 5C The table entries shown are similar in implementation to those of the string "candlest" mentioned above, and will not be repeated here to avoid redundancy.
[0125] In the above embodiments of this application, the string is grouped into multiple character groups by a preset number of bytes. Based on the characters included in each character group and their arrangement order, the storage address corresponding to each character group is determined, and the position information of each character group within the string is obtained. Then, based on the storage address corresponding to each character group, the actual number of bits, the starting bit position of the target bucket, and the position information of each character group within the string, the compressed entry corresponding to the compressed string is determined. This method, by grouping the string and determining the storage address corresponding to each group, can store the string in a more compact manner. Utilizing the mapping relationship of storage addresses, redundant space can be significantly reduced. By combining the actual number of bits and the starting bit position of the target bucket, storage resources are further precisely planned, thereby making data storage more efficient. The configuration information of the target bucket provides a clear structural framework for data storage. The actual number of bits specifies the amount of data that each target bucket can hold, and the starting bit position clarifies the starting position of the data in the storage medium, enabling the compressed entries to be stored in an orderly manner, facilitating subsequent data retrieval, reading, and management operations.
[0126] Furthermore, based on the above embodiments, combined with Figure 7 , Figure 7 This is a schematic diagram illustrating an exemplary embodiment of obtaining a table entry after string reconstruction, explaining... Figure 8 The process involves restoring compressed entries based on the configuration information of the target bucket to obtain the restored string entries.
[0127] Please see Figure 8 , Figure 8 This is a flowchart illustrating an exemplary embodiment of a method for obtaining a table entry after string restoration. The method may include the following steps:
[0128] S801. Obtain the position information of each character group in the string in the compressed table entry.
[0129] To facilitate understanding of this embodiment, in conjunction with Figure 9 , Figure 9 This is a schematic diagram illustrating the restoration of a 32-bit table in an exemplary embodiment, providing a brief example of the restoration process. For instance, taking the compressed 36-bit and 24-bit entries from the above embodiment as examples, the 36-bit and 24-bit entries can be restored to 64-bit entries respectively during the restoration process.
[0130] Taking the string "candlest" as an example, because it corresponds to a 32-bit compression table during the compression process, its restoration process can be as follows: Figure 10 As shown, Figure 10This is an exemplary embodiment illustrating the restoration of a 32-bit compressed table entry. First, the starting bit position for each bucket is determined. The starting bit positions for buckets 0 to 7 are 0, 1, 3, 6, 10, 15, 21, and 28, respectively. The actual number of bits for buckets 0 to 7 are 1, 2, 3, 4, 5, 6, 7, and 8, respectively. Each character in "candlest" is iterated sequentially, and all eight buckets are iterated to determine the restored entry rcRst[pos'][bucket], where rcRst represents the restored entry, pos' represents the target byte (string character number), and [bucket] is the identifier of the target bucket (bucket number). The restored entry rcRst[pos'][bucket] is equal to ori[Bucketstartbitlist[bucket] + pos' - 2], where ori represents the original compressed table entry, and Bucketstartbitlist[bucket] represents the starting bit position of the target bucket. The restoration process for a 24-bit compressed table can be as follows: Figure 11 As shown, Figure 11 This is an exemplary embodiment illustrating the restoration of a 24-bit compressed entry. First, the starting bit position for each bucket is determined. The starting bit positions for buckets 0 to 10 are 0, 1, 3, 6, 10, 15, 21, 28, 36, 44, and 52, respectively. The actual number of bits for buckets 0 to 10 are 1, 2, 3, 4, 5, 6, 7, 8, 8, 8, 8, 8, respectively. Each character is iterated sequentially, polling all 11 buckets, to determine the restored entry rcRst[pos'][bucket]. The restored entry rcRst[pos'][bucket] is equal to ori[Bucketstartbitlist[bucket+8]+pos'-2]. The addition of 8 is because... Figure 4 The bucket numbers corresponding to the 24-bit compressed table shown start from 8.
[0131] In this embodiment, the position information of each character group in the string is first obtained.
[0132] S802. Based on the position information of each character group in the string in the compression table entry, determine the target byte corresponding to each character group in the preset bytes. The target byte includes a preset number of bits.
[0133] like Figure 7The strings shown correspond to 64-bit entries. Taking the string "candlest" as an example, the position information of the character group "ca" in the string is the first group. Therefore, the target byte corresponding to the preset bytes is byte "7". Correspondingly, the target byte corresponding to the character group "nd" is byte "6", the target byte corresponding to the character group "le" is byte "5", the target byte corresponding to the character group "dl" is byte "4", the target byte corresponding to the character group "an" is byte "3", the target byte corresponding to the character group "es" is byte "2", and the target byte corresponding to the character group "st" is byte "1". Each target byte includes 8 bits, corresponding to 8 buckets.
[0134] S803. Obtain the identification information of the target bucket.
[0135] The target bucket identifier is the bucket number; the target bucket corresponding to the string "candlest" is bucket6.
[0136] S804. Based on the identification information of the target bucket, determine the valid identifier bit of each character group in the corresponding target byte from a preset number of bits.
[0137] According to the target bucket identifier information bucket6, taking the character group "ca" as an example, its corresponding rcRst[pos'][bucket] is rcRst[7][6]. Therefore, the 6th bit in the target byte "7" corresponding to the character group "ca" is the valid identifier bit.
[0138] S805. Based on the valid identifier bit, actual number of bits, starting bit bit of the target bucket, and position information of each character group in the string in the compression table entry, determine the data after restoration of each character group.
[0139] One possible implementation is to input the actual number of bits, the starting bit of the target bucket, and the position information of each character group in the string in the compressed table entry into a preset restoration algorithm. The restoration algorithm is then used to determine the value corresponding to the valid bit of each character group, and the valid identifier bit of each character group in the corresponding target byte is converted from the default initial value to the value corresponding to the valid bit of each character group, thus obtaining the restored data of each character group.
[0140] In this embodiment, the preset restoration algorithm is the above-mentioned ori[Bucketstartbitlist[bucket]+pos'-2] or ori[Bucketstartbitlist[bucket+8]+pos'-2].
[0141] Taking the character group "ca" as an example, rcRst[7][6]=ori[Bucketstartbitlist[bucket]+pos'-2]=[21+7-2]=
[26] , in the compression table entry, bit26 corresponds to 0, so rcRst[7][6]=ori[Bucketstartbitlist[bucket]+pos'-2]=[21+7-2]=
[26] =0, the effective identifier bit of the character group "ca" in the corresponding target byte "7" is converted from the default initial value of 1 to the corresponding value of 0 on the effective bit of each character group, thus obtaining the data after the character group "ca" is restored.
[0142] S806. Based on the data restored from each character group, determine the table entries after the string restoration.
[0143] Based on the above method, the restored data corresponding to the remaining character groups of the string "candlest" can be determined, ultimately resulting in the following: Figure 7 The table entry shown corresponds to the 64-bit string.
[0144] Since the compressed table entry is 60 bits (36 bits + 24 bits), during the restoration process, the 60 bits of content are restored to two original 64-bit entries. Then, a shift-or matching process is performed, which matches the restored entries with the pre-stored string entries. If they match, it means the rule has been hit, and the string is pre-filtered out. If they do not match, it means the rule has not been hit, and the string is not pre-filtered out.
[0145] In the above embodiments of this application, the position information of each character group in the compressed entry within the string is obtained. Based on the position information of each character group in the compressed entry within the string, the target byte corresponding to each character group in a preset number of bytes is determined, wherein the target byte includes a preset number of bits. The identification information of the target bucket is obtained, and based on the identification information of the target bucket, the valid identifier bit of each character group in the corresponding target byte is determined from the preset number of bits. Then, based on the valid identifier bit of each character group in the corresponding target byte, the actual number of bits, the starting bit bit corresponding to the target bucket, and the position information of each character group in the compressed entry within the string, the data after restoration of each character group is determined. Finally, based on the data after restoration of each character group, the entry after string restoration is determined. The method in this embodiment, through a preset position calculation algorithm, combined with the actual number of bits, the starting bit of the target bucket, and the position information of the character group in the string, can accurately determine the effective bits of each character group at the corresponding address, convert the effective bits of each character group at the corresponding address from the default initial value to the preset value, and obtain the compressed table entry corresponding to the string compression, thereby saving storage space. Each character group can be compactly stored in a suitable location, improving the utilization rate of storage resources.
[0146] To facilitate a better understanding of the string filtering method of this application, a brief description is provided below using complete embodiments. Please refer to [link / reference]. Figure 12 , Figure 12 This is a flowchart illustrating a string pre-filtering method, as shown in another exemplary embodiment. The method may include the following steps:
[0147] S121. Obtain the pre-filtered string.
[0148] S122. Based on the number of bytes included in the string, determine the target bucket for storing the string from the preset mapping relationship between the number of bytes and buckets.
[0149] S123. Obtain the configuration information of the target bucket.
[0150] S124. Group the string into groups of a preset number of bytes to obtain multiple character groups.
[0151] S125. For any character group, perform target base conversion on the characters included in the character group to obtain the corresponding data of each character after conversion.
[0152] S126. Select data with a preset number of digits from the data corresponding to each character after conversion.
[0153] S127. Based on the order of the characters in the character group, combine the data of a preset number of bits selected from each character to determine the storage address corresponding to the character group.
[0154] S128. Obtain the position information of each character group in the string.
[0155] S129. Input the actual number of bits, the starting bit corresponding to the target bucket, and the position information of each character group in the string into the preset position calculation algorithm, and use the position calculation algorithm to determine the effective bits of each character group at the corresponding address.
[0156] S1210. Convert the effective bits of each character group at the corresponding address from the default initial value to the preset value to obtain the corresponding compressed table entry after string compression.
[0157] S1211. Obtain the position information of each character group in the string in the compressed table entry.
[0158] S1212. Based on the position information of each character group in the string in the compression table entry, determine the target byte corresponding to each character group in the preset bytes. The target byte includes a preset number of bits.
[0159] S1213. Obtain the identification information of the target bucket.
[0160] S1214. Based on the identification information of the target bucket, determine the valid identifier bit of each character group in the corresponding target byte from a preset number of bits.
[0161] S1215. Input the actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string in the compression table entry into the preset restoration algorithm, and use the restoration algorithm to determine the corresponding value of the effective bit position of each character group.
[0162] S1216. Convert the valid identifier bits of each character group in the corresponding target byte from the default initial value to the corresponding values of the valid bits of each character group to obtain the restored data of each character group.
[0163] S1217. Based on the data restored from each character group, determine the table entries after the string restoration.
[0164] For the specific implementation process and technical effects of each step, please refer to the above-mentioned multiple embodiments. To avoid redundancy, the description will not be repeated. Through this application, the pre-filtering performance of the full-package floating string is improved from 240Gbps to 800Gbps, which greatly improves the matching performance of the full-package floating string rules.
[0165] This application also provides a string pre-filtering device; please refer to [link to relevant documentation]. Figure 13 , Figure 13 This is a schematic diagram illustrating the structure of a string pre-filtering device according to an exemplary embodiment. The device includes:
[0166] The acquisition module 131 is used to acquire the pre-filtered string and determine the target bucket for storing the string.
[0167] The acquisition module 131 is also used to acquire the configuration information of the target bucket.
[0168] The determination module 132 is used to determine the compression table entry corresponding to the compressed string based on the configuration information of the target bucket and the string.
[0169] Processing module 133 is used to restore the compressed table entries according to the configuration information of the target bucket to obtain the table entries after string restoration.
[0170] The processing module 133 is also used to pre-filter out the string if the restored table entry is consistent with the table entry of the pre-stored string.
[0171] One possible implementation is that the target bucket configuration information includes: the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket. The determining module 132 is specifically used for:
[0172] The string is grouped into multiple character groups by a preset number of bytes.
[0173] The storage address corresponding to each character group is determined based on the characters included in each character group and their arrangement order.
[0174] Get the position information of each character group in the string.
[0175] Based on the storage address of each character group, the actual number of bits, the starting bit of the target bucket, and the position information of each character group in the string, determine the corresponding compression table entry after string compression.
[0176] One possible implementation is to determine module 132, specifically for:
[0177] For any character set, perform target base conversion on the characters included in the character set to obtain the corresponding data for each character after conversion.
[0178] Select data with a preset number of bits from the data corresponding to each character after conversion.
[0179] Based on the order of the characters in the character group, the data of a preset number of bits selected from each character are combined to determine the storage address corresponding to the character group.
[0180] One possible implementation is to input the actual number of bits, the starting bit of the target bucket, and the position information of each character group in the string into a preset position calculation algorithm, and then use the position calculation algorithm to determine the effective bits of each character group at the corresponding address.
[0181] The effective bits of each character group at the corresponding address are converted from the default initial value to the preset value to obtain the corresponding compressed table entry after string compression.
[0182] One possible implementation is that the target bucket configuration information includes the actual number of bits in the target bucket and the starting bit position corresponding to the target bucket. Processing module 133 is specifically used for:
[0183] Get the position information of each character group in the string in the compressed table entry.
[0184] Based on the position information of each character group in the string in the compression table entry, determine the target byte corresponding to each character group in the preset bytes. The target byte includes a preset number of bits.
[0185] Obtain the identification information of the target bucket.
[0186] Based on the identification information of the target bucket, the valid identifier bits of each character group in the corresponding target byte are determined from a preset number of bits.
[0187] Based on the valid identifier bit, actual number of bits, starting bit bit of the target bucket, and position information of each character group in the string in the compression table entry, determine the data after restoration of each character group.
[0188] Based on the data restored from each character group, determine the table entries after the string restoration.
[0189] One possible implementation is that processing module 133 is specifically used for:
[0190] The actual number of bits, the starting bit of the target bucket, and the position information of each character group in the string in the compression table are input into the preset restoration algorithm, and the restoration algorithm is used to determine the value corresponding to the effective bit of each character group.
[0191] The valid identifier bits of each character group in the corresponding target byte are converted from their default initial values to the corresponding values of the valid bits of each character group, thus obtaining the restored data of each character group.
[0192] For a description of the features in the embodiment corresponding to the string pre-filtering device, please refer to the relevant description in the embodiment corresponding to the string pre-filtering method, which will not be repeated here.
[0193] Figure 14 This is a schematic diagram illustrating the structure of an electronic device as shown in an exemplary embodiment. Figure 14As shown, the electronic device provided in this embodiment includes at least one processor 141 and a memory 142. Optionally, the electronic device further includes a communication component 143. The processor 141, memory 142, and communication component 143 are connected via a bus 144.
[0194] In the specific implementation process, at least one processor 141 executes computer execution instructions stored in memory 142, causing at least one processor 141 to execute the above-described string pre-filtering method embodiment.
[0195] The specific implementation process of processor 141 can be found in the above method embodiments, and its implementation principle and technical effect are similar. It will not be repeated here.
[0196] In the above embodiments, it should be understood that the processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the application can be directly manifested as being executed by a hardware processor, or executed by a combination of hardware and software modules within the processor.
[0197] The memory may include random access memory (RAM) and may also include non-volatile memory (NVM), such as at least one disk storage device.
[0198] The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of illustration, the buses shown in the accompanying drawings are not limited to a single bus or a single type of bus.
[0199] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above-described string pre-filtering method embodiments at runtime.
[0200] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.
[0201] Embodiments of this application also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above-described string pre-filtering method embodiments.
[0202] Embodiments of this application also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in any of the above-described string pre-filtering method embodiments.
[0203] Other embodiments of this application 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 application that follow the general principles of this application 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 application are indicated by the following claims.
[0204] It should be understood that this application 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 this application is limited only by the appended claims.
Claims
1. A string pre-filtering method, characterized in that, include: Obtain the pre-filtered string and determine the target bucket for storing the string; Obtain the configuration information of the target bucket; Based on the configuration information of the target bucket and the string, determine the compressed table entry corresponding to the compressed string; Based on the configuration information of the target bucket, the compressed table entry is restored to obtain the table entry after the string is restored; If the restored table entry matches the pre-stored string entry, then the string is pre-filtered out.
2. The method according to claim 1, characterized in that, The configuration information of the target bucket includes: the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket; The step of determining the compression entry corresponding to the compressed string based on the configuration information of the target bucket and the string includes: The string is grouped into multiple character groups by a preset number of bytes; Determine the storage address corresponding to each character group based on the characters included in each character group and the order in which the characters are arranged. Get the position information of each character group in the string; Based on the storage address corresponding to each character group, the actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string, the compression table entry corresponding to the compressed string is determined.
3. The method according to claim 2, characterized in that, The step of determining the storage address corresponding to each character group based on the characters included in each character group and the order in which the characters are arranged includes: For any character group, the characters included in the character group are converted to the target base to obtain the data corresponding to each character after conversion; Select data with a preset number of bits from the data corresponding to each character after conversion; Based on the order of the characters in the character group, a preset number of bits of data selected from each character are combined to determine the storage address corresponding to the character group.
4. The method according to claim 2, characterized in that, The step of determining the compression table entry corresponding to the compressed string based on the storage address corresponding to each character group, the actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string includes: The actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string are input into a preset position calculation algorithm, and the position calculation algorithm is used to determine the effective bit position of each character group at the corresponding address. The effective bits of each character group at the corresponding address are converted from the default initial value to the preset value to obtain the compression table entry corresponding to the compressed string.
5. The method according to claim 2, characterized in that, The configuration information of the target bucket includes the actual number of bits included in the target bucket and the starting bit position corresponding to the target bucket; The step of restoring the compressed table entry based on the configuration information of the target bucket to obtain the table entry after string restoration includes: Obtain the position information of each character group in the string within the compressed table entry; Based on the position information of each character group in the string in the compression table entry, the target byte corresponding to each character group in the preset bytes is determined, and the target byte includes a preset number of bits; Obtain the identification information of the target bucket; Based on the identification information of the target bucket, the valid identifier bits of each character group in the corresponding target byte are determined from the preset number of bits; Based on the valid identifier bit of each character group in the corresponding target byte, the actual number of bits, the starting bit bit of the target bucket, and the position information of each character group in the string in the compression table entry, determine the data after restoration of each character group; Based on the data restored from each character group, determine the table entry for the restored string.
6. The method according to claim 5, characterized in that, The step of determining the restored data for each character group based on the valid identifier bit of each character group in the corresponding target byte, the actual number of bits, the starting bit bit corresponding to the target bucket, and the position information of each character group in the string in the compression table entry includes: The actual number of bits, the starting bit position corresponding to the target bucket, and the position information of each character group in the string in the compression table entry are input into the preset restoration algorithm, and the restoration algorithm is used to determine the value corresponding to the effective bit position of each character group. The valid identifier bits of each character group in the corresponding target byte are converted from their default initial values to the corresponding values on the valid bits of each character group, thus obtaining the restored data of each character group.
7. A string pre-filtering device, characterized in that, include: The acquisition module is used to acquire the pre-filtered string and determine the target bucket for storing the string; The acquisition module is also used to acquire the configuration information of the target bucket; The determination module is used to determine the compressed table entry corresponding to the compressed string based on the configuration information of the target bucket and the string. The processing module is used to restore the compressed table entry according to the configuration information of the target bucket to obtain the table entry after the string is restored; The processing module is further configured to pre-filter out the string if the restored table entry is consistent with the pre-stored string table entry.
8. An electronic device, characterized in that, include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executed instructions; The processor executes computer execution instructions stored in the memory to implement the method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the method as described in any one of claims 1 to 6.
10. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the method described in any one of claims 1-6.
