CN113779165B - IP address geographic position ambiguity judging method and related equipment - Google Patents
IP address geographic position ambiguity judging method and related equipment Download PDFInfo
- Publication number
- CN113779165B CN113779165B CN202110884008.9A CN202110884008A CN113779165B CN 113779165 B CN113779165 B CN 113779165B CN 202110884008 A CN202110884008 A CN 202110884008A CN 113779165 B CN113779165 B CN 113779165B
- Authority
- CN
- China
- Prior art keywords
- address
- dispute
- active
- information
- address segment
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/29—Geographical information databases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/24—Querying
- G06F16/245—Query processing
- G06F16/2455—Query execution
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/903—Querying
- G06F16/90335—Query processing
- G06F16/90348—Query processing by searching ordered data, e.g. alpha-numerically ordered data
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/69—Types of network addresses using geographic information, e.g. room number
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computational Linguistics (AREA)
- Remote Sensing (AREA)
- Navigation (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The disclosure provides a method and related equipment for determining geographic position ambiguity of an IP address, wherein the method comprises the following steps: and constructing the same IP address segment set and the disputed IP address segment set according to different IP positioning libraries, detecting the activity of the IP address based on the same IP address segment set, and constructing an active IP address data set. And associating the dispute IP address segment with the active IP address segment, respectively calculating path vectors corresponding to different IP address segments, and taking the address position of the active IP address segment closest to the path vector of the dispute IP address segment as the target geographic position of the dispute IP address segment. The judging method solves the problem that the geographic positions of the IP addresses of the multi-source IP address geographic position database are inconsistent, fully utilizes the full-path information from the detection point to the target IP, and has higher reliability. Meanwhile, only partial active IP corresponding to the disputed city is needed, and the discrimination of the geographic position can be completed, so that the method has the advantages of real time, accuracy, light weight and easiness in deployment.
Description
Technical Field
The disclosure relates to the technical field of internet, in particular to a geographic position ambiguity judging method of an IP address and related equipment.
Background
The IP address is a unified address format provided by the IP protocol, is a core component of the internet, and can be used to uniquely identify a host or device accessing the network. The device or host used by the user must have an IP address to access the internet, thereby acquiring network resources. IP address geographic location refers to an address in physical space that corresponds to an IP address in network space. Generally, there is a one-to-one correspondence between IP addresses and physical addresses. IP positioning refers to establishing the mapping relation between an IP address and a physical address thereof by a certain technical means. The IP positioning is widely applied in the aspects of network performance optimization, network security analysis, personalized recommendation and the like. The IP address is a logical address of a network or host in the internet, and its geographic location plays an important role in network traffic scheduling, network security event analysis, and user popularization. There are many databases of geographic locations of IP addresses in the industry, but the multi-source geographic location information of IP addresses causes ambiguity of the locations of IP addresses, and reduces the effect of using the geographic locations of IP addresses.
Disclosure of Invention
Accordingly, an objective of the present disclosure is to provide a method and related device for determining geographic location ambiguity of an IP address.
Based on the above object, the present disclosure provides a method for determining ambiguity of geographic location of an IP address, including:
acquiring positioning information from at least two IP positioning libraries;
carrying out standardization processing on the geographic position in the positioning information;
associating an IP address field in the positioning information with autonomous system as (autonomous system) information in a routing information table through a routing prefix;
constructing the same IP address segment set based on the positioning information and the as information, and constructing a dispute IP address segment set based on the positioning information and the as information;
determining an active IP address segment set through activity detection based on the same IP address segment set;
determining, based on the set of dispute IP address segments and the set of active IP address segments, at least two active IP address segments associated with each of the set of dispute IP address segments by a predetermined rule;
and respectively acquiring the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated with the path vector of the dispute IP address segment through route tracking, respectively calculating the distance between the path vector of the dispute IP address segment and the path vector of each active IP address segment, and taking the geographic position associated with the active IP address segment corresponding to the minimum distance as the target geographic position of the dispute IP address segment.
Further, the positioning information includes: start-stop IP, country code, state/province/region and city name, the geographic location including country code, state/province/region and city name.
Further, the normalization process includes: inquiring the geographic position in a preset standard geographic position library, and if the geographic position is a non-standard geographic position, replacing the geographic position with the standard geographic position.
Further, the constructing the same set of IP address segments based on the positioning information and the as information, and constructing the set of disputed IP address segments based on the positioning information and the as information, includes: and merging the record information with the same geographic position and as information corresponding to the start-stop IP to construct the same IP address segment set, and merging the record information with the same start-stop IP and different geographic position and/or as information to construct the dispute IP address segment set.
Further, the determining the set of active IP address segments by activity detection based on the set of identical IP address segments includes: extracting information from the same IP address segment set to construct a first dictionary, wherein the first dictionary is { city name: as: and (3) randomly extracting part of IP addresses from each IP address segment of the first dictionary, detecting the activity of the IP addresses, and constructing an active IP address segment set based on the city name, the as information and the IP address segment which corresponds to the city name and has the active activity detection result.
Further, the predetermined rule includes: extracting information from the dispute IP address fragment set to construct a second dictionary, wherein the second dictionary is { dispute IP address fragment: [ first dispute city second dispute city … Nth dispute city as ] }, querying the first dispute city in the second dictionary, the second dispute city …, and the active IP address segment corresponding to the Nth dispute city in the active IP address segment set as an active IP address segment associated with the dispute IP address segment, respectively, based on as information using a similarity principle.
Further, the obtaining, by route tracing, the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated therewith, respectively, includes: constructing a third dictionary, wherein the third dictionary is { dispute IP address fragment: [ first dispute city +as+first active IP address segment second dispute city +as+second active IP address segment … Nth dispute city +as+Nth active IP address segment ] }, initiating a route tracking probe for the dispute IP address segment and all the active IP address segments in the third dictionary, and converting a path obtained by the route tracking probe into a path vector.
Based on the same inventive concept, the present disclosure also provides an IP address geographic ambiguity determining apparatus, including:
the acquisition module is configured to acquire positioning information from at least two IP positioning libraries;
the standardized processing module is configured to perform standardized processing on the geographic position in the positioning information;
an information association module configured to associate an IP address segment in the location information with as information in a routing information table through a routing prefix;
a set construction module configured to construct a set of identical IP address segments based on the location information and the as information, and a set of disputed IP address segments based on the location information and the as information;
an activity detection module configured to determine a set of active IP address segments by activity detection based on the same set of IP address segments;
an associated active IP determination module configured to determine, based on the set of dispute IP address segments and the set of active IP address segments, at least two active IP address segments associated with each of the set of dispute IP address segments by a predetermined rule;
and the geographic position judging module is configured to respectively acquire the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated with the path vector of the dispute IP address segment through route tracking, respectively calculate the distance between the path vector of the dispute IP address segment and the path vector of each active IP address segment, and take the geographic position associated with the active IP address segment corresponding to the minimum distance as the target geographic position of the dispute IP address segment.
Based on the same inventive concept, the present disclosure also provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable by the processor, the processor implementing the method as described above when executing the computer program.
Based on the same inventive concept, the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the method as described above.
From the above, it can be seen that the method and the related device for determining ambiguity of IP address geographic location provided by the present disclosure solve the problem that IP address geographic locations of a multi-source IP address geographic location database are inconsistent. The method comprises the steps of obtaining a database of IP address geographic positions by analyzing the multi-source IP address geographic position, locating the same IP address set and different IP address sets in the database, obtaining network paths from specific measuring points to the sets by active measurement, and establishing a network path reference data set of the ground city level according to the network paths locating the same IP address set. Aiming at the set of inconsistent IP address geographic positions, the ambiguity judgment of the IP address geographic positions is realized by comparing the similarity of network paths to the reference data set of the specific urban network paths. The method provided by the disclosure has low dependence on network quality, fully utilizes the full path information from the detection point to the target IP, and has high reliability. Meanwhile, only partial active IP corresponding to the disputed city is needed, and the discrimination of the geographic position can be completed, so that the method has the advantages of real time, accuracy, light weight and easiness in deployment.
Drawings
In order to more clearly illustrate the technical solutions of the present disclosure or related art, the drawings required for the embodiments or related art description will be briefly described below, and it is apparent that the drawings in the following description are only embodiments of the present disclosure, and other drawings may be obtained according to these drawings without inventive effort to those of ordinary skill in the art.
Fig. 1 is a flowchart illustrating a method for determining ambiguity of geographic location of an IP address according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of activity detection according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of an IP address geographic location ambiguity determining apparatus according to an embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the disclosure.
Detailed Description
For the purposes of promoting an understanding of the principles and advantages of the disclosure, reference will now be made to the embodiments illustrated in the drawings and specific language will be used to describe the same.
It should be noted that unless otherwise defined, technical or scientific terms used in the embodiments of the present disclosure should be given the ordinary meaning as understood by one of ordinary skill in the art to which the present disclosure pertains. The terms "first," "second," and the like, as used in embodiments of the present disclosure, do not denote any order, quantity, or importance, but rather are used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that elements or items preceding the word are included in the element or item listed after the word and equivalents thereof, but does not exclude other elements or items. The terms "connected" or "connected," and the like, are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", etc. are used merely to indicate relative positional relationships, which may also be changed when the absolute position of the object to be described is changed.
As described in the background, an IP address geographic location database is a database describing the mapping of IP addresses to their physical locations, commonly referred to as an IP location database. The use of an IP location repository to obtain IP location is one of the most common forms, and thus many institutions provide IP location repository services. The existing common IP positioning library generally has two free and commercial versions, the number of records of the free version is smaller than that of the commercial version, and the positioning accuracy is relatively low. IP positioning is stored in a plurality of records, each record typically containing address block prefix or start address to end address, continent code, country code, state/province/region, city, latitude and longitude, postal code, etc. Based on this, the mapping relationship of the IP address to the physical address can be determined. Because the detection methods used by different IP positioning libraries are different, the situation that the positioning is inconsistent can exist for the same IP positioning library with different IP addresses, the inconsistent data are called disputed IP, and the disputed IP ambiguous address positions are judged, so that the problem of inconsistent geographic positions of the multi-source IP addresses is solved.
Embodiments of the present disclosure are described in detail below with reference to the attached drawings.
Referring to fig. 1, the present disclosure provides a method for determining ambiguity of geographic location of an IP address, including the following steps:
and step S101, positioning information is acquired from at least two IP positioning libraries. Specifically, different IP positioning libraries have inconsistent descriptions of IP addresses due to different detection methods. Extracting the positioning information of the IP address field from different IP positioning libraries, and further processing the positioning information.
And step S102, carrying out standardization processing on the geographic position in the positioning information. Descriptions of the same geographic location in different IP location libraries may be different, and it is necessary to unify the descriptions of the geographic locations, that is, perform standardization processing on the descriptions of the same geographic location.
Step S103, the IP address segment in the positioning information is associated with as information in a routing information table through a routing prefix. The routing table contains routing prefixes and autonomous system number asn (autonomous system number) of autonomous domain, and establishes a prefix tree for all the routing prefixes, and searches the routing prefix belonging to the IP address segment from the prefix tree, so that the IP address segment can be associated with the routing prefix and asn belonging to the IP address segment.
Step S104, constructing the same IP address segment set based on the positioning information and the as information, and constructing the disputed IP address segment set based on the positioning information and the as information. Specifically, different sets are respectively constructed according to different IP address field information in the positioning information, the positioning information with no disputes in the IP address field is combined to construct the same IP address field set, and the positioning information with disputes in the IP address field is combined to construct the disputed IP address field set.
Step S105, based on the same IP address segment set, determining an active IP address segment set through activity detection. Specifically, for the same IP address segment set with no dispute of the IP address segments, activity detection is carried out on the IP address segments in the set, and the IP address segments with active detection results are combined to be used as the active IP address segment set.
Step S106, determining at least two active IP address segments associated with each dispute IP address segment in the set of dispute IP address segments by a predetermined rule based on the set of dispute IP address segments and the set of active IP address segments. And associating the disputed IP address segment with the active IP address segments in the active IP address segment set, and selecting at least two active IP address segments with the highest similarity with the disputed IP address segment for subsequent judgment of the geographic position of the disputed IP address segment.
Step S107, respectively obtaining the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated with the path vector of the dispute IP address segment through route tracking, respectively calculating the distance between the path vector of the dispute IP address segment and the path vector of each active IP address segment, and taking the geographic position associated with the active IP address segment corresponding to the minimum distance as the target geographic position of the dispute IP address segment.
In some embodiments, the positioning information comprises: start-stop IP, country code, state/province/region and city name, the geographic location including country code, state/province/region and city name. The location information in an IP location repository typically includes address block prefix or start address to end address, country code, state/province/region and city fields, and the description of the same city by different IP location repositories may differ.
In some embodiments, the normalization process includes: inquiring the geographic position in a preset standard geographic position library, and if the geographic position is a non-standard geographic position, replacing the geographic position with the standard geographic position. Specifically, geographic position information in one of the IP positioning libraries is used as a reference, geographic position information in the other positioning libraries is used as a key, geographic position information in the reference positioning library is used as a value, and { alias: and (3) standard naming the dictionary, and if the geographic position information of a certain record is different from the geographic position information in the reference library, querying the dictionary for replacement.
In some embodiments, the constructing the same set of IP address segments based on the location information and the as information, constructing the set of disputed IP address segments based on the location information and the as information, comprises: and merging the record information with the same geographic position and as information corresponding to the start-stop IP to construct the same IP address segment set, and merging the record information with the same start-stop IP and different geographic position and/or as information to construct the dispute IP address segment set.
Specifically, the IP address field in the positioning information includes an undisputed IP address field and a disputed IP address field, and the two IP address fields are combined to construct a set. The non-disputed IP address field is the record information with the identical geographic position information in the positioning information, and the same IP address field set is built by combining. For example, the location information in the first IP location repository is { IP segment one: start-stop IP, national first, province first, city first, as first }, the positioning information in the second IP positioning library is { IP segment one: starting and stopping IP, national first, province first, city first, as first, then regard such positioning information as the same record information, construct the same IP address segment set and keep.
The geographic location information or as information of the dispute IP address segment is different, including state/province/region, city name or as information, and the like, and the different geographic location information of the dispute IP address segment is recorded behind the dispute IP address segment as an element of the set of dispute IP address segments. For example, the location information in the first IP location repository is { IP segment one: start-stop IP, national first, province first, city first, as first }, the positioning information in the second IP positioning library is { IP segment one: starting and stopping IP, national first province, province second, city second, as first }, such positioning information is regarded as different record information, and a disputed IP address segment set is constructed for storage.
In some embodiments, the determining the set of active IP address segments by activity probing based on the same set of IP address segments comprises: extracting information from the same IP address segment set to construct a first dictionary, wherein the first dictionary is { city name: as: and (3) randomly extracting part of IP addresses from each IP address segment of the first dictionary, detecting the activity of the IP addresses, and constructing an active IP address segment set based on the city name, the as information and the IP address segment which corresponds to the city name and has the active activity detection result.
Specifically, city names and as information in the same set of IP address fields are used as keys, and the corresponding IP address field is used as a value to construct a first dictionary { city names: as: [ set of IP address fragments ] }, the same city name and as information correspond to different IP address fragments, which are recorded as a set behind the city name and as information. For the IP address segment set, which may include an active IP address segment and an inactive IP address segment, a detection tool is required to further detect the network condition. Referring to fig. 2, in this embodiment, PING is used to detect activity by sending an ICMP message to a destination address, and if a reply message is received, the address segment is considered to be an active address segment, and after the active address is stored in the address segment, the inactive IP address segment is removed from the set, so as to establish a set of active IP address segments that are the same for each city and each network location.
In some embodiments, the predetermined rule comprises: extracting information from the dispute IP address fragment set to construct a second dictionary, wherein the second dictionary is { dispute IP address fragment: [ first dispute city second dispute city … Nth dispute city as ] }, querying the first dispute city in the second dictionary, the second dispute city …, and the active IP address segment corresponding to the Nth dispute city in the active IP address segment set as an active IP address segment associated with the dispute IP address segment, respectively, based on as information using a similarity principle.
Specifically, different disputed cities corresponding to the disputed IP address fields with the same as information are queried in the active IP address field set, the IP address field with the highest similarity corresponding to each disputed city is selected as the active IP address field corresponding to the disputed city, and a third dictionary { disputed IP address field: first disputed city + as + first active IP address segment second disputed city + as + second active IP address segment … nth disputed city + as + nth active IP address segment ] }.
In some embodiments, the obtaining, by route tracing, the path vector of the dispute IP address segment and the path vectors of all of the active IP address segments associated therewith, respectively, comprises: constructing a third dictionary, wherein the third dictionary is { dispute IP address fragment: [ first dispute city +as+first active IP address segment second dispute city +as+second active IP address segment … Nth dispute city +as+Nth active IP address segment ] }, initiating a route tracking probe for the dispute IP address segment and all the active IP address segments in the third dictionary, and converting a path obtained by the route tracking probe into a path vector. In this embodiment, the scampe tool is adopted to initiate route tracking, so that the detection can be performed in a multithread manner, the sending rate of the detection packet is controlled, the detection rate is improved, and the detection result is stored in a file form.
Building a fourth dictionary { IP address field: [ Path vector ] }, which includes the path vector of the disputed IP address segment and the path vector of the active IP address segment, which is dropped when it is encountered (no return packet) at the time of construction. The IP address segment in the third dictionary is used as a key, corresponding values are searched in the fourth dictionary, and a fifth dictionary { disputed IP address segment is constructed: disputed IP address segment path vector first active IP address segment corresponds to path vector second active IP address segment corresponds to path vector … nth active IP address segment corresponds to path vector. The distances between the disputed IP address field path vector and each active IP address field path vector are compared respectively, and the similarity of two IP address fields with closer distances in the physical space is larger. Because of the non-uniform length of the vectors, a dynamic time warping (DTW, dynamic Time Warping) algorithm is used to compare the distances between the vectors, as follows:
(1) And inputting a path vector corresponding to the disputed IP address segment and a path vector corresponding to one of the active IP address segments, and respectively calculating the distance between each point of the two vectors by constructing a distance matrix between the two vectors.
(2) A path from the upper left corner to the lower right corner is found from the distance matrix such that the sum of the elements on the path is minimized, the sum of the elements being the distance of the two vectors. The method for searching the minimum element and adopting the dynamic programming method is specifically realized as follows:
assuming that the distance matrix is M, the shortest path length from the upper left corner (1, 1) to any point (i, j) of the matrix is Lmin (i, j). Since current path length = previous path length + current element size, for a certain element (i, j) on the path, its previous element can only be one of the following: a) the left neighbor (i, j-1), b) the upper neighbor (i-1, j), c) the upper left neighbor (i-1, j-1). Then a recursive algorithm may be used to find the shortest path length: lmin (i, j) =min { Lmin (i, j-1), lmin (i-1, j-1) } +m (i, j), where the initial condition lmin= (1, 1) =m (1, 1), the result returns the distance between the two vectors.
(3) And respectively taking (the path vector of the disputed IP address field, the path vector of the first active IP address field, the path vector of the disputed IP address field and the path vector of the second active IP address field) … (the path vector of the disputed IP address field and the path vector of the N active IP address field) as parameters, inputting the parameters into the DTW algorithm, comparing the return distance values, and finally obtaining the geographic position of the active IP address field corresponding to the minimum distance value as the target geographic position of the disputed IP address field, thereby completing the judgment of the geographic position of the disputed IP address.
In one particular embodiment, there are two IP location libraries a and B. Firstly, taking the A library as a standard, and carrying out standardization processing on records of the cities and the A library in the B library in aliases. And then, combining the routing table of the current day, and associating each IP address segment with the prefix of the routing table so as to be further associated with the corresponding as. Then comparing the positioning of each IP segment in the A library with that in the B library, storing the record with the same positioning as the same IP address segment set, dividing the data in the set according to the city and as, and establishing { city: as: and taking the [ IP address segment set ] } set as a reference, randomly selecting a plurality of IPs for activity detection for each IP segment in the reference set, detecting by using a PING tool, considering the address as active after receiving a reply, attaching the active IP address segment to the back of the IP address segment, and eliminating the IP address segment if the active IP address segment is not found. And storing records with different positioning as a disputed IP address segment set, wherein the positioning of the A library to the IP address segment is Suzhou, and the positioning of the B library to the IP address segment is Nanj. For this record we save as { disputed IP address field: [ Nanjing as, suzhou ] }, and searching the active IP address set of the corresponding as of Nanjing and Suzhou from the benchmark set, searching the IP address segment with the highest similarity with the disputed IP address segment from the active addresses by utilizing a similarity principle, and generating { disputed IP address segment: the [ Suzhou+as+Nanjing+as+second active IP of the first active IP ] } dictionary. And respectively initiating route tracking detection to the dispute IP and the corresponding active IP by using the scampe, and storing the result in a file form. Converting the detected path into a path vector, and constructing { IP: [ Path vector ] } dictionary. In { dispute IP address field: the IP in the [ su+as+first active IP south-Beijing+as+second active IP ] } dictionary is a key, at { IP: searching a dictionary corresponding value in the [ path vector ] } dictionary, and constructing { dispute IP: the dispute IP path vector first active IP corresponds to path vector second active IP corresponds to path vector dictionary. And comparing the distances between the disputed IP and the corresponding path vectors of the first active IP and the second active IP by using a DTW algorithm, and considering that the IP address field is positioned in Suzhou if the returned result shows that the distance between the disputed IP and the first active IP address field is close.
It should be noted that the method of the embodiments of the present disclosure may be performed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene, and is completed by mutually matching a plurality of devices. In the case of such a distributed scenario, one of the devices may perform only one or more steps of the methods of embodiments of the present disclosure, the devices interacting with each other to accomplish the methods.
It should be noted that the foregoing describes some embodiments of the present disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments described above and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Based on the same inventive concept, the present disclosure also provides an IP address geographic location ambiguity determining apparatus corresponding to the method of any embodiment.
Referring to fig. 3, the device for determining geographic position ambiguity of an IP address includes:
an acquisition module 301 configured to acquire positioning information from at least two IP positioning libraries;
a normalization processing module 302 configured to normalize the geographic location in the positioning information;
an information association module 303 configured to associate the IP address segment in the location information with as information in a routing information table by a routing prefix;
a set construction module 304 configured to construct a set of identical IP address segments based on the location information and the as information, and a set of disputed IP address segments based on the location information and the as information;
an activity detection module 305 configured to determine a set of active IP address segments by activity detection based on the same set of IP address segments;
an associated active IP determination module 306 configured to determine at least two active IP address segments associated with each dispute IP address segment in the set of dispute IP address segments by a predetermined rule based on the set of dispute IP address segments and the set of active IP address segments;
a geographic location determination module 307 configured to obtain, by route tracing, a path vector of the dispute IP address segment and a path vector of all the active IP address segments associated therewith, respectively, calculate a distance between the path vector of the dispute IP address segment and the path vector of each of the active IP address segments, and take, as a target geographic location of the dispute IP address segment, a geographic location associated with the active IP address segment corresponding to the minimum distance.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, the functions of the various modules may be implemented in the same one or more pieces of software and/or hardware when implementing the present disclosure.
The device of the foregoing embodiment is configured to implement the corresponding method for determining geographic location ambiguity of an IP address in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, the present disclosure also provides an electronic device corresponding to the method of any embodiment, including a memory, a processor, and a computer program stored on the memory and capable of running on the processor, where the processor implements the method for determining geographic location ambiguity of an IP address according to any embodiment when executing the program.
Fig. 4 shows a more specific hardware architecture of an electronic device according to this embodiment, where the device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 implement communication connections therebetween within the device via a bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit ), microprocessor, application specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, etc. for executing relevant programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of ROM (Read Only Memory), RAM (Random Access Memory ), static storage device, dynamic storage device, or the like. Memory 1020 may store an operating system and other application programs, and when the embodiments of the present specification are implemented in software or firmware, the associated program code is stored in memory 1020 and executed by processor 1010.
The input/output interface 1030 is used to connect with an input/output module for inputting and outputting information. The input/output module may be configured as a component in a device (not shown in the figure) or may be external to the device to provide corresponding functionality. Wherein the input devices may include a keyboard, mouse, touch screen, microphone, various types of sensors, etc., and the output devices may include a display, speaker, vibrator, indicator lights, etc.
Communication interface 1040 is used to connect communication modules (not shown) to enable communication interactions of the present device with other devices. The communication module may implement communication through a wired manner (such as USB, network cable, etc.), or may implement communication through a wireless manner (such as mobile network, WIFI, bluetooth, etc.).
Bus 1050 includes a path for transferring information between components of the device (e.g., processor 1010, memory 1020, input/output interface 1030, and communication interface 1040).
It should be noted that although the above-described device only shows processor 1010, memory 1020, input/output interface 1030, communication interface 1040, and bus 1050, in an implementation, the device may include other components necessary to achieve proper operation. Furthermore, it will be understood by those skilled in the art that the above-described apparatus may include only the components necessary to implement the embodiments of the present description, and not all the components shown in the drawings.
The electronic device of the foregoing embodiment is configured to implement the corresponding method for determining geographic location ambiguity of an IP address in any of the foregoing embodiments, and has the beneficial effects of the corresponding method embodiment, which is not described herein.
Based on the same inventive concept, corresponding to any of the above embodiments of the method, the present disclosure further provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the IP address geographical location ambiguity determination method according to any of the above embodiments.
The computer readable media of the present embodiments, including both permanent and non-permanent, removable and non-removable media, may be used to implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device.
The storage medium of the foregoing embodiment stores computer instructions for causing the computer to execute the method for determining geographic location ambiguity of an IP address according to any one of the foregoing embodiments, and has the advantages of the corresponding method embodiments, which are not described herein.
Those of ordinary skill in the art will appreciate that: the discussion of any of the embodiments above is merely exemplary and is not intended to suggest that the scope of the disclosure, including the claims, is limited to these examples; the technical features of the above embodiments or in the different embodiments may also be combined under the idea of the present disclosure, the steps may be implemented in any order, and there are many other variations of the different aspects of the embodiments of the present disclosure as described above, which are not provided in details for the sake of brevity.
Additionally, well-known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures, in order to simplify the illustration and discussion, and so as not to obscure the embodiments of the present disclosure. Furthermore, the devices may be shown in block diagram form in order to avoid obscuring the embodiments of the present disclosure, and this also accounts for the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform on which the embodiments of the present disclosure are to be implemented (i.e., such specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the disclosure, it should be apparent to one skilled in the art that embodiments of the disclosure can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative in nature and not as restrictive.
While the present disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of those embodiments will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) may use the embodiments discussed.
The disclosed embodiments are intended to embrace all such alternatives, modifications and variances which fall within the broad scope of the appended claims. Accordingly, any omissions, modifications, equivalents, improvements, and the like, which are within the spirit and principles of the embodiments of the disclosure, are intended to be included within the scope of the disclosure.
Claims (10)
1. A geographical position ambiguity judging method of an IP address comprises the following steps:
acquiring positioning information from at least two IP positioning libraries;
carrying out standardization processing on the geographic position in the positioning information;
associating an IP address segment in the positioning information with autonomous system as information in a routing information table through a routing prefix;
constructing the same IP address segment set based on the positioning information and the as information, and constructing a dispute IP address segment set based on the positioning information and the as information;
determining an active IP address segment set through activity detection based on the same IP address segment set;
determining, based on the set of dispute IP address segments and the set of active IP address segments, at least two active IP address segments associated with each of the set of dispute IP address segments by a predetermined rule;
and respectively acquiring the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated with the path vector of the dispute IP address segment through route tracking, respectively calculating the distance between the path vector of the dispute IP address segment and the path vector of each active IP address segment, and taking the geographic position associated with the active IP address segment corresponding to the minimum distance as the target geographic position of the dispute IP address segment.
2. The determination method according to claim 1, wherein the positioning information includes: start-stop IP, country code, state/province/region and city name, the geographic location including country code, state/province/region and city name.
3. The determination method according to claim 1, wherein the normalization process includes: inquiring the geographic position in a preset standard geographic position library, and if the geographic position is a non-standard geographic position, replacing the geographic position with the standard geographic position.
4. The method of determining according to claim 2, wherein the constructing the same set of IP address segments based on the location information and the as information, and constructing the set of disputed IP address segments based on the location information and the as information, comprises:
and merging the record information with the same geographic position and as information corresponding to the start-stop IP to construct the same IP address segment set, and merging the record information with the same start-stop IP and different geographic position and/or as information to construct the dispute IP address segment set.
5. The method of determining according to claim 2, wherein the determining the set of active IP address segments by activity probing based on the same set of IP address segments comprises:
extracting information from the same IP address segment set to construct a first dictionary, wherein the first dictionary is { city name: as: and (3) randomly extracting part of IP addresses from each IP address segment of the first dictionary, detecting the activity of the IP addresses, and constructing an active IP address segment set based on the city name, the as information and the IP address segment which corresponds to the city name and has the active activity detection result.
6. The determination method according to claim 1, wherein the predetermined rule includes: extracting information from the dispute IP address fragment set to construct a second dictionary, wherein the second dictionary is { dispute IP address fragment: [ first dispute city second dispute city … Nth dispute city as ] }, querying the first dispute city in the second dictionary, the second dispute city …, and the active IP address segment corresponding to the Nth dispute city in the active IP address segment set as an active IP address segment associated with the dispute IP address segment, respectively, based on as information using a similarity principle.
7. The method of determining as recited in claim 6, said separately obtaining path vectors for said disputed IP address segments and path vectors for all of said active IP address segments associated therewith by route tracking, comprising: constructing a third dictionary, wherein the third dictionary is { dispute IP address fragment: [ first dispute city +as+first active IP address segment second dispute city +as+second active IP address segment … Nth dispute city +as+Nth active IP address segment ] }, initiating a route tracking probe for the dispute IP address segment and all the active IP address segments in the third dictionary, and converting a path obtained by the route tracking probe into a path vector.
8. An IP address geographic ambiguity determining apparatus comprising:
the acquisition module is configured to acquire positioning information from at least two IP positioning libraries;
the standardized processing module is configured to perform standardized processing on the geographic position in the positioning information;
an information association module configured to associate an IP address segment in the location information with as information in a routing information table through a routing prefix;
a set construction module configured to construct a set of identical IP address segments based on the location information and the as information, and a set of disputed IP address segments based on the location information and the as information;
an activity detection module configured to determine a set of active IP address segments by activity detection based on the same set of IP address segments;
an associated active IP determination module configured to determine, based on the set of dispute IP address segments and the set of active IP address segments, at least two active IP address segments associated with each of the set of dispute IP address segments by a predetermined rule;
and the geographic position judging module is configured to respectively acquire the path vector of the dispute IP address segment and the path vectors of all the active IP address segments associated with the path vector of the dispute IP address segment through route tracking, respectively calculate the distance between the path vector of the dispute IP address segment and the path vector of each active IP address segment, and take the geographic position associated with the active IP address segment corresponding to the minimum distance as the target geographic position of the dispute IP address segment.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable by the processor, the processor implementing the method according to any one of claims 1 to 7 when the computer program is executed.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the method of any one of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110884008.9A CN113779165B (en) | 2021-08-03 | 2021-08-03 | IP address geographic position ambiguity judging method and related equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110884008.9A CN113779165B (en) | 2021-08-03 | 2021-08-03 | IP address geographic position ambiguity judging method and related equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113779165A CN113779165A (en) | 2021-12-10 |
CN113779165B true CN113779165B (en) | 2023-07-28 |
Family
ID=78836606
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110884008.9A Active CN113779165B (en) | 2021-08-03 | 2021-08-03 | IP address geographic position ambiguity judging method and related equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113779165B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115378912B (en) * | 2022-07-21 | 2023-06-09 | 北京华顺信安科技有限公司 | Scanning method and system for active IPv6 address |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110858810A (en) * | 2018-08-24 | 2020-03-03 | 中国移动通信集团四川有限公司 | Network link state monitoring method, device, system and medium |
CN111629081A (en) * | 2020-05-28 | 2020-09-04 | 腾讯科技(深圳)有限公司 | Internet protocol IP address data processing method and device and electronic equipment |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8806322B2 (en) * | 2011-11-28 | 2014-08-12 | Google Inc. | System and method for obtaining a structured address by geocoding unstructured address information |
US9804253B2 (en) * | 2013-07-08 | 2017-10-31 | Rockwell Collins, Inc. | System and methods for non-parametric technique based geolocation and cognitive sensor activation |
-
2021
- 2021-08-03 CN CN202110884008.9A patent/CN113779165B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110858810A (en) * | 2018-08-24 | 2020-03-03 | 中国移动通信集团四川有限公司 | Network link state monitoring method, device, system and medium |
CN111629081A (en) * | 2020-05-28 | 2020-09-04 | 腾讯科技(深圳)有限公司 | Internet protocol IP address data processing method and device and electronic equipment |
Non-Patent Citations (1)
Title |
---|
自相似活跃子网前缀空间的路由查找;彭艳兵,龚俭,丁伟,徐加羚;计算机学报(08);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN113779165A (en) | 2021-12-10 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109040343B (en) | Domain name resolution method and device, computer readable storage medium and electronic equipment | |
RU2486586C1 (en) | Method and device for integration of data on point provided by group of suppliers | |
US20200326197A1 (en) | Method, apparatus, computer device and storage medium for determining poi alias | |
KR102236571B1 (en) | Maintaining point of interest data using wireless access points | |
US9042907B2 (en) | Location identification of a portable electronic device based on characteristics of an operating environment of the portable electronic device | |
CN104703125B (en) | Information recommendation method, device and terminal based on instant messaging | |
TW201543859A (en) | Method, apparatus, and system for determining a location of a terminal | |
US20150161207A1 (en) | Assisting query and querying | |
CN111447292B (en) | IPv6 geographical position positioning method, device, equipment and storage medium | |
WO2014161228A1 (en) | Method and server for locating ip position by using position data of mobile terminal | |
CN110837091B (en) | Differential data processing method and receiver testing method | |
US9453741B2 (en) | Navigation system with indexed term searching and method of operation thereof | |
CN113779165B (en) | IP address geographic position ambiguity judging method and related equipment | |
CN112653748A (en) | Information pushing method and device, electronic equipment and readable storage medium | |
CN111832579B (en) | Map interest point data processing method and device, electronic equipment and readable medium | |
US20180035367A1 (en) | Method and Apparatus for Accessing Wifi Access Point in Target Shop | |
US20240273472A1 (en) | Electronic receipt mail processing | |
CN110619027A (en) | House source information recommendation method and device, terminal equipment and medium | |
CN114448849B (en) | Method for detecting supporting mode of IPv6 network of website and electronic equipment | |
CN109511166B (en) | Positioning method and positioning device of equipment | |
CN109996275A (en) | A kind of method and apparatus obtaining network signal coverage information | |
JP4510792B2 (en) | LOCATION ANALYSIS DEVICE, LOCATION ANALYSIS METHOD, ITS PROGRAM, AND RECORDING MEDIUM | |
CN113590909B (en) | Method for positioning geographical position of domain name root mirror image node based on multi-source information | |
CN110749912B (en) | Cycle slip detection method, device, equipment and storage medium | |
CN112187708B (en) | Automatic supplementing method and equipment for certificate chain of digital certificate |
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 |