CN109783521B - IP home location determination method, device and computer storage medium - Google Patents
IP home location determination method, device and computer storage medium Download PDFInfo
- Publication number
- CN109783521B CN109783521B CN201811633072.4A CN201811633072A CN109783521B CN 109783521 B CN109783521 B CN 109783521B CN 201811633072 A CN201811633072 A CN 201811633072A CN 109783521 B CN109783521 B CN 109783521B
- Authority
- CN
- China
- Prior art keywords
- home
- attribution
- alternative
- actual
- determining
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 33
- 230000015654 memory Effects 0.000 claims description 35
- 238000004891 communication Methods 0.000 claims description 4
- 230000001360 synchronised effect Effects 0.000 description 8
- 238000012216 screening Methods 0.000 description 4
- 238000004364 calculation method Methods 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 235000008216 herbs Nutrition 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 230000008520 organization Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention discloses a method for determining IP attribution, which comprises the following steps: respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP attribution according to attribution regions of the same hierarchy, and grouping the alternative IP attribution databases of the same hierarchy and the same attribution region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired. The invention also discloses an IP attribution determining device and a computer storage medium.
Description
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for determining an IP home location, and a computer storage medium.
Background
An IP (Internet Protocol) address is a unified address format provided by the IP Protocol, and assigns a logical address to each host on the Internet. IP address geolocation (IP location), which is intended to accurately determine the geographic location where a given IP address is located. With the rapid development of internet services, IP positioning is widely applied in the fields of network performance optimization, network security, social networking, targeted advertising, and the like.
At present, the IP positioning technology is rapidly developed, and a plurality of enterprises, organizations and individuals research and establish own IP positioning data to provide IP home location services such as online inquiry or offline data downloading and the like. Because research means and ways for obtaining information are different, the established IP positioning data has great difference, and more or less situations of inaccurate regional information and inaccurate positioning information exist. Therefore, there is a situation that the regional information of the same IP address in different IP positioning systems is different from each other, or even has a large difference, which causes inaccuracy and inaccuracy of the determined IP attribution.
Disclosure of Invention
In view of the above, the main object of the present invention is to provide a method, an apparatus and a computer storage medium for determining an IP home with less human interference, higher reliability, and higher accuracy and precision.
In order to achieve the purpose, the technical scheme of the invention is realized as follows:
the invention provides a method for determining IP attribution, which comprises the following steps: respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP home location according to the home location regions with the same hierarchy, and grouping IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home location region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired.
In the foregoing solution, the determining a hierarchy actual IP home location of the IP address to be queried according to a packet of a home location includes: calculating the number of the alternative IP home location databases contained in each group; and taking the alternative IP home location in the packet containing the maximum number of the alternative IP home location databases as the hierarchy actual IP home location of the IP address to be inquired.
In the above scheme, the method further comprises: determining the weight value of the at least one alternative IP home database; if the number of the alternative IP attribution databases in at least two groups is the same, calculating the sum of the weights corresponding to the IP attribution databases respectively corresponding to the alternative IP attributions contained in each group; and taking the alternative IP home location in the packet with the maximum weight value sum as the level actual IP home location of the IP address to be inquired.
In the above scheme, the method further comprises: if the IP home database cannot provide a hierarchical home zone, the IP home database is no longer an alternative IP home provider.
In the above scheme, the method further comprises: and if the alternative IP attribution corresponding to the grouping of the IP attribution database is not determined as the actual IP attribution of the hierarchy, the IP attribution database is no longer used as an alternative IP attribution provider.
In the above scheme, the method further comprises: and if the hierarchy has no grouping of the attribution region, no longer determining the IP attribution, and determining the actual IP attribution of the IP address to be inquired according to the actual IP attribution of the existing hierarchy.
In the foregoing solution, the dividing the at least one alternative IP home area into at least one hierarchy according to a home region includes: and dividing the at least one alternative IP attribution into four levels according to countries, provinces, cities and counties.
In the above scheme, the method further comprises: and storing the corresponding relation between the IP address to be inquired and the actual IP home location.
In order to achieve the above object, the present invention also provides an IP home location determining apparatus, which includes a processor, and a memory connected to the processor through a communication bus; wherein, the memory is used for storing the program determined by the IP home location; the processor is configured to execute the IP home location determination program to implement any one of the IP home location determination methods described above.
To achieve the above object, the present invention also provides a computer storage medium storing one or more programs, which are executable by one or more processors to cause the one or more processors to execute to implement any of the IP attribution determination methods described above.
The invention also provides an IP home location determining device, which comprises: the alternative acquisition module is used for respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database; the alternative layering module is used for dividing the attribution of the at least one alternative IP into at least one hierarchy according to an attribution region; the alternative grouping module is used for grouping the at least one alternative IP attribution according to attribution regions of the same hierarchy, and grouping the alternative IP attribution databases of the same hierarchy and the same attribution region into a group; the hierarchy determining module is used for determining the actual IP attribution of the hierarchy of the IP address to be inquired according to the grouping of the attribution region; and the attribution determining module is used for determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies and determining the actual IP attribution of the IP address to be inquired.
The method, the device and the computer storage medium for determining the IP home location provided by the invention are used for inquiring at least one alternative IP home location corresponding to the IP address to be inquired from at least one IP home location database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP home location according to the home location regions with the same hierarchy, and grouping IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home location region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired. Therefore, the alternative IP attribution is divided into at least one hierarchy according to the attribution region, so that the accurate judgment of the hierarchy attribution region is realized; the actual IP attribution of the IP address to be inquired is determined by determining the actual IP attribution of the hierarchy for multiple times, so that the reliability and the accuracy of a determination result are improved; by determining the IP home location according to the number of the IP home location databases, the influence of human factors caused by only using the weight value of the data source as the IP home location is reduced.
Drawings
Fig. 1 is a schematic flow chart of a method for determining an IP home location according to an alternative embodiment of the present invention;
fig. 2 is a schematic flow chart of a method for determining an IP home location according to an alternative embodiment of the present invention;
FIG. 3 is a flowchart illustrating a method for determining IP home according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an IP home location determining apparatus according to an alternative embodiment of the present invention;
fig. 5 is a schematic diagram of a component structure of an IP home location determining apparatus according to an alternative embodiment of the present invention;
fig. 6 is a schematic diagram of a component structure of an IP home location determining apparatus according to an alternative embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and specific embodiments.
Fig. 1 is a schematic flow chart of a method for determining an IP home location in an embodiment of the present invention, and referring to fig. 1, the embodiment of the present invention provides a method for determining an IP home location, where the method includes:
step S101: and respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database. Here, the IP home database may be a database of an internet IP location service provider, wherein the internet IP location service provider may be a business, an organization, or an individual, and the manner of providing the internet IP location service may be online or offline.
Step S102: and dividing the at least one alternative IP home into at least one hierarchy according to the home region. Here, the at least one candidate IP home may be divided into four levels according to countries, provinces, cities, and counties, and the candidate IP home may be divided into four levels according to a home region: country, province, city and county.
Step S103: and grouping the at least one alternative IP home according to the home regions with the same hierarchy, and grouping IP home databases corresponding to the alternative IP home regions with the same hierarchy and the same home region into a group. Here, the determination is first grouped according to the first level of the home zone, i.e. "country"; grouping according to a second level of the home region, namely the province; grouping again according to the third level of the home region, namely 'city'; and finally, grouping according to the fourth level of the home region, namely 'district county'. And dividing IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home region into a group.
Step S104: and determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region. Here, the number of the alternative IP home databases included in each packet is calculated; and taking the alternative IP home location in the packet containing the maximum number of the alternative IP home location databases as the hierarchy actual IP home location of the IP address to be inquired. Here, in an optional embodiment, determining a weight of the at least one alternative IP home database; if the number of the alternative IP attribution databases in at least two groups is the same, calculating the sum of the weights corresponding to the IP attribution databases respectively corresponding to the alternative IP attributions contained in each group; and taking the alternative IP home location in the packet with the maximum weight value sum as the level actual IP home location of the IP address to be inquired.
In an alternative embodiment, if the IP home database cannot provide a hierarchical home zone, the IP home database no longer serves as an alternative IP home provider, and the IP home database provides an alternative IP home without making a next hierarchical home zone determination.
In an optional embodiment, if the alternative IP home location corresponding to the packet where the IP home location database is located is not determined as the actual hierarchical IP home location, the IP home location database is no longer used as the alternative IP home location provider, and the alternative IP home location provided by the IP home location database does not determine the next hierarchical home location.
Step S105: and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired. Here, the alternative IP home may be divided into four hierarchies according to a home region: country, province, city and county, i.e. determining the actual IP home of the hierarchy four times according to step S104, one hierarchy at a time, e.g. determining the first hierarchy, i.e. "country", for the first time; determining a second level, namely the province, for the second time; determining a third level, namely 'city of land'; and fourthly, determining a fourth level, namely the district county, and finally determining the actual IP home location of the IP address to be inquired.
In an optional embodiment, if the hierarchy has no packet of a home domain, the IP home location is no longer determined, and the actual IP home location of the IP address to be queried is determined according to the actual IP home location of the existing hierarchy. That is, if the home regions that can be provided by the database are all less than four, for example, three levels, only the third-level home region is determined, and the actual IP home location of the IP address to be queried is determined according to the determined three-level home regions.
After the step S105, please refer to fig. 2, the method further includes:
step S106: and storing the corresponding relation between the IP address to be inquired and the actual IP home location. Here, the IP address to be queried, the actual IP home location corresponding to the IP address to be queried, and the correspondence between the IP address to be queried and the actual IP home location are stored in a database, and a local IP home location information base is established.
The method for determining the IP home location provided by the invention comprises the steps of inquiring at least one alternative IP home location corresponding to an IP address to be inquired from at least one IP home location database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP home location according to the home location regions with the same hierarchy, and grouping IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home location region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired. Therefore, the alternative IP attribution is divided into at least one hierarchy according to the attribution region, so that the accurate judgment of the hierarchy attribution region is realized; the actual IP attribution of the IP address to be inquired is determined by determining the actual IP attribution of the hierarchy for multiple times, so that the reliability and the accuracy of a determination result are improved; by determining the IP home location according to the number of the IP home location databases, the influence of human factors caused by only using the weight value of the data source as the IP home location is reduced.
To enhance the understanding of the present invention, reference is made to the following description of an embodiment, which is illustrated in figure 3,
step S301: and starting.
Step S302: and determining IP home location databases, and setting a weight value for each IP home location database.
Step S303: and dividing the alternative IP attributions provided by the IP attribution database into levels according to the attribution regions.
Step S304: and grouping the IP home location databases according to the same layer level and the same home location.
Step S305: the number of alternative IP home databases contained in each packet is calculated.
Step S306: whether there is a maximum number of packets; if the determination result is no, go to step S307; if yes, go to step S308.
Step S307: and adding the weight value, and calculating the score of each group.
Step S308: the home domain corresponding to the largest number of packets is stored.
Step S309: and eliminating unadopted IP home location databases.
Step S310: whether four rounds of determinations are complete or there is no hierarchical home zone grouping; if yes, go to step S311; if the determination result is negative, step S305 is performed.
Step S311: and determining the actual IP home according to the existing hierarchy actual IP home.
Step S312: and (6) ending.
The following is illustrated by a specific example:
1. determining six IP positioning data sources, wherein the IP positioning data sources are A, B, C, D, E, F, and preliminarily determining A, B, C, D, E, F weight values according to the accuracy performance of the data sources as follows: 0.95,0.94,0.93,0.9,0.8,0.7.
2. For the target IP address, the attribution information of each data source to the IP address is obtained firstly, and after formatting, the attribution information respectively comprises: a: China-Guangdong province-Shenzhen City-Nanshan district; b: china-guangdong province-guangzhou city; c: china-guangdong province-guangzhou city-carinity district; d: china-hunan province-changsha city; e: china-hunan province-changsha city; f: china-guangdong province.
3. The first level of home territory determines the country. The attributions identified by the 6 data sources are all China, so the attributions determined in the first round are as follows: china, the attribution places of 6 data sources are all right at the same time, and all enter the next round;
4. the province is determined in the second-level attributive region, and after the provinces determined by the 6 data sources are grouped, two provinces exist: and counting the number of data sources in the two groups, namely Guangdong province and Hunan province, wherein the number of the Guangdong province is 4, and the number of the Hunan province is 2. According to the principle that the number is the most selected, the determined attribution is as follows: guangdong province. Meanwhile, 4 data sources enter the next round in the round, and 2 data sources are eliminated: d and E.
5. The third-level home region determines the city, and the cities identified according to A, B, C, F by the 4 data sources are 2: guangzhou, Shenzhen, where F has no data for a place level of attribution, and is no longer an alternative IP attribution provider. The number of Guangzhou cities is 2 through statistical calculation, the number of Shenzhen cities is 1, and the determined attribution is as follows: guangzhou city. The round eliminates 2 data sources: a and F.
6. Determining a district county by the attribution region of the fourth level, wherein the participants have B and C, and the finally determined attribution region is as follows: the region of Bangian.
7. Determining an IP home location through four levels, wherein the finally determined IP address home location is as follows: the region of Guangzhou city of Guangzhou, Guangdong province, China.
The following is illustrated by way of another specific example:
1. determining six IP positioning data sources, wherein the IP positioning data sources are A, B, C, D, E, F, and preliminarily determining A, B, C, D, E, F weight values according to the accuracy performance of the data sources as follows: 0.95,0.94,0.93,0.9,0.8,0.7.
2. For the target IP address, acquiring the attribution information of each data source to the IP address, and formatting the attribution information as follows: a: China-Guangdong province-Shenzhen city; b: china-guangdong province; c: china-guangdong province-guangzhou city; d: china-hunan province-changsha city; e: china-hunan province-changsha city; f: China-Hunan province.
3. Determining a first-level attribution region, wherein the determined attribution region is China, and 6 data sources automatically enter the next round;
4. the second level attribution region is determined, and 2 candidate provinces exist: the number of the Chinese medicinal herbs is 3 in Guangdong province and Hunan province; at this time, the score is calculated according to the weight of each data source, and the score of Guangdong province is: 0.95+0.94+0.93 ═ 2.82, the score in Hunan province was: 0.9+0.8+0.7 ═ 2.4, then the determined attribution is: guangdong province. At the same time, D, E, F will be eliminated;
5. the third-level attribution region is determined, and 3 data sources participate: A. b, C, there are 2 candidate cities: shenzhen city and Guangzhou city, the number of which is 1, and 1 data source does not provide data; at this time, the score is calculated according to the weight, and Shenzhen: 0.94, guangzhou city: 0.92, the derived attribution is: shenzhen city. At the same time, B and C were eliminated.
6. The home region of the fourth level is determined, and only one data source has 1: a, no candidate county, IP home determines cutoff.
7. Determining an IP home location through four levels, wherein the finally determined IP home location is as follows: shenzhen city of Guangdong province in China.
To achieve the above object, the present invention further provides an IP home location determining apparatus, referring to fig. 4, the apparatus includes a processor 401, and a memory 402 connected to the processor 401 through a communication bus 403; wherein, the memory 402 is used for storing the program determined by the IP home; the processor 401 is configured to execute the IP home determination program to implement the IP home determination steps as follows: respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP home location according to the home location regions with the same hierarchy, and grouping IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home location region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: the determining the level actual IP home location of the IP address to be inquired according to the grouping of the home location area comprises the following steps: calculating the number of the alternative IP home location databases contained in each group; and taking the alternative IP home location in the packet containing the maximum number of the alternative IP home location databases as the hierarchy actual IP home location of the IP address to be inquired.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: determining the weight value of the at least one alternative IP home database; if the number of the alternative IP attribution databases in at least two groups is the same, calculating the sum of the weights corresponding to the IP attribution databases respectively corresponding to the alternative IP attributions contained in each group; and taking the alternative IP home location in the packet with the maximum weight value sum as the level actual IP home location of the IP address to be inquired.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: if the IP home database cannot provide a hierarchical home zone, the IP home database is no longer an alternative IP home provider.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: and if the alternative IP attribution corresponding to the grouping of the IP attribution database is not determined as the actual IP attribution of the hierarchy, the IP attribution database is no longer used as an alternative IP attribution provider.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: and if the hierarchy has no grouping of the attribution region, no longer determining the IP attribution, and determining the actual IP attribution of the IP address to be inquired according to the actual IP attribution of the existing hierarchy.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: the dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region includes: and dividing the at least one alternative IP attribution into four levels according to countries, provinces, cities and counties.
Here, the processor 401 is configured to execute the IP home determination program to implement the following IP home determination steps: the method further comprises the following steps: and storing the corresponding relation between the IP address to be inquired and the actual IP home location.
Optionally, the Processor 401 may be a general-purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component. Here, the program executed by the processor 401 may be stored in a memory connected to the processor through a bus, and the memory 402 may be a volatile memory or a nonvolatile memory, or may include both volatile and nonvolatile memories. Among them, the nonvolatile Memory may be a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Programmable Read-Only Memory (EPROM), an Electrically Erasable Programmable Read-Only Memory (EEPROM), a magnetic random access Memory (FRAM), a Flash Memory (Flash Memory), a magnetic surface Memory, an optical disk, or a Compact Disc Read-Only Memory (CD-ROM); the magnetic surface storage may be disk storage or tape storage. Volatile Memory can be Random Access Memory (RAM), which acts as external cache Memory. By way of illustration and not limitation, many forms of RAM are available, such as Static Random Access Memory (SRAM), Synchronous Static Random Access Memory (SSRAM), Dynamic Random Access Memory (DRAM), Synchronous Dynamic Random Access Memory (SDRAM), Double Data Rate Synchronous Dynamic Random Access Memory (DDRSDRAM), Enhanced Synchronous Dynamic Random Access Memory (ESDRAM), Enhanced Synchronous Dynamic Random Access Memory (Enhanced Synchronous Dynamic Random Access Memory), Synchronous linked Dynamic Random Access Memory (DRAM, Synchronous Link Dynamic Random Access Memory), Direct Memory (DRmb Random Access Memory). The memory 402 described in connection with the embodiments of the invention is intended to comprise, without being limited to, these and any other suitable types of memory 402. The memory 402 in embodiments of the present invention is used to store various types of data to support the operation of the processor. Examples of such data include: any computer program for operation of the processor 401, such as operating systems and application programs; contact data; telephone book data; a message; a picture; video, etc. The operating system includes various system programs, such as a framework layer, a core library layer, a driver layer, and the like, and is used for implementing various basic services and processing hardware-based tasks.
To achieve the above object, the present invention also provides a computer storage medium storing one or more programs, which are executable by one or more processors 401 to cause the one or more processors 401 to perform the IP homing determination step as follows: respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database; dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region; grouping the at least one alternative IP home location according to the home location regions with the same hierarchy, and grouping IP home location databases corresponding to the alternative IP home locations with the same hierarchy and the same home location region into a group; determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region; and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: the determining the level actual IP home location of the IP address to be inquired according to the grouping of the home location area comprises the following steps: calculating the number of the alternative IP home location databases contained in each group; and taking the alternative IP home location in the packet containing the maximum number of the alternative IP home location databases as the hierarchy actual IP home location of the IP address to be inquired.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: determining the weight value of the at least one alternative IP home database; if the number of the alternative IP attribution databases in at least two groups is the same, calculating the sum of the weights corresponding to the IP attribution databases respectively corresponding to the alternative IP attributions contained in each group; and taking the alternative IP home location in the packet with the maximum weight value sum as the level actual IP home location of the IP address to be inquired.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: if the IP home database cannot provide a hierarchical home zone, the IP home database is no longer an alternative IP home provider.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: and if the alternative IP attribution corresponding to the grouping of the IP attribution database is not determined as the actual IP attribution of the hierarchy, the IP attribution database is no longer used as an alternative IP attribution provider.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: and if the hierarchy has no grouping of the attribution region, no longer determining the IP attribution, and determining the actual IP attribution of the IP address to be inquired according to the actual IP attribution of the existing hierarchy.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: the dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region includes: and dividing the at least one alternative IP attribution into four levels according to countries, provinces, cities and counties.
Optionally, the one or more programs may be executable by the one or more processors 401 to cause the one or more processors 401 to perform the following IP homing determination steps: and storing the corresponding relation between the IP address to be inquired and the actual IP home location.
Optionally, the computer storage medium may be a volatile Memory (volatile Memory), such as a Random-Access Memory (RAM); or a non-volatile Memory (non-volatile Memory), such as a Read-Only Memory (ROM), a flash Memory (flash Memory), a Hard Disk (Hard Disk Drive, HDD) or a Solid-State Drive (SSD); or may be a respective device, such as a mobile phone, computer, tablet device, personal digital assistant, etc., that includes one or any combination of the above-mentioned memories.
The present invention also provides an IP home location determining apparatus, referring to fig. 5, the apparatus includes: an alternative obtaining module 501, configured to respectively obtain at least one alternative IP home location corresponding to an IP address to be queried by querying from at least one IP home location database; an alternative layering module 502, configured to divide the at least one alternative IP home area into at least one tier according to a home region; the alternative grouping module 503 is configured to group the at least one alternative IP attribution according to attribution regions of the same hierarchy, and group IP attribution databases corresponding to the alternative IP attributions of the same hierarchy and the same attribution region; a hierarchy determining module 504, configured to determine, according to a packet of a home domain, a hierarchy actual IP home location of the IP address to be queried; an attribution determining module 505, configured to determine the number of times of determining the actual IP attribution of the hierarchy, where the number of times is the same as that of the hierarchies, and determine the actual IP attribution of the IP address to be queried.
Here, referring to fig. 6, the hierarchy determining module 504 includes a number calculating unit 5041 and a first determining unit 5042; the number calculation unit 5041 is configured to calculate the number of the alternative IP home databases included in each packet; the first determining unit 5042 is configured to use the alternative IP home location in the packet containing the maximum number of alternative IP home locations databases as a hierarchical actual IP home location of the IP address to be queried.
Here, referring again to fig. 6, the hierarchy determining module 504 further includes a weight determining unit 5043, a weight calculating unit 5044, and a second determining unit 5045; the weight determining unit 5043 is configured to determine a weight of the at least one candidate IP home database; the weight calculation unit 5044 is configured to calculate, if the number of the alternative IP home databases in at least two groups is the same, a sum of weights corresponding to the IP home databases respectively corresponding to the alternative IP home databases included in each group; the second determining unit 5045 is configured to use the alternative IP home location in the packet with the largest sum of the weights as the hierarchical actual IP home location of the IP address to be queried.
Here, referring again to fig. 6, the hierarchy determination module 504 further includes a first screening unit 5046; the first screening unit 5046 is configured to, if the IP home database cannot provide a hierarchical home zone, the IP home database no longer serves as an alternative IP home provider.
Here, referring again to fig. 6, the hierarchy determination module 504 further includes a second screening unit 5047; the second screening unit 5047 is configured to, if the alternative IP home location corresponding to the packet where the IP home location database is located is not determined as the hierarchical actual IP home location, the IP home location database no longer serves as the alternative IP home location provider.
Here, referring again to fig. 6, the attribution determination module 505 includes a termination determination unit 5051; the termination determining unit 5051 is configured to, if the hierarchy has no packet of the home domain, no longer perform IP home location determination, and determine the actual IP home location of the IP address to be queried according to the actual IP home location of the existing hierarchy.
Here, the candidate layer module 502 is specifically configured to divide the at least one candidate IP attribution into four levels according to a country, a province, a city, and a county.
Here, referring to fig. 6 again, the IP home location determining apparatus further includes a storage module 506, where the storage module 506 is configured to store a corresponding relationship between the IP address to be queried and the actual IP home location.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.
Claims (10)
1. A method for IP home determination, the method comprising:
respectively inquiring at least one alternative IP attribution corresponding to the IP address to be inquired from at least one IP attribution database;
dividing the home region of the at least one alternative IP into at least one hierarchy according to the home region;
grouping the at least one alternative IP home region according to a home region with the same hierarchy, which specifically comprises the following steps: for the alternative IP home, firstly grouping according to a first level of a home region, namely 'country'; grouping according to a second level of the home region, namely the province; grouping again according to the third level of the home region, namely 'city'; grouping according to a fourth level of the attribution region, namely 'district county', and grouping IP attribution region databases corresponding to the alternative IP attributions of the same level and the same attribution region into a group;
determining the level actual IP attribution of the IP address to be inquired according to the grouping of the attribution region;
and determining the number of times of the actual IP attribution of the hierarchy with the same number as the number of the hierarchies, and determining the actual IP attribution of the IP address to be inquired.
2. The method according to claim 1, wherein the determining the hierarchical actual IP home of the IP address to be queried according to the grouping of the home domain comprises:
calculating the number of the alternative IP home location databases contained in each group;
and taking the alternative IP home location in the packet containing the maximum number of the alternative IP home location databases as the hierarchy actual IP home location of the IP address to be inquired.
3. The IP home determination method of claim 2, further comprising:
determining the weight value of the at least one alternative IP home database;
if the number of the alternative IP attribution databases in at least two groups is the same, calculating the sum of the weights corresponding to the IP attribution databases respectively corresponding to the alternative IP attributions contained in each group;
and taking the alternative IP home location in the packet with the maximum weight value sum as the level actual IP home location of the IP address to be inquired.
4. The IP home determination method of claim 1, further comprising:
if the IP home database cannot provide a hierarchical home zone, the IP home database is no longer an alternative IP home provider.
5. The IP home determination method of claim 1, further comprising:
and if the alternative IP attribution corresponding to the grouping of the IP attribution database is not determined as the actual IP attribution of the hierarchy, the IP attribution database is no longer used as an alternative IP attribution provider.
6. The IP home determination method of claim 1, further comprising:
and if the hierarchy has no grouping of the attribution region, no longer determining the IP attribution, and determining the actual IP attribution of the IP address to be inquired according to the actual IP attribution of the existing hierarchy.
7. The method according to any of claims 1 to 6, wherein the dividing the at least one alternative IP home into at least one hierarchy according to home zones comprises:
and dividing the at least one alternative IP attribution into four levels according to countries, provinces, cities and counties.
8. The IP home determination method according to any one of claims 1 to 6, further comprising:
and storing the corresponding relation between the IP address to be inquired and the actual IP home location.
9. An IP home determination apparatus, comprising a processor, and a memory connected to the processor through a communication bus; wherein,
the memory is used for storing the program determined by the IP home location;
the processor, configured to execute the IP home determination procedure to implement the IP home determination step according to any one of claims 1 to 8.
10. A computer storage medium, characterized in that the computer storage medium stores one or more programs executable by one or more processors to cause the one or more processors to perform the IP homing determination step of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811633072.4A CN109783521B (en) | 2018-12-29 | 2018-12-29 | IP home location determination method, device and computer storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201811633072.4A CN109783521B (en) | 2018-12-29 | 2018-12-29 | IP home location determination method, device and computer storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN109783521A CN109783521A (en) | 2019-05-21 |
CN109783521B true CN109783521B (en) | 2021-09-28 |
Family
ID=66497950
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201811633072.4A Active CN109783521B (en) | 2018-12-29 | 2018-12-29 | IP home location determination method, device and computer storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN109783521B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112019644B (en) * | 2019-05-29 | 2022-08-02 | 贵州白山云科技股份有限公司 | Method, system, medium and equipment for determining attribution information of IP address |
CN113495892A (en) * | 2020-03-20 | 2021-10-12 | 北京沃东天骏信息技术有限公司 | Method and device for updating IP address information base |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009077338A (en) * | 2007-09-25 | 2009-04-09 | Saxa Inc | Method of determining location of ip communication terminal, ip network management apparatus and hub |
CN103177000A (en) * | 2011-12-21 | 2013-06-26 | 卓望数码技术(深圳)有限公司 | Grouping method of Internet protocol (IP) addresses or cell phone numbers and query method of attribution place |
CN103561123A (en) * | 2013-10-28 | 2014-02-05 | 北京国双科技有限公司 | Method and device for determining IP segment affiliation |
CN104780235A (en) * | 2014-01-14 | 2015-07-15 | 腾讯科技(深圳)有限公司 | IP attribution inquiry method and device and server |
-
2018
- 2018-12-29 CN CN201811633072.4A patent/CN109783521B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2009077338A (en) * | 2007-09-25 | 2009-04-09 | Saxa Inc | Method of determining location of ip communication terminal, ip network management apparatus and hub |
CN103177000A (en) * | 2011-12-21 | 2013-06-26 | 卓望数码技术(深圳)有限公司 | Grouping method of Internet protocol (IP) addresses or cell phone numbers and query method of attribution place |
CN103561123A (en) * | 2013-10-28 | 2014-02-05 | 北京国双科技有限公司 | Method and device for determining IP segment affiliation |
CN104780235A (en) * | 2014-01-14 | 2015-07-15 | 腾讯科技(深圳)有限公司 | IP attribution inquiry method and device and server |
Also Published As
Publication number | Publication date |
---|---|
CN109783521A (en) | 2019-05-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US9113294B2 (en) | Method for positioning IP location and server | |
CN108446281B (en) | Method, device and storage medium for determining user intimacy | |
JP6689515B2 (en) | Method and apparatus for identifying the type of user geographic location | |
US9049549B2 (en) | Method and apparatus for probabilistic user location | |
US20180158108A1 (en) | System and Method for Estimating Mobile Device Locations | |
US20160036646A1 (en) | Method and apparatus for determining area in which ip address is located | |
US11681927B2 (en) | Analyzing geotemporal proximity of entities through a knowledge graph | |
CN106547770B (en) | User classification and user identification method and device based on user address information | |
CN105869057B (en) | Comment storage device, comment reading method and device, and comment writing method and device | |
WO2017133539A1 (en) | Service data processing method, device and system | |
CN109783521B (en) | IP home location determination method, device and computer storage medium | |
CN106537384A (en) | Reverse IP databases using data indicative of user location | |
CN107766433A (en) | A kind of range query method and device based on Geo BTree | |
CN113849702B (en) | Method and device for determining target data, electronic equipment and storage medium | |
CN112543926A (en) | Determining a geographic location of a network device | |
CN105229639A (en) | Short word hash | |
CN103476003B (en) | Geographic information storage method for mobile equipment and mobile equipment | |
US8396877B2 (en) | Method and apparatus for generating a fused view of one or more people | |
CN108345662A (en) | A kind of microblog data weighted statistical method of registering considering user distribution area differentiation | |
Chan et al. | Leveraging Twitter to detect event names associated with a place | |
Quattrone et al. | Modelling growth of urban crowd-sourced information | |
CN112070342B (en) | Microservice evaluation method and device, electronic equipment and computer readable storage medium | |
CN109918468A (en) | Internet of things equipment position data region screening technique based on Mercator projection | |
Spreitzenbarth et al. | Comparing sources of location data from android smartphones | |
CN111611337B (en) | Terminal data processing system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |