Data search method and apparatus, and electronic device and storage medium
By converting keywords into stored integers smaller than the original integer, the problems of wasted space and low efficiency in the array storage solution are solved, and the compression of storage space and data search efficiency are improved.
Patent Information
- Application Number
- PCT/CN2024/127477
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-25
- Filing Date
- 2024-10-25
- Publication Date
- 2025-07-03
AI Technical Summary
In the prior art, the array storage scheme has a high spatial complexity in limited and repeated input scenarios and occupies a large storage space, resulting in low data search efficiency and waste of storage space.
By converting the keyword to be found into the target original integer number and converting it into a target storage integer that is smaller than the original integer number, the target storage integer number is used to determine the data location in the storage array, compressing the storage space and improving data search efficiency.
It effectively compresses the storage space of the storage array, avoids the waste of space in traditional storage methods, and improves the efficiency of data search.
Smart Images

Figure CN2024127477_03072025_PF_FP_ABST
Abstract
Description
Data search method, device, electronic device and storage medium
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on December 25, 2023, with application number 202311800081.9, and invention name “Data search method, device, electronic device and storage medium”, all contents of which are incorporated by reference into this application. Technical Field
[0002] The present application relates to the field of data processing technology, and more specifically, to a data search method, device, electronic device, and storage medium. Background Art
[0003] Currently, the development of embedded software for the Internet of Vehicles (IoV) often involves limited and repetitive input scenarios. For these scenarios, array storage solutions can achieve faster data lookups. However, array storage solutions have high space complexity and occupy a large amount of storage space.
[0004] Summary of the Invention
[0005] In view of the above problems, the present application proposes a data search method, device, electronic device and storage medium.
[0006] In a first aspect, an embodiment of the present application provides a data search method, the method comprising: obtaining a target original integer number corresponding to a keyword to be searched; converting the target original integer number into a target stored integer number according to a target conversion rule, wherein different original integer numbers have different stored integer numbers after conversion according to the target conversion rule, and the stored integer number obtained after conversion according to the target conversion rule is smaller than the original integer number; determining the data stored at the position where the target stored integer number is located from a storage array as the target data corresponding to the keyword to be searched, wherein the stored integer number corresponding to each position in the storage array is obtained by converting the original integer number corresponding to each position according to the target conversion rule, and the original integer number corresponding to each position is the original integer number corresponding to the keyword associated with the data stored at each position.
[0007] In an optional embodiment, converting the target original integer number into the target storage integer number according to the target conversion rule includes: obtaining a first conversion parameter, the first conversion parameter being used to convert the original integer numbers corresponding to different positions in the storage array into storage integer numbers, and the original integer numbers corresponding to different positions in the storage array converted by the first conversion parameter have different storage integer numbers; if the first conversion parameter is a power of 2, obtaining binary data corresponding to the target original integer number as first data; obtaining data located from the 1st to the (M-1)th position from the right to the left in the first data as second data, wherein M is the number of bits of the binary data corresponding to the first conversion parameter; converting the second data into decimal data to obtain the target storage integer number.
[0008] In an optional embodiment, converting the target original integer into a target stored integer according to a target conversion rule includes: if the first conversion parameter is not a power of 2, obtaining a second conversion parameter, the second conversion parameter being used to convert the first conversion parameter into a power of 2; obtaining a third conversion parameter based on the power of 2 corresponding to the product of the second conversion parameter and the first conversion parameter; and obtaining a target stored integer corresponding to the target original integer according to the first conversion parameter, the second conversion parameter, and the third conversion parameter.
[0009] In an optional embodiment, obtaining the target original integer number corresponding to the keyword to be searched includes: if the data type corresponding to the keyword to be searched is an integer type, determining that the target original integer number corresponding to the keyword to be searched is the keyword to be searched; if the data type corresponding to the keyword to be searched is a non-integer type, obtaining the integer value corresponding to the keyword to be searched according to a data table, the data table including multiple non-integer type data and the integer value corresponding to each non-integer type data; performing hash processing on the integer value according to the conversion base of the hash algorithm to obtain the hash value corresponding to the keyword to be searched as the target original integer number corresponding to the keyword to be searched.
[0010] In an optional embodiment, establishing the storage array includes: obtaining multiple keywords and data corresponding to each keyword; obtaining the original integer corresponding to each keyword; converting the original integer corresponding to each keyword into a storage integer according to the target conversion rule to obtain multiple different storage integers, each of the multiple storage integers corresponds to an original integer; establishing a storage array including multiple positions according to the number of the multiple storage integers, the multiple positions corresponding one-to-one to the multiple storage integers; based on the correspondence between the original integer corresponding to each keyword and the storage integer, storing the data corresponding to each keyword in the corresponding position in the storage array.
[0011] In an optional embodiment, converting the original integer corresponding to each keyword into a storage integer according to the target conversion rule to obtain multiple different storage integers includes: determining a first conversion parameter according to the original integer corresponding to each keyword, the first conversion parameter being used to convert the original integer corresponding to each keyword into a storage integer, and different original integers converted by the first conversion parameter have different storage integers; converting the original integer corresponding to each keyword into a storage integer according to the first conversion parameter to obtain multiple different storage integers.
[0012] In an optional embodiment, the converting the original integer corresponding to each keyword into a storage integer according to the first conversion parameter to obtain multiple different storage integers includes: if the first conversion parameter is a power of 2, converting the original integer corresponding to each keyword into a storage integer according to the first conversion parameter to obtain multiple different storage integers; if the first conversion parameter is not a power of 2, obtaining the maximum original integer among the original integers corresponding to the multiple keywords; determining a second conversion parameter for converting the first conversion parameter into a power of 2 according to the maximum original integer and the first conversion parameter; converting the first conversion parameter into a power of 2 according to the second conversion parameter to obtain a third conversion parameter; converting the original integer corresponding to each keyword into a storage integer according to the first conversion parameter, the second conversion parameter, and the third conversion parameter to obtain multiple different storage integers.
[0013] In a second aspect, an embodiment of the present application provides a data search device, comprising: an original integer number acquisition module, for acquiring a target original integer number corresponding to a keyword to be searched; a stored integer number conversion module, for converting the target original integer number into a target stored integer number according to a target conversion rule, wherein different original integer numbers have different stored integer numbers after conversion according to the target conversion rule, and the stored integer number obtained after conversion according to the target conversion rule is smaller than the original integer number; a target data acquisition module, for determining the data stored at the position where the target stored integer number is located from a storage array as the target data corresponding to the keyword to be searched, wherein the stored integer number corresponding to each position in the storage array is obtained by converting the original integer number corresponding to each position according to the target conversion rule, and the original integer number corresponding to each position is the original integer number corresponding to the keyword associated with the data stored at each position.
[0014] In a third aspect, an embodiment of the present application provides an electronic device comprising: one or more processors; a memory; and one or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the data search method provided in the first aspect above.
[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, in which a program code is stored. The program code can be called by a processor to execute the data search method provided in the first aspect above.
[0016] The solution provided by the present application first converts the search keyword into an integer to obtain a target original integer corresponding to the search keyword, then converts the target original integer into a target storage integer smaller than the target original integer, and finally determines the target data corresponding to the search keyword in the storage array based on the target storage integer. Since the storage integer corresponding to each position in the storage array is data smaller than the original integer corresponding to each position after the original integer corresponding to each position is converted according to the target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position, during the data storage process, the target original integer is converted into a storage integer smaller than the target original integer, and the storage integer is associated with the storage position of the storage array. This compresses the storage space of the storage array and avoids space waste caused by traditional storage array storage methods. Moreover, when searching for the target data of the search keyword, it is only necessary to convert the original integer corresponding to the search keyword into the corresponding storage integer, thereby improving data search efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0018] FIG1 shows a flow chart of a data search method according to an embodiment of the present application.
[0019] FIG2 shows a flow chart of a data search method provided in another embodiment of the present application.
[0020] FIG3 shows a flow chart of a data search method provided in yet another embodiment of the present application.
[0021] FIG4 shows a structural block diagram of a data search device provided in an embodiment of the present application.
[0022] FIG5 shows a structural block diagram of an electronic device provided by an embodiment of the present application for executing a data search method according to an embodiment of the present application. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0024] The inventors conducted further research on array storage solutions and found that for complex data types, the use of array storage solutions increases space complexity and occupies a high amount of resources. When space complexity increases and resource occupancy is high, data search efficiency decreases. Moreover, when an array establishes storage locations for multiple keywords, it will open up multiple consecutive locations based on the values corresponding to the multiple keywords. The number of locations is the same as the value of the keyword with the largest value among the multiple keywords. In limited and repetitive scenarios, only a very small number of storage locations are actually needed for data storage. Therefore, the array storage solution in the related art establishes too many storage locations, which easily leads to a waste of storage space. Moreover, when searching for data in a storage location, a traversal search method is used. Too many storage locations will increase the time for data search and reduce the efficiency of data difference.
[0025] For example, the keyword-data to be stored are 3:12; 4:800; 80000:200. The keywords are 3, 4, and 80000 respectively. If the array storage solution in the related art is adopted, it is necessary to establish an array with a length of 80001 and 80,000 storage locations. Among them, 12 is stored in storage location 3, 800 is stored in storage location 4, and 200 is stored in storage location 80000. If you want to find the data corresponding to storage location 3, you only need to find the corresponding storage location 3. However, if you want to find the data corresponding to storage location 800000, you need to traverse the 80,000 storage locations until you find the data corresponding to storage location 80000. In this way, only 3 storage locations are actually used out of 80,000 storage locations, resulting in a huge waste of storage space.
[0026] In response to the background technology and the above-mentioned technical problems, the inventors have proposed a data search method, device, electronic device, and storage medium. The method first converts a keyword to be searched into an integer to obtain a target original integer corresponding to the keyword to be searched, then converts the target original integer into a target storage integer smaller than the target original integer, and finally determines the target data corresponding to the keyword to be searched in a storage array based on the target storage integer. Since the storage integer corresponding to each position in the storage array is the data smaller than the original integer corresponding to each position obtained after the original integer corresponding to each position is converted according to the target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position, during the data storage process, the target original integer is converted into a storage integer smaller than the target original integer, and the storage integer is associated with the storage position of the storage array, thereby compressing the storage space of the storage array and avoiding the space waste caused by the storage method of the traditional storage array. Moreover, when searching for the target data of the keyword to be searched, it is only necessary to convert the original integer corresponding to the keyword to be searched into the corresponding storage integer, thereby improving the efficiency of data search.
[0027] Please refer to Figure 1, which shows a flow chart of a data search method provided by an embodiment of the present application. In a specific embodiment, the data search method is applied to a data search device 200 as shown in Figure 4 and an electronic device equipped with the data search device 200.
[0028] The following will describe in detail the process shown in FIG1 . The data search method may specifically include the following steps:
[0029] Step S110: Obtain the target original integer corresponding to the keyword to be searched.
[0030] Since keywords correspond one-to-one with data, when searching for target data, one only needs to obtain the keywords corresponding to the target data to obtain the target data. The keywords to be searched can be determined by a user inputting them via a terminal device (mobile terminal or server terminal), or by the user selecting multiple keywords stored in the terminal device by clicking or long-pressing them. The determination of the keywords to be searched is not specifically limited herein.
[0031] In an array storage solution, an array can only store data of one data type at a time. To facilitate array data storage, the keywords corresponding to the data to be stored need to be uniformly converted. During the storage process, the array will establish storage locations for the data corresponding to the keywords based on the keywords, and the established storage locations correspond to the keywords. Therefore, to facilitate the array establishing storage locations corresponding to the keywords when storing data, the keywords are usually uniformly converted to integers. Therefore, in the embodiments of the present application, the keywords to be searched are converted to integers. Obtaining the target original integer number for the keyword to be searched can be done by searching a table that stores the keywords and the original integer numbers corresponding to the keywords, thereby obtaining the target original integer number corresponding to the keyword to be searched. Obtaining the target original integer number corresponding to the keyword to be searched can also be done by first determining the data type of the keyword to be searched. If the data type of the keyword to be searched is an integer type, the target original integer number is the keyword to be searched itself. If the data type of the keyword to be searched is not an integer type, the keyword to be searched is converted according to the integer data conversion rules to obtain the original integer number corresponding to the keyword to be searched. The integer data conversion rule may be an ASCII code conversion rule, which records uppercase and lowercase English letters and the integer corresponding to each uppercase and lowercase English letter. The ASCII code conversion rule is used to convert the English letter keyword to be searched into integer data to obtain the target original integer.
[0032] Step S120: converting the target original integer into a target stored integer according to a target conversion rule, wherein different original integers converted according to the target conversion rule have different stored integers, and the stored integers converted according to the target conversion rule are smaller than the original integers.
[0033] Among them, due to the array storage, storage space will be continuously opened up for data according to the value of the original integer number corresponding to the keyword in the array, and the data corresponding to the keyword will be stored in the array position corresponding to the original integer number. If the values of the original integer numbers corresponding to the keywords in the array are greatly different, it will cause more blank positions between the storage positions of the data corresponding to two adjacent keywords in the array, which consumes more memory. The target conversion rule is used to convert multiple original integer numbers into smaller and different data, so as to ensure that there are no blank storage positions or fewer blank storage positions between the storage positions opened up for data storage in the array, so as to achieve the purpose of compressing the storage space of the array.
[0034] The target conversion rule may be a rule that specifies the storage integer corresponding to the original integer. After obtaining the target original integer corresponding to the keyword to be searched, the target storage integer corresponding to the target original integer is determined according to the target conversion rule. The target conversion rule may also specify a conversion method and / or calculation rule for converting the original integer into a storage integer, so that the original integer is converted into a storage integer according to the conversion method and / or calculation rule in the target conversion rule. The specific rules and / or specific calculation methods of the target conversion rule are not limited here. The target conversion rule may be a remainder rule. The remainder rule refers to using the remainder of the original integer as the storage integer corresponding to the original integer through a remainder algorithm. It should be noted that the remainders obtained by the remainder rule for different original integers are different. The target conversion rule may also be a data correspondence rule. The data correspondence rule specifies different storage integers corresponding to different original integers, and each storage integer is smaller than the corresponding original integer.
[0035] Step S130: Determine the data stored at the location of the target stored integer from the storage array as the target data corresponding to the keyword to be searched, wherein the stored integer corresponding to each location in the storage array is obtained by converting the original integer corresponding to each location according to the target conversion rule, and the original integer corresponding to each location is the original integer corresponding to the keyword associated with the data stored at each location.
[0036] In the embodiment of the present application, since the locations of the stored data correspond to the stored integers, and each location stores the data corresponding to the keyword, the location in the storage array where the data corresponding to the keyword is stored can be determined based on the conversion relationship between the keyword and the stored integer. After determining the target stored integer corresponding to the target original integer for the key to be searched, the storage location of the data corresponding to the key to be searched in the storage array is determined based on the target stored integer, thereby obtaining the target data corresponding to the key to be searched.
[0037] The data search method provided in an embodiment of the present application first converts a keyword to be searched into an integer to obtain a target original integer corresponding to the keyword to be searched, then converts the target original integer into a target storage integer smaller than the target original integer, and finally determines the target data corresponding to the keyword to be searched in the storage array based on the target storage integer. Since the storage integer corresponding to each position in the storage array is data smaller than the original integer corresponding to each position after the original integer corresponding to each position is converted by a target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position, during the data storage process, the target original integer is converted into a storage integer smaller than the target original integer, and the storage integer is associated with the storage position of the storage array, thereby compressing the storage space of the storage array and avoiding space waste caused by traditional storage array storage methods. Moreover, when searching for the target data of the keyword to be searched, it is only necessary to convert the original integer corresponding to the keyword to be searched into the corresponding storage integer, thereby improving the efficiency of data search.
[0038] Please refer to Figure 2, which shows a flow chart of a data search method provided by another embodiment of the present application. The flow chart shown in Figure 2 will be described in detail below. The data search method may specifically include the following steps:
[0039] Step S201: Obtain the data type corresponding to the key to be searched.
[0040] Step S202: If the data type corresponding to the keyword to be searched is an integer type, then determining the target original integer corresponding to the keyword to be searched is the keyword to be searched.
[0041] In an embodiment of the present application, when the data type of the keyword to be searched is an integer type, the target original integer number corresponding to the keyword to be searched is the keyword to be searched itself. The target original integer number of the keyword to be searched, whose data type is an integer type, is determined to be the keyword to be searched itself, thereby reducing the computing power for converting the integer-type keyword to be searched and improving the conversion efficiency of the integer-type keyword to be searched into the stored integer number.
[0042] Step S203: If the data type corresponding to the keyword to be searched is a non-integer type, obtain the integer value corresponding to the keyword to be searched according to the data table, wherein the data table includes multiple non-integer type data and the integer value corresponding to each non-integer type data.
[0043] Among them, non-integer types include but are not limited to string types, floating-point types and other types.
[0044] The data table includes multiple non-integer data types and the integer value corresponding to each non-integer data type. The data table can be an ASCII code table, which includes all uppercase and lowercase letters and the integer value corresponding to each uppercase and lowercase letter. The data table can also be established by user-defined correspondence between data and integers. The content of the data table is not specifically limited here.
[0045] For example, let's assume the keyword to be searched is the string "APC" and the data table is an ASCII code table. "APC" is a string type, and the integer values corresponding to "A", "P", and "C" are searched in the ASCII code table. The integer value corresponding to "A" is 65, the integer value corresponding to "P" is 87, and the integer value corresponding to "C" is 67.
[0046] Step S204: performing hash processing on the integer value according to the conversion base of the hash algorithm to obtain the hash value corresponding to the keyword to be searched as the target original integer corresponding to the keyword to be searched.
[0047] A hash algorithm is a function that converts data of arbitrary length into a string of fixed length. In the present embodiment, a hash algorithm is used to convert one or more integer values into another integer value. The conversion base refers to the function base in the hash algorithm. It should be noted that the conversion base in the hash algorithm is usually a prime number to reduce the probability of numerical collisions after hashing.
[0048] For example, taking the keyword to be searched as the string "APC" as an example, the conversion base is 31. Hash processing is performed based on the conversion base and the integer values "65", "80" and "67" corresponding to "APC" to obtain the hash value corresponding to "APC".
[0049] The hashing process can be implemented with the following code:
[0050] res=0
[0051] for v in['A','P',C']:
[0052] res*=31
[0053] res+=ord(v)
[0054] res&=0xffffffff
[0055] Where res is the variable used in the calculation process, for v in ['A', 'P', C'] indicates that the variable v is evaluated sequentially from the corresponding integer values in ['A', 'P', C'], res* = 31 indicates that the integer value multiplied by the conversion base equals the next integer value, res+ = ord(v) indicates that the next integer value is added to the variable v to obtain the next integer value, and res& = 0xffffffff indicates that if the integer value exceeds 32 bits, only 32 bits are retained for calculation.
[0056] The process for obtaining the hash value corresponding to "APC" is to first obtain the integer value corresponding to variable v, which is the integer value corresponding to "A," 65. Then, res = 0 is multiplied by 31 to obtain 0, and then 0 is added to 65 to obtain res = 65. Next, the integer value corresponding to variable v is set to 80. Res = 65 is multiplied by 31 to obtain 2015. Then, 2015 is added to 80 to obtain res = 2095. Finally, the integer value corresponding to variable v is set to 67. Res = 2095 is multiplied by 31 to obtain 64945. 64945 is added to 67 to obtain the final hash value of 65012. 65012 is determined to be the original integer corresponding to the string data "APC."
[0057] Step S205: Obtain a first conversion parameter, where the first conversion parameter is used to convert the original integer numbers corresponding to different positions in the storage array into stored integer numbers, and the original integer numbers corresponding to different positions in the storage array are converted to different stored integer numbers using the first conversion parameter.
[0058] The first conversion parameter is determined by the original integers of the multiple keywords corresponding to the data stored in the storage array. Different data stored in the storage array corresponds to different keywords, and thus the original integers corresponding to the keywords are different, resulting in different first conversion parameters. The first conversion parameter is used to convert multiple original integers into different storage integers, and the storage integers are smaller than the original integers, thereby compressing the storage space of the storage array. Since each storage array can convert original integers into storage integers corresponding to multiple conversion parameters, the first conversion parameter can be the smallest conversion parameter among the multiple conversion parameters, or it can be a conversion parameter specified by the user. The determination of the first conversion parameter is not specifically limited here.
[0059] Step S206: If the first conversion parameter is a power of 2, binary data corresponding to the target original integer is obtained as the first data.
[0060] Step S207: obtaining data located from the 1st bit to the (M-1)th bit from the right to the left in the first data as the second data, wherein M is the number of bits of the binary data corresponding to the first conversion parameter.
[0061] Step S208: Convert the second data into decimal data to obtain the target storage integer.
[0062] In an embodiment of the present application, since the data is stored in the electronic device in binary form, when the first conversion parameter is a power of 2, the number of bits of the binary data corresponding to the first conversion parameter is the exponent of the power of 2 corresponding to the first conversion parameter plus 1.
[0063] Since data is represented in binary form in electronic devices, the target conversion rule may be to convert binary data, thereby improving the conversion efficiency of original integers to stored integers.
[0064] In the embodiment of the present application, the target conversion rule is preferably a remainder rule. The first conversion parameter is the modulus in the remainder rule. When performing remainder calculation on binary data, an optimization solution can be performed based on whether the first conversion parameter is a power of 2. When the first conversion parameter is a power of 2, formula (1) is satisfied: x%(2 n )=x&(2 n -1) (1)
[0065] Among them, x is the original integer number, 2 n is the first conversion parameter, % represents the remainder symbol, and & represents the AND symbol.
[0066] Formula (1) indicates that when the original integer is modulo the power of 2, it is equivalent to performing an AND operation on the binary data of the original integer and the binary data corresponding to the difference between the power of 2 minus 1. If both the binary data and the binary data are 1, the result is 1; otherwise, the result is 0.
[0067] For example, let's continue to take the original integer "65012" corresponding to the string "APC" as an example, the first conversion parameter is 16, that is, the first conversion parameter is 2 4 The binary data corresponding to 65012 is 1111110111110100, and the binary data corresponding to the difference between the first conversion parameter and 1 is 1111. Performing the AND operation on 1111110111110100 and 1111 from right to left yields the binary data of 100. Converting 100 to decimal yields the stored integer corresponding to the original integer, which is 4.
[0068] From another perspective, 2 nThe binary data corresponding to -1 are all binary data of 1, which is equivalent to performing AND calculation on the binary data of the original integer and the binary data of all 1, that is, the data after the Mth bit from right to left in the binary data of the original integer is used as the stored integer corresponding to the original integer, and the number of bits corresponding to the data after the Mth bit is 2. n -1 binary data corresponding to the number of bits, that is, the value of M and 2 n The number of binary digits is the same.
[0069] Continuing with the above example, the first conversion parameter is 2 4 The binary data corresponding to the first conversion parameter is 10000, that is, M is 5. The last four digits of the binary data corresponding to 65012 are used as the stored integer, that is, 0100 is used as the stored integer. The decimal data corresponding to 0100 is 4.
[0070] Step S209: If the first conversion parameter is not a power of 2, obtain a second conversion parameter, where the second conversion parameter is used to convert the first conversion parameter to a power of 2.
[0071] Step S210: Obtain a third conversion parameter based on a power of 2 corresponding to a product of the second conversion parameter and the first conversion parameter.
[0072] Step S211: Obtain a target stored integer corresponding to the target original integer according to the first conversion parameter, the second conversion parameter, and the third conversion parameter.
[0073] In the embodiment of the present application, when the first conversion parameter corresponding to the storage array is not a power of 2, the second conversion parameter in the storage array can be obtained, and the product of the second conversion parameter and the first conversion parameter is a power of 2, and the converted power of 2 is used as the third conversion parameter, so that the stored integer corresponding to the original integer is obtained according to the first conversion parameter, the second conversion parameter and the third conversion parameter.
[0074] The original integer obtained according to the first conversion parameter, the second conversion parameter, and the third conversion parameter corresponds to the stored integer that satisfies the following formula: x-((x*m)>>r)*mod (2)
[0075] Among them, >> represents the sign of binary data shifting to the right, and >>r represents the binary data shifting to the right by r bits.
[0076] Formula (2) shows that the original integer minus the integer and the first conversion parameter yields the stored integer corresponding to the original integer. In the formula, (x*m)>>r represents the integer obtained by shifting a number right by r positions. It should be noted that the first, second, and third conversion parameters are related to the storage array. Different storage arrays have different corresponding keywords, and the first, second, and third conversion parameters are different.
[0077] For example, taking the original integer number 65012 as an example, the first conversion parameter is 5, the second conversion parameter is 225179981368525, and the third conversion parameter is 2 50 , where 5*225179981368525≈2 50 The stored integer corresponding to 65012 is 65012-((65012*225179981368525)>>50)*5=2.
[0078] By converting the original integer binary data and utilizing multiplication, AND operations, and shift operations during the conversion process, the energy consumption of data conversion can be reduced, thereby optimizing the data conversion process. For example, the CPU cycle for a standard remainder operation is 60 instruction cycles, the CPU cycle for integer multiplication is 8 instruction cycles, the CPU cycle for shifting is 1 instruction cycle, and the CPU cycle for AND calculation is 6 instruction cycles. Even if multiplication, shifting, and AND calculation are all used during the data conversion process, the instruction cycles used are far fewer than those for remainder operation, reflecting the optimization of computing power by the target conversion rule.
[0079] Step S212: Determine the data stored at the location of the target stored integer from the storage array as the target data corresponding to the keyword to be searched, wherein the stored integer corresponding to each location in the storage array is obtained by converting the original integer corresponding to each location according to the target conversion rule, and the original integer corresponding to each location is the original integer corresponding to the keyword associated with the data stored at each location.
[0080] The detailed description of step S212 can be found in the detailed description of step S130 in the above embodiment, which will not be repeated here.
[0081] The data search method provided in the embodiment of the present application optimizes the conversion process of converting original integers into stored integers based on the characteristics of binary data, since the data in the electronic device is binary data, thereby improving the conversion efficiency of the original integers into stored integers.
[0082] Please refer to Figure 3, which shows a flow chart of a data search method provided by another embodiment of the present application. The flow chart shown in Figure 3 will be described in detail below. The data search method may specifically include the following steps:
[0083] Step S310: Acquire multiple keywords and data corresponding to each keyword.
[0084] Step S320: Obtain the original integer corresponding to each keyword.
[0085] Step S330: According to the target conversion rule, the original integer corresponding to each keyword is converted into a stored integer to obtain a plurality of different stored integers, each of which corresponds to an original integer.
[0086] In the embodiments of the present application, different keywords correspond to different raw integers, and the stored integers obtained based on the raw integers corresponding to each keyword are different. Before searching for data based on the stored integers corresponding to the raw integers, it is necessary to store the currently used data according to the stored integers. The keywords can be user-specified or can be all currently involved keywords. Keywords are not specifically limited here.
[0087] For the method of obtaining the original integer corresponding to each keyword and obtaining the stored integer corresponding to the original integer of each keyword according to the target conversion rule, please refer to the detailed description in the above embodiment and will not be repeated here.
[0088] In some embodiments, converting the original integer corresponding to each keyword into a storage integer according to the target conversion rule to obtain a plurality of different storage integers specifically includes: determining a first conversion parameter according to the original integer corresponding to each keyword, the first conversion parameter being used to convert the original integer corresponding to each keyword into a storage integer, and different original integers converted by the first conversion parameter yield different storage integers. Converting the original integer corresponding to each keyword into a storage integer according to the first conversion parameter to obtain a plurality of different storage integers.
[0089] Since the keyword may change according to user needs, and the first conversion parameter is determined by the original integer corresponding to the keyword, after the keyword is determined, the first conversion parameter is determined based on the original integer corresponding to the keyword, so that when the keyword is subsequently used to search for data, the determined first conversion parameter is directly used to obtain the stored integer corresponding to the original integer.
[0090] For example, taking the target conversion rule as a remainder rule, to ensure that the stored integers corresponding to the original integers of multiple keywords are different, the modulus in the target conversion rule can be determined as a conflict-free modulus. To further save computing power, the modulus can be determined as the minimum conflict-free modulus.
[0091] In a specific implementation process, according to the first conversion parameter, the original integer corresponding to each keyword is converted into a storage integer to obtain a plurality of different storage integers, including: if the first conversion parameter is a power of 2, then according to the first conversion parameter, the original integer corresponding to each keyword is converted into a storage integer to obtain a plurality of different storage integers. If the first conversion parameter is not a power of 2, the maximum original integer among the original integers corresponding to the multiple keywords is obtained. According to the maximum original integer and the first conversion parameter, a second conversion parameter for converting the first conversion parameter into a power of 2 is determined. According to the second conversion parameter, the first conversion parameter is converted into a power of 2 to obtain a third conversion parameter. According to the first conversion parameter, the second conversion parameter and the third conversion parameter, the original integer corresponding to each keyword is converted into a storage integer to obtain a plurality of different storage integers.
[0092] Among them, when the first conversion parameter is a power of 2, the specific steps of converting the original integer into the storage integer can be found in the specific steps in the above embodiment, which will not be repeated here.
[0093] In the embodiment of the present application, since the binary digits of integers in electronic devices are 32 bits, if the digits exceed 32 bits, the value will overflow, resulting in inaccurate data during the calculation process. To ensure the accuracy of the data, the maximum original integer number among the original integer numbers corresponding to multiple keywords should be less than 2 64 Because the second conversion parameter converts the first conversion parameter into a power of 2, the exponent of the power of 2 obtained by converting the first conversion parameter by the second conversion parameter is less than 64.
[0094] The first conversion parameter is converted to a power of 2 using the second conversion parameter. The conversion method can be multiplication, division, addition, or a combination of multiple algorithms. In the embodiment of the present application, multiplication is used for conversion. At this time, the product of the second conversion parameter and the first conversion parameter is less than 2. 64 After the second conversion parameter and the third conversion parameter are determined, the second conversion parameter and the third conversion parameter need to be verified to ensure their accuracy.
[0095] The formula for obtaining the third conversion parameter is as follows: m*mod=2 r(3) x max *m<2 64 (4)
[0096] Among them, m is the second conversion parameter, mod is the first conversion parameter, 2 r is the third conversion parameter, the second conversion parameter and the third conversion parameter are both positive integers, and the third conversion parameter r<64.
[0097] It should be noted that when the first conversion parameter is not a power of 2, the third conversion parameter cannot divide the first conversion parameter or the second conversion parameter. Therefore, in the process of determining the second conversion parameter based on multiple original integers, the second conversion parameter needs to be rounded down. Since the result of x*m (positive decimal) is (2 r ), if the second conversion parameter is rounded down, it will result in ((x*m) / / (2 r ) The result is too small, resulting in an error. This solution is not feasible. Therefore, the second conversion parameter is rounded up. During the rounding process, a certain error will be generated. To avoid the impact of the error, the following conditions should be met:
[0098] In formula (5), x 误差 ∈(0, 1), x is the original integer corresponding to each keyword.
[0099] From formula (5), we can see that x 误差 As small as possible to ensure that the original integer corresponding to each keyword is less than
[0100] According to formulas (3)(4)(5), the second conversion parameter and the third conversion parameter can be determined together.
[0101] For example, taking the target conversion rule as a remainder rule, the remainder rule satisfies:
[0102] x% mod=x-((x*m)>>r)*mod (6)
[0103] The second conversion parameter is rounded by the integer remainder method. According to formula (3)(4)(5)(6), we get: x%mod=x-(x / / mod)*mod=x-(x / / ((2^r) / m))*mod=x-((x*m) / / (2^r))*mod =x-((x*m)>>r)*mod
[0104] If the first conversion parameter is 5 and the original integer parameter is 65012, the stored integer corresponding to 65012 is 2, the original integer is 66, the stored integer corresponding to 66 is 1, the original integer is 15, the stored integer corresponding to 15 is 0, and the original integer is 128, the stored integer corresponding to 128 is 3. Multiple sets of second and third conversion parameters can be determined. To save computing power, the set with the smallest third conversion parameter is selected. That is, the second conversion parameter is 225179981368525, and the third conversion parameter is 50.
[0105] And verify the second conversion parameter and the third conversion parameter corresponding to the original integer and the stored integer. As follows: 65012-((65012*225179981368525)>>50)*5=2=65012%5 66-((66*225179981368525)>>50)*5=1=66%5 15-((15*225179981368525)>>50)*5=0=15%5 128-((128*225179981368525)>>50)*5=3=128%5
[0106] It has been verified that the second conversion parameter and the third conversion parameter are reasonably determined.
[0107] When the first conversion parameter is not a power of 2, the second conversion parameter and the third conversion parameter are determined based on the original integer corresponding to the keyword and the first conversion parameter. The original integer corresponding to each keyword is then converted to a storage integer based on the first conversion parameter, the second conversion parameter, and the third conversion parameter. The specific steps for converting the original integer corresponding to each keyword based on the first conversion parameter, the second conversion parameter, and the third conversion parameter are described in the aforementioned embodiment and are not repeated here.
[0108] Step S340: establishing a storage array including a plurality of positions according to the number of the plurality of stored integers, wherein the plurality of positions correspond one-to-one to the plurality of stored integers.
[0109] Step S350: According to the correspondence between the original integer corresponding to each keyword and the stored integer, the data corresponding to each keyword is stored in the corresponding position in the storage array.
[0110] In the embodiment of the present application, to ensure that the data corresponding to each keyword is stored in a corresponding position in the storage array, the number of positions in the storage array needs to be determined based on the number of stored integers. Furthermore, based on the correspondence between the stored integers and positions, and the correspondence between the original integer corresponding to each keyword and the stored integer, the data corresponding to the keyword is stored, so that the corresponding data can be found based on the stored integer obtained by converting the original integer of the keyword.
[0111] Step S360: Obtain the target original integer corresponding to the keyword to be searched.
[0112] Step S370: According to the target conversion rule, the target original integer is converted into a target stored integer, wherein different original integers have different stored integers after being converted according to the target conversion rule, and the stored integers obtained after being converted according to the target conversion rule are smaller than the original integers.
[0113] Step S380: Determine the data stored at the location of the target stored integer from the storage array as the target data corresponding to the keyword to be searched, wherein the stored integer corresponding to each location in the storage array is obtained by converting the original integer corresponding to each location according to the target conversion rule, and the original integer corresponding to each location is the original integer corresponding to the keyword associated with the data stored at each location.
[0114] For detailed description of steps S360 to S380 , please refer to steps S110 to S130 of the aforementioned embodiment, which will not be repeated here.
[0115] The data search method provided in an embodiment of the present application converts the original integers corresponding to multiple keywords into multiple storage integers that are smaller than the original integers and different from each other through a target conversion rule, and establishes a storage array with a number of positions corresponding to the values of the storage integers based on the values of the storage integers. Based on the correspondence between the positions and the storage integers and the correspondence between the original integers of the keywords and the storage integers, the data corresponding to the keywords are stored in the positions corresponding to the storage integers. This facilitates searching for data after converting the original integers of the keywords into storage integers, and uses the values of the storage integers to establish a storage array, thereby compressing the storage space of the storage array and avoiding space waste caused by large differences in the values of the original integers of the keywords.
[0116] Please refer to Figure 4, which shows a block diagram of a data search device 200 provided in an embodiment of the present application. The data search device 200 is applied to an electronic device and includes: an original integer number acquisition module 210 for acquiring a target original integer number corresponding to a keyword to be searched; a stored integer number conversion module 220 for converting the target original integer number into a target stored integer number according to a target conversion rule, wherein different original integer numbers converted according to the target conversion rule have different stored integer numbers, and the stored integer numbers converted according to the target conversion rule are smaller than the original integer numbers; and a target data acquisition module 230 for determining the data stored at the location of the target stored integer number from a storage array as the target data corresponding to the keyword to be searched, wherein the stored integer number corresponding to each location in the storage array is obtained by converting the original integer number corresponding to each location according to the target conversion rule, and the original integer number corresponding to each location is the original integer number corresponding to the keyword associated with the data stored at each location.
[0117] In some embodiments of the present application, the storage integer conversion module 220 includes: a first conversion parameter acquisition unit, used to acquire a first conversion parameter, where the first conversion parameter is used to convert the original integers corresponding to different positions in the storage array into storage integers, and the original integers corresponding to different positions in the storage array are converted into different storage integers by the first conversion parameter; a first data acquisition unit, used to acquire binary data corresponding to the target original integer as first data if the first conversion parameter is a power of 2; a second data acquisition unit, used to acquire data located from the 1st to the (M-1)th position from the right to the left in the first data as second data, where M is the number of bits of the binary data corresponding to the first conversion parameter; a first target storage integer acquisition unit, used to convert the second data into decimal data to obtain the target storage integer.
[0118] In some embodiments of the present application, the stored integer conversion module 220 further includes: a second conversion parameter acquisition unit, for acquiring a second conversion parameter if the first conversion parameter is not a power of 2, the second conversion parameter being used to convert the first conversion parameter into a power of 2; a third conversion parameter acquisition unit, for acquiring a third conversion parameter based on the power of 2 corresponding to the product of the second conversion parameter and the first conversion parameter; and a second target stored integer acquisition unit, for acquiring a target stored integer corresponding to the target original integer based on the first conversion parameter, the second conversion parameter, and the third conversion parameter.
[0119] In some embodiments of the present application, the original integer number acquisition module 210 includes: a target original integer number acquisition unit for integer type data, which is used to determine that the target original integer number corresponding to the keyword to be searched is the keyword to be searched if the data type corresponding to the keyword to be searched is an integer type; an integer value acquisition unit for non-integer type data, which is used to obtain the integer value corresponding to the keyword to be searched according to a data table if the data type corresponding to the keyword to be searched is a non-integer type, and the data table includes multiple non-integer type data and the integer value corresponding to each non-integer type data; a hash processing unit, which is used to perform hash processing on the integer value according to the conversion base of the hash algorithm to obtain the hash value corresponding to the keyword to be searched as the target original integer number corresponding to the keyword to be searched.
[0120] In some embodiments of the present application, the data search device 200 includes a storage array establishment module, including: a data acquisition unit, used to acquire multiple keywords and data corresponding to each keyword; an original integer number acquiring the original integer number corresponding to each keyword; a storage integer number acquisition unit, used to convert the original integer number corresponding to each keyword into a storage integer number according to the target conversion rule, to obtain multiple different storage integer numbers, each of the multiple storage integer numbers corresponds to an original integer number; an empty storage array establishment unit, used to establish a storage array including multiple positions according to the number of the multiple storage integer numbers, and the multiple positions correspond one-to-one to the multiple storage integer numbers; a data storage unit in the storage array, used to store the data corresponding to each keyword in the corresponding position in the storage array according to the correspondence between the original integer number corresponding to each keyword and the storage integer number.
[0121] In some embodiments of the present application, the storage integer number acquisition unit includes: a first conversion parameter determination subunit, used to determine a first conversion parameter based on the original integer number corresponding to each keyword, the first conversion parameter being used to convert the original integer number corresponding to each keyword into a storage integer number, and different original integer numbers converted by the first conversion parameter have different storage integer numbers; a storage integer number conversion subunit, used to convert the original integer number corresponding to each keyword into a storage integer number based on the first conversion parameter, to obtain multiple different storage integer numbers.
[0122] In some embodiments of the present application, the storage integer conversion subunit includes: a first conversion micro-unit, which is used to convert the original integer corresponding to each keyword into a storage integer according to the first conversion parameter if the first conversion parameter is a power of 2, so as to obtain multiple different storage integers; a maximum original integer number acquisition micro-unit, which is used to obtain the maximum original integer among the original integers corresponding to the multiple keywords if the first conversion parameter is not a power of 2; a second conversion parameter determination micro-unit, which is used to determine the second conversion parameter for converting the first conversion parameter into a power of 2 according to the maximum original integer and the first conversion parameter; a converted first conversion parameter acquisition micro-unit, which is used to convert the first conversion parameter into a power of 2 according to the second conversion parameter to obtain a third conversion parameter; a second conversion micro-unit, which is used to convert the original integer corresponding to each keyword into a storage integer according to the first conversion parameter, the second conversion parameter and the third conversion parameter, so as to obtain multiple different storage integers.
[0123] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0124] In several embodiments provided in this application, the coupling between modules may be electrical, mechanical or other forms of coupling.
[0125] In addition, the functional modules in the various embodiments of the present application may be integrated into a processing module, or each module may exist physically separately, or two or more modules may be integrated into a single module. The above-mentioned integrated modules may be implemented in the form of hardware or software functional modules.
[0126] Please refer to Figure 5, which shows a block diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device 100 in the present application may include one or more of the following components: a processor 110, a memory 120, and one or more application programs, wherein the one or more application programs may be stored in the memory 120 and configured to be executed by the one or more processors 110, and the one or more programs are configured to perform the method described in the aforementioned method embodiment.
[0127] The processor 110 may include one or more processing cores. The processor 110 utilizes various interfaces and circuits to connect various components within the electronic device 100. It executes instructions, programs, code sets, or instruction sets stored in the memory 120, and accesses data stored in the memory 120 to perform various functions and process data within the electronic device 100. Optionally, the processor 110 may be implemented using at least one of the following hardware forms: a digital signal processing (DSP), a field-programmable gate array (FPGA), or a programmable logic array (PLA). The processor 110 may integrate one or a combination of a central processing unit (CPU), a graphics processing unit (GPU), and a modem. The CPU primarily processes the operating system, user interface, and application programs; the GPU is responsible for rendering and drawing display content; and the modem handles wireless communications. It is understood that the modem may not be integrated into the processor 110 and may be implemented separately via a communications chip.
[0128] The memory 120 may include a random access memory (RAM) or a read-only memory (ROM). The memory 120 may be used to store instructions, programs, codes, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data created by the electronic device 100 during use (such as a phone book, audio and video data, chat history data), etc.
[0129] A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores program code, and the program code can be called by a processor to execute the method described in the above method embodiment.
[0130] The computer-readable storage medium may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read-Only Memory), an EPROM, a hard disk, or a ROM. Alternatively, the computer-readable storage medium includes a non-transitory computer-readable storage medium. The computer-readable storage medium has storage space for program codes for executing any of the method steps described above. These program codes can be read from or written to one or more computer program products. The program codes can be compressed, for example, in an appropriate form.
[0131] In summary, the solution provided by the present application first converts the keyword to be searched into an integer to obtain the target original integer corresponding to the keyword to be searched, then converts the target original integer into a target storage integer smaller than the target original integer, and finally determines the target data corresponding to the keyword to be searched in the storage array according to the target storage integer. Since the storage integer corresponding to each position in the storage array is the data smaller than the original integer corresponding to each position after the original integer corresponding to each position is converted by the target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position, the storage space of the storage array is compressed through the data storage method such as the storage array, avoiding the space waste caused by the storage method of the traditional storage array. Moreover, when searching for the target data of the keyword to be searched, it is only necessary to convert the original integer corresponding to the keyword to be searched into the corresponding storage integer, thereby improving the efficiency of data search.
[0132] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A data search method, characterized in that, The method includes: Obtaining a target original integer corresponding to a keyword to be searched; Converting the target original integer into a target stored integer according to a target conversion rule, where the stored integers obtained after converting different original integers through the target conversion rule are different, and the stored integer obtained after converting through the target conversion rule is smaller than the original integer; Determining the data stored at the position where the target stored integer is located in the storage array as the target data corresponding to the keyword to be searched, where the stored integer corresponding to each position in the storage array is obtained by converting the original integer corresponding to each position according to the target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position.
2. The method according to claim 1, wherein The converting the target original integer into a target stored integer according to the target conversion rule includes: Obtaining a first conversion parameter, where the first conversion parameter is used to convert the original integers corresponding to different positions in the storage array into stored integers, and the stored integers obtained by converting the original integers corresponding to different positions in the storage array through the first conversion parameter are different; If the first conversion parameter is a power of 2, obtaining the binary data corresponding to the target original integer as the first data; Obtaining the data from the 1st bit to the (M - 1)th bit from right to left in the first data as the second data, where M is the number of bits of the binary data corresponding to the first conversion parameter; Converting the second data into a decimal number to obtain the target stored integer.
3. The method according to claim 2, characterized in that, The converting the target original integer into a target stored integer according to the target conversion rule includes: If the first conversion parameter is not a power of 2, obtaining a second conversion parameter, where the second conversion parameter is used to convert the first conversion parameter into a power of 2; Obtaining a third conversion parameter based on the power of 2 corresponding to the product of the second conversion parameter and the first conversion parameter; Obtaining the target stored integer corresponding to the target original integer according to the first conversion parameter, the second conversion parameter, and the third conversion parameter.
4. The method according to claim 1, characterized in that, The obtaining the target original integer corresponding to the keyword to be searched includes: If the data type corresponding to the keyword to be searched is an integer type, determining the target original integer corresponding to the keyword to be searched as the keyword to be searched; If the data type corresponding to the keyword to be searched is a non-integer type, obtaining the integer value corresponding to the keyword to be searched according to a data table, where the data table includes multiple non-integer type data and the integer value corresponding to each non-integer type data; Performing a hash process on the integer value according to the conversion base of the hash algorithm to obtain the hash value corresponding to the keyword to be searched as the target original integer corresponding to the keyword to be searched.
5. The method according to any one of claims 1-4, characterized in that, The establishment of the storage array includes: Obtaining multiple keywords and the data corresponding to each keyword; Obtaining the original integer corresponding to each keyword; According to the target conversion rule, convert the original integer corresponding to each keyword into a stored integer, obtaining multiple distinct stored integers, where each stored integer in the multiple stored integers corresponds to an original integer; Establish a storage array including multiple positions according to the number of the multiple stored integers, where the multiple positions correspond one-to-one to the multiple stored integers; According to the correspondence between the original integer and the stored integer corresponding to each keyword, store the data corresponding to each keyword at the corresponding position in the storage array.
6. The method according to claim 5, wherein The step of converting the original integer corresponding to each keyword into a stored integer according to the target conversion rule to obtain multiple distinct stored integers includes: Determine a first conversion parameter according to the original integer corresponding to each keyword, where the first conversion parameter is used to convert the original integer corresponding to each keyword into a stored integer, and the stored integers obtained by converting different original integers through the first conversion parameter are different; According to the first conversion parameter, convert the original integer corresponding to each keyword into a stored integer, obtaining multiple distinct stored integers.
7. The method according to claim 6, characterized in that, The step of converting the original integer corresponding to each keyword into a stored integer according to the first conversion parameter to obtain multiple distinct stored integers includes: If the first conversion parameter is a power of 2, then convert the original integer corresponding to each keyword into a stored integer according to the first conversion parameter, obtaining multiple distinct stored integers; If the first conversion parameter is not a power of 2, then obtain the largest original integer among the original integers corresponding to the multiple keywords; According to the largest original integer and the first conversion parameter, determine a second conversion parameter for converting the first conversion parameter into a power of 2; According to the second conversion parameter, convert the first conversion parameter into a power of 2, obtaining a third conversion parameter; According to the first conversion parameter, the second conversion parameter, and the third conversion parameter, convert the original integer corresponding to each keyword into a stored integer, obtaining multiple distinct stored integers.
8. A data search device, characterized in that, It includes: An original integer acquisition module for acquiring the target original integer corresponding to the keyword to be searched; A stored integer conversion module for converting the target original integer into a target stored integer according to the target conversion rule, where the stored integers obtained by converting different original integers through the target conversion rule are different, and the stored integers obtained by converting through the target conversion rule are smaller than the original integers. A target data acquisition module, configured to determine, from a storage array, data stored at a position where the target stored integer is located as target data corresponding to the keyword to be searched, wherein the stored integer corresponding to each position in the storage array is obtained by converting the original integer corresponding to each position according to the target conversion rule, and the original integer corresponding to each position is the original integer corresponding to the keyword associated with the data stored at each position.
9. An electronic device, characterized in that, Comprising: One or more processors; A memory; One or more applications, wherein the one or more applications are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, Program code is stored in the computer-readable storage medium, and the program code can be called by a processor to execute the method according to any one of claims 1-7.
Citation Information
Patent Citations
Preheat data processing method and device and computer readable storage medium
CN113918541A
Image query method and related equipment
CN115757852A
Data searching method and device, electronic equipment and storage medium
CN117971879A
Block-level and hash-based single-instance storage
US7454592B1