CN107613043A - The regional information searching method and its device of IP address - Google Patents

The regional information searching method and its device of IP address Download PDF

Info

Publication number
CN107613043A
CN107613043A CN201710883969.1A CN201710883969A CN107613043A CN 107613043 A CN107613043 A CN 107613043A CN 201710883969 A CN201710883969 A CN 201710883969A CN 107613043 A CN107613043 A CN 107613043A
Authority
CN
China
Prior art keywords
address
mapping relation
target
region information
mapping
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.)
Withdrawn
Application number
CN201710883969.1A
Other languages
Chinese (zh)
Inventor
梁希云
秦锋剑
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Green Bay Network Technology Co Ltd
Original Assignee
Grass Count Language (beijing) Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Grass Count Language (beijing) Technology Co Ltd filed Critical Grass Count Language (beijing) Technology Co Ltd
Priority to CN201710883969.1A priority Critical patent/CN107613043A/en
Publication of CN107613043A publication Critical patent/CN107613043A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention proposes a kind of the regional information searching method and its device of IP address, wherein, method includes:Obtain the mapping relations of IP address;Wherein, mapping relations include regional information corresponding to IP address and IP address;By mapping relations storage into application program;Generate IP address retrieval request;Wherein, IP address retrieval request includes target ip address to be retrieved;According to target ip address, inquired about in mapping relations, obtain the target area information matched with target ip address.This method, which can be realized, is transferred to the IP address retrieval request in server in application program, the regional information matched with IP address is obtained by application program inquiry, so as to reduce the pressure of server.

Description

Method and device for searching regional information of IP address
Technical Field
The invention relates to the technical field of internet, in particular to a regional information searching method and a regional information searching device for an IP address.
Background
In internet applications, a user has a need to obtain region information corresponding to an IP address according to the IP address. In the prior art, a server may receive an IP address retrieval request sent by a user, then search for region information corresponding to the IP address in a database of a cloud server, and after obtaining matched region information, the user may obtain the region information through a network access service interface.
In practical applications, it can be seen that the server needs to bear a larger access amount, thereby causing a larger resource consumption and a larger load of the server.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art.
Therefore, a first object of the present invention is to provide a method for searching for geographic information of an IP address, so as to transfer an IP address retrieval request in a server to an application program, and query and acquire geographic information matching the IP address by the application program, thereby reducing the pressure of the server, and being used to solve the problems that the existing server needs to bear a large access amount, and thus the resource consumption of the server is large and the load is large.
The second purpose of the invention is to provide another method for searching the regional information of the IP address.
A third object of the invention is to propose an application.
A fourth object of the present invention is to provide a server.
A fifth object of the invention is to propose a computer device.
A sixth object of the invention is to propose a computer program product.
A seventh object of the invention is to propose a non-transitory computer-readable storage medium.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a method for searching geographic information of an IP address, including:
acquiring a mapping relation of an IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
storing the mapping relation into an application program;
generating an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved;
and inquiring the mapping relation according to the target IP address to acquire target region information matched with the target IP address.
According to the method for searching the regional information of the IP address, disclosed by the embodiment of the invention, the mapping relation of the IP address is obtained, the mapping relation is stored in an application program, and then an IP address retrieval request is generated, wherein the IP address retrieval request comprises a target IP address to be retrieved, and the target regional information matched with the target IP address is obtained by inquiring in the mapping relation according to the target IP address. Therefore, the IP address retrieval request in the server can be transferred to the application program, and the application program inquires and acquires the region information matched with the IP address, so that the pressure of the server is reduced.
In order to achieve the above object, an embodiment of a second aspect of the present invention provides another method for searching for geographical information of an IP address, including:
acquiring an IP address and region information corresponding to the IP address, and constructing a mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
updating the mapping relation;
and issuing the updated mapping relation to an application program.
The method for searching the regional information of the IP address comprises the steps of acquiring the IP address and the regional information corresponding to the IP address, and constructing a mapping relation of the IP address; the mapping relation comprises the IP address and the region information corresponding to the IP address, the mapping relation is updated, and then the updated mapping relation is issued to the application program. Therefore, the mapping relation can be updated at the server side, dynamic maintenance of the mapping relation is realized, and real-time performance of data acquisition of a user is guaranteed.
To achieve the above object, an embodiment of a third aspect of the present invention provides an application program, including:
the obtaining module is used for obtaining the mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
the storage module is used for storing the mapping relation into an application program;
the generation module is used for generating an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved;
and the query acquisition module is used for querying the mapping relation according to the target IP address and acquiring the region information matched with the target IP address.
According to the application program of the embodiment of the invention, the mapping relation of the IP address is obtained, the mapping relation is stored in the application program, and then the IP address retrieval request is generated, wherein the IP address retrieval request comprises the target IP address to be retrieved, and the target region information matched with the target IP address is obtained by inquiring in the mapping relation according to the target IP address. Therefore, the IP address retrieval request in the server can be transferred to the application program, and the application program inquires and acquires the region information matched with the IP address, so that the pressure of the server is reduced.
To achieve the above object, a fourth aspect of the present invention provides a server, including:
the acquisition and construction module is used for acquiring an IP address and region information corresponding to the IP address and constructing a mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
and the updating and issuing module is used for updating the mapping relation and issuing the updated mapping relation to an application program.
The server of the embodiment of the invention constructs the mapping relation of the IP address by acquiring the IP address and the region information corresponding to the IP address; the mapping relation comprises the IP address and the region information corresponding to the IP address, the mapping relation is updated, and then the updated mapping relation is issued to the application program. Therefore, the mapping relation can be updated at the server side, dynamic maintenance of the mapping relation is realized, and real-time performance of data acquisition of a user is guaranteed.
To achieve the above object, a fifth embodiment of the present invention provides a computer device, including: a processor and a memory; the processor reads the executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the method for searching the geographical information of the IP address according to the embodiment of the first aspect of the present invention, or the method for searching the geographical information of the IP address according to the embodiment of the second aspect of the present invention.
To achieve the above object, a sixth aspect of the present invention provides a computer program product, wherein instructions in the computer program product, when executed by a processor, are configured to implement the method for searching for geographical information of an IP address according to the first aspect of the present invention, or the method for searching for geographical information of an IP address according to the second aspect of the present invention.
To achieve the above object, a seventh embodiment of the present invention provides a non-transitory computer-readable storage medium, having a computer program stored thereon, where the computer program is executed by a processor to implement the method for searching for geographical information of an IP address according to the first embodiment of the present invention or the method for searching for geographical information of an IP address according to the second embodiment of the present invention.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The foregoing and/or additional aspects and advantages of the present invention will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
fig. 1 is a schematic flowchart of a first method for searching geographical information of an IP address according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second method for searching geographical information of an IP address according to an embodiment of the present invention;
fig. 3 is a flowchart illustrating a third method for searching geographical information of an IP address according to an embodiment of the present invention;
fig. 4 is a schematic flowchart of a fourth method for searching geographical information of an IP address according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an application according to an embodiment of the present invention;
FIG. 6 is a block diagram of another application according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
A method and an apparatus for searching for geographical information of an IP address according to an embodiment of the present invention will be described with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a first method for searching geographical information of an IP address according to an embodiment of the present invention.
The execution main body of the embodiment of the present invention may be an application program, and the application program may be installed in a terminal device, and the terminal device may be, for example, a hardware device having various operating systems, such as a smart phone, a tablet computer, a personal digital assistant, and an electronic book.
As shown in fig. 1, the method for searching the geographical information of the IP address includes the following steps:
step S101, obtaining a mapping relation of an IP address; the mapping relation comprises an IP address and region information corresponding to the IP address.
In practical applications, each IP address has a corresponding geographical information. In this embodiment, the regional information may include, for example, network type information such as country, city, home, street, specific cell, network operator, WiFi, and/or mobile network. The region information may be, for example: beijing, Haihu district, Haihu street; moving; 4G network.
In a specific implementation, the application may send an acquisition request to the server, and after receiving the acquisition request, the server may send the mapping relationship of the IP address to the application, so that the application may receive the mapping relationship.
Or, in order to implement the real-time property of data acquisition, the mapping relationship in the server may be dynamically updated, and when the server monitors that the mapping relationship is updated, the updated mapping relationship may be automatically issued to the application program, so that the application program may receive the mapping relationship.
It is understood that the same region information may correspond to one IP address, or to a plurality of IP addresses, or to one IP address range. For example, referring to table 1, the regional information is: beijing, Haihu district, east of Zhongguancun; communicating; the WIFI network has the corresponding IP addresses as follows: 123.134.145.156 to 123.134.145.189, or the region information is: hangzhou city, Binjiang district, south loop; telecommunications; the corresponding IP address of the 4G network is as follows: 123.135.149.123 to 123.137.152.139. Therefore, in this embodiment, for each region information, the server may establish an association between a plurality of IP addresses and the region information to form a mapping relationship, that is, the mapping relationship is formed by establishing an association between a plurality of IP addresses belonging to the same region information and the region information.
Or, since the same region information may correspond to a plurality of IP addresses, in this embodiment, the server may identify, from the plurality of IP addresses, an IP start address and an IP end address belonging to the same region information, for example, referring to table 1, the belonging region information is < beijing city, hai lake district, middle guan village east road; communicating; WIFI network > has an IP start address of 123.134.145.156 and an IP end address of 123.134.145.189. Then, for each region information, the server may establish an association between the IP start address, the IP end address, and the region information to form a mapping relationship, that is, the mapping relationship is formed by establishing an association between the IP start address, the IP end address, and the region information belonging to the same region information.
TABLE 1
Step 102, storing the mapping relation into the application program.
Optionally, after the application program obtains the mapping relationship sent by the server, the mapping relationship may be stored locally, so as to improve the applicability of the method.
Step 103, generating an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved.
In specific implementation, a user can manually input a target IP address through an input device in an application program, or the user can input the target IP address through a voice pickup device in the application program, and then the application program can receive the target IP address input by the user and generate an IP address retrieval request according to the target IP address.
Or, the application program may capture the corresponding IP address from the network configuration information of the terminal device where the application program is located as the target IP address, and then generate an IP address retrieval request according to the captured target IP address.
And 104, inquiring the mapping relation according to the target IP address to acquire target region information matched with the target IP address.
After the application program generates the IP address retrieval request, the IP address retrieval request can be inquired in the mapping relation according to the target IP address to be retrieved in the retrieval request, and the target region information matched with the target IP address is obtained from the mapping relation.
The method for searching the regional information of the IP address in this embodiment stores the mapping relationship into the application program by obtaining the mapping relationship of the IP address, and then generates an IP address retrieval request, where the IP address retrieval request includes a target IP address to be retrieved, and queries the mapping relationship according to the target IP address to obtain target regional information matched with the target IP address. Therefore, the IP address retrieval request in the server can be transferred to the application program, and the application program inquires and acquires the region information matched with the IP address, so that the pressure of the server is reduced.
As a possible implementation manner of the embodiment of the present invention, referring to fig. 2, on the basis of the embodiment shown in fig. 1, step 102 specifically includes the following sub-steps:
step 201, an IP address is extracted from the mapping relationship as a key value and the region information corresponding to the IP address is extracted as a numerical value.
It can be understood that, since the same region information may correspond to a plurality of IP addresses, the plurality of IP addresses may be extracted from the mapping relationship as key values, and the region information corresponding to the plurality of IP addresses may be extracted as numerical values.
For example, when the same region information corresponds to an IP address range, an IP start address and an IP end address belonging to the same region information may be identified, and then < IP start address, IP end address > may be used as a key value, and the region information to which the IP start address and the IP end address belong may be used as a numerical value. As an example, referring to table 1, when the regional information is < beijing city, hai lake district, east way of guan village; communicating; in case of WIFI network >, if the affiliated IP start address is 123.134.145.156 and the IP end address is 123.134.145.189, then <123.134.145.156, 123.134.145.189> may be used as key values, and < beijing city, hai lake district, zhongguancun east road; communicating; WIFI network > as a numerical value.
Step 202, an index is constructed by using the extracted key values.
In specific implementation, an index can be constructed for each extracted key value.
Step 203, storing the index and mapping relationship in the application program.
Optionally, after the index is constructed by using the extracted key value, the index and the mapping relation can be stored in the application program, so that the applicability of the method is improved.
In the method for searching the geographical information of the IP address according to this embodiment, the IP address is extracted from the mapping relationship as the key value, and the geographical information corresponding to the IP address is extracted as the numerical value, the index is constructed by using the extracted key value, and the index and the mapping relationship are stored in the application program, so that the applicability of the method can be improved.
As a possible implementation manner of the embodiment of the present invention, referring to fig. 3, on the basis of the embodiment shown in fig. 1, step 104 specifically includes the following sub-steps:
step 301, generating an index entry according to the target IP address.
In this embodiment, after the application generates the IP address retrieval request, the index item may be automatically generated according to the target IP address to be retrieved in the retrieval request.
In this embodiment, the index entry corresponding to the target IP address may be generated according to a preset index granularity. For example, the preset index granularity is 24 or 16 high bits.
In the embodiment, a preset algorithm model can be trained by using an actually acquired IP address and an IP address in an actual access log, an optimal index granularity can be extracted after the trained algorithm model is stable, and an index item is constructed by the index granularity, so that the performance can be improved and the memory occupation can be considered.
For example, when the target IP address is 123.134.146.138, assuming that an index entry is created for the target IP address by the upper 24 bits of the IP address, the generated index entry is 123.134.146. And when the target IP address is 123.134.146.138, assuming that an index entry is created for the target IP address according to the upper 16 bits of the IP address, the generated index entry is 123.134.
Step 302, according to the query of the index item in the index, obtaining a key value range corresponding to the index item.
After the index entry corresponding to the target IP address is obtained, the index can be queried to obtain the key value range corresponding to the index entry. For example, if the index entry is created according to the upper 24 bits of the IP address, and the target IP address is 123.134.146.138, the generated index entry is 123.134.146, and the key value range corresponding to the index entry is <123.134.146.123, 123.134.147.139> when the index entry is queried in the index according to the generated index entry.
Or, assuming that when the index entry is created according to the upper 16 bits of the IP address, and when the target IP address is 123.134.146.138, the generated index entry is 123.134, the key value ranges corresponding to the index entry are <123.134.145.156, 123.134.145.189> and <123.134.146.123, 123.134.147.139> obtained by querying the index according to the generated index entry.
Step 303, using the target IP address as a query object, querying the mapping relationship in the key value range to obtain the target region information.
Optionally, after the index item of the target IP address is obtained, a key value range corresponding to the index item may be obtained, and then the target IP address is used as a query object to query the mapping relationship in the key value range to obtain the target region information.
Still in the above example, assuming that when the index entry is created according to the upper 24 bits of the IP address, the mapping relationship is queried in the key value range <123.134.146.123, 123.134.147.139> with the target IP address 123.134.146.138 as the query object, and the target region information matching the target IP address is < beijing city, hai lake area, hai lake street; moving; 4G network >.
Alternatively, assuming that the index entry is created according to the upper 16 bits of the IP address, the mapping relationship is queried in the key value ranges <123.134.145.156, 123.134.145.189> and <123.134.146.123, 123.134.147.139> with the target IP address 123.134.146.138 as the query object, so that the target IP address 123.134.146.138 can be found in the key value ranges <123.134.146.123, 123.134.147.139 >. Therefore, the target region information matched with the target IP address is < beijing city, hai lake district, hai lake street; moving; 4G network >.
In the method for searching the geographical information of the IP address according to this embodiment, the index item is generated according to the target IP address, the key value range corresponding to the index item is obtained by querying in the index according to the index item, and the mapping relationship is queried in the key value range with the target IP address as a query object, so as to obtain the target geographical information. In this embodiment, by generating the index entry corresponding to the IP address and using the index entry to query and acquire the region information matched with the IP address, the query efficiency can be improved. In addition, the region information matched with the IP address is inquired by using the index item, so that the inquiry range can be reduced, and the data volume inquired by the application program can be reduced.
Fig. 4 is a flowchart illustrating a fourth method for searching geographical information of an IP address according to an embodiment of the present invention.
The execution subject of the embodiment of the present invention may be a server.
As shown in fig. 4, the method for searching the geographical information of the IP address includes the following steps:
step 401, collecting an IP address and region information corresponding to the IP address.
Alternatively, the server may collect the IP address and the region information corresponding to the IP address by using the prior art. For example, the IP address and the region information corresponding to the IP address may be acquired through a Simple Network Management Protocol (SNMP), a TELNET Protocol (TELNET), a Secure Shell Protocol (SSH), and the like.
Step 402, constructing a mapping relation of IP addresses; the mapping relation comprises an IP address and region information corresponding to the IP address.
It is understood that the same region information may correspond to one IP address, or to a plurality of IP addresses, or to one IP address range. For example, referring to table 1, the regional information is: beijing, Haihu district, east of Zhongguancun; communicating; the WIFI network has corresponding IP addresses of 123.134.145.156-123.134.145.189, or the regional information is: hangzhou city, Binjiang district, south loop; telecommunications; 4G network, its corresponding IP address is 123.135.149.123-123.137.152.139. Therefore, in this embodiment, the server may obtain a plurality of IP addresses belonging to the same region information, and then, for each region information, may establish associations between the plurality of IP addresses and the region information to form a mapping relationship, that is, the mapping relationship is formed by establishing associations between the plurality of IP addresses belonging to the same region information and the region information.
Or, since the same region information may correspond to a plurality of IP addresses, in this embodiment, the server may obtain a plurality of IP addresses belonging to the same region information, and then identify an IP start address and an IP end address belonging to the same region information from the plurality of IP addresses, for example, see table 1, where the region information belongs to the east road of beijing, hai lake district, or zhongguan village; communicating; WIFI network > has an IP start address of 123.134.145.156 and an IP end address of 123.134.145.189. Then, for each region information, the server may establish an association between the IP start address, the IP end address, and the region information to form a mapping relationship, that is, the mapping relationship is formed by establishing an association between the IP start address, the IP end address, and the region information belonging to the same region information.
In step 403, the mapping relationship is updated.
It can be understood that, in order to implement the real-time property of data acquisition, the mapping relationship in the server may be dynamically updated, and when the server monitors that the mapping relationship is updated, the mapping relationship may be updated to implement the dynamic maintenance of the mapping relationship, thereby ensuring the real-time property of the user for acquiring data.
And step 404, issuing the updated mapping relation to the application program.
Optionally, after the server finishes updating the mapping relationship, the updated mapping relationship may be issued to the application program, so as to ensure real-time performance of the user in acquiring data.
In the method for searching the regional information of the IP address, a mapping relationship of the IP address is established by collecting the IP address and the regional information corresponding to the IP address; the mapping relation comprises the IP address and the region information corresponding to the IP address, the mapping relation is updated, and then the updated mapping relation is issued to the application program. Therefore, the mapping relation can be updated at the server side, dynamic maintenance of the mapping relation is realized, and real-time performance of data acquisition of a user is guaranteed.
Fig. 5 is a schematic structural diagram of an application according to an embodiment of the present invention.
As shown in fig. 5, the application 500 may include: an acquisition module 510, a storage module 520, a generation module 530, and a query acquisition module 540. Wherein,
an obtaining module 510, configured to obtain a mapping relationship of an IP address; the mapping relation comprises an IP address and region information corresponding to the IP address.
In the embodiment of the invention, the mapping relation is formed by establishing association between a plurality of IP addresses belonging to the same region information and the region information. Alternatively, the mapping relationship is formed by establishing a relationship between the IP start address, the IP end address and the region information belonging to the same region information.
In specific implementation, the obtaining module 510 is specifically configured to send an obtaining request to a server, and receive a mapping relationship from the server; or receiving the mapping relation sent by the server; the mapping relation is sent down after the server monitors that the mapping relation is updated.
A storage module 520, configured to store the mapping relationship in the application program.
A generating module 530, configured to generate an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved.
In specific implementation, the generating module 530 is specifically configured to receive a target IP address manually or by voice input by a user, and generate an IP address retrieval request according to the target IP address; or capturing an IP address corresponding to the application program from the network configuration information of the terminal equipment where the application program is located as a target IP address, and generating an IP address retrieval request according to the target IP address.
And the query obtaining module 540 is configured to perform query on the mapping relationship according to the target IP address, and obtain the region information matched with the target IP address.
Further, referring to fig. 6, on the basis of the embodiment shown in fig. 5, the application 700 may further include:
in a specific implementation, the storage module 520 includes:
the extracting submodule 521 is configured to extract, from the mapping relationship, the IP address as a key value and the region information corresponding to the IP address as a numerical value.
Sub-module 522 is utilized for building an index using the extracted key values.
The storage submodule 523 is configured to store the index and the mapping relationship in the application program.
In a specific implementation, the query obtaining module 540 includes:
the generating submodule 541 is configured to generate an index entry according to the target IP address.
The obtaining submodule 542 is configured to obtain, according to the query of the index item in the index, a key value range corresponding to the index item.
And the query submodule 543 is used for querying the mapping relation in the key value range by taking the target IP address as a query object, so as to obtain the target region information.
It should be noted that the explanation of the method for searching for the geographic information of the IP address in the foregoing embodiments of fig. 1 to 3 also applies to the application 500 of this embodiment, and details are not repeated here.
The application program of this embodiment stores the mapping relationship into the application program by obtaining the mapping relationship of the IP address, and then generates an IP address retrieval request, where the IP address retrieval request includes a target IP address to be retrieved, and queries the mapping relationship according to the target IP address to obtain target region information matched with the target IP address. Therefore, the IP address retrieval request in the server can be transferred to the application program, and the application program inquires and acquires the region information matched with the IP address, so that the pressure of the server is reduced.
Fig. 7 is a schematic structural diagram of a server according to an embodiment of the present invention.
As shown in fig. 7, the server 700 may include: an acquisition construction module 710 and an update delivery module 720. Wherein,
the acquisition and construction module 710 is configured to acquire an IP address and region information corresponding to the IP address, and construct a mapping relationship of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address.
As a possible implementation manner of the embodiment of the present invention, the acquisition and construction module 710 is specifically configured to acquire an IP address and geographic information corresponding to the IP address; acquiring a plurality of IP addresses belonging to the same region information; and establishing association between a plurality of IP addresses and the region information aiming at each region information to form a mapping relation.
As another possible implementation manner of the embodiment of the present invention, the acquisition and construction module 710 is specifically configured to acquire an IP address and region information corresponding to the IP address; acquiring a plurality of IP addresses belonging to the same region information; identifying an IP initial address and an IP end address belonging to the same region information from a plurality of IP addresses; and establishing association between the IP initial address, the IP end address and the region information aiming at each region information to form a mapping relation.
And the update issuing module 720 is configured to update the mapping relationship and issue the updated mapping relationship to the application program.
It should be noted that the explanation of the method for searching for the geographical information of the IP address in the embodiment of fig. 4 also applies to the server 700 in the embodiment, and details are not repeated here.
The server of the embodiment constructs a mapping relationship of the IP address by acquiring the IP address and the region information corresponding to the IP address; the mapping relation comprises the IP address and the region information corresponding to the IP address, the mapping relation is updated, and then the updated mapping relation is issued to the application program. Therefore, the mapping relation can be updated at the server side, dynamic maintenance of the mapping relation is realized, and real-time performance of data acquisition of a user is guaranteed.
In order to implement the above embodiments, the present invention further provides a computer device, including a processor and a memory; the processor reads the executable program code stored in the memory to run the program corresponding to the executable program code, so as to implement the region information search method for the IP address proposed in the embodiments of fig. 1 to 3, or implement the region information search method for the IP address proposed in the embodiment of fig. 4.
In order to implement the foregoing embodiments, the present invention further provides a computer program product, which when executed by an instruction processor in the computer program product, executes the method for searching for geographical information of an IP address according to the foregoing embodiments of fig. 1 to 3 of the present invention, or implements the method for searching for geographical information of an IP address according to the foregoing embodiment of fig. 4.
In order to implement the foregoing embodiments, the present invention further provides a computer-readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the method for searching for geographical information of an IP address as set forth in the foregoing embodiments of fig. 1-3, or implements the method for searching for geographical information of an IP address as set forth in the foregoing embodiment of fig. 4.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing steps of a custom logic function or process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and when the program is executed, the program includes one or a combination of the steps of the method embodiments.
In addition, functional units in the embodiments of the present invention may be integrated into one processing module, or each unit may exist alone physically, or two or more units are integrated into one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode. The integrated module, if implemented in the form of a software functional module and sold or used as a stand-alone product, may also be stored in a computer readable storage medium.
The storage medium mentioned above may be a read-only memory, a magnetic or optical disk, etc. Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (15)

1. A method for searching IP address region information is characterized by comprising the following steps:
acquiring a mapping relation of an IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
storing the mapping relation into an application program;
generating an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved;
and inquiring the mapping relation according to the target IP address to acquire target region information matched with the target IP address.
2. The method of claim 1, wherein storing the mapping relationship in an application comprises:
extracting the IP address as a key value and the region information corresponding to the IP address as a numerical value from the mapping relation;
constructing an index by using the extracted key values;
storing the index and the mapping relationship in the application.
3. The method according to claim 2, wherein the querying the mapping relationship according to the target IP address to obtain target geographic information matched with the target IP address includes:
generating an index entry according to the target IP address;
inquiring in the index according to the index item, and acquiring a key value range corresponding to the index item;
and inquiring the mapping relation in the key value range by taking the target IP address as an inquiry object to obtain the target region information.
4. The method according to any one of claims 1 to 3, wherein the mapping is formed by establishing an association between a plurality of IP addresses belonging to the same geographical information and the geographical information.
5. A method according to any of claims 1-3, characterized in that the mapping is formed by establishing an association between IP start addresses, IP end addresses belonging to the same geographical information and the geographical information.
6. The method of claim 1, wherein the obtaining the mapping relationship of the IP addresses comprises:
sending an acquisition request to a server and receiving the mapping relation from the server; or,
receiving the mapping relation sent by the server; and the mapping relation is issued after the server monitors that the mapping relation is updated.
7. The method of claim 1, wherein the generating the IP address retrieval information comprises:
receiving the target IP address manually or voice-input by a user, and generating the IP address retrieval request according to the target IP address; or,
and capturing an IP address corresponding to the application program from the network configuration information of the terminal equipment where the application program is located as the target IP address, and generating the IP address retrieval request according to the target IP address.
8. A method for searching IP address region information is characterized by comprising the following steps:
acquiring an IP address and region information corresponding to the IP address, and constructing a mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
updating the mapping relation;
and issuing the updated mapping relation to an application program.
9. The method of claim 8, wherein the constructing the mapping relationship of the IP addresses comprises:
acquiring a plurality of IP addresses belonging to the same region information;
and establishing association between the plurality of IP addresses and the region information aiming at each region information to form the mapping relation.
10. The method of claim 8, wherein the constructing the mapping relationship of the IP addresses comprises:
acquiring a plurality of IP addresses belonging to the same region information;
identifying an IP starting address and an IP ending address belonging to the same region information from a plurality of IP addresses;
and establishing association among the IP initial address, the IP end address and the region information aiming at each region information to form the mapping relation.
11. An application program, comprising:
the obtaining module is used for obtaining the mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
the storage module is used for storing the mapping relation into an application program;
the generation module is used for generating an IP address retrieval request; the IP address retrieval request comprises a target IP address to be retrieved;
and the query acquisition module is used for querying the mapping relation according to the target IP address and acquiring the region information matched with the target IP address.
12. A server, comprising:
the acquisition and construction module is used for acquiring an IP address and region information corresponding to the IP address and constructing a mapping relation of the IP address; the mapping relation comprises an IP address and region information corresponding to the IP address;
and the updating and issuing module is used for updating the mapping relation and issuing the updated mapping relation to an application program.
13. A computer device, comprising: a processor and a memory; wherein the processor executes a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method for searching the geographical information of the IP address according to any one of claims 1 to 7, or the method for searching the geographical information of the IP address according to any one of claims 8 to 10.
14. A computer program product, characterized in that instructions in the computer program product, when executed by a processor, are configured to implement the method for searching for geographical information of an IP address according to any one of claims 1 to 7, or the method for searching for geographical information of an IP address according to any one of claims 8 to 10.
15. A non-transitory computer-readable storage medium having stored thereon a computer program, wherein the computer program, when executed by a processor, implements the method for searching for geographical information of an IP address according to any one of claims 1 to 7 or the method for searching for geographical information of an IP address according to any one of claims 8 to 10.
CN201710883969.1A 2017-09-26 2017-09-26 The regional information searching method and its device of IP address Withdrawn CN107613043A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710883969.1A CN107613043A (en) 2017-09-26 2017-09-26 The regional information searching method and its device of IP address

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710883969.1A CN107613043A (en) 2017-09-26 2017-09-26 The regional information searching method and its device of IP address

Publications (1)

Publication Number Publication Date
CN107613043A true CN107613043A (en) 2018-01-19

Family

ID=61058742

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710883969.1A Withdrawn CN107613043A (en) 2017-09-26 2017-09-26 The regional information searching method and its device of IP address

Country Status (1)

Country Link
CN (1) CN107613043A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446365A (en) * 2018-03-14 2018-08-24 北京思特奇信息技术股份有限公司 A kind of address information querying method, system, equipment and storage medium
CN109246014A (en) * 2018-09-10 2019-01-18 中通服咨询设计研究院有限公司 The method that a kind of pair of IP address carries out Fast Classification
CN110266834A (en) * 2019-07-29 2019-09-20 中国工商银行股份有限公司 The regional lookup method and device of internet protocol-based address
CN110505321A (en) * 2019-08-26 2019-11-26 北京泰和纬度网络技术有限公司 It is a kind of for accessing the method and system of IP address
CN112307138A (en) * 2019-07-30 2021-02-02 华扬联众数字技术股份有限公司 Storage and query method, system and medium of region information
CN112738866A (en) * 2020-12-31 2021-04-30 百果园技术(新加坡)有限公司 Terminal access method, device, equipment and medium
CN113157705A (en) * 2021-05-10 2021-07-23 广州欢网科技有限责任公司 Method and device for quickly querying region according to IP
CN114500454A (en) * 2021-12-20 2022-05-13 成都鲁易科技有限公司 Method and device for detecting geographical position change of electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080275978A1 (en) * 2000-04-03 2008-11-06 Microsoft Corporation, Infosplit, Inc. Method and systems for locating geographical locations of online users
CN103327133A (en) * 2013-05-31 2013-09-25 青岛海信传媒网络技术有限公司 Method and device for updating geographic position information
CN104767839A (en) * 2015-03-25 2015-07-08 五八有限公司 IP positioning method and device
CN105407156A (en) * 2015-11-23 2016-03-16 北京百度网讯科技有限公司 Method and device for positioning through client
CN105516392A (en) * 2015-12-30 2016-04-20 小米科技有限责任公司 Method and device for updating IP address information base
CN106210163A (en) * 2016-06-30 2016-12-07 百度在线网络技术(北京)有限公司 IP address-based localization method and device
CN106936887A (en) * 2015-12-31 2017-07-07 珠海金山办公软件有限公司 A kind of geographic position locating method and device

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080275978A1 (en) * 2000-04-03 2008-11-06 Microsoft Corporation, Infosplit, Inc. Method and systems for locating geographical locations of online users
CN103327133A (en) * 2013-05-31 2013-09-25 青岛海信传媒网络技术有限公司 Method and device for updating geographic position information
CN104767839A (en) * 2015-03-25 2015-07-08 五八有限公司 IP positioning method and device
CN105407156A (en) * 2015-11-23 2016-03-16 北京百度网讯科技有限公司 Method and device for positioning through client
CN105516392A (en) * 2015-12-30 2016-04-20 小米科技有限责任公司 Method and device for updating IP address information base
CN106936887A (en) * 2015-12-31 2017-07-07 珠海金山办公软件有限公司 A kind of geographic position locating method and device
CN106210163A (en) * 2016-06-30 2016-12-07 百度在线网络技术(北京)有限公司 IP address-based localization method and device

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108446365A (en) * 2018-03-14 2018-08-24 北京思特奇信息技术股份有限公司 A kind of address information querying method, system, equipment and storage medium
CN108446365B (en) * 2018-03-14 2022-03-15 北京思特奇信息技术股份有限公司 Address information query method, system, device and storage medium
CN109246014A (en) * 2018-09-10 2019-01-18 中通服咨询设计研究院有限公司 The method that a kind of pair of IP address carries out Fast Classification
CN109246014B (en) * 2018-09-10 2021-04-20 中通服咨询设计研究院有限公司 Method for rapidly classifying IP addresses
CN110266834A (en) * 2019-07-29 2019-09-20 中国工商银行股份有限公司 The regional lookup method and device of internet protocol-based address
CN110266834B (en) * 2019-07-29 2022-08-26 中国工商银行股份有限公司 Area searching method and device based on internet protocol address
CN112307138A (en) * 2019-07-30 2021-02-02 华扬联众数字技术股份有限公司 Storage and query method, system and medium of region information
CN110505321B (en) * 2019-08-26 2022-05-31 北京泰和纬度网络技术有限公司 Method and system for accessing IP address
CN110505321A (en) * 2019-08-26 2019-11-26 北京泰和纬度网络技术有限公司 It is a kind of for accessing the method and system of IP address
CN112738866A (en) * 2020-12-31 2021-04-30 百果园技术(新加坡)有限公司 Terminal access method, device, equipment and medium
CN112738866B (en) * 2020-12-31 2024-04-30 百果园技术(新加坡)有限公司 Terminal access method, device, equipment and medium
CN113157705A (en) * 2021-05-10 2021-07-23 广州欢网科技有限责任公司 Method and device for quickly querying region according to IP
CN114500454A (en) * 2021-12-20 2022-05-13 成都鲁易科技有限公司 Method and device for detecting geographical position change of electronic equipment
CN114500454B (en) * 2021-12-20 2024-01-23 成都鲁易科技有限公司 Method and device for detecting geographic position change of electronic equipment

Similar Documents

Publication Publication Date Title
CN107613043A (en) The regional information searching method and its device of IP address
CN107682466B (en) Method and device for searching regional information of IP address
CN106708833B (en) Method and device for acquiring data based on position information
WO2019095889A1 (en) Method and device for discovering nf by nrf, and readable storage medium
US20160154643A1 (en) Method and system for updating in-vehicle navigation map, in-vehicle navigation device and mobile terminal
CN101754186B (en) Method and system for residing when mobile terminal is powered on
CN111885216B (en) DNS query method, device, equipment and storage medium
CN107135149B (en) Method and equipment for recommending social users
CN105224609A (en) Index query method and device
CN109167840B (en) Task pushing method, node autonomous server and edge cache server
CN109729183A (en) Request processing method, device, equipment and storage medium
CN109982152B (en) P2P CDN service processing method, intelligent gateway and CDN platform
CN110413845B (en) Resource storage method and device based on Internet of things operating system
CN105373595B (en) data self-classification storage method and terminal
CN103346896A (en) Method and system for quick data transmission
CN110764688B (en) Method and device for processing data
CN110309479A (en) Attribute information acquiring method and device
CN105659689A (en) Method and system for dual role handling in a wireless environment
US20180255145A1 (en) Data Connection Establishment Method, Server, and Mobile Terminal
CN112307058A (en) Short link processing method and device, storage medium and computer equipment
CN113127420A (en) Metadata request processing method, device, equipment and medium
CN103167002A (en) Business card sending method and system
CN111431818A (en) Cross-domain request traffic distribution method and device, storage medium and computer equipment
EP2466854A1 (en) Mobile search method and system thereof
CN104471910A (en) A method, a server and a computer program for local discovery

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20190903

Address after: 100192 Dongsheng Science Park, Zhongguancun, 66 Xixiaokou Road, Haidian District, Beijing

Applicant after: Green Bay Network Technology Co., Ltd.

Address before: 100089 Beijing Haidian District Xixiaokou Road 66 Zhongguancun Dongsheng Science Park B-6 Building B 5 floors

Applicant before: Grass count language (Beijing) Technology Co., Ltd.

WW01 Invention patent application withdrawn after publication
WW01 Invention patent application withdrawn after publication

Application publication date: 20180119