Query method and device for numbers, non-volatile storage medium, processor

By determining the prefix number of the number interval as the index value, matching the number to be queried to narrow the query range, the problem of inefficient number query in the prior art is solved, and efficient query in a high concurrency environment is achieved.

CN115442799BActive Publication Date: 2025-06-24CHINA TELECOM CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211066976.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-01
Publication Date
2025-06-24
Estimated Expiration
2042-09-01

AI Technical Summary

Technical Problem

The prior art cannot effectively narrow the scope of number query, resulting in inefficient query efficiency, especially in high concurrency environments that cannot meet performance requirements.

Method used

By obtaining the start and end numbers of multiple number intervals, the prefix numbers of each number interval are determined as the index value, the number to be queried is matched with the index value, the first target number interval is determined, and the second target number interval is found from it.

Benefits of technology

It realizes the narrowing of the number query range, improves query efficiency, and can meet performance requirements in a high concurrency environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115442799B_ABST
    Figure CN115442799B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for querying numbers, a non-volatile storage medium, and a processor. Among them, the method includes: respectively obtaining the start number and the end number within a plurality of number ranges; respectively determining the same prefix numbers among the start number and the end number within each number range, and determining the prefix number as the index value of each number range, where the prefix number is the digit starting from the left in the start number and the end number; matching the number to be queried with the index values of each number range, and determining the number range corresponding to the index value that successfully matches the number to be queried as the first target number range; searching for the second target number range to which the number to be queried belongs from the first target number range. The present application solves the technical problem of low polling traversal query efficiency caused by the inability to narrow the query range of numbers and the inability to meet the performance requirements in a high-concurrency environment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of data processing, and in particular, to a method and device for querying numbers, a non-volatile storage medium, and a processor. Background Art

[0002] In the service scenario of wireless core network communication, it is often necessary to specify some service behaviors of a number segment through a specific number. Among them, the service behaviors include, for example, routing forwarding, configuration policies, etc. When a program implements a service function, it usually needs to quickly reverse query the best-matching number segment record from a large amount of data through a specified number to obtain associated data. The existing query methods cannot narrow the query range of the number, resulting in low query efficiency, and cannot meet the performance requirements in a high-concurrency environment.

[0003] In view of the above problems, no effective solution has been proposed yet. Summary of the Invention

[0004] Embodiments of the present application provide a method and device for querying numbers, a non-volatile storage medium, and a processor, so as to at least solve the technical problems of low polling traversal query efficiency caused by the inability to narrow the query range of the number and the inability to meet the performance requirements in a high-concurrency environment.

[0005] According to one aspect of the embodiments of the present application, a method for querying numbers is provided, including: respectively obtaining start numbers and end numbers in a plurality of number ranges; respectively determining the same prefix numbers among the start numbers and end numbers in each number range, and determining the prefix numbers as the index values of each number range, where the prefix number is the number starting from the left in the start number and the end number; matching the number to be queried with the index values of each number range, and determining the number range corresponding to the index value that matches the number to be queried as the first target number range; searching for the second target number range to which the number to be queried belongs in the first target number range.

[0006] Optionally, respectively determining the same prefix numbers among the start numbers and end numbers in each number range includes: sequentially traversing the numbers in the start number and the numbers in the end number in order from left to right until the numbers in the same position in the start number and the end number are different, and stopping traversing; determining the traversed numbers as the prefix numbers.

[0007] Optionally, matching the number to be queried with the index values of each number range includes: sequentially removing the last digit of the number to be queried from right to left to obtain the target number to be queried; matching the target number to be queried with the index value; if the target number to be queried is the same as the index value, determining the number range corresponding to the index value with the same target number to be queried as the first target number range; if the target number to be queried is different from the index value, continue to remove the last digit of the target number to be queried from right to left until the target number to be queried is the same as the index value.

[0008] Optionally, matching the number to be queried with the index values of each number range further includes: if the target number to be queried is the leftmost digit of the number to be queried and the target number to be queried is different from the index value, ending the step of matching the number to be queried with the index value and determining that the first target number range is not found.

[0009] Optionally, the first target number range includes multiple number ranges. Finding the second target number range to which the number to be queried belongs from the first target number range includes: respectively comparing the number to be queried with the start number and the end number of each number range included in the first target number range; determining the second target number range from each number range included in the first target number range according to the comparison result.

[0010] Optionally, the start number and the end number are digital strings composed of digits.

[0011] Optionally, the number of digits included in the start number and the end number is the same.

[0012] According to another aspect of the embodiments of the present application, a non-volatile storage medium is further provided. The storage medium includes a stored program, wherein when the program runs, it controls the device where the storage medium is located to execute the above-mentioned number query method.

[0013] According to another aspect of the embodiments of the present application, a processor is further provided. The processor is used to run a program stored in a memory, wherein when the program runs, it executes the above-mentioned number query method.

[0014] In the embodiment of the present application, the start numbers and end numbers in multiple number ranges are obtained respectively; the same prefix numbers among the start numbers and end numbers in each number range are determined respectively, and the prefix numbers are determined as the index values of each number range, where the prefix numbers are the digits starting from the left in the start numbers and end numbers; the number to be queried is matched with the index values of each number range, and the number range corresponding to the index value that successfully matches the number to be queried is determined as the first target number range; by the method of finding the second target number range to which the number to be queried belongs from the first target number range, through determining the index value corresponding to the number range and matching the number to be queried with the index value, and determining the number range to which the number to be queried belongs according to the matching result, the purpose of narrowing the number query range is achieved, thereby realizing the technical effect of improving the number query efficiency, and further solving the technical problems of low polling traversal query efficiency caused by the inability to narrow the number query range and the inability to meet the performance requirements in a high-concurrency environment. Description of the Drawings

[0015] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation to the present application. In the drawings:

[0016] Figure 1 is a flowchart of a method for querying numbers according to an embodiment of the present application;

[0017] Figure 2 is a schematic diagram for determining a prefix number according to an embodiment of the present application;

[0018] Figure 3 is a schematic diagram for removing digits from the number to be queried according to an embodiment of the present application;

[0019] Figure 4 is a structural diagram of a number query device according to an embodiment of the present application;

[0020] Figure 5 is a hardware structure block diagram of a computer terminal (or electronic device) for a method for querying numbers provided according to an embodiment of the present application. Detailed Embodiments

[0021] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions 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. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0022] It should be noted that the terms "first", "second", etc. in the description, claims and above-mentioned drawings of this application are used to distinguish similar objects, and do not necessarily have to be used to describe a specific order or sequence. It should be understood that such data used can be interchanged under appropriate circumstances, so that the embodiments of this application described here can be implemented in an order other than those illustrated or described here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device comprising a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0023] According to an embodiment of this application, a method embodiment of a method for querying numbers is provided. It should be noted that the steps shown in the flowchart of the drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that here.

[0024] Figure 1 is a flowchart of a method for querying numbers according to an embodiment of this application, as Figure 1 shown, the method includes the following steps:

[0025] Step S102, respectively obtain the start number and the end number within multiple number ranges.

[0026] According to an optional embodiment of this application, the start number is the first number within a specified number range, and the end number is the last number within that number range. Obtain the start number and the end number of each number range among multiple number ranges. The start number and the end number are not completely the same numbers. For example, obtain the start number and the end number of 5 number ranges. Among them, the start number of the first number range is 13742690185, and the end number is 13742692574; the start number of the second number range is 13742692000, and the end number is 13742693000; the start number of the third number range is 13742693000, and the end number is 13742693990; the start number of the fourth number range is 13742694000, and the end number is 13742697000; the start number of the fifth number range is 13742600000, and the end number is 13743690000. It should be noted that the numerical value of the constituent digits of the end number is larger than the numerical value of the constituent digits of the start number.

[0027] Step S104: Determine the same prefix numbers among the start numbers and end numbers within each number range respectively, and determine the prefix number as the index value of each number range. Here, the prefix number is the number starting from the left in the start number and the end number.

[0028] According to another optional embodiment of the present application, extract the same prefix part of the start number and end number of the number range as the index value of the number range. Traverse each digit in the number from the highest digit to the lowest digit in sequence, and compare whether the digits of the same digit positions in the start number and the end number are the same. If they are the same, continue to traverse to the lower digit. Otherwise, stop traversing, and use the digit string composed of all the traversed digits as the hash index of the number segment.

[0029] Step S106: Match the number to be queried with the index values of each number range, and determine the number range corresponding to the index value that matches the number to be queried successfully as the first target number range.

[0030] In some optional embodiments of the present application, according to Step S104, the index values of the 5 number ranges in Step S102 can be determined, as shown in the following table:

[0031] Record Start number End number Index value 1 13742690185 13742692574 1374269 2 13742692000 13742693000 1374269 3 13742693000 13742693990 13742693 4 13742694000 13742697000 1374269 5 13742600000 13743690000 1374

[0032] For example, if the number to be queried is 13742695936, the value after processing the number to be queried and the same as the index value is 1374269. Then the first target number ranges are Record 1, Record 2, and Record 4.

[0033] Step S108: Search for the second target number range to which the number to be queried belongs in the first target number range.

[0034] As an optional embodiment of the present application, according to the 3 first target number ranges obtained in Step S106, select the range with the smallest number of numbers within the range as the second target number range.

[0035] According to the above steps, by determining the index value corresponding to the number range and matching the number to be queried with the index value, and determining the number range to which the number to be queried belongs according to the matching result, the purpose of narrowing the number query range is achieved, thus realizing the technical effect of improving the number query efficiency, and further solving the technical problems of low polling query efficiency caused by the inability to narrow the number query range and the inability to meet the performance requirements in a high-concurrency environment.

[0036] The present application can be applied to the industry message distribution service of the 5G message MaaP platform.

[0037] According to an optional embodiment of the present application, determining the same prefix numbers in the start number and the end number within each number range respectively includes the following steps: traversing the digits in the start number and the digits in the end number sequentially from left to right until the digits at the same position in the start number and the end number are different, and then stopping the traversal; determining the traversed digits as the prefix numbers.

[0038] Figure 2 is a schematic diagram of determining a prefix number according to an embodiment of the present application, as Figure 2 shown. For example, the start number of a certain number range is 13742690185, and the end number is 13742692574. Traversing the digits in the start number and the digits in the end number sequentially from left to right, the first digits of the start number and the end number are the same, so continue to traverse the second digit. Since the second digits are the same, continue to traverse the third digit until the eighth digit is traversed. The eighth digit of the start number is 0, and the eighth digit of the end number is 2. Since the digits at the same position (the eighth position) in the start number and the end number are different, stop the traversal and determine the traversed digits as the prefix numbers. At this time, the traversed digits are 1374269, so the same prefix number in the start number and the end number is 1374269.

[0039] In some optional embodiments of the present application, matching the number to be queried with the index values of each number range can be achieved by the following method: removing the last digit of the number to be queried sequentially from right to left to obtain the target number to be queried; matching the target number to be queried with the index value; if the target number to be queried is the same as the index value, determining the number range corresponding to the index value that is the same as the target number to be queried as the first target number range; if the target number to be queried is different from the index value, continue to remove the last digit of the target number to be queried sequentially from right to left until the target number to be queried is the same as the index value.

[0040] As an optional embodiment of the present application, for example, the index values of 5 number ranges are as follows in the table:

[0041] Record Start number End number Index value 1 13742690185 13742692574 1374269 2 13742692000 13742693000 1374269 3 13742693000 13742693990 13742693 4 13742694000 13742697000 1374269 5 13742600000 13743690000 1374

[0042] To find the best matching set according to the number 13742695936, it is necessary to remove the last digit of the number 13742695936 in sequence from right to left. Among them, the last digit is the rightmost ending digit until the number to be queried is the same as the index value. When querying, first take 13742695936 as the query condition, and the result is that it cannot be found. Continue to use 1374269593 as the query condition, and the result is that it cannot be found. Until querying with 1374269, at this time, 3 matching records can be found, namely record 1, record 2, and record 4.

[0043] Figure 3 is a schematic diagram of removing digits in the number to be queried according to an embodiment of the present application. In Figure 3 first, the last digit of 13742695936 is removed to obtain 1374269593. If the index value matching 1374269593 cannot be found, continue to remove the last digit of 1374269593 until the same index value is found when querying with 1374269, and then stop the removal process.

[0044] In some alternative embodiments of the present application, when matching the number to be queried with the index values of each number range, it is also necessary to: if the target number to be queried is the leftmost digit in the number to be queried and the target number to be queried is different from the index value, end the step of matching the number to be queried with the index value, and determine that the first target number range has not been queried.

[0045] As another alternative embodiment of the present application, when finding the best matching range through a specified number, first, it is necessary to remove the last digit of the number from right to left and use the remaining digits as the query condition to match the prefix index value generated for each number segment in the preprocessing stage. If the intercepted number prefix exactly matches the prefix index value, enter the exact search stage; otherwise, continue to remove the last digit and then query until the remaining digits are the leftmost starting digit and the leftmost starting digit is different from the index value, and the determination result is that the first target number range has not been found.

[0046] An index is established by preprocessing the number segment, and in the query stage, the number is reduced from right to left to perform a hash index query to filter out a large number of invalid data sets, and finally, the best matching result is obtained by polling through the valid data sets.

[0047] According to an alternative embodiment of the present application, the first target number range includes a plurality of number ranges. Finding the second target number range to which the number to be queried belongs from the first target number range is achieved by the following method: respectively comparing the number to be queried with the start number and the end number of each number range included in the first target number range; determining the second target number range from each number range included in the first target number range according to the comparison result.

[0048] According to another alternative embodiment of the present application, respectively compare the number to be queried with the start number and the end number of each number range included in the first target number range, and select the range with the smallest number of numbers within the number range as the second target number range.

[0049] In some alternative embodiments of the present application, the start number and the end number are digital strings composed of numbers.

[0050] In some alternative embodiments of the present application, the number of digits included in the start number and the end number is the same.

[0051] If the start number is a digital string composed of 7 digits, then the end number is also a digital string composed of 7 digits.

[0052] Figure 4 It is a structural diagram of a number query device according to an embodiment of the present application, as Figure 4 shown. The device includes:

[0053] An acquisition module 40, configured to respectively acquire the start number and the end number within a plurality of number ranges;

[0054] A determination module 42, configured to respectively determine the same prefix numbers among the start numbers and the end numbers within each number range, and determine the prefix numbers as the index values of each number range, where the prefix number is the number starting from the left in the start number and the end number;

[0055] A matching module 44, configured to match the number to be queried with the index values of each number range, and determine the number range corresponding to the index value that successfully matches the number to be queried as the first target number range;

[0056] A search module 46, configured to search for the second target number range to which the number to be queried belongs from the first target number range.

[0057] It should be noted that Figure 4 For the preferred implementation manners of the embodiments shown, reference may be made to the relevant descriptions of the embodiments Figure 1 shown, which will not be elaborated here.

[0058] Figure 5According to an embodiment of the present application, there is provided a hardware structure block diagram of a computer terminal (or electronic device) for a method of querying numbers. As Figure 5 shown, the computer terminal 50 (or electronic device 50) may include one or more processors (the processors may include, but are not limited to, processing devices such as a microprocessor MCU or a programmable logic device FPGA, shown as 502a, 502b, ……, 502n in the figure), a memory 504 for storing data, and a transmission module 506 for communication functions. In addition, it may further include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a power supply, and / or a camera. Those of ordinary skill in the art can understand that Figure 5 the structure shown is only illustrative and does not limit the structure of the above-mentioned electronic device. For example, the computer terminal 50 may further include more or fewer components than Figure 5 shown in the figure, or have a different configuration from Figure 5 shown in the figure.

[0059] It should be noted that the above one or more processors and / or other data processing circuits are generally referred to as "data processing circuits" in this article. The data processing circuit may be embodied in whole or in part as software, hardware, firmware, or any combination thereof. In addition, the data processing circuit may be a single independent processing module, or be incorporated in whole or in part into any one of the other elements in the computer terminal 50 (or electronic device). As involved in the embodiments of the present application, the data processing circuit is used for processor control (such as the selection of a variable resistance terminal path connected to an interface).

[0060] The memory 504 may be used to store software programs and modules of application software, such as program instructions / data storage devices corresponding to the method of querying numbers in the embodiments of the present application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory 504, that is, implements the above-mentioned method of querying numbers. The memory 504 may include a high-speed random access memory, and may further include a non-volatile memory, such as one or more magnetic storage devices, flash memories, or other non-volatile solid-state memories. In some instances, the memory 504 may further include a memory remotely provided relative to the processor, and these remote memories may be connected to the computer terminal 50 through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.

[0061] The transmission module 506 is used to receive or send data via a network. Specific examples of the above-mentioned network may include a wireless network provided by the communication provider of the computer terminal 50. In one example, the transmission device 506 includes a network adapter (Network Interface Controller, NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 506 can be a Radio Frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0062] The display can be, for example, a touch-screen liquid crystal display (LCD), which enables the user to interact with the user interface of the computer terminal 50 (or electronic device).

[0063] It should be noted here that in some alternative embodiments, the above Figure 5 shown computer device (or electronic device) may include hardware elements (including circuits), software elements (including computer code stored on a computer-readable medium), or a combination of both hardware elements and software elements. It should be pointed out that Figure 5 is only an example of a specific specific instance and is intended to show the types of components that may exist in the above computer device (or electronic device).

[0064] It should be noted that Figure 5 the shown electronic device is used to execute Figure 1 the query method of the shown number. Therefore, the relevant explanations in the execution method of the above command are also applicable to this electronic device, which will not be elaborated here.

[0065] The embodiment of the present application also provides a non-volatile storage medium. The non-volatile storage medium includes a stored program. Wherein, when the program runs, it controls the device where the storage medium is located to execute the above-mentioned number query method.

[0066] The program executed by the non-volatile storage medium has the following functions: respectively obtaining the start number and the end number within multiple number ranges; respectively determining the same prefix numbers among the start numbers and the end numbers within each number range, and determining the prefix numbers as the index values of each number range, where the prefix number is the number starting from the left in the start number and the end number; matching the number to be queried with the index values of each number range, and determining the number range corresponding to the index value that matches the number to be queried as the first target number range; searching for the second target number range to which the number to be queried belongs in the first target number range.

[0067] An embodiment of the present application further provides a processor, which is used to run a program stored in a memory. When the program runs, it executes the above-mentioned number query method.

[0068] The processor is used to run a program that executes the following functions: respectively obtain the start number and the end number within a plurality of number ranges; respectively determine the same prefix numbers among the start number and the end number within each number range, and determine the prefix number as the index value of each number range, where the prefix number is the number starting from the left in the start number and the end number; match the number to be queried with the index values of each number range, and determine the number range corresponding to the index value that matches the number to be queried as the first target number range; find the second target number range to which the number to be queried belongs from the first target number range.

[0069] The serial numbers of the embodiments of the present application above are only for description and do not represent the advantages or disadvantages of the embodiments.

[0070] In the above embodiments of the present application, the descriptions of the various embodiments have their own emphases. For the parts not detailed in a certain embodiment, reference may be made to the relevant descriptions of other embodiments.

[0071] In several embodiments provided by the present application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only illustrative. For example, the division of the units can be a logical function division. In actual implementation, there can be other division methods. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some interfaces. The indirect coupling or communication connection of the units or modules can be in an electrical or other form.

[0072] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or can be distributed to multiple units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0073] In addition, the functional units in the various embodiments of the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit. The above-mentioned integrated units can be implemented in the form of hardware or in the form of software functional units.

[0074] When the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the related technology, or all or part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The foregoing storage medium includes: various media that can store program codes, such as USB flash drives, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), mobile hard disks, magnetic disks, or optical discs.

[0075] The foregoing are only the preferred embodiments of this application. It should be noted that for those of ordinary skill in the art of this technology, without departing from the principle of this application, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of this application.

Claims

1. A method for querying a number, which is applied to a service scenario of wireless core network communication, characterized in that Including: Respectively obtain the start number and the end number within multiple number ranges; Respectively determine the same prefix number among the start number and the end number within each of the number ranges, and determine the prefix number as the index value for each of the number ranges, where the prefix number is the digit starting from the left in the start number and the end number; Match the number to be queried with the index values of each of the number ranges, and determine the number range corresponding to the index value that successfully matches the number to be queried as the first target number range; Search for the second target number range to which the number to be queried belongs from the first target number range; Among them, respectively determining the same prefix number among the start number and the end number within each of the number ranges includes: sequentially traversing the digits in the start number and the digits in the end number in order from left to right until the digits at the same position in the start number and the end number are different, stop traversing, and determine the traversed digits as the prefix number; Matching the number to be queried with the index values of each of the number ranges includes: sequentially removing the last digit from the number to be queried in order from right to left to obtain the target number to be queried, and matching the target number to be queried with the index value; if the target number to be queried is the same as the index value, determine a successful match; if the target number to be queried is different from the index value, continue to remove the last digit from the target number to be queried in order from right to left until the target number to be queried is the same as the index value.

2. The method according to claim 1, characterized in that, Matching the number to be queried with the index values of each of the number ranges further includes: If the target number to be queried is the leftmost digit in the number to be queried and the target number to be queried is different from the index value, end the step of matching the number to be queried with the index value, and determine that the first target number range is not found.

3. The method according to claim 1, wherein The first target number range includes multiple number ranges. Searching for the second target number range to which the number to be queried belongs from the first target number range includes: Respectively compare the number to be queried with the start number and the end number of each of the number ranges included in the first target number range; Determine the second target number range from each of the number ranges included in the first target number range according to the comparison result.

4. The method according to any one of claims 1 to 3, characterized in that The start number and the end number are digit strings composed of digits.

5. The method according to claim 4, wherein The number of digits included in the start number and the end number is the same.

6. A query device for numbers, which is applied to the service scenario of wireless core network communication, is characterized in that Including: An acquisition module, configured to respectively obtain the start number and the end number within multiple number ranges; A determination module, configured to respectively determine the same prefix numbers in the start number and the end number within each of the number ranges, including: traversing the digits in the start number and the digits in the end number in sequence from left to right until the digits at the same position in the start number and the end number are different, stopping the traversal, and determining the traversed digits as the prefix numbers; determining the prefix numbers as the index values for each of the number ranges; A matching module, configured to match the number to be queried with the index values of each of the number ranges, including: sequentially removing the last digit in the number to be queried from right to left to obtain a target number to be queried, matching the target number to be queried with the index value, if the target number to be queried is the same as the index value, determining that the matching is successful, if the target number to be queried is different from the index value, continuing to remove the last digit in the target number to be queried from right to left until the target number to be queried is the same as the index value; determining the number range corresponding to the index value that successfully matches the number to be queried as the first target number range; A searching module, configured to search for the second target number range to which the number to be queried belongs from the first target number range.

7. A non-volatile storage medium, characterized in that, The non-volatile storage medium includes a stored program, wherein when the program runs, it controls the device where the non-volatile storage medium is located to execute the number query method according to any one of claims 1 to 5.

8. A processor, characterized in that, The processor is configured to run the program stored in the memory, wherein when the program runs, it executes the number query method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Data query method and device, storage medium and electronic equipment

    CN112579641A

  • Data inquiry method

    CN1967529A