Number query method, system and device, medium and program product

By performing segmented encryption and feature value extraction on mobile phone numbers and creating an index structure, the security risks and inefficiency problems in encrypted mobile phone numbers are solved, and an efficient and secure query solution is achieved.

CN120372057APending Publication Date: 2025-07-25CHINA MOBILE SHANGHAI ICT CO LTD +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510347451.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-24
Publication Date
2025-07-25

AI Technical Summary

Technical Problem

The prior art has security risks and inefficient query problems when encrypting mobile phone number query, especially when decrypting the number data, it exposes the key and causes the index to fail.

Method used

Encrypt the mobile phone number in segments and extract feature values, create an index structure, and perform matching queries through feature value fields to avoid decryption operations and improve query efficiency.

Benefits of technology

On the premise of ensuring user privacy, efficient mobile phone number query is achieved, improving query speed and security, and reducing the risk of key exposure.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120372057A_ABST
    Figure CN120372057A_ABST
Patent Text Reader

Abstract

The invention discloses a number query method, system and device, a medium and a program product, and the method comprises the steps: firstly segmenting an original number to obtain a plurality of first number segments, then encrypting the plurality of first number segments to obtain first encrypted number segments corresponding to the first number segments, and storing the first encrypted number segments in a database; carrying out feature value extraction on the first encrypted number segment to obtain a feature value corresponding to each first number segment; wherein the characteristic value corresponding to the first number segment is stored in a database in the form of a characteristic value field; the method comprises the steps of obtaining a feature value field, creating an index for the feature value field to obtain a first index structure, and finally performing matching query on the feature value field based on the first index structure according to a query number input by a user to obtain a query result. By adopting the method and the device, the search operation can be executed under the condition of not decrypting the number data, and the query efficiency of the number can be improved on the basis of guaranteeing the privacy of the user.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of information security technology, and in particular, to a method, system, device, medium and program product for querying numbers. Background Art

[0002] As an important piece of personal information, mobile phone numbers are often used to identify user identities, conduct communication, and handle business-related matters. Therefore, mobile phone numbers play a crucial role in intelligent management systems. With the explosion of information volume and the improvement of information security awareness, encrypting the storage of mobile phone numbers has become a necessary measure. However, due to the loss of the original format features of encrypted mobile phone numbers, the search method based on plaintext is no longer applicable to query encrypted mobile phone numbers.

[0003] Currently, the methods for querying encrypted mobile phone numbers mainly involve decrypting the fields storing the encrypted mobile phone numbers first when performing SQL (Structured Query Language) queries, and then performing full fuzzy matching queries. However, when decrypting the fields in this method, the encryption key of the mobile phone number is usually directly exposed to the database layer, which poses certain security risks; at the same time, when using full fuzzy matching to query mobile phone numbers, due to the inability to utilize indexes, the query efficiency of mobile phone numbers is low. Summary of the Invention

[0004] The present invention provides a method, system, device, medium and program product for querying numbers, which can perform search operations without decrypting the number data, and realizes improving the query efficiency of numbers on the basis of protecting user privacy.

[0005] To achieve the above object, an embodiment of the present invention provides a method for querying numbers, including:

[0006] Segment the original number to obtain a plurality of first number segments;

[0007] Encrypt the plurality of first number segments to obtain corresponding first encrypted number segments for each of the first number segments;

[0008] Extract feature values from the first encrypted number segments to obtain corresponding feature values for each of the first number segments; wherein, the feature values corresponding to the first number segments are stored in the form of feature value fields in the database;

[0009] Create an index for the feature value fields to obtain a first index structure;

[0010] Based on the user-entered query number, perform a matching query on the feature value fields based on the first index structure to obtain a query result.

[0011] As an improvement to the above solution, segmenting the original number to obtain a plurality of first number segments includes:

[0012] Taking each character of the original number as the starting point of the truncation window to truncate the number segments, obtaining a plurality of first number segments; wherein, the first number segment includes a first set number of consecutive characters in the original number.

[0013] As an improvement to the above solution, extracting eigenvalue of the first encrypted number segment to obtain the eigenvalue corresponding to each first number segment includes:

[0014] Extracting one encrypted character or multiple encrypted characters in each of the first encrypted number segments to obtain the eigenvalue corresponding to each first number segment.

[0015] As an improvement to the above solution, performing a matching query on the eigenvalue field based on the first index structure according to the query number input by the user to obtain a query result includes:

[0016] Obtaining the query number input by the user, segmenting the query number to obtain a plurality of second number segments;

[0017] Encrypting the plurality of second number segments to obtain a second encrypted number segment corresponding to each second number segment;

[0018] Extracting eigenvalue of the second encrypted number segment to obtain the eigenvalue corresponding to each second number segment;

[0019] Forming a query condition with the eigenvalue corresponding to each second number segment, and performing a matching query on the eigenvalue field based on the first index structure according to the query condition to obtain a query result.

[0020] As an improvement to the above solution, forming a query condition with the eigenvalue corresponding to each second number segment, and performing a matching query on the eigenvalue field based on the first index structure according to the query condition to obtain a query result includes:

[0021] Taking the first eigenvalue field as the starting point, querying the eigenvalue stored in the consecutive second set number of eigenvalue fields based on the first index structure to obtain a first eigenvalue sequence; wherein, the second set number is the number of segments of the second encrypted number segment;

[0022] Sorting the eigenvalues of all the second number segments to obtain a second eigenvalue sequence;

[0023] Judging whether the eigenvalues in the first eigenvalue sequence match the eigenvalues in the second eigenvalue sequence one by one;

[0024] When there is a match, return the query result of the number record with a match;

[0025] When there is no match, return the query result of the number record where no match is found.

[0026] Optionally, creating an index for the eigenvalue field to obtain a first index structure, including:

[0027] Create a balanced tree index for the eigenvalue field to obtain a first index structure.

[0028] Optionally, before segmenting the original number to obtain multiple first number segments, the method further includes:

[0029] Encrypt the entire original number to obtain an encrypted number string, and store the encrypted number string in the database in the form of a first field;

[0030] Create an index for the first field to obtain a second index structure.

[0031] To achieve the above object, an embodiment of the present invention further provides a number query system, including:

[0032] A number segmentation module for segmenting the original number to obtain multiple first number segments;

[0033] A number encryption module for encrypting the multiple first number segments to obtain first encrypted number segments corresponding to the respective first number segments;

[0034] An eigenvalue mapping module for extracting eigenvalues from the first encrypted number segments to obtain eigenvalues corresponding to the respective first number segments; wherein, the eigenvalues corresponding to the first number segments are stored in the database in the form of an eigenvalue field;

[0035] An index creation module for creating an index for the eigenvalue field to obtain a first index structure;

[0036] A query module for performing a matching query on the eigenvalue field based on the first index structure according to the query number input by the user to obtain a query result.

[0037] To achieve the above object, an embodiment of the present invention further provides a number query device, including: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements the number query method described in any one of the above.

[0038] To achieve the above object, an embodiment of the present invention further provides a computer-readable storage medium, which stores a computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the number query method described in any one of the above.

[0039] To achieve the above object, an embodiment of the present invention further provides a computer program product, including a computer program / instructions. When the computer program / instructions are executed by a processor, the number query method described in any one of the above is implemented.

[0040] Compared with the prior art, a number query method, system, device, medium and program product provided by an embodiment of the present invention first segments an original number to obtain a plurality of first number segments, then encrypts the plurality of first number segments to obtain first encrypted number segments corresponding to the respective first number segments, and extracts eigenvalue of the first encrypted number segments to obtain eigenvalues corresponding to the respective first number segments; wherein, the eigenvalue corresponding to the first number segment is stored in the database in the form of an eigenvalue field; at the same time, an index is created for the eigenvalue field to obtain a first index structure, and finally, based on the first index structure, a matching query is performed on the eigenvalue field according to a query number input by a user to obtain a query result. The present invention realizes the effect of being able to perform a query without decrypting the number by segmenting, encrypting and storing the number, extracting eigenvalues and creating an index, and can ensure the efficient execution of the query operation while maintaining a high level of data security. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] In order to more clearly illustrate the technical solutions of the present invention, the drawings to be used in the embodiments will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0042] Figure 1 is a flowchart of a number query method provided by an embodiment of the present invention;

[0043] Figure 2 is a schematic diagram of number segmentation provided by an embodiment of the present invention;

[0044] Figure 3 is a structural block diagram of a number query system provided by an embodiment of the present invention;

[0045] Figure 4 is a structural block diagram of a number query device provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0047] See Figure 1 , Figure 1 which is a schematic flowchart of a number query method provided by an embodiment of the present invention. The number query method includes steps S1 to S5:

