Method, Electronic Device, Storage Medium and Program Product for Data Retrieval
By using multi-layer preset search filters in the CAN bus network to filter CAN messages, the problem of high screening complexity in the prior art is solved, and more efficient data retrieval is achieved.
Patent Information
- Application Number
- CN202410736537.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-07
- Publication Date
- 2025-06-13
- Estimated Expiration
- 2044-06-07
AI Technical Summary
In CAN bus network, the complexity of filtering CAN messages is high, resulting in low retrieval speed and efficiency.
The candidate search results of the search data are determined from multiple preset data through a multi-layer preset search filter, and the number of preset search filters is positively correlated with the number of layers.
It effectively reduces the amount and complexity of the search data, and improves the search speed and efficiency.
Smart Images

Figure CN118349710B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the technical field of vehicles, and in particular, to a method for data retrieval, an electronic device, a storage medium, and a program product. Background Art
[0002] In the automotive manufacturing industry, the CAN (Controller Area Network) bus has become the mainstream communication method in fields such as automotive electronic control systems and industrial automation. In the CAN bus network, information is exchanged between each node through CAN messages, and CAN messages, as the basic unit of information transmission, have advantages such as high real-time performance and high reliability. However, with the continuous expansion of the CAN bus application scenarios and the continuous increase in data volume, it has become more difficult and time-consuming to obtain the required data. In the related art, the complexity of screening CAN messages is high, resulting in low retrieval speed and efficiency of CAN messages. Summary of the Invention
[0003] The purpose of the present disclosure is to provide a method for data retrieval, an electronic device, a storage medium, and a program product, which are used to improve the speed and efficiency of data retrieval.
[0004] According to the first aspect of the embodiments of the present disclosure, a method for data retrieval is provided, and the method includes:
[0005] Obtain retrieval data;
[0006] Determine candidate retrieval results corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters, where the number of the preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters;
[0007] In the case where the candidate retrieval results include candidate result data corresponding to the retrieval data, determine the target retrieval result of the retrieval data according to the candidate result data and the retrieval data.
[0008] Optionally, the method further includes:
[0009] Determine at least one retrieval word segment corresponding to the retrieval data according to the position information of each character in the retrieval data, where the position information is used to represent the position of the character in the retrieval data;
[0010] The determining candidate retrieval results corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters includes:
[0011] Determine the candidate retrieval results corresponding to the at least one retrieval word segment from the multiple preset data through multiple layers of the preset retrieval filters.
[0012] Optionally, the multiple preset data correspond to multiple logical partitions, and the memory address of each preset data is stored in one of the logical partitions; the determining of the candidate retrieval results corresponding to the at least one retrieval term from the multiple preset data by means of multiple layers of the preset retrieval filters includes:
[0013] Determining the candidate retrieval results from the multiple preset data by means of multiple layers of the preset retrieval filters according to the multiple logical partitions, the at least one retrieval term, and a preset correspondence relationship, where the preset correspondence relationship includes the correspondence relationship between the logical partitions and the preset retrieval filters.
[0014] Optionally, the determining of the candidate retrieval results from the multiple preset data by means of multiple layers of the preset retrieval filters according to the multiple logical partitions, the at least one retrieval term, and a preset correspondence relationship includes:
[0015] According to the logical partitions, the at least one retrieval term, and the preset correspondence relationship, sequentially traverse the first target filters in each layer of the preset retrieval filters according to the number of layers of the preset retrieval filters until all layers of the first target filters are traversed, or determine that the candidate retrieval results are that there is no target data in the multiple preset data that matches the at least one retrieval term; each layer of the first target filters is determined according to the screening result of the previous layer of the preset retrieval filters, and the first target filters in the first layer are all the preset retrieval filters in that layer;
[0016] In the case of traversing all layers of the first target filters, determine the candidate retrieval results according to the screening result of the last layer of the first target filters.
[0017] Optionally, the first hash values corresponding to the multiple preset data are stored in each layer of the preset retrieval filters; the sequentially traversing the first target filters in each layer of the preset retrieval filters according to the logical partitions, the at least one retrieval term, and the preset correspondence relationship includes:
[0018] For each layer of the preset retrieval filters, determine the second hash values of the at least one retrieval term according to the hash function corresponding to the preset retrieval filters in that layer;
[0019] Take the logical partitions corresponding to the filters in the previous layer of the preset retrieval filters where the at least one retrieval term is determined to exist as the first target logical partitions;
[0020] Take the filters corresponding to the first target logical partitions in the preset retrieval filters in that layer as the first target filters;
[0021] Traverse the first target filter according to the second hash value to obtain the screening result of the preset retrieval filter at this layer.
[0022] Optionally, determining the candidate retrieval result according to the screening result of the first target filter of the last layer includes:
[0023] When the screening result of the first target filter of the last layer indicates that the target data exists in the multiple preset data, use the logical partition corresponding to the filter with the at least one retrieval word segmentation in the first target filter of the last layer as the second target logical partition;
[0024] Use the data corresponding to the memory address stored in the second target logical partition as the candidate result data;
[0025] Generate the candidate retrieval result according to the candidate result data.
[0026] Optionally, the method further includes:
[0027] Receive the preset data;
[0028] Store the preset data into a preset memory space to obtain the memory address corresponding to the preset data;
[0029] Store the memory address into the third target logical partition corresponding to the preset data;
[0030] Store the preset data into the preset retrieval filter according to the third target logical partition.
[0031] Optionally, storing the memory address into the third target logical partition corresponding to the preset data includes:
[0032] Determine the third target logical partition from multiple logical partitions according to a preset partitioning rule, and the preset partitioning rule includes a logical rule for partitioning the preset data;
[0033] Store the memory address into the third target logical partition.
[0034] Optionally, storing the preset data into the preset retrieval filter according to the third target logical partition includes:
[0035] Determine at least one target word segmentation corresponding to the preset data according to the position information of each character in the preset data, and the position information is used to represent the position of the character in the preset data;
[0036] Store the at least one target word segmentation into the preset retrieval filter according to the third target logical partition.
[0037] Optionally, the number of the preset retrieval filters in each layer increases in sequence, and the multiple preset data correspond to multiple logical partitions; the storing the at least one target word segment into the preset retrieval filter according to the third target logical partition includes:
[0038] For each layer of the preset retrieval filters, determining a second target filter corresponding to the third target logical partition in the preset retrieval filter of this layer according to a preset corresponding relationship, where the preset corresponding relationship includes the corresponding relationship between the logical partition and the preset retrieval filter;
[0039] Determining a third hash value corresponding to the at least one target word segment according to the hash function corresponding to the preset retrieval filter of this layer;
[0040] Storing the third hash value into the second target filter.
[0041] Optionally, the storing the third hash value into the second target filter includes:
[0042] Taking the remainder of the third hash value with respect to the length of the second target filter to obtain a target bit position;
[0043] Setting the value of the target bit position to a preset bit value.
[0044] Optionally, the determining the target retrieval result of the retrieval data according to the candidate result data and the retrieval data includes:
[0045] Linearly searching for the retrieval data in the candidate result data;
[0046] When there is target data matching the retrieval data in the candidate result data, using the target data as the retrieval result.
[0047] Optionally, the preset retrieval filter includes a Bloom filter.
[0048] According to a second aspect of the embodiments of the present disclosure, there is provided an electronic device, including:
[0049] A memory, on which a computer program is stored;
[0050] A processor, configured to execute the computer program in the memory to implement the steps of the method according to the first aspect of the embodiments of the present disclosure.
[0051] According to a third aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method according to the first aspect of the embodiments of the present disclosure are implemented.
[0052] According to a fourth aspect of the embodiments of the present disclosure, there is provided a computer program product, including a computer program, which when executed by a processor, implements the steps of the method described in the first aspect of the embodiments of the present disclosure.
[0053] Through the above technical solutions, the present disclosure first obtains retrieval data, and determines candidate retrieval results corresponding to the retrieval data from a plurality of preset data through multiple preset retrieval filters, where the number of preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters. In the case where the candidate retrieval results include candidate result data corresponding to the retrieval data, the target retrieval result of the retrieval data is determined according to the candidate result data and the retrieval data. The present disclosure filters the preset data through multiple preset retrieval filters. Since the number of each layer of preset retrieval filters increases sequentially as the number of layers increases, the amount of data obtained after passing through each layer of preset retrieval filters will decrease layer by layer. Retrieving the retrieval data from the candidate result data filtered by the multiple preset retrieval filters can effectively reduce the amount of retrieved data and complexity, thereby improving the retrieval speed and efficiency.
[0054] Other features and advantages of the present disclosure will be described in detail in the subsequent specific implementation part. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The drawings are used to provide a further understanding of the present disclosure, and constitute a part of the specification. Together with the following specific implementation, they are used to explain the present disclosure, but do not constitute a limitation to the present disclosure.
[0056] Figure 1 is a flowchart of a method for data retrieval shown according to an exemplary embodiment.
[0057] Figure 2 is according to Figure 1 an embodiment shows a schematic diagram of a multiple-layer preset retrieval filter.
[0058] Figure 3 is a flowchart of another method for data retrieval shown according to an exemplary embodiment.
[0059] Figure 4 is a flowchart of another method for data retrieval shown according to an exemplary embodiment.
[0060] Figure 5 is a flowchart of another method for data retrieval shown according to an exemplary embodiment.
[0061] Figure 6 is a block diagram of a data retrieval device shown according to an exemplary embodiment.
[0062] Figure 7It is a flowchart of a method for storing data shown according to an exemplary embodiment.
[0063] Figure 8 It is a flowchart of a method for retrieving data shown according to an exemplary embodiment.
[0064] Figure 9 It is a block diagram of a data retrieval device shown according to an exemplary embodiment.
[0065] Figure 10 It is a block diagram of another data retrieval device shown according to an exemplary embodiment.
[0066] Figure 11 It is a block diagram of another data retrieval device shown according to an exemplary embodiment.
[0067] Figure 12 It is a block diagram of an electronic device shown according to an exemplary embodiment. Detailed implementation manners
[0068] The following provides a detailed description of the specific implementation manners of the present disclosure with reference to the accompanying drawings. It should be understood that the specific implementation manners described herein are only used to illustrate and explain the present disclosure, and are not used to limit the present disclosure.
[0069] Before introducing a data retrieval method, an electronic device, a storage medium, and a program product shown in the embodiments of the present disclosure, the application scenarios related to the embodiments of the present disclosure are first introduced.
[0070] Traditional CAN message screening methods are divided into two categories: The first category is linear search, which traverses the data in the dataset one by one, and filters out the sub-dataset after comparing with the screening conditions. This type of method has a low space complexity, but the time complexity of the traversal process is relatively high, which is proportional to the number of the dataset; The second category is binary search based on a binary tree. Each piece of data is split into multiple words as the binary tree keys, and the data or data address is used as the binary tree value. The input screening conditions can be quickly found in the binary tree through binary search to find the corresponding keys. The time complexity is relatively low, but the space complexity and time complexity of establishing all the word segments of the dataset are relatively high.
[0071] The present disclosure filters the preset data through multiple layers of preset retrieval filters. Since the number of each layer of preset retrieval filters increases successively with the increase of the number of layers, the amount of data obtained after passing through each layer of preset retrieval filters will decrease layer by layer. Retrieving the retrieval data from the candidate result data filtered by the multiple layers of preset retrieval filters can effectively reduce the amount of data and complexity of the retrieval, thereby improving the retrieval speed and efficiency.
[0072] Figure 1It is a flowchart of a data retrieval method shown according to an exemplary embodiment. As Figure 1 shown, the method may include the following steps.
[0073] Step S101, obtain retrieval data.
[0074] Step S102, determine candidate retrieval results corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters.
[0075] Exemplarily, the data in the embodiments of the present disclosure may be CAN messages or any other type of data, and the present disclosure does not make specific limitations thereon. The retrieval data can be understood as the screening conditions of the data. After obtaining the retrieval data, multiple preset data can be filtered through multiple layers of preset retrieval filters according to the retrieval data to obtain candidate retrieval results. Among them, the candidate retrieval results can indicate whether there is data in the multiple preset data that matches the retrieval data. In the case where there is data that matches the retrieval data, the candidate result data may include the candidate result data obtained by filtering the multiple preset data by the preset retrieval filters. In the case where there is no data that matches the retrieval data, the candidate retrieval results do not include candidate result data, that is, the candidate retrieval results are empty.
[0076] The preset retrieval filter may be a Bloom filter or any other filter that can implement data filtering, and the present disclosure does not make specific limitations thereon. The number of layers of the preset retrieval filter can be set according to the data volume of the preset data. For example, the number of layers of the preset retrieval filter may be positively correlated with the data volume of the preset data, that is, the larger the data volume of the preset data, the larger the number of layers of the preset retrieval filter can be. The number of each layer of preset retrieval filters and the number of layers of the preset retrieval filter may also be positively correlated, that is, the higher the number of layers of the preset retrieval filter, the more the number of the preset retrieval filters of this layer. Taking the preset retrieval filter having 3 layers as an example, as Figure 2 shown, the number of the first layer of preset retrieval filters A11 may be 1, the number of the second layer of preset retrieval filters A12 may be 4, and the number of the third layer of preset retrieval filters A13 may be 16. Among them, the first 4 preset retrieval filters of the third layer correspond to the first preset retrieval filter of the second layer, that is, the same preset data is stored in the first 4 preset retrieval filters of the third layer and the first preset retrieval filter of the second layer. The 5th - 8th preset retrieval filters of the third layer correspond to the second preset filter of the second layer, and so on. Each preset retrieval filter may be composed of a fixed - sized and continuous memory space. When initializing, the memory value of each bit can be set to 0.
[0077] In some embodiments, the preset retrieval filter may be a Bloom filter. The multi-layer Bloom filter may include three layers: The first-layer filter may contain only one Bloom filter, which occupies a relatively large continuous memory space, such as 100 MBYTE, and is used to store the hash function values generated by multiple preset data through hash function 1, corresponding to indicating whether all preset data may be valid. The second-layer filter contains multiple Bloom filters, such as 100, and each filter may occupy a continuous memory space of 100 M BYTE / 100, and is used to store the hash function values generated by multiple preset data through hash function 2, and each filter corresponds to indicating whether a part of the preset data may be valid. The third-layer filter contains multiple Bloom filters, such as 100,000, and each occupies a continuous memory space of 100 M BYTE / 100,000, and is used to store the hash function values generated by multiple preset data through hash function 3, and each filter corresponds to indicating whether an even smaller part of the preset data than the second layer may be valid.
[0078] In some other embodiments, according to the retrieved data, the preset data may be filtered through each layer of the preset retrieval filter in sequence to determine the candidate retrieval result corresponding to the retrieved data from multiple preset data. Taking the preset retrieval filter having three layers as an example, if after filtering through the first-layer preset retrieval filter, it is determined that there may be target data in multiple preset data that matches the retrieved data, then filtering may be performed through the second-layer preset retrieval filter. If there may be target data in a certain preset retrieval filter in the second layer that matches the retrieved data, then filtering may be performed through the multiple preset retrieval filters corresponding to this preset retrieval filter in the third layer to obtain the final candidate retrieval result. Taking the Figure 2 filter shown as an example, if there is target data in the first preset retrieval filter in the second layer that matches the retrieved data, then filtering may continue through the first 4 preset retrieval filters in the third layer.
[0079] In this way, by using the multi-layer preset retrieval filter, it is determined layer by layer whether there may be target data in multiple preset data that matches the retrieved data. When it is determined by a certain layer of the preset retrieval filter that there is no retrieved data in multiple preset data, there is no need to continue judging the filters in the next layer, which is faster than directly judging the data. When it is determined by a certain layer of the preset retrieval filter that there may be target data in multiple preset data, the false positive rate is reduced, and the number of preset retrieval filters in the next layer can be increased. This method of increasing or decreasing the number of traversed filters according to the level of the false positive rate can reduce the calculation amount and speed up the retrieval speed.
[0080] Step S103, in the case that the candidate retrieval result includes the candidate result data corresponding to the retrieved data, determine the target retrieval result of the retrieved data according to the candidate result data and the retrieved data.
[0081] Exemplarily, if it is determined that there may be target data in the preset data that matches the retrieval data after filtering by the last-layer preset retrieval filter, then the preset data stored in the preset retrieval filter where the target data exists in the last-layer preset retrieval filter can be used as candidate result data.
[0082] After obtaining the candidate retrieval results, a linear search for the retrieval data can be performed in the candidate result data in the candidate retrieval results. In the case where there is target data in the candidate result data that matches the retrieval data, the target data can be used as the target retrieval result. In the case where there is no target data in the candidate result data that matches the retrieval data, it can be determined that there is no target data in the multiple preset data that matches the retrieval data. After filtering by the preset retrieval filter, candidate result data with a smaller data volume is obtained, and then the retrieval data is further retrieved in the filtered candidate result data, which can effectively reduce the data volume and complexity of the retrieval, thereby improving the retrieval speed and efficiency.
[0083] In summary, the present disclosure first obtains retrieval data and determines candidate retrieval results corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters, where the number of preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters. In the case where the candidate retrieval results include candidate result data corresponding to the retrieval data, the target retrieval result of the retrieval data is determined based on the candidate result data and the retrieval data. The present disclosure filters the preset data through multiple layers of preset retrieval filters. Since the number of each layer of preset retrieval filters increases sequentially as the number of layers increases, the data volume obtained after each layer of preset retrieval filter will decrease layer by layer. Retrieving the retrieval data in the candidate result data filtered by the multiple layers of preset retrieval filters can effectively reduce the data volume and complexity of the retrieval, thereby improving the retrieval speed and efficiency.
[0084] Figure 3 is a flowchart of another data retrieval method shown according to an exemplary embodiment. As Figure 3 shown, the method may further include the following steps.
[0085] Step S104, determine at least one retrieval token corresponding to the retrieval data according to the position information of each character in the retrieval data.
[0086] Exemplarily, at least one retrieval token corresponding to the retrieval data can be generated according to the position information of each character in the retrieval data, so as to obtain at least one retrieval token corresponding to the retrieval data, where the position information can be used to represent the position of the character in the retrieval data.
[0087] For example, the retrieved data includes "123, CAN, XY", which contains three retrieval conditions: "123", "CAN", and "XY". Each retrieval condition corresponds to a certain column of the data. The maximum length of the row corresponding to the retrieved data is 31. Among them, 1 is in the 4th position of the retrieved data, 2 is in the 5th position of the retrieved data, 3 is in the 6th position of the retrieved data, C is in the 12th position of the retrieved data, A is in the 13th position of the retrieved data, N is in the 14th position of the retrieved data, X is in the 26th position of the retrieved data, and Y is in the 27th position of the retrieved data. Then, the retrieval word segmentation corresponding to the retrieved data is as follows:
[0088] \0\0\01\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0089] \0\0\0\02\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0090] \0\0\0\0\03\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0091] \0\0\0\0\0\0\0\0\0\0\0C\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0092] \0\0\0\0\0\0\0\0\0\0\0\0A\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0093] \0\0\0\0\0\0\0\0\0\0\0\0\0N\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0094] \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0X\0\0\0\0\0
[0095] \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Y\0\0\0\0
[0096] In the embodiments of the present disclosure, the corresponding retrieval word segmentation can be determined by combining the position of each character in the retrieval data in the retrieval data. The data word segmentation method is simple and easy to implement, reducing the amount of data processing. Moreover, multiple retrieval conditions can be combined into retrieval data through data word segmentation, enabling flexible multi-condition retrieval and improving the retrieval efficiency.
[0097] Correspondingly, one implementation manner of step S102 may be: determining at least one candidate retrieval result corresponding to the retrieval word segmentation from multiple preset data through multiple layers of preset retrieval filters.
[0098] Exemplarily, the preset data can be filtered layer by layer through each layer of preset retrieval filter according to the retrieval word segmentation to determine the candidate retrieval result corresponding to the retrieval word segmentation from multiple preset data.
[0099] According to some embodiments of the present disclosure, multiple preset data may correspond to multiple logical partitions, and the memory address of each preset data is stored in a logical partition. Correspondingly, another implementation manner of step S102 may be: determining the candidate retrieval result from multiple preset data through multiple layers of preset retrieval filters according to multiple logical partitions, at least one retrieval word segmentation, and a preset correspondence relationship. Wherein, the preset correspondence relationship includes the correspondence relationship between the logical partition and the preset retrieval filter.
[0100] Exemplarily, the preset data can be stored in a preset memory space to obtain the memory address corresponding to the preset data, and then the memory address is stored in the logical partition corresponding to the preset data. Each preset retrieval filter corresponds to a logical partition, so the preset data can be stored in each layer of corresponding preset retrieval filter according to the logical partition corresponding to the preset data.
[0101] In some embodiments, according to the logical partition, at least one retrieval word segmentation, and the preset correspondence relationship, the first target filters in each layer of the preset retrieval filters can be traversed in sequence according to the number of layers of the preset retrieval filters until all layers of the first target filters are traversed, or it is determined that the candidate retrieval result is that there is no target data in the multiple preset data that matches at least one retrieval word segmentation. Wherein, each layer of the first target filter is determined according to the screening result of the previous layer of the preset retrieval filter, and the first target filter of the first layer is all the preset retrieval filters of this layer. In the case of traversing all layers of the first target filters, the candidate retrieval result can be determined according to the screening result of the last layer of the first target filter.
[0102] Taking the case where the preset retrieval filter includes three layers as an example, the first target filter of the first layer is all the preset retrieval filters of the first layer. After traversing the first target filters in the preset retrieval filters, if it is determined that there may be target data matching the retrieval participles, then the preset retrieval filters in the first layer where target data exists can be used as the first target filters of the corresponding preset retrieval filters in the second layer. Then traverse all the first target filters of the second layer. If it is determined that there may be target data matching the retrieval participles, then the preset retrieval filters in the second layer where target data exists can be used as the first target filters of the corresponding preset retrieval filters in the third layer. Then traverse all the first target filters of the third layer. If it is determined that there may be target data matching the retrieval participles, then the preset data corresponding to the preset retrieval filters in the first target filters of the third layer where target data may exist can be used as the candidate result data.
[0103] Figure 4 is a flowchart of another data retrieval method shown according to an exemplary embodiment, as Figure 4 shown, step S102 can be implemented through the following steps.
[0104] Step S1021, for each layer of preset retrieval filters, determine the second hash values of at least one retrieval participle according to the hash function corresponding to the preset retrieval filters of this layer.
[0105] Step S1022, use the logical partition corresponding to the filter in the previous layer of preset retrieval filters where at least one retrieval participle is determined to exist as the first target logical partition.
[0106] Step S1023, use the filters corresponding to the first target logical partition in the preset retrieval filters of this layer as the first target filters.
[0107] Step S1024, traverse the first target filters according to the second hash values to obtain the screening results of the preset retrieval filters of this layer.
[0108] Exemplarily, taking the case where the preset retrieval filter includes two layers as an example, for the preset retrieval filters of the first layer, the second hash values of the retrieval participles in the first layer can be calculated according to the hash function corresponding to the preset retrieval filters of the first layer, and the first target filters of the first layer can be traversed according to the second hash values to determine whether there are hash values in the first hash values stored in the first target filters of the first layer that match the second hash values. If there are, the preset data corresponding to the first target filters can be used as the screening results of the first layer. At the same time, the logical partition corresponding to the filter in the first layer where the retrieval participles exist can be used as the first target logical partition of the first layer, and the filters corresponding to the first target logical partition in the second layer can be used as the first target filters of the second layer.
[0109] For the first target filter of the second layer, the second hash value of the retrieval word segmentation in the second layer can be calculated according to the hash function corresponding to the preset retrieval filter of the second layer, and the first target filter of the second layer can be traversed according to the second hash value to determine whether there is a hash value in the first hash values stored in the first target filter of the second layer that matches the second hash value. If there is a match, the preset data corresponding to the first target filter can be used as the screening result of the second layer.
[0110] Taking the example that there are three layers of preset retrieval filters and N retrieval word segmentations, first, the first hash values of all retrieval word segmentations can be calculated through hash function 1: L 1 1~L 1 N, and then the first hash values are respectively modulo the bit length of the preset retrieval filter of the first layer to determine whether the corresponding bit is 1.
[0111] If one of them is not 1, it can be determined that there is no target data corresponding to the retrieval word segmentation among the multiple preset data. If all are 1, it indicates that there may be target data corresponding to the retrieval word segmentation among the multiple preset data. Then, the second hash values of all retrieval word segmentations can be calculated through hash function 2: L 2 1~L 2 N, and then the second hash values are respectively modulo the bit length of each preset retrieval filter of the second layer to determine whether the corresponding bit is 1.
[0112] If one of them is not 1, it can be determined that there is no target data corresponding to the retrieval word segmentation among the multiple preset data corresponding to the preset retrieval filter. If all are 1, it indicates that there may be target data corresponding to the retrieval word segmentation among the preset data corresponding to the preset retrieval filter.
[0113] If there is no target data corresponding to the retrieval word segmentation among the preset data corresponding to all the preset retrieval filters of the second layer, it can be determined that there is no target data among the multiple preset data. If at least one of all the preset retrieval filters of the second layer is all 1, it can be determined that there may be target data corresponding to the retrieval word segmentation among the multiple preset data, and the preset retrieval filters with the bit determined to be 1 in the second layer can be used as candidate retrieval filters. Then, the third hash values of all retrieval word segmentations can be calculated through hash function 3: L 3 1~L 3 N, and then the third hash values are respectively modulo the bit length of each preset retrieval filter corresponding to the candidate retrieval filter in the third layer to determine whether the corresponding bit is 1.
[0114] If the target data corresponding to the retrieval token does not exist in all the preset data corresponding to the third - layer preset retrieval filters, it can be determined that the target data corresponding to the retrieval token does not exist in the multiple preset data. If at least one of all the preset retrieval filters in the third layer is all 1, it can be determined that the target data corresponding to the retrieval token may exist in the multiple preset data. Then, the preset data corresponding to the preset retrieval filter with the bit position judged as 1 in the third layer can be used as the candidate result data.
[0115] In this way, by using the preset retrieval filter to store the hash value of the data token and retrieving the data through the comparison of bit - value numbers, since the bit - value number judgment is fast and the space complexity is small, the speed and efficiency of data retrieval can be improved.
[0116] According to some other embodiments of the present disclosure, when the screening result of the first target filter in the last layer indicates that the target data exists in the multiple preset data, the logical partition corresponding to the filter with the retrieval token in the first target filter in the last layer can be used as the second target logical partition, and the data corresponding to the memory address stored in the second target logical partition can be used as the candidate result data, and then the candidate retrieval result can be generated according to the candidate result data.
[0117] Figure 5 is a flowchart of another data retrieval method shown according to an exemplary embodiment, as Figure 5 shown, and the method may further include the following steps.
[0118] Step S105, receive preset data.
[0119] Step S106, store the preset data in the storage module to obtain the memory address corresponding to the preset data.
[0120] Step S107, store the memory address in the third target logical partition corresponding to the preset data.
[0121] Step S108, store the preset data in the preset retrieval filter according to the third target logical partition.
[0122] Exemplarily, when the storage module receives the preset data, it can allocate a space in the heap memory to store the preset data and obtain the memory address corresponding to the preset data. Then, the third target logical partition can be determined from multiple logical partitions according to the preset division rule, and the memory address can be stored in the third target logical partition. Among them, the preset division rule may include the logical rule for dividing the preset data. The preset data can also be stored in the preset retrieval filter according to the third target logical partition.
[0123] In some embodiments, the target word segmentation corresponding to each character can be determined according to the position information of each character in the preset data, so as to obtain at least one target word segmentation corresponding to the preset data, and the at least one target word segmentation can be stored in the preset retrieval filter according to the third target logical partition. The position information can be used to represent the position of each character in the preset data.
[0124] For example, the preset data is data containing i characters as shown below:
[0125] 1000.0123240 CANFD 1 1 Tx 0 0 d 8 8 88 99 AA BB CC DD EE FF
[0126] i word segmentations can be obtained as follows:
[0127] 1\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
[0128] \00\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 .....
[0129] \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0F\0
[0130] \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0F
[0131] In the embodiments of the present disclosure, the target word segmentation corresponding to each character in the preset data can be determined by combining the position of each character in the preset data, and the data word segmentation method is simple and easy to implement, reducing the data processing amount.
[0132] In some other embodiments, the number of preset retrieval filters in each layer increases sequentially, and multiple preset data correspond to multiple logical partitions. For each layer of preset retrieval filters, the second target filter corresponding to the third target logical partition in the preset retrieval filters of this layer can be determined according to a preset correspondence relationship, where the preset correspondence relationship includes the correspondence relationship between multiple logical partitions and multiple layers of preset retrieval filters. Then, at least one third hash value corresponding to the target word segment can be determined according to the hash function corresponding to the preset retrieval filters of this layer, and the third hash value can be stored in the second target filter. For example, the third hash value can be modulo-divided by the length of the second target filter to obtain a target bit position, and then the value of the target bit position can be set to a preset bit value, and the preset bit value can be 1 for example.
[0133] For example, taking the case where there are three layers of preset retrieval filters as an example, first, according to the preset correspondence relationship, the second target filter corresponding to the third target logical partition in each layer of preset retrieval filters can be determined, and the second target filter for each layer can be one. Then, i third hash values n1, n2,..., ni can be calculated for all retrieval word segments respectively through hash function 1, and then each third hash value is modulo-divided by the bit length of the second target filter of the first layer to set the value of the target bit position corresponding to the bit position index to 1. Similarly, i third hash values m1, m2,..., mi can be calculated for all retrieval word segments respectively through hash function 2, and then each third hash value is modulo-divided by the bit length of the second target filter of the second layer to set the value of the target bit position corresponding to the bit position index to 1. Similarly, i third hash values l1, l2,..., li can be calculated for all retrieval word segments respectively through hash function 3, and then each third hash value is modulo-divided by the bit length of the second target filter of the third layer to set the value of the target bit position corresponding to the bit position index to 1.
[0134] Some specific embodiments are provided below.
[0135] Such as Figure 6As shown, in one embodiment, the data retrieval device in the embodiments of the present disclosure may include a multi-layer Bloom filter module A10, a screening module A20, a data set storage module A30, and a data word segmentation generation module A40. Among them, the multi-layer Bloom filter module A10 can be used to save the hash function values of the retrieval word segments and can determine whether the retrieval data exists in the corresponding logical block. In this embodiment, each Bloom filter is composed of a fixed-size and continuous memory space. When initialized, the memory value of each bit can be set to 0. The screening module A20 can be used to perform multi-layer Bloom filtering on the input retrieval word segments to screen out the logical block corresponding to the last-layer Bloom filter, and retrieve the preset data of the logical block corresponding to the last-layer Bloom filter, and compare it with the retrieval data, and output the final screening result, that is, the candidate retrieval result. The data set storage module A30 can be used to store a data set including multiple preset data and perform logical partitioning on the data set. In this embodiment, the preset data can be stored in the memory heap space at any address, and each logical block can include the memory addresses of multiple preset data. The data word segmentation generation module A40 can be used to segment the input retrieval data to obtain retrieval word segments, and save the hash function values generated by the retrieval word segments into the multi-layer Bloom filter module A10. In this embodiment, the retrieval word segments can generate a hash function value through a hash function, and take the remainder of the hash function value with the length of the Bloom filter bit position to obtain the bit position in the Bloom filter and set it to 1.
[0136] As Figure 7 shown, in another embodiment, taking the preset retrieval filter as a Bloom filter and having three layers as an example, the storage process of the preset data may include: First, the data set storage module can receive a CAN message data from other modules, allocate a memory space in the heap memory to store the preset data, and obtain the corresponding memory address. The data set storage module can also perform logical partitioning on this data, and save the obtained memory address into the corresponding logical block. The data word segmentation generation module (word segmentation module) can segment this preset data, generate a word segment for each character, obtain multiple target word segments, and respectively obtain three hash function values (integer values) corresponding to each target word segment through the three hash functions corresponding to the three layers of Bloom filters. The data word segmentation generation module can also determine the Bloom filter corresponding to each layer where the logical block of this CAN message data is located (each layer will only correspond to one), and save the hash function value corresponding to the target word segment into the corresponding Bloom filter.
[0137] As Figure 8As shown, in another embodiment, taking the preset retrieval filter as a Bloom filter and there are three layers of the preset retrieval filter as an example, the retrieval process of data may include: First, the screening module may receive the retrieval data as a screening condition. The data word segmentation generation module may perform word segmentation on the retrieval data, with each character as a word segment, and fill other positions with \0, and the filled length is equal to the maximum data length of each column, so as to obtain the retrieval word segments. The screening module may screen the input retrieval word segments through multiple layers of Bloom filters to obtain the logical block corresponding to the last layer of Bloom filter, then take out the preset data of the logical block corresponding to the last layer of Bloom filter, and compare it with the retrieval data to output the final screening result, that is, the target retrieval result. In this embodiment, the retrieval data may include multiple retrieval conditions, and each retrieval condition corresponds to a certain column of data. When multiple retrieval conditions are all met, the target retrieval result is output. For example, there are multiple preset data including multiple columns (separated by spaces) as: 1000.0123240 CANFD 1 1 Tx 0 0 d 8 8 88 99 AA BB CC DD EE FF, and the retrieval data including multiple retrieval conditions is: 123, CAN, AA, and the target retrieval result can be obtained from the above multiple preset data for this retrieval data.
[0138] In summary, the present disclosure first obtains the retrieval data, and determines the candidate retrieval result corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters, wherein the number of preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters. In the case that the candidate retrieval result includes the candidate result data corresponding to the retrieval data, the target retrieval result of the retrieval data is determined according to the candidate result data and the retrieval data. The present disclosure filters the preset data through multiple layers of preset retrieval filters. Since the number of each layer of preset retrieval filters increases sequentially as the number of layers increases, the amount of data obtained after passing through each layer of preset retrieval filters will decrease layer by layer. Retrieving the retrieval data from the candidate result data filtered by multiple layers of preset retrieval filters can effectively reduce the amount of retrieved data and complexity, thereby improving the retrieval speed and efficiency.
[0139] Figure 9 is a block diagram of a data retrieval device shown according to an exemplary embodiment, as Figure 9 shown, the device 200 may include the following modules.
[0140] An obtaining module 201, configured to obtain retrieval data.
[0141] A first determining module 202, configured to determine the candidate retrieval result corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters, and the number of preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters.
[0142] The second determination module 203 is configured to determine the target retrieval result of the retrieval data according to the candidate result data and the retrieval data when the candidate retrieval result includes the candidate result data corresponding to the retrieval data.
[0143] Figure 10 is a block diagram of another data retrieval device shown according to an exemplary embodiment, as Figure 10 shown, the device 200 may further include the following modules.
[0144] The third determination module 204 is configured to determine at least one retrieval word segment corresponding to the retrieval data according to the position information of each character in the retrieval data, and the position information is used to characterize the position of the character in the retrieval data.
[0145] Correspondingly, the first determination module 202 is configured to: determine candidate retrieval results corresponding to at least one retrieval word segment from multiple preset data through multiple layers of preset retrieval filters.
[0146] In some embodiments, the multiple preset data correspond to multiple logical partitions, and the memory address of each preset data is stored in a logical partition. The first determination module 202 is configured to: determine candidate retrieval results from the multiple preset data through multiple layers of preset retrieval filters according to the multiple logical partitions, at least one retrieval word segment, and a preset correspondence relationship, and the preset correspondence relationship includes the correspondence relationship between the multiple logical partitions and the multiple layers of preset retrieval filters.
[0147] In some other embodiments, the first determination module 202 is configured to: according to the logical partition, at least one retrieval word segment, and the preset correspondence relationship, sequentially traverse the first target filter in the preset retrieval filter according to the number of layers of the preset retrieval filter until all layers of the first target filter are traversed, or determine that the candidate retrieval result is that there is no target data in the multiple preset data that matches at least one retrieval word segment. Each layer of the first target filter is determined according to the screening result of the previous layer of the preset retrieval filter, and the first layer of the first target filter is the preset retrieval filter of this layer.
[0148] In the case of traversing all layers of the first target filter, determine the candidate retrieval result according to the screening result of the last layer of the first target filter.
[0149] In some other embodiments, each layer of the preset retrieval filter stores the first hash values corresponding to the multiple preset data. The first determination module 202 is configured to: for each layer of the preset retrieval filter, determine the second hash value of at least one retrieval word segment according to the hash function corresponding to this layer of the preset retrieval filter.
[0150] Use the logical partition corresponding to the filter in the previous layer of the preset retrieval filter where at least one retrieval word segment is determined to exist as the first target logical partition.
[0151] Use the filter corresponding to the first target logical partition in the preset retrieval filter of this layer as the first target filter.
[0152] Traverse the first target filter according to the second hash value to obtain the screening result of the preset retrieval filter of this layer.
[0153] In some other embodiments, the first determination module 202 is configured to: in the case where the screening result of the first target filter of the last layer indicates that there is target data among multiple preset data, use the logical partition corresponding to the filter with at least one retrieval word segment in the first target filter of the last layer as the second target logical partition.
[0154] Use the data corresponding to the memory address stored in the second target logical partition as the candidate result data.
[0155] Generate a candidate retrieval result according to the candidate result data.
[0156] Figure 11 It is a block diagram of another data retrieval device shown according to an exemplary embodiment, as Figure 11 shown, the device 200 may further include the following modules.
[0157] A receiving module 205, configured to receive preset data.
[0158] A first storage module 206, configured to store the preset data into a preset memory space to obtain the memory address corresponding to the preset data.
[0159] A second storage module 207, configured to store the memory address into a third target logical partition corresponding to the preset data.
[0160] A third storage module 208, configured to store the preset data into a preset retrieval filter according to the third target logical partition.
[0161] In some other embodiments, the second storage module 207 is configured to: determine the third target logical partition from multiple logical partitions according to a preset partitioning rule, and the preset partitioning rule includes a logical rule for partitioning the preset data.
[0162] Store the memory address into the third target logical partition.
[0163] In some other embodiments, the third storage module 208 is configured to: determine the target word segment corresponding to each character according to the position information of each character in the preset data to obtain at least one target word segment corresponding to the preset data, and the position information is used to represent the position of the character in the preset data.
[0164] Store at least one target word segment into a preset retrieval filter according to a third target logical partition.
[0165] In some other embodiments, the number of preset retrieval filters for each layer increases sequentially, and multiple preset data correspond to multiple logical partitions. The third storage module 208 is configured to: for each layer of preset retrieval filters, determine a second target filter corresponding to the third target logical partition in the preset retrieval filters of this layer according to a preset correspondence relationship, where the preset correspondence relationship includes the correspondence relationship between multiple logical partitions and multiple layers of preset retrieval filters. Determine a third hash value corresponding to at least one target word segment according to the hash function corresponding to this layer of preset retrieval filters. Store the third hash value into the second target filter.
[0166] In some other embodiments, the third storage module 208 is configured to: take the remainder of the third hash value with respect to the length of the second target filter to obtain a target bit position. Set the value of the target bit position to a preset bit value.
[0167] In some other embodiments, the second determination module 203 is configured to: linearly search for retrieval data in candidate result data. In the case where there is target data matching the retrieval data in the candidate result data, use the target data as the retrieval result.
[0168] In some other embodiments, the preset retrieval filter includes a Bloom filter.
[0169] In summary, the present disclosure first obtains retrieval data, and determines a candidate retrieval result corresponding to the retrieval data from multiple preset data through multiple layers of preset retrieval filters, where the number of preset retrieval filters is positively correlated with the number of layers of the preset retrieval filters. In the case where the candidate retrieval result includes candidate result data corresponding to the retrieval data, determine the target retrieval result of the retrieval data according to the candidate result data and the retrieval data. The present disclosure filters the preset data through multiple layers of preset retrieval filters. Since the number of preset retrieval filters for each layer increases sequentially as the number of layers increases, the amount of data obtained after passing through each layer of preset retrieval filters will decrease layer by layer. Retrieving the retrieval data in the candidate result data filtered by multiple layers of preset retrieval filters can effectively reduce the amount of data and complexity of the retrieval, thereby improving the retrieval speed and efficiency.
[0170] Figure 12 is a block diagram of an electronic device shown according to an exemplary embodiment. As Figure 12 shown, the electronic device 300 may include: a processor 301, a memory 302. The electronic device 300 may further include one or more of a multimedia component 303, an input / output (I / O) interface 304, and a communication component 305.
[0171] Among them, the processor 301 is used to control the overall operation of the electronic device 300 to complete all or part of the steps in the above data retrieval method. The memory 302 is used to store various types of data to support the operation of the electronic device 300. Such data may include, for example, instructions for any application or method operating on the electronic device 300, as well as application-related data, such as contact data, received and sent messages, pictures, audio, video, and so on. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 303 may include a screen and an audio component. Among them, the screen can be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, and the microphone is used to receive external audio signals. The received audio signals can be further stored in the memory 302 or sent through the communication component 305. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 304 provides an interface between the processor 301 and other interface modules, and the above other interface modules can be a keyboard, a mouse, buttons, etc. These buttons can be virtual buttons or physical buttons. The communication component 305 is used for wired or wireless communication between the electronic device 300 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 305 may include: a Wi-Fi module, a Bluetooth module, an NFC module, and so on.
[0172] In an exemplary embodiment, the electronic device 300 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components, and is used to execute the above data retrieval method.
[0173] In another exemplary embodiment, a computer-readable storage medium including program instructions is further provided. When the program instructions are executed by a processor, the steps of the above data retrieval method are implemented. For example, the computer-readable storage medium may be the above memory 302 including program instructions, and the above program instructions may be executed by the processor 301 of the electronic device 300 to complete the above data retrieval method.
[0174] In another exemplary embodiment, a computer program product is further provided, including a computer program. When the computer program is executed by a processor, the steps of the above data retrieval method are implemented.
[0175] The preferred embodiments of the present disclosure have been described in detail above with reference to the accompanying drawings. However, the present disclosure is not limited to the specific details in the above embodiments. Within the scope of the technical concept of the present disclosure, various simple modifications can be made to the technical solutions of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.
[0176] In addition, it should be noted that, among the various specific technical features described in the above specific embodiments, without conflict, they can be combined in any appropriate manner. To avoid unnecessary repetition, the present disclosure will not separately describe various possible combination methods.
[0177] In addition, any combination can be made between various different embodiments of the present disclosure, as long as it does not violate the idea of the present disclosure, and it should also be regarded as the content disclosed by the present disclosure.
Claims
1. A data retrieval method, characterized in that: The method comprises: Get the retrieved data; Determine the candidate search results corresponding to the search data from the multiple preset data through multiple layers of preset search filters, the number of the preset search filters is positively correlated with the number of layers of the preset search filters; each of the preset search filters corresponds to a logical partition, the multiple preset data correspond to multiple logical partitions, the memory address of each preset data is stored in one of the logical partitions according to a preset partitioning rule, the preset partitioning rule includes a logical rule for partitioning the preset data, and each preset data is stored in each layer of the preset search filter according to the logical partition corresponding to the preset data; In a case where the candidate search results include candidate result data corresponding to the search data, determining a target search result of the search data according to the candidate result data and the search data; The method further comprises: Determining at least one search word corresponding to the search data according to position information of each character in the search data, wherein the position information is used to represent the position of the character in the search data; Determining the candidate search results corresponding to the search data from the plurality of preset data by using the multiple layers of preset search filters includes: Determining the candidate search result corresponding to the at least one search word from the plurality of preset data through the multiple layers of the preset search filters; Determining the candidate search result corresponding to the at least one search word from the plurality of preset data through the plurality of preset search filters includes: Through multiple layers of the preset search filter, the candidate search result is determined from the multiple preset data according to the multiple logical partitions, the at least one search word and the preset correspondence, and the preset correspondence includes the correspondence between the logical partition and the preset search filter.
2. The method according to claim 1, characterized in that The determining the candidate search result from the plurality of preset data by using the plurality of preset search filters at multiple levels according to the plurality of logical partitions, the at least one search word and the preset corresponding relationship comprises: According to the logical partition, the at least one search word and the preset corresponding relationship, the first target filter in each layer of the preset search filter is traversed in sequence according to the number of layers of the preset search filter, until the first target filters of all layers are traversed, or it is determined that the candidate search result is that there is no target data matching the at least one search word in the multiple preset data; the first target filter of each layer is determined according to the screening result of the preset search filter of the previous layer, and the first target filter of the first layer is all the preset search filters of the layer; In the case of traversing all layers of the first target filters, the candidate retrieval result is determined according to the screening result of the last layer of the first target filters.
3. The method according to claim 2, characterized in that The first Hash values corresponding to the plurality of preset data are stored in each layer of the preset search filter; and the first target filter in each layer of the preset search filter is sequentially traversed according to the number of layers of the preset search filter according to the logical partition, the at least one search word and the preset corresponding relationship, including: For each layer of the preset search filters, determining a second Hash value of the at least one search word according to a Hash function corresponding to the preset search filter of the layer; The logical partition corresponding to the filter in which the at least one search word is determined to exist in the preset search filter of the previous layer is used as the first target logical partition; Using the filter corresponding to the first target logical partition in the preset search filter of the layer as the first target filter; The first target filter is traversed according to the second Hash value to obtain the screening result of the preset search filter at this layer.
4. The method according to claim 2, characterized in that: Determining the candidate search results according to the screening results of the first target filter in the last layer includes: When the screening result of the last layer of the first target filter indicates that the target data exists in the plurality of preset data, the logical partition corresponding to the filter containing the at least one search word in the last layer of the first target filter is used as the second target logical partition; Using the data corresponding to the memory address stored in the second target logical partition as the candidate result data; The candidate search result is generated according to the candidate result data.
5. The method according to claim 1, characterized in that: The method further comprises: receiving the preset data; Storing the preset data in a preset memory space to obtain a memory address corresponding to the preset data; Storing the memory address to a third target logical partition corresponding to the preset data; The preset data is stored in the preset search filter according to the third target logical partition.
6. The method according to claim 5, characterized in that The storing the memory address to the third target logical partition corresponding to the preset data comprises: Determine the third target logical partition from a plurality of logical partitions according to a preset partitioning rule, wherein the preset partitioning rule includes a logical rule for partitioning the preset data; The memory address is stored in the third target logical partition.
7. The method according to claim 6, characterized in that The storing the preset data into the preset search filter according to the third target logical partition comprises: Determining at least one target word segmentation corresponding to the preset data according to position information of each character in the preset data, wherein the position information is used to represent the position of the character in the preset data; The at least one target word segment is stored in the preset search filter according to the third target logical partition.
8. The method according to claim 7, characterized in that The number of the preset search filters in each layer increases successively, and the plurality of preset data corresponds to a plurality of logical partitions; and storing the at least one target word segmentation into the preset search filter according to the third target logical partition comprises: For each layer of the preset search filters, determining the second target filter corresponding to the third target logical partition in the preset search filters of the layer according to a preset corresponding relationship, wherein the preset corresponding relationship includes a corresponding relationship between the logical partition and the preset search filter; Determine a third Hash value corresponding to the at least one target word segmentation according to the Hash function corresponding to the preset search filter of the layer; The third hash value is stored in the second target filter.
9. The method according to claim 8, characterized in that The storing the third Hash value to the second target filter comprises: Taking the modulus of the third Hash value and the length of the second target filter to obtain a target bit position; The target bit value is set to a preset bit value.
10. The method according to claim 1, characterized in that Determining the target search result of the search data according to the candidate result data and the search data includes: Linearly searching for the search data in the candidate result data; When target data matching the search data exists in the candidate result data, the target data is used as the target search result.
11. The method according to any one of claims 1 to 10, characterized in that The preset search filter includes a Bloom filter.
12. An electronic device, characterized in that: include: a memory having a computer program stored thereon; A processor, configured to execute the computer program in the memory to implement the steps of the method according to any one of claims 1 to 11.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.
14. A computer program product, characterized in that The invention comprises a computer program, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Data processing method and device based on block chain and readable storage medium
CN117390020A