A method for locating an IP address and a query system for an IP address
Through comparative analysis and fusion correction of different IP address databases, combined with the delay values of detectors and routers, and adopting the principle of "the minority obeys the majority", the problem of inconsistent IP address positioning results and low accuracy in the existing technology is solved. Achieving high-precision and high-confidence IP address positioning.
Patent Information
- Application Number
- CN202211696987.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-28
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2042-12-28
AI Technical Summary
The data in the existing IP address database is uneven, resulting in different IP address positioning results and the accuracy of the positioning results cannot be ensured. The use of a single database results in low credibility of the positioning results.
Through comparative analysis between different IP address databases, the positioning results of the target IP address are fused and corrected based on different IP address databases, the common positioning results are extracted and corrected using preset correction rules, and the delay of the detector and router is combined The value is further revised, and the 'minority obeys the majority' principle is adopted to determine the final positioning result.
It improves the precision and accuracy of IP address positioning, enhances the credibility of positioning results, reduces errors, and ensures the accuracy and reliability of positioning results.
Smart Images

Figure CN116016440B
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to an IP address positioning method and an IP address query system. Background Art
[0002] With the rapid development of the Internet, IP address positioning has been increasingly applied in various fields. Among them, IP address positioning has played an important role in network security, network management, advertising, big data analysis and other fields. At present, the market has not only put forward requirements for positioning accuracy for IP address positioning, but also comprehensively considered positioning efficiency and positioning implementation cost.
[0003] The current IP address positioning methods mainly include methods based on data mining, methods based on network measurement, and methods based on information query. Among them, the current faster method to achieve IP address positioning is to retrieve the mapping relationship between the network IP address and the physical geographical location by querying the established IP address database to determine the positioning result of the IP address. However, the data in the existing IP address database is uneven. On the one hand, due to different data sources, collection methods, and positioning methods used, the positioning results of the IP address will be different; on the other hand, due to the non-standard fields of some IP address positioning data and the interference of dynamic IP, the use of a single IP address database will not be able to ensure the accuracy of the positioning results due to its singleness. Summary of the invention
[0004] In view of this, the purpose of the present application is to provide an IP address positioning method and an IP address query system. The present application performs a fusion correction on the positioning results of the target IP address based on different IP address databases through comparison and analysis between different IP address databases. It can not only obtain positioning results with higher positioning accuracy, but also improve the accuracy of the positioning results.
[0005] In a first aspect, an embodiment of the present application provides a method for locating an IP address, the locating method comprising:
[0006] Obtain first positioning results for the target IP address from multiple IP address databases respectively;
[0007] Performing fusion and correction processing on the first positioning results obtained from multiple IP address databases to obtain a third positioning result for the target IP address;
[0008] Controls the display of third-party positioning results for the target IP address on the map.
[0009] In an optional embodiment of the present application, the step of fusing and correcting the first positioning results obtained from multiple IP address databases to obtain a third positioning result for the target IP address includes:
[0010] Based on the first positioning results obtained from the multiple IP address databases, a common positioning result is extracted from all the first positioning results to obtain a second positioning result;
[0011] Based on the first positioning results obtained from multiple IP address databases, the second positioning result is corrected to obtain a third positioning result for the target IP address.
[0012] In an optional embodiment of the present application, based on the first positioning results obtained from multiple IP address databases, the second positioning result is corrected to obtain a third positioning result for the target IP address, including:
[0013] If it is detected that the first positioning results obtained from multiple IP address databases are the same, the second positioning result is determined to be the third positioning result for the target IP address.
[0014] In an optional embodiment of the present application, based on the first positioning results obtained from multiple IP address databases, the step of correcting the second positioning result to obtain a third positioning result for the target IP address further includes:
[0015] If it is detected that the first positioning results obtained from the multiple IP address databases are different, determining the geographically corrected position at the target positioning accuracy from all the first positioning results;
[0016] If it is detected that a detection machine is provided at the geographical correction location, the detection machine provided at the geographical correction location is controlled to send a detection packet to the target IP address;
[0017] If the detection delay value between the detection machine and the target IP address is detected to be less than the first preset delay threshold according to the detection packet sent by the detection machine, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0018] In an optional embodiment of the present application, based on the first positioning results obtained from multiple IP address databases, the step of correcting the second positioning result to obtain a third positioning result for the target IP address further includes:
[0019] If it is detected that the geographical correction location is not provided with a detector, detecting a relative delay value between the target IP address and a router of the geographical correction location;
[0020] If the relative delay value is less than the second preset delay threshold, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0021] In an optional embodiment of the present application, based on the first positioning results obtained from multiple IP address databases, the step of correcting the second positioning result to obtain a third positioning result for the target IP address further includes:
[0022] Detecting the same number of first positioning results obtained from multiple IP address databases;
[0023] The second positioning result is corrected to the first positioning result with the largest number, and a third positioning result for the target IP address is obtained.
[0024] In an optional embodiment of the present application, the third positioning result includes: an IP address, a positioning accuracy corresponding to the IP address, a geographical location corresponding to the IP address, and a location identifier of the geographical location corresponding to the IP address on a map.
[0025] In an optional embodiment of the present application, the positioning method further includes:
[0026] After obtaining the third positioning result for the target IP address, the first positioning result for the target IP address in the plurality of IP address databases is updated according to the third positioning result.
[0027] In a second aspect, an embodiment of the present application further provides an IP address query system, the query system comprising: a client and a server;
[0028] The client is used to display a query interface on a graphical user interface; in response to a user's input operation on the query interface for a target IP address, obtain a query request for the target IP address, and send the query request for the target IP address to the server;
[0029] The server is used to obtain first positioning results for the target IP address from multiple IP address databases according to the query request of the target IP address; perform fusion and correction processing on the first positioning results obtained from the multiple IP address databases to obtain a third positioning result for the target IP address; and control the display of the third positioning result for the target IP address in the map, so that the third positioning result for the target IP address is displayed in the query interface of the client.
[0030] In an optional embodiment of the present application, the client is further used for:
[0031] After the server obtains the first positioning result for the target IP address, the client displays the first positioning result on the query interface;
[0032] The first positioning result includes: the name of the IP address database, the IP address, the positioning accuracy corresponding to the IP address, and the geographical location corresponding to the IP address.
[0033] The embodiment of the present application provides an IP address positioning method and an IP address query system, which solves the technical problem that the data of the existing IP address database in the prior art is uneven, which not only leads to different IP address positioning results, but also fails to ensure the accuracy of the positioning results. Furthermore, the embodiment of the present application performs a fusion correction on the positioning results of the target IP address based on different IP address databases through comparison and analysis between different IP address databases, which can not only obtain a positioning result with high positioning accuracy, but also improve the accuracy of the positioning result, with high credibility and small error.
[0034] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, preferred embodiments are specifically cited below and described in detail with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0036] Figure 1 A flowchart of a method for locating an IP address provided in an embodiment of the present application;
[0037] Figure 2 A schematic diagram of IP address positioning provided in an embodiment of the present application;
[0038] Figure 3 A schematic diagram of the structure of an IP address query system provided in an embodiment of the present application;
[0039] Figure 4 A schematic diagram of a query interface for a target IP address provided in an embodiment of the present application;
[0040] Figure 5 A schematic diagram of a target IP address location result provided in an embodiment of the present application;
[0041] Figure 6 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0042] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, each other embodiment obtained by those skilled in the art without making creative work belongs to the scope of protection of the present application.
[0043] First, the application scenarios to which this application can be applied are introduced.
[0044] With the rapid development of the Internet, IP address positioning has been increasingly used in various fields. Here, IP address (Internet Protocol Address) refers to the Internet Protocol address, which is the identifier of an Internet device. IP address positioning refers to the method of determining the geographical location of a network device based on the Internet IP address of the network device. Among them, IP address positioning has played an important role in network security, network management, advertising, big data analysis and other fields. At present, the market has not only put forward requirements for positioning accuracy for IP address positioning, but also comprehensively considered positioning efficiency and positioning implementation costs.
[0045] The current IP address positioning methods mainly include methods based on data mining, methods based on network measurement, and methods based on information query. Among them, the current faster method to achieve IP address positioning is to retrieve the mapping relationship between the network IP address and the physical geographical location by querying the constructed IP address database to determine the positioning result of the IP address. However, the data in the existing IP address database is uneven. On the one hand, due to the different data sources, collection methods and positioning methods used, the positioning results of the IP address will be different; on the other hand, due to the non-standard fields of some IP address positioning data and the interference of dynamic IP, the use of a single IP address database will not be able to ensure the accuracy of the positioning result due to its singleness and the low reliability of a single database, making the credibility of the positioning result low.
[0046] Based on this, the embodiments of the present application provide an IP address positioning method and an IP address query system. Through comparison and analysis between different IP address databases, the positioning results of the target IP address are fused and corrected based on different IP address databases. Not only can positioning results with higher positioning accuracy be obtained, but also the accuracy of the positioning results can be improved.
[0047] See also Figure 1 , Figure 1 This is a flow chart of a method for locating an IP address provided in an embodiment of the present application. Figure 1 As shown in , the method for locating an IP address provided in an embodiment of the present application includes:
[0048] S101, respectively obtaining first positioning results for a target IP address from a plurality of IP address databases;
[0049] S102, performing fusion correction processing on the first positioning results obtained from multiple IP address databases to obtain a third positioning result for the target IP address;
[0050] S103: Control display of the third positioning result for the target IP address on the map.
[0051] In step S101, multiple IP address databases may come from different operating companies. Since different operating companies have different ways of collecting IP addresses, this will cause different operating companies to obtain different positioning results for the same IP address. In other words, the first positioning results for the target IP address obtained from multiple IP address databases may be different.
[0052] On the basis of step S101, step S102 needs to fuse and correct the first positioning results for the target IP address obtained from different IP address databases, so as to obtain a third positioning result for the target IP address.
[0053] Among them, fusion processing refers to extracting the same field data in the first positioning result for the target IP address in all IP address databases, so as to ensure that the extracted field data is accurate, has high credibility and small error.
[0054] Correction processing refers to correcting the positioning result obtained through fusion processing using the first positioning results for the target IP address in multiple IP address databases and pre-set correction rules, thereby obtaining a third positioning result with higher positioning accuracy.
[0055] In step S103, the third positioning result for the target IP address is displayed on the map, wherein a location identifier of the target IP address is displayed on the map, and the location identifier corresponds to the third positioning result.
[0056] The embodiment of the present application can obtain a third positioning result with higher positioning accuracy by fusing and correcting the first positioning results for the target IP address obtained from multiple IP address databases, and then display the third positioning result on the map. By comparing and analyzing different IP address databases, not only can a positioning result with higher positioning accuracy be obtained, but also the accuracy of the positioning result can be improved.
[0057] The following is an illustrative description of the IP address location method provided in the embodiment of the present application as applied to the server, but is not limited to this.
[0058] In the embodiment of the present application, step S102 includes:
[0059] Step 1021: based on the first positioning results obtained from the multiple IP address databases, extract a common positioning result from all the first positioning results to obtain a second positioning result;
[0060] Step 1022: Based on the first positioning results obtained from multiple IP address databases, the second positioning result is corrected to obtain a third positioning result for the target IP address.
[0061] In step 1021, the common positioning result refers to the positioning result with the same field data. The positioning results with the same field data are extracted from all the first positioning results to obtain the second positioning result, that is, the second positioning result is the result included in all IP address databases.
[0062] Exemplarily, the first positioning result for the target IP address obtained from the first IP address database is City C, Province B, Country A; the first positioning result for the target IP address obtained from the second IP address database is City D, Province B, Country A; and the first positioning result for the target IP address obtained from the third IP address database is Province B, Country A. Then, after the fusion processing of step 1021, the second positioning result can be obtained as Province B, Country A.
[0063] In step 1022, the second positioning result obtained through fusion processing is corrected using the first positioning results for the target IP address in multiple IP address databases and a pre-set correction rule, thereby obtaining a third positioning result with higher positioning accuracy.
[0064] In one embodiment, the IP address location provided in the embodiments of the present application is performed according to the following steps:
[0065] Step 1: Step 1022 includes:
[0066] Step 10221: If it is detected that the first positioning results obtained from multiple IP address databases are the same, determine that the second positioning result is the third positioning result for the target IP address.
[0067] Here, detecting whether the first positioning results obtained from multiple IP address databases are the same requires detecting whether the corresponding fields in the multiple first positioning results are the same.
[0068] Furthermore, if the first positioning results obtained from multiple IP address databases are the same, it means that the second positioning result is any one of the first positioning results obtained from the multiple IP address databases, and further, the third positioning result for the target IP address finally determined is also any one of the first positioning results obtained from the multiple IP address databases.
[0069] In the above method, when the first positioning results obtained in all IP address databases are the same, it means that the positioning result of the target IP address is the first positioning result. This is determined through comparative analysis between different IP address databases, and the accuracy of the positioning result can be basically determined.
[0070] Step 2: Step 1022 also includes:
[0071] Step 10222: if it is detected that the first positioning results obtained from the multiple IP address databases are different, determine the geographically corrected position at the target positioning accuracy from all the first positioning results;
[0072] Step 10223: If it is detected that a detection machine is set at the geographical correction location, the detection machine set at the geographical correction location is controlled to send a detection packet to the target IP address;
[0073] Step 10224: if the detection delay value between the detector and the target IP address is less than the first preset delay threshold value, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address;
[0074] Step 10225: If it is detected that the geographical correction location is not provided with a detector, then the relative delay value between the target IP address and the router of the geographical correction location is detected;
[0075] Step 10226: If the relative delay value is less than the second preset delay threshold, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0076] In the above step 10222, the geographically corrected position is determined by the following steps:
[0077] The target positioning accuracy is determined based on all the first positioning results; wherein the target positioning accuracy is the positioning accuracy of the first positioning results included in some IP address databases; here, the target positioning accuracy is the most accurate positioning accuracy in all IP address databases.
[0078] Among them, positioning accuracy refers to the degree of proximity between the spatial entity location information (usually coordinates) and its actual location. The positioning accuracy in the embodiment of the present application refers to the degree of proximity between the first positioning result for the IP address and its actual location. Here, the higher the positioning accuracy, the more accurate the positioning result for the IP address.
[0079] For example, the first positioning result for the target IP address obtained from the first IP address database is country A, province B, city C, and its positioning accuracy is city; the first positioning result for the target IP address obtained from the third IP address database is country A, province B, and its positioning accuracy is province. At this time, it can be considered that the positioning accuracy of the first positioning result for the target IP address obtained from the first IP address database is different from that of the first positioning result for the target IP address obtained from the third IP address database.
[0080] According to the first positioning result included in the partial IP address database, a geographically corrected position with a target positioning accuracy is determined; wherein the geographically corrected position includes at least one geographical location.
[0081] Exemplarily, the first positioning result for the target IP address obtained from the first IP address database is City C, Province B, Country A; the first positioning result for the target IP address obtained from the second IP address database is City D, Province B, Country A; the first positioning result for the target IP address obtained from the third IP address database is Province B, Country A; then the target positioning accuracy is city, and the geographically corrected position is City C and City D.
[0082] In the above steps 10223 and 10224, the geographically corrected position at which the detection delay value between the detector and the target IP address is less than the first preset delay threshold is the geographically corrected position that is the actual location of the target IP address. Then, the second positioning result is corrected using the geographically corrected position to obtain the corrected third positioning result of the target IP address.
[0083] It should be noted that when there are multiple geographic correction locations, the detector set at each geographic correction location is controlled to send a detection packet to the target IP address; if the detection delay value between multiple detectors and the target IP address is detected to be less than the first preset delay threshold according to the detection packet sent by the detector, the geographic correction location where the detector corresponding to the minimum detection delay value is located is selected to correct the second positioning result to obtain the third positioning result for the target IP address.
[0084] In actual application scenarios, if there is no detector at the geographically corrected location under the target positioning accuracy, it is impossible to send a detection packet to the target IP address for detection. At this time, it is necessary to use the router at the geographically corrected location for route tracking. Then, route tracking is used to locate the IP address in steps 10225 and 10226.
[0085] Here, since there must be a router in each geographical location, the actual location of the target IP address can be detected by routing traceback, which can overcome the disadvantage that the geographical location without a detector cannot be detected to a certain extent. Among them, the routing traceback command uses the ICMP protocol to locate all routers between the computer at the geographical correction location and the target IP address. The TTL value can reflect the number of routers or gateways that the data packet passes through. By manipulating the TTL value of the independent ICMP call message and observing the return information of the message being discarded, the traceroute command can traverse all routers on the data packet transmission path.
[0086] It should be noted that when there are multiple geographic correction locations and none of these multiple geographic correction locations are equipped with detectors, the relative delay value between the target IP address and the router of each geographic correction location is detected; if there are multiple relative delay values that are less than the second preset delay threshold, the geographic correction location where the router corresponding to the minimum relative delay value is located is selected to correct the second positioning result to obtain a third positioning result for the target IP address.
[0087] The first preset delay threshold and the second preset delay threshold are both set according to actual conditions and can be adjusted in real time. Preferably, the first preset delay threshold and the second preset delay threshold are the same.
[0088] By correcting the positioning result of the target IP address through the above-mentioned delay-based correction method, the positioning results for the target IP address in different IP address databases can be effectively unified, and the data information in different IP address databases can be sorted and summarized to obtain a third positioning result. The third positioning result summarizes all attribute fields of the target IP address (including the IP address, the positioning accuracy corresponding to the IP address, the geographical location corresponding to the IP address, and the location mark of the geographical location corresponding to the IP address on the map, etc.), thereby effectively enhancing the uniformity of data in different IP address databases, not only can a positioning result with higher positioning accuracy be obtained, but also the accuracy of the positioning result can be improved.
[0089] Step 3: Step 1022 also includes:
[0090] Step 10227, detect the same number of first positioning results obtained from multiple IP address databases; correct the second positioning result to the first positioning result with the largest number, and obtain a third positioning result for the target IP address.
[0091] Here, if there is no detection data for correction, the "minority obeys majority" principle is adopted, and the first positioning result corresponding to the largest number of identical first positioning results is determined as the second positioning result, and then the second positioning result is determined as the third positioning result for the target IP address.
[0092] Determining the third positioning result of the target IP address through the above-mentioned "minority obeys majority" principle can improve the accuracy of IP address positioning to a certain extent and have a certain degree of credibility. Among them, the "minority obeys majority" principle can reduce the positioning error of the IP address.
[0093] The third positioning result includes: the IP address, the positioning accuracy corresponding to the IP address, the geographical location corresponding to the IP address, and the position identifier of the geographical location corresponding to the IP address on the map.
[0094] Here, the positioning accuracy corresponding to the IP address refers to the geographical area to which the geographical location corresponding to the IP address is ultimately accurate. For example, in Province B of Country A, the positioning accuracy is the province; for City C of Province B of Country A, the positioning accuracy is the city; the geographical location corresponding to the IP address includes the continent, country code, country, province, city, district, county, longitude, latitude, time zone, etc.; the location identifier of the geographical location corresponding to the IP address on the map is the map icon.
[0095] Exemplarily, the method for locating an IP address is illustrated by giving examples, wherein four cases are described respectively: Case 1: the first locating result of the IP address database (S1) for the target IP address (IPv1 address) is country A, province B, city C; the first locating result of the IP address database (S2) for the target IP address (IPv1 address) is country A, province B, city C; the first locating result of the IP address database (S3) for the target IP address (IPv1 address) is country A, province B, city C; Case 2: the first locating result of the IP address database (S1) for the target IP address (IPv2 address) is country A, province B; the first locating result of the IP address database (S2) for the target IP address (IPv2 address) is country A, province B, city C; the first locating result of the IP address database (S3) for the target IP address (IPv1 address) is country A, province B, city C; v2 address) is Country A, Province B; Case 3: The first positioning result of the IP address database (S1) for the target IP address (IPv3 address) is Country A, Province B, City C, the first positioning result of the IP address database (S2) for the target IP address (IPv3 address) is Country A, Province B, City E, and the first positioning result of the IP address database (S3) for the target IP address (IPv3 address) is Country A, Province B; Case 4: The first positioning result of the IP address database (S1) for the target IP address (IPv4 address) is Country A, Province B, City C, the first positioning result of the IP address database (S2) for the target IP address (IPv4 address) is Country A, Province B, City C, and the first positioning result of the IP address database (S3) for the target IP address (IPv4 address) is Country A, Province B, City D.
[0096] like Figure 2 As shown, for situation 1, since the first positioning results for the target IP address (IPv1 address) obtained from the three IP address databases (S1, S2, S3) are all the same (all in Country A, Province B, City C), a common positioning result is extracted from them to obtain a second positioning result. At this time, the second positioning result is the same as any of the first positioning results, that is, the second positioning result is Country A, Province B, City C; since the first positioning results for the IPv1 address obtained from the three IP address databases (S1, S2, S3) have the same positioning accuracy and the same first positioning results, the second positioning result is determined as the third positioning result, that is, the third positioning result of the IPv1 address is Country A, Province B, City C. Here, since the positioning accuracy of the first positioning results is the same and the first positioning results are the same, the first positioning results (Country A, Province B, City C) in the three IP address databases can be directly merged to obtain the third positioning result (Country A, Province B, City C) of the target IP address (IPv1 address).
[0097] For situation 2, based on the first positioning results for the target IP address (IPv2 address) obtained from the three IP address databases (S1, S2, S3), a common positioning result is extracted from all the first positioning results to obtain a second positioning result. At this time, the second positioning result is Province B in Country A. Since the positioning accuracy of the first positioning results for the IPv2 address obtained from the three IP address databases (S1, S2, S3) is different, the geographically corrected position under the target positioning accuracy (city) is determined from all the first positioning results to be City C, where in City C A detector 201 is provided, and the detector 201 set in City C is controlled to send a detection packet to the IPv2 address 202. If the detection delay value between the detector 201 and the IPv2 address 202 is detected to be less than the first preset delay threshold according to the detection packet sent by the detector 201, here, the detection delay value between the detector 201 in City C and the IPv2 address 202 is 1.5ms, and the first preset delay threshold is 2ms, then the second positioning result (Country A, Province B) is corrected using City C, and the third positioning result for the IPv2 address 202 is City C, Province B, Country A.
[0098] In the above situation 2, the detector in City C is first controlled to send ICMP or Traceroute detection packets to the target IP address. If it is found that the detection delay value between the detector in City C and the target IP address is less than the first preset delay threshold, the system displays the third positioning result as City C, Province B, Country A after system delay correction. The system can improve the positioning accuracy of the IP address through delay correction.
[0099] For situation 3, based on the first positioning results for the target IP address (IPv3 address) obtained from the three IP address databases (S1, S2, S3), a common positioning result is extracted from all the first positioning results to obtain a second positioning result. At this time, the second positioning result is Province B, Country A. Since the positioning accuracy of the first positioning results for IPv3 address 203 obtained from the three IP address databases (S1, S2, S3) is different, the geographically corrected position under the target positioning accuracy (city) is determined from all the first positioning results to be City C and City E, wherein, City C and City E are not If a detector is provided, the relative delay values between the IPv3 address 203 and the routers 204 in City C and City E are detected respectively; here, the relative delay value between the IPv3 address and City C is 1.5ms, the relative delay value between the IPv3 address and City E is 23ms, and the second preset delay threshold is 2ms. Therefore, the relative delay value between the IPv3 address and City C is less than the second preset delay threshold, and the relative delay value between the IPv3 address and City E is greater than the second preset delay threshold. City C is used to correct Province B in Country A, and the third positioning result for the IPv3 address is City C in Province B in Country A.
[0100] In the above situation 3, if City C and City E are not equipped with detection machines, that is, when the detection packet cannot be sent, it is determined whether the relative delay between the target IP address and the routers of City C and City E is less than the second preset delay threshold. The system obtains that the relative delay value between the IPv3 address and City C is less than the second preset delay threshold, and the relative delay value between the IPv3 address and City E is greater than the second preset delay threshold. Then the third positioning result displayed by the system is City C, Province B, Country A after system delay correction. The system can improve the positioning accuracy of the IP address through delay correction.
[0101] For situation 4, based on the first positioning results for the target IP address (IPv4 address) obtained from the three IP address databases (S1, S2, S3), the common positioning results are extracted from all the first positioning results to obtain the second positioning result, and the second positioning result at this time is Country A, Province B; since the positioning accuracy of the first positioning results for the target IP address (IPv4 address) obtained from the three IP address databases (S1, S2, S3) is the same, the positioning accuracy is all cities, but not all the first positioning results are the same, so the number of the same first positioning results is detected, among which the number of Country A, Province B, City C is 2, and the number of Country A, Province B, City D is 1. According to the principle of "the minority obeys the majority", the second positioning result is corrected to the first positioning result with the largest number, that is, the second positioning result is Country A, Province B, City C, and then the third positioning result for the IPv4 address is Country A, Province B, City C. Here, the principle of the minority obeys the majority is adopted to further improve the accuracy of IP address positioning. In addition, when there is no accurate detection data for correction and judgment, the principle of the minority obeys the majority can also be adopted to determine the positioning result of the IP address.
[0102] In another embodiment, the IP address location provided in the embodiment of the present application is performed according to the following steps:
[0103] Step 102211: Check whether the positioning accuracy of the first positioning results obtained from multiple IP address databases is the same.
[0104] Step 102222: If they are the same, use the first correction method to correct the second positioning result to obtain a third positioning result for the target IP address.
[0105] Step 102233: If they are different, use the second correction method to correct the second positioning result to obtain a third positioning result for the target IP address.
[0106] In the above steps 102222 and 102233, if the positioning accuracies are the same, the first correction method is used to correct the second positioning result; if the positioning accuracies are different, the second correction method is used to correct the second positioning result.
[0107] Wherein, step 102222 specifically includes:
[0108] Detecting whether the first positioning results obtained from multiple IP address databases are the same;
[0109] If they are the same, the second positioning result is determined to be the third positioning result for the target IP address;
[0110] If they are different, the number of identical first positioning results obtained from multiple IP address databases is detected; the second positioning result is corrected to the first positioning result with the largest number, and a third positioning result for the target IP address is obtained.
[0111] Here, if the first positioning results obtained from multiple IP address databases are different, the principle of "the minority obeys the majority" is adopted to determine the first positioning result corresponding to the largest number of identical first positioning results as the second positioning result, and then determine the second positioning result as the third positioning result for the target IP address. Furthermore, by determining the third positioning result of the target IP address through the above-mentioned principle of "the minority obeys the majority", the accuracy of IP address positioning can be improved to a certain extent, and it has a certain degree of credibility, wherein the principle of "the minority obeys the majority" can reduce the positioning error of the IP address.
[0112] In an optional embodiment of the present application, step 102233 specifically includes:
[0113] Determine the geographically corrected position of the target at the positioning accuracy from all the first positioning results;
[0114] If it is detected that a detection machine is set at the geographical correction location, the detection machine set at the geographical correction location is controlled to send a detection packet to the target IP address;
[0115] If the detection delay value between the detector and the target IP address is less than the first preset delay threshold value, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address;
[0116] If it is detected that there is no detector at the geographical correction location, the relative delay value between the target IP address and the router at the geographical correction location is detected;
[0117] If the relative delay value is less than the second preset delay threshold, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0118] It should be noted that the features involved in this embodiment can refer to the description of the corresponding features in the previous embodiment, and will not be repeated here.
[0119] In an optional embodiment of the present application, the method for locating an IP address further includes:
[0120] After obtaining the third positioning result for the target IP address, the first positioning result for the target IP address in the plurality of IP address databases is updated according to the third positioning result.
[0121] By updating the location results of the IP address in the IP address database in real time, the accuracy of the location results of the IP address stored in the IP address database can be improved, making it easier to retrieve the location results of the IP address from the IP address database in the future, thereby indirectly improving the speed of determining the location results of the IP address.
[0122] The IP address positioning method provided in the embodiment of the present application solves the technical problem that the data of the existing IP address database is uneven in the prior art, which not only leads to different IP address positioning results, but also fails to ensure the accuracy of the positioning results. Furthermore, the embodiment of the present application performs a fusion correction on the positioning results of the target IP address based on different IP address databases through comparison and analysis between different IP address databases, which can not only obtain a positioning result with high positioning accuracy, but also improve the accuracy of the positioning result, with high credibility and small error.
[0123] Based on the same concept, in the IP address query system provided in the embodiment of the present application, the server executes the above-mentioned IP address locating method, that is, the principle of solving the problem by the server is similar to the above-mentioned IP address locating method in the embodiment of the present application. Therefore, part of the implementation of the IP address query system can refer to the implementation of the method, and the repeated parts will not be repeated.
[0124] See also Figure 3 , Figure 3 An IP address query system provided in an embodiment of the present application includes a client 301 and a server 302;
[0125] The client 301 is used to display a query interface on a graphical user interface; in response to a user input operation on the query interface for a target IP address, obtain a query request for the target IP address, and send the query request for the target IP address to the server;
[0126] The server 302 is used to obtain first positioning results for the target IP address from multiple IP address databases according to the query request of the target IP address; perform fusion and correction processing on the first positioning results obtained from the multiple IP address databases to obtain a third positioning result for the target IP address; and control the display of the third positioning result for the target IP address in the map, so that the third positioning result for the target IP address is displayed in the query interface of the client 301.
[0127] Here, the IP address query system can analyze and process the query request for the target IP address submitted by the user, and then query the positioning result corresponding to the target IP address from the configured multiple IP address databases. During the query process, the various positioning results of the target IP address obtained can be compared and listed in the form of unified standard fields. The various positioning results of the target IP address are processed according to the processing rules set internally by the server (multiple database fusion, delay-based correction and the principle of minority obeys majority), and finally a more accurate positioning result of the target IP address is obtained and displayed on the map.
[0128] In an optional embodiment of the present application, the client 301 is further used for:
[0129] After the server obtains the first positioning result for the target IP address, the client displays the first positioning result on the query interface; wherein the first positioning result includes: the IP address database name, the IP address, the positioning accuracy corresponding to the IP address, and the geographical location corresponding to the IP address.
[0130] In the above steps, during the query process, the various positioning results of the target IP address obtained can be compared and listed in a unified standard field format for easy observation by the user.
[0131] Exemplarily, an address query box can be set on the query system of the client, and in response to the user entering the target IP address in the address query box, a first positioning result can be directly displayed on the query interface, and the first positioning result includes: the IP address database name, IP address, the positioning accuracy corresponding to the IP address, and the geographical location corresponding to the IP address (continent, country code, country, province, city, district, county, longitude, latitude, time zone, zip code, etc.); click the "Result Query" button on the query interface to display the third positioning result of the target IP address in the query interface, wherein the third positioning result includes: the IP address, the positioning accuracy corresponding to the IP address, the geographical location corresponding to the IP address, and the location identifier of the geographical location corresponding to the IP address on the map.
[0132] For example, Figure 4 and Figure 5 As shown, in Figure 4In the address query box 401, enter the target IP address: 2xx.xxx.xx.xxx, x represents any number from 0 to 9, and the first positioning result 402 in different IP address databases can be displayed on the query interface 400. At this time, the first positioning result 402 includes multiple IP address database names, such as Maxmind, IP2location, DB-IP, etc.; the IP address is 2xx.xxx.xx.xxx, and the positioning accuracy corresponding to the IP address is the geographical location corresponding to the city and the IP address, such as Y continent, Z country, K city, latitude 3x.xxxxxx, longitude 1xx.xxxxxx, postal code 1xxxxx, time zone UTC+x, etc. By clicking the result query button 403 on the query interface, the third positioning result 404 of the target IP address can be displayed in the query interface 400, such as Figure 5 As shown, such as IP address: 2xx.xxx.xx.xxx; positioning accuracy: city; continent: continent Y; country code: Q; country: country Z; province: city K; city: city K; latitude: 3x.xxxxxx, longitude: 1xx.xxxxxx; postal code: 1xxxxx, time zone: UTC+x.
[0133] In an optional embodiment of the present application, the server 302 is specifically used for:
[0134] Based on the first positioning results obtained from the multiple IP address databases, a common positioning result is extracted from all the first positioning results to obtain a second positioning result;
[0135] Based on the first positioning results obtained from the multiple IP address databases, the second positioning result is corrected to obtain a third positioning result for the target IP address.
[0136] In an optional embodiment of the present application, the server 302 is further configured to:
[0137] If it is detected that the first positioning results obtained from the multiple IP address databases are the same, the second positioning result is determined to be the third positioning result for the target IP address.
[0138] In an optional embodiment of the present application, the server 302 is further configured to:
[0139] If it is detected that the first positioning results obtained from the multiple IP address databases are different, determining the geographically corrected position of the target at the positioning accuracy from the first positioning results;
[0140] If it is detected that a detection machine is set at the geographical correction location, the detection machine set at the geographical correction location is controlled to send a detection packet to the target IP address;
[0141] If the detection delay value between the detector and the target IP address is less than the first preset delay threshold value, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0142] In an optional embodiment of the present application, the server 302 is further configured to:
[0143] If it is detected that there is no detector at the geographical correction location, the relative delay value between the target IP address and the router at the geographical correction location is detected;
[0144] If the relative delay value is less than the second preset delay threshold, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
[0145] In an optional embodiment of the present application, the server 302 is further configured to:
[0146] Detecting the same number of first positioning results obtained from multiple IP address databases;
[0147] The second positioning result is corrected to the first positioning result with the largest number, and a third positioning result for the target IP address is obtained.
[0148] The third positioning result includes: the IP address, the positioning accuracy corresponding to the IP address, the geographical location corresponding to the IP address, and the position identifier of the geographical location corresponding to the IP address on the map.
[0149] In an optional embodiment of the present application, the server 302 is further configured to:
[0150] After obtaining the third positioning result for the target IP address, the first positioning results for the target IP address in the plurality of IP address databases are updated according to the third positioning result.
[0151] The query system for IP addresses provided in the embodiment of the present application compares and analyzes the positioning results of different IP address databases through a server, uses multi-database fusion, correction based on delay and the principle of minority obeying majority, effectively unifies the positioning results of different IP address databases, and obtains the final positioning result of the IP address. The final positioning result summarizes all attribute fields (including IP address, positioning accuracy corresponding to the IP address, geographical location corresponding to the IP address, and location identification of the geographical location corresponding to the IP address in the map, etc.), thereby effectively enhancing the uniformity of different IP address databases. Furthermore, by comprehensively analyzing and comparing the positioning results of multiple IP address databases through the query system and then displaying them, it can not only quickly and efficiently help analysts accurately grasp the differences between the positioning results of different IP address databases, but also recommend accurate positioning results to users, thereby improving the accuracy of the positioning results, and solving the problems of low credibility, large error range, lack of reference, and difficulty in comparing differences in positioning of a single IP address database.
[0152] See also Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 6 As shown in , the electronic device 600 includes a processor 601 , a memory 602 and a bus 603 .
[0153] The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device 600 is running, the processor 601 communicates with the memory 602 via the bus 603. When the machine-readable instructions are executed by the processor 601, the above-mentioned Figure 1 The steps of the method for locating the IP address in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0154] The present application also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the computer program can execute the above-mentioned Figure 1 The steps of the method for locating the IP address in the method embodiment shown, the specific implementation method can be found in the method embodiment, and will not be repeated here.
[0155] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0156] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.
[0157] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0158] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0159] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a non-volatile computer-readable storage medium that is executable by a processor. Based on this understanding, the technical solution of the present application can essentially be embodied in the form of a software product, or in other words, the part that contributes to the prior art or the part of the technical solution. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0160] Finally, it should be noted that the above-described embodiments are only specific implementation methods of the present application, which are used to illustrate the technical solutions of the present application, rather than to limit them. The protection scope of the present application is not limited thereto. Although the present application is described in detail with reference to the above-mentioned embodiments, ordinary technicians in the field should understand that any technician familiar with the technical field can still modify the technical solutions recorded in the above-mentioned embodiments within the technical scope disclosed in the present application, or can easily think of changes, or make equivalent replacements for some of the technical features therein; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.
Claims
1. A method for locating an IP address, characterized in that: The positioning method comprises: Obtain first positioning results for the target IP address from multiple IP address databases respectively; Based on the first positioning results obtained from the multiple IP address databases, a common positioning result is extracted from all the first positioning results to obtain a second positioning result; Based on the first positioning results obtained from the multiple IP address databases, the second positioning result is corrected to obtain a third positioning result for the target IP address; Control the display of third-party positioning results for the target IP address on the map; The step of correcting the second positioning result based on the first positioning result obtained from the multiple IP address databases to obtain a third positioning result for the target IP address includes: If it is detected that the first positioning results obtained from the multiple IP address databases are different, determining the geographically corrected position at the target positioning accuracy from all the first positioning results; If it is detected that a detection machine is provided at the geographical correction location, the detection machine provided at the geographical correction location is controlled to send a detection packet to the target IP address; If the detection delay value between the detection machine and the target IP address is detected to be less than the first preset delay threshold according to the detection packet sent by the detection machine, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
2. The positioning method according to claim 1, characterized in that: The step of correcting the second positioning result based on the first positioning result obtained from the plurality of IP address databases to obtain a third positioning result for the target IP address also includes: If it is detected that the first positioning results obtained from multiple IP address databases are the same, the second positioning result is determined to be the third positioning result for the target IP address.
3. The positioning method according to claim 1, characterized in that: The step of correcting the second positioning result based on the first positioning result obtained from the plurality of IP address databases to obtain a third positioning result for the target IP address also includes: If it is detected that the geographical correction location is not provided with a detector, detecting a relative delay value between the target IP address and a router of the geographical correction location; If the relative delay value is less than the second preset delay threshold, the second positioning result is corrected using the geographic correction position to obtain a third positioning result for the target IP address.
4. The positioning method according to claim 3, characterized in that: The step of correcting the second positioning result based on the first positioning result obtained from the plurality of IP address databases to obtain a third positioning result for the target IP address also includes: Detecting the same number of first positioning results obtained from multiple IP address databases; The second positioning result is corrected to the first positioning result with the largest number, and a third positioning result for the target IP address is obtained.
5. The positioning method according to claim 1, characterized in that: The third positioning result includes: the IP address, the positioning accuracy corresponding to the IP address, the geographical location corresponding to the IP address, and the position identifier of the geographical location corresponding to the IP address in the map.
6. The positioning method according to claim 1, characterized in that: The positioning method further includes: After obtaining the third positioning result for the target IP address, the first positioning result for the target IP address in the plurality of IP address databases is updated according to the third positioning result.
7. An IP address query system, characterized in that: The query system includes: a client and a server; The client is used to display a query interface on a graphical user interface; in response to a user's input operation on the query interface for a target IP address, obtain a query request for the target IP address, and send the query request for the target IP address to the server; The server is used to obtain first positioning results for the target IP address from multiple IP address databases according to the query request of the target IP address; based on the first positioning results obtained from the multiple IP address databases, extract a common positioning result from all the first positioning results to obtain a second positioning result; if it is detected that the first positioning results obtained from the multiple IP address databases are different, determine the geographical correction position with the target positioning accuracy from all the first positioning results; if it is detected that a detector is set at the geographical correction position, control the detector set at the geographical correction position to send a detection packet to the target IP address; if it is detected that the detection delay value between the detector and the target IP address is less than a first preset delay threshold according to the detection packet sent by the detector, use the geographical correction position to correct the second positioning result to obtain a third positioning result for the target IP address; control the display of the third positioning result for the target IP address in the map, so that the query interface of the client displays the third positioning result for the target IP address.
8. The query system according to claim 7, characterized in that: The client is also used to: After the server obtains the first positioning result for the target IP address, the client displays the first positioning result on the query interface; The first positioning result includes: the name of the IP address database, the IP address, the positioning accuracy corresponding to the IP address, and the geographical location corresponding to the IP address.