[0048] S1. Segment the original number to obtain a plurality of first number segments;

[0049] In one implementation, the step of segmenting the original number to obtain a plurality of first number segments includes:

[0050] Taking each character of the original number as the starting point of the truncation window to truncate the number segments, and obtaining a plurality of first number segments; wherein, the first number segment includes a first set number of consecutive characters in the original number; preferably, the first set number is four.

[0051] It should be noted that when segmenting and encrypting the number, taking 4 digits as a segment is more in line with people's reading and memory habits, facilitating user identification and processing. For example, a mobile phone number is usually naturally divided into three segments by people, such as 138 - 1234 - 5678, and this segmentation method is easy to understand and remember. At the same time, when many encryption algorithms process data, operating with blocks of a fixed length is more efficient and stable. The length of 4 digits can achieve a better balance in terms of computational complexity and processing speed. It will neither cause excessive encryption times and low efficiency due to too small data blocks, nor increase the algorithm complexity and consumption of computing resources due to too large data blocks. Moreover, the length of 4 digits can adapt to the word length and data processing unit of the computer system in most cases, facilitating bit operations, logical operations, etc., and improving the speed of encryption and decryption. In many industries such as finance and communication, a convention and standard of processing and displaying data in units of 4 digits have been formed. For example, bank card numbers are usually also displayed and processed in segments of 4 digits. Using 4 digits as a segment for number encryption can better be compatible with existing industry standards and business processes, facilitating data interaction and sharing between systems, and reducing compatibility problems caused by inconsistent data formats.

[0052] Exemplarily, see Figure 2 , Figure 2 which is a schematic diagram of number segmentation provided by an embodiment of the present invention. As Figure 2As shown, taking the existing 11-digit mobile phone number as an example, assuming the original number is "1ABCDEFGHIJ", the starting point of the intercept window can be the first digit of the mobile phone number, and the fixed length of four digits can be intercepted as a number segment. Starting from the first character "1", taking four characters as an intercept window, the first number segment "1ABC" is obtained; starting from the second character "A", taking four characters as the intercept window, the second number segment "ABCD" is obtained; and so on. Starting from the third character "B", "BCDE" is obtained; starting from the fourth character "C", "CDEF" is obtained; starting from the fifth character "D", "DEFG" is obtained; starting from the sixth character "E", "EFGH" is obtained; starting from the seventh character "F", "FGHI" is obtained; starting from the seventh character "G", since there are less than four characters behind, only the remaining characters are intercepted, and "GHIJ" is obtained. In this way, by taking each character of the original number as the starting point of the intercept window for number segment interception, and each first number segment contains four consecutive characters, a total of eight first number segments are finally obtained: 1ABC, ABCD, BCDE, CDEF, DEFG, EFGH, FGHI, and GHIJ.

[0053] S2. Encrypt the multiple first number segments to obtain the first encrypted number segments corresponding to the respective first number segments;

[0054] Exemplarily, after segmenting the mobile phone number into multiple number segments, each number segment is encrypted independently. This can not only ensure the security of the data but also retain certain characteristics of the mobile phone number, facilitating subsequent index construction.

[0055] It should be noted that selecting a suitable encryption algorithm is one of the key steps to achieve the above functions. The encryption algorithm should have high-strength security and be able to resist various known cracking attempts. In addition, the efficiency of the encryption algorithm also needs to be considered to ensure that it will not have too much impact on the performance of the system. Preferably, in the embodiments of the present invention, a symmetric encryption algorithm (such as AES) is selected to encrypt the number segments. The most suitable solution can be determined according to the requirements of the actual application scenario during specific implementation.

[0056] S3. Extract the characteristic values from the first encrypted number segments to obtain the characteristic values corresponding to the respective first number segments; wherein, the characteristic values corresponding to the first number segments exist in the database in the form of characteristic value fields;

[0057] In one implementation manner, the extracting the characteristic values from the first encrypted number segments to obtain the characteristic values corresponding to the respective first number segments includes:

[0058] Extract one encrypted character or multiple encrypted characters from each of the first encrypted number segments to obtain the eigenvalue corresponding to each of the first number segments.

[0059] It should be noted that, in order to further enhance data security and optimize the query efficiency in the database, the embodiments of the present invention adopt a novel eigenvalue mapping strategy to process the encrypted numbers. The core lies in the eigenvalue extraction mechanism, aiming to achieve more efficient data management and retrieval.

[0060] Exemplarily, this eigenvalue mapping strategy starts from the first digit of the mobile phone number, intercepts a segment every four digits as a number segment, and extracts the eigenvalue of this encrypted number segment. It should be noted that the eigenvalue extraction used here can be implemented based on the symmetric encryption algorithm when encrypting the number segment. Specifically, the first few characters or characters at specific positions of the encrypted string can be used as the eigenvalue of each number segment. In addition, the eigenvalue extraction can also be achieved by means of a more customized method. Exemplarily, a carefully designed mapping table can also be used to convert the four-digit sequence (ranging from 0001 to 9999) into a specific eigenvalue. This mapping table is maintained by the corresponding application program, which can ensure the randomness and unpredictability of the mapping rules, thereby providing additional security in the required scenarios.

[0061] Exemplarily, through the above steps, the original mobile phone number can be cleverly decomposed into multiple segments, and each segment is converted into a unique eigenvalue. See Figure 2 , and these eigenvalues are then stored in eight independent fields in the database, which can be named encode_num1 to encode_num8 respectively.

[0062] It should be noted that by storing the eigenvalues in the form of eigenvalue fields in the database, not only the uniformity of data distribution is enhanced, but also the subsequent data query process is greatly simplified. For example, if the number is a long digit string, then it can be divided into multiple four-character paragraphs, each paragraph is encrypted independently, and each will be converted into a new eigenvalue and stored in the specified field. Such a storage method makes it difficult for attackers to parse the original number even if the data in the database is illegally accessed.

[0063] S4. Create an index for the eigenvalue field to obtain a first index structure;

[0064] It can be understood that after segmenting and encrypting the mobile phone number through the above steps, then extracting the eigenvalue and storing it in the form of an eigenvalue field, the finally formed storage structure is as Figure 2As shown, each field (encode_num1 to encode_num8) will store a feature value.

[0065] In an alternative embodiment, creating an index for the feature value field to obtain a first index structure includes:

[0066] Creating a balanced tree index for the feature value field to obtain a first index structure.

[0067] It should be noted that in the existing number query scheme, when fuzzy query is required, the encryption key usually needs to be passed to the database layer to decrypt the data during the query process. This approach has certain risks because once the decryption key enters the database layer, it may be accessed by unauthorized personnel or malware. In addition, the decryption process itself may also become a weak link in the system. Especially when dealing with large-scale data sets, the decryption operation may cause additional time delays, increasing the complexity of the system and potential security vulnerabilities.

[0068] Exemplarily, when executing an SQL query, the encrypted number field is first decrypted and then fuzzy matching query is performed. For example, if you want to query all mobile phone numbers containing "3230", the SQL statement needs to be modified to: SELECT * FROM table_name WHERE AES_DECRYPT(phone, key) LIKE '%3230%'; Here, key refers to the key used for the encryption algorithm.

[0069] However, this kind of fuzzy query (LIKE query), especially the query containing wildcards (such as %), often causes the index to become invalid, thereby reducing the query efficiency. This is because the database management system needs to perform a full table scan to find all qualified records, which is a very time-consuming operation for large databases. To improve this, the embodiment of the present invention introduces a strategy of exact matching. Exact matching means using exact values for comparison during the query instead of relying on wildcards to find possible matching items. This approach can make full use of the index structure in the database, enabling the query operation to locate the required data faster.

[0070] Therefore, in order to further improve the efficiency of data processing, especially in the case of a large amount of data query, an independent balanced tree index (such as B-Tree index) can be created for each eigenvalue field (encode_num1 to encode_num8), and these eigenvalues together constitute a unique index structure system. This system is subsequently used to quickly locate and retrieve related records while ensuring data security. Through such processing, not only the security of the data is enhanced, but also a solid foundation is laid for efficient data management and retrieval. The index structure in the embodiment of the present invention is particularly suitable for application scenarios that need to frequently query user information and attach great importance to user privacy protection.

[0071] S5. According to the query number input by the user, a matching query is performed on the feature value field based on the first index structure to obtain a query result.

[0072] It should be noted that when performing a fuzzy query on the query number input by the user, the input query number needs to be segmented, encrypted, and feature-extracted similarly to the original number, and then matched with the index in the database to quickly locate the relevant record.

[0073] In an optional implementation manner, performing a matching query on the feature value field based on the first index structure according to the query number input by the user to obtain a query result includes:

[0074] Obtain a query number input by a user, segment the query number, and obtain multiple second number segments; specifically, use each character of the query number as a starting point of a capture window to perform number segment capture, and obtain multiple second number segments; wherein the second number segment includes a set number of consecutive characters in the query number, and the set number is the same as the above-mentioned first set number.

[0075] Encrypting multiple second number segments to obtain second encrypted number segments corresponding to each of the second number segments;

[0076] Extracting feature values from the second encrypted number segments to obtain feature values corresponding to each of the second number segments; specifically, extracting one or more encrypted characters from each of the second encrypted number segments to obtain feature values corresponding to each of the second number segments;

[0077] The characteristic values corresponding to each of the second number segments are used to form a query condition, and a matching query is performed on the characteristic value field based on the first index structure according to the query condition to obtain a query result.

[0078] It should be noted that in traditional fuzzy queries, a word segmentation algorithm is usually used. Existing word segmentation algorithms (such as the forward maximum matching method, the backward maximum matching method, and the bidirectional maximum matching method) mainly rely on a pre-constructed dictionary to identify words in the text and are mainly used for text processing. The purpose is to segment a continuous character sequence into meaningful lexical units. However, when applied to a digital sequence such as a mobile phone number, traditional word segmentation algorithms are often not flexible and efficient enough. In the embodiments of the present invention, when segmenting the query number input by the user, it can also be regarded as a word segmentation process. Exemplarily, the mobile phone number is segmented without distinction every 4 digits. This word segmentation method is not affected by the internal logic of the number, ensuring that each part has a fixed length, thus simplifying the subsequent encryption process. Since a fixed word segmentation length is adopted, the problem of inconsistent data lengths caused by different word segmentation strategies is avoided, thereby reducing the complexity in the data processing process and the requirement for storage space. Therefore, the method for segmenting the number in the present invention not only improves the security of encryption but also effectively solves the problem of data expansion caused by excessive word segmentation.

[0079] In an alternative embodiment, forming a query condition by using the characteristic values corresponding to each of the second number segments, and based on the query condition, performing a matching query on the characteristic value field based on the first index structure to obtain a query result, including:

[0080] Taking the first characteristic value field as a starting point, querying the characteristic values stored in a continuous second set number of characteristic value fields based on the first index structure to obtain a first characteristic value sequence; wherein, the second set number is the number of segments of the second encrypted number segment;

[0081] Sorting the characteristic values of all the second number segments to obtain a second characteristic value sequence;

[0082] Determining whether the characteristic values in the first characteristic value sequence match the characteristic values in the second characteristic value sequence one by one;

[0083] When there is a match, returning the query result of the number record with a match;

[0084] When there is no match, returning the query result of not finding a matching number record.

[0085] Exemplarily, still taking the mobile phone number as an example, when the user inputs a 4-digit number (such as ABCD) for query, the same characteristic value operation can be directly performed on the input 4-digit number. Assuming the obtained characteristic value is A, then a parallel search for matching items is performed in the encode_num series fields of the characteristic value fields of the original number. At this time, the query condition is: (encode_num1 = 'A') OR (encode_num2 = 'A')......OR (encode_num8 = 'A').

[0086] When the user inputs a 5-digit number for query, the input number needs to be divided into consecutive 4-digit segments (e.g., ABCDE is divided into ABCD and BCDE), and then the eigenvalue operation is performed on each number segment. Suppose X and Y are obtained, and then parallel searches for matching items are performed in the encode_num series fields of the eigenvalue field of the original number. The combined query conditions formed at this time can be: (encode_num1 = 'X' AND encode_num2 = 'Y') OR (encode_num2 = 'X' AND encode_num3 = 'Y').... OR (encode_num7 = 'X' AND encode_num8 = 'Y').

[0087] Understandably, when querying with a number of more than 6 digits or more, refer to the operations when the user inputs a 5-digit number for query to form query conditions, traverse all possible field combinations, and then obtain the query results.

[0088] Exemplarily, when the database matches according to the query conditions in the eigenvalue field, if records that meet the conditions are found, it may return the complete data records containing these eigenvalues. As Figure 2 shown, in a user information table, in addition to the eigenvalue field, there may also be other business fields, such as user name, registration time, address and other information. The query results can return all relevant information that meets the conditions for a comprehensive understanding and processing of the record. If sometimes only some fields in the query results are needed, such as only focusing on the eigenvalue field and a few fields directly related to the business, such as the user's membership level, points, etc. In this case, the query results will only contain the data of these specified partial fields to reduce the data transmission volume and processing complexity.

[0089] In specific implementation, in the MySQL 8.0 environment and under the InnoDB storage engine, through 1 million randomly generated test data sets, it is verified that the query response time of the number query method provided by the embodiment of the present invention is stable at the level of dozens of milliseconds, which can show that it has good execution efficiency on large-scale data sets.

[0090] In summary, the number query method provided by the embodiments of the present invention segments a number into segments of a fixed length and then encrypts and stores them independently, extracts eigenvalue and builds an index based on these encrypted segments. When performing a query, the input query condition is processed by similar segment encryption and eigenvalue extraction, and then matched with the index in the database to quickly locate relevant records. Compared with the existing method of decrypting first and then performing fuzzy query, the embodiments of the present invention create a non-decrypting query scheme for number query. Through the idea of number segmentation, each segment corresponds to a unique eigenvalue, thereby converting the original fuzzy query into an accurate match. The query can be realized through the eigenvalue without decrypting the encrypted data first, and the encryption key is no longer transmitted to the database layer, which ensures the data security to a certain extent. At the same time, by establishing a corresponding index mechanism, the query efficiency is improved. In addition, the present invention is not only applicable to industries such as e-commerce and logistics, but also can be widely applied to any scenario that needs to store and query numbers, including but not limited to industries such as financial services, medical health, and education. Since the core idea of the solution is the encrypted storage and index construction of data, it can be easily integrated with other systems without causing major interference to the existing business processes.

[0091] In an alternative embodiment, before segmenting the original number to obtain a plurality of first number segments, the method further includes:

[0092] Encrypt the entire original number to obtain an encrypted number string, and store the encrypted number string in the database in the form of a first field;

[0093] Create an index for the first field to obtain a second index structure.

[0094] It should be noted that, in order to effectively protect the user's information from being obtained or tampered with by unauthorized third parties, the embodiments of the present invention can also use a suitable encryption algorithm to perform an encryption transformation on the user's number. Taking a mobile phone number as an example, see Figure 2 , the encrypted mobile phone number will be stored in a specific field in the database table in the form of ciphertext, and the specific field name can be "mobile_encrypt". This field is specifically used to store the encrypted mobile phone number, so as to avoid the direct exposure of the original, unencrypted phone number in the database. Even if the data at the database level is leaked, it is difficult for attackers to interpret the real mobile phone number, which can further improve the data security.

[0095] It should be noted that the encryption of the entire original number can also use a symmetric encryption algorithm (such as AES). However, during the implementation process, it should also be noted that in order to be able to decrypt these numbers in the future, the keys used in the encryption process must be properly stored. Best practices should be followed for storing and using these keys to prevent the encryption from losing its meaning due to key leakage.

[0096] Exemplarily, an independent B-Tree index can also be created for the field mobile_encrypt that stores the encrypted mobile phone number, so that in subsequent number queries, the location of the encrypted mobile phone number can be more quickly located, reducing the data scanning range during the query, quickly finding the target record, significantly improving the speed of exact match queries, quickly returning accurate results, and at the same time supporting the implementation of uniqueness checks on the encrypted mobile phone number to ensure the integrity and accuracy of the data and avoid duplicate data.

[0097] It should be noted that the design of the index needs to consider the characteristics of the encryption algorithm and the query pattern. An inverted index can also be used to support keyword searches, or a Bloom Filter can be used to quickly exclude records that are unlikely to match, reducing the scope of exact matches.

[0098] See Figure 3 , Figure 3 FIG. is a structural block diagram of a number query system 200 provided by an embodiment of the present invention. The number query system 200 includes:

[0099] A number segmentation module 21, configured to segment the original number to obtain a plurality of first number segments;

[0100] A number encryption module 22, configured to encrypt the plurality of first number segments to obtain first encrypted number segments corresponding to the respective first number segments;

[0101] A feature value mapping module 23, configured to extract feature values from the first encrypted number segments to obtain feature values corresponding to the respective first number segments; wherein, the feature values corresponding to the first number segments are stored in the database in the form of feature value fields;

[0102] An index creation module 24, configured to create an index for the feature value fields to obtain a first index structure;

[0103] A query module 25, configured to perform a matching query on the feature value fields based on the first index structure according to a query number input by a user to obtain a query result.

[0104] In an alternative embodiment, the number segmentation module 21 is specifically configured to:

[0105] Taking each character of the original number as the starting point of the intercepting window to intercept number segments, and obtaining a plurality of first number segments; wherein, the first number segment includes a first set number of consecutive characters in the original number.

[0106] In an alternative embodiment, the eigenvalue mapping module 23 is specifically configured to:

[0107] Extract one encrypted character or a plurality of encrypted characters from each of the first encrypted number segments to obtain the eigenvalue corresponding to each of the first number segments.

[0108] In an alternative embodiment, the index creation module 24 is specifically configured to:

[0109] Create a balanced tree index for the eigenvalue field to obtain a first index structure.

[0110] In an alternative embodiment, the query module 25 includes:

[0111] A second number segmentation unit, configured to obtain a query number input by a user, segment the query number to obtain a plurality of second number segments;

[0112] A second number encryption unit, configured to encrypt the plurality of second number segments to obtain a second encrypted number segment corresponding to each of the second number segments;

[0113] A second eigenvalue mapping unit, configured to perform eigenvalue extraction on the second encrypted number segment to obtain the eigenvalue corresponding to each of the second number segments;

[0114] A query unit, configured to form a query condition by using the eigenvalues corresponding to each of the second number segments, and perform a matching query on the eigenvalue field based on the first index structure according to the query condition to obtain a query result.

[0115] In an alternative embodiment, the query unit is specifically configured to:

[0116] Taking the first eigenvalue field as the starting point, query the eigenvalues stored in consecutive second set number of eigenvalue fields based on the first index structure to obtain a first eigenvalue sequence; wherein, the second set number is the number of segments of the second encrypted number segment;

[0117] Sort the eigenvalues of all the second number segments to obtain a second eigenvalue sequence;

[0118] Determine whether the eigenvalues in the first eigenvalue sequence match the eigenvalues in the second eigenvalue sequence one by one;

[0119] When there is a match, return the query result of the existence of a matching number record;

[0120] When there is no match, return the query result of the un-found matching number record.

[0121] In an alternative embodiment, the number query system 200 further includes:

[0122] An original number encryption module, configured to encrypt the entire original number to obtain an encrypted number string, and store the encrypted number string in the database in the form of a first field;

[0123] A second index construction module, configured to create an index for the first field to obtain a second index structure.

[0124] It should be noted that a number query system provided in an embodiment of the present invention is used to execute all process steps of a number query method in the above embodiment, and the working principles and beneficial effects of the two correspond one by one, so details will not be described herein again.

[0125] See Figure 4 , Figure 4 is a structural block diagram of a number query device 300 provided in an embodiment of the present invention. The number query device 300 includes a processor 31, a memory 32, and a computer program stored in the memory 32 and executable on the processor 31. When the processor 31 executes the computer program, the steps in the above-mentioned various number query method embodiments are implemented, such as steps S1 to S5.

[0126] Exemplarily, the computer program may be divided into one or more modules / units. The one or more modules / units are stored in the memory 32 and executed by the processor 31 to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing specific functions, and the instruction segments are used to describe the execution process of the computer program in the number query device 300.

[0127] The number query device 300 may include, but is not limited to, a processor 31 and a memory 32. Those skilled in the art can understand that the schematic diagram is only an example of the number query device 300, and does not constitute a limitation on the number query device 300. It may include more or fewer components than those shown in the figure, or combine some components, or different components. For example, the number query device 300 may further include an input / output device, a network access device, a bus, etc.

[0128] The processor 31 may be a Central Processing Unit (CPU), or may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc. The processor 31 is the control center of the number query device 300, and connects various parts of the entire number query device 300 through various interfaces and lines.

[0129] The memory 32 can be used to store the computer programs and / or modules. The processor 31 realizes various functions of the number query device 300 by running or executing the computer programs and / or modules stored in the memory 32, and by calling the data stored in the memory 32. The memory 32 mainly includes a program storage area and a data storage area. Among them, the program storage area can store an operating system, application programs required for at least one function (such as a sound playback function, an image playback function, etc.); the data storage area can store data created according to the use of the mobile phone (such as audio data, phone book, etc.). In addition, the memory 32 may include high-speed random access memory, and may also include non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a Flash Card, at least one magnetic disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0130] Among them, if the modules / units integrated in the number query device 300 are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above-mentioned embodiment methods of the present invention, it can also be completed by instructing relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor 31, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.

[0131] The above is the preferred implementation manner of the present invention. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements are also regarded as the protection scope of the present invention.

Claims

1. A method for querying numbers, characterized in that, Including: Segment the original number to obtain multiple first number segments; Encrypt the multiple first number segments to obtain the first encrypted number segments corresponding to the respective first number segments; Extract eigenvalue of the first encrypted number segments to obtain the eigenvalues corresponding to the respective first number segments; wherein, the eigenvalue corresponding to the first number segment is stored in the database in the form of an eigenvalue field; Create an index for the eigenvalue field to obtain a first index structure; Based on the first index structure, perform a matching query on the eigenvalue field according to the query number input by the user to obtain a query result.

2. The number query method according to claim 1, characterized in that The segmenting the original number to obtain multiple first number segments includes: Respectively use each character of the original number as the starting point of the truncation window to truncate the number segments, obtaining multiple first number segments; wherein, the first number segment includes a first set number of consecutive characters in the original number.

3. The number query method according to claim 1, characterized in that, The extracting eigenvalue of the first encrypted number segments to obtain the eigenvalues corresponding to the respective first number segments includes: Extract one encrypted character or multiple encrypted characters in each of the first encrypted number segments to obtain the eigenvalues corresponding to the respective first number segments.

4. The number query method according to claim 1, characterized in that, The performing a matching query on the eigenvalue field based on the first index structure according to the query number input by the user to obtain a query result includes: Obtain the query number input by the user, segment the query number to obtain multiple second number segments; Encrypt the multiple second number segments to obtain the second encrypted number segments corresponding to the respective second number segments; Extract eigenvalue of the second encrypted number segments to obtain the eigenvalues corresponding to the respective second number segments; Form a query condition using the eigenvalues corresponding to the respective second number segments, and based on the query condition, perform a matching query on the eigenvalue field based on the first index structure to obtain a query result.

5. The number query method according to claim 4, wherein, The forming a query condition using the eigenvalues corresponding to the respective second number segments, and based on the query condition, performing a matching query on the eigenvalue field based on the first index structure to obtain a query result includes: Using the first eigenvalue field as the starting point, query the eigenvalues stored in the consecutive second set number of eigenvalue fields based on the first index structure to obtain a first eigenvalue sequence; wherein, the second set number is the number of segments of the second encrypted number segment; Sort the eigenvalues of all the second number segments to obtain a second eigenvalue sequence; Determine whether the eigenvalues in the first eigenvalue sequence match the eigenvalues in the second eigenvalue sequence one by one; When there is a match, return the query result of the number record with a match; When there is no match, return the query result of not finding a matching number record.

6. The number query method according to claim 1, wherein, The creating an index for the eigenvalue field to obtain a first index structure includes: Create a balanced tree index for the eigenvalue field to obtain a first index structure.

7. The number query method according to claim 1, characterized in that, Before the segmenting the original number to obtain multiple first number segments, the method further includes: Encrypt the entire original number to obtain an encrypted number string, and store the encrypted number string in the database in the form of a first field; Create an index for the first field to obtain a second index structure.

8. A number query system, characterized in that, Comprising: A number segmentation module for segmenting the original number to obtain a plurality of first number segments; A number encryption module for encrypting the plurality of first number segments to obtain a first encrypted number segment corresponding to each of the first number segments; A feature value mapping module for extracting feature values from the first encrypted number segment to obtain feature values corresponding to each of the first number segments; wherein, the feature values corresponding to the first number segments are stored in a database in the form of a feature value field; An index creation module for creating an index for the feature value field to obtain a first index structure; A query module for performing a matching query on the feature value field based on the first index structure according to the query number input by the user to obtain a query result.

9. A number query device, characterized in that, Comprising: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein when the processor executes the computer program, the number query method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, wherein when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the number query method according to any one of claims 1 to 7.

11. A computer program product, comprising a computer program / instructions, characterized in that, When the computer program / instructions are executed by the processor, the number query method according to any one of claims 1 to 7 is implemented.