The grouping method of ip address or mobile phone number and the query method of attribution
A technology of IP address and mobile phone number, applied in the field of network communication, can solve the problems of large system resource consumption, low system consumption, consumption and other problems, and achieve the effect of small system resource consumption, fast initialization speed and less system resources
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Publication Date
- 2016-06-15
Smart Images
Figure 1 Figure 2 Figure 3
Abstract
Description
technical field
[0001] The invention relates to the field of network communication, more specifically, to a method for grouping IP addresses or mobile phone numbers and a method for inquiring about their locations. Background technique
[0002] Telecom operators have the need to query IP addresses and mobile phone numbers in groups. For example, query the attribution of the IP address and the attribution of the mobile phone number, etc.
[0003] There are two existing query methods:
[0004] The first one is to save the corresponding relationship between the mobile phone number segment, the IP address subnet segment and the province in the database, and traverse the database query when querying.
[0005] The second is to store the corresponding relationship between the mobile phone number segment, IP address subnet segment and province in the memory correspondence of the distributed storage system (Key-Value), and directly use the mobile phone number or IP address as the p...
Examples
Embodiment Construction
[0063] The method for grouping IP addresses or mobile phone numbers and the query method for attribution of the present invention will be further explained below in conjunction with the accompanying drawings and embodiments.
[0064] figure 1 It is the flow chart of the first embodiment of the IP address grouping method of the present invention, as figure 1 As shown, in the present embodiment, the grouping method of the IP address of the present invention comprises the following steps:
[0065] S110, grouping the IP addresses in the database according to the attribution;
[0066] S120, converting the IP address of each group into an integer number and sorting according to the increment of the value;
[0067] S130. The integer number with the smallest value in each group is used as the initial value of the IP address and stored in the array, and the initial value of the IP address is self-incremented and compared with the adjacent integer numbers; if they are equal, continue ...