CN113157705A - Method and device for quickly querying region according to IP - Google Patents

Method and device for quickly querying region according to IP Download PDF

Info

Publication number
CN113157705A
CN113157705A CN202110505089.7A CN202110505089A CN113157705A CN 113157705 A CN113157705 A CN 113157705A CN 202110505089 A CN202110505089 A CN 202110505089A CN 113157705 A CN113157705 A CN 113157705A
Authority
CN
China
Prior art keywords
region
preset
data
section
inquired
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.)
Pending
Application number
CN202110505089.7A
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.)
Guangdong Huanwang Technology Co Ltd
Original Assignee
Guangdong Huanwang 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 Guangdong Huanwang Technology Co Ltd filed Critical Guangdong Huanwang Technology Co Ltd
Priority to CN202110505089.7A priority Critical patent/CN113157705A/en
Publication of CN113157705A publication Critical patent/CN113157705A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/24Querying
    • G06F16/245Query processing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/29Geographical information databases

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • Computational Linguistics (AREA)
  • Remote Sensing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The application relates to a method for rapidly inquiring regions according to IP, which comprises the steps of generating an IP-region table through preset IP section data in a preset system and preset region data corresponding to the preset IP section data; loading the IP-geographical table when the project is running; and when the IP analysis request with the IP to be inquired is obtained, inquiring the region information of the IP to be inquired through the IP-region table. Therefore, the IP-region table is firstly manufactured, and then the IP-region table is loaded when the project runs, so that the region information can be quickly inquired according to the IP when the IP analysis request is received, and the corresponding speed of the corresponding interface is increased.

Description

Method and device for quickly querying region according to IP
Technical Field
The application relates to the technical field of internet, in particular to a method and a device for quickly querying a region according to an IP.
Background
In the field of internet technology, projects related to regional information are often involved, and ip needs to be parsed into regional provinces and cities, so that regional matching is performed in the projects.
In the prior art, an IP table needs to be obtained first, an IP to be queried is compared with the IP table, then a city-saving table corresponding to an IP segment is obtained, address information of the IP to be queried is obtained through query based on information corresponding to the IP table, and the process is slow in speed, time-consuming and seriously affects response speed of a related interface.
Disclosure of Invention
The method and the device for inquiring the region according to the IP are used for solving the problem that in the prior art, when the region information is acquired according to the IP, the inquiry speed is low, and the corresponding speed of the project or the interface is reduced.
The above object of the present application is achieved by the following technical solutions:
in a first aspect, an embodiment of the present application provides a method for quickly querying a geographic area according to an IP, including:
generating an IP-geographical table based on the preset IP section data and the preset geographical data corresponding to the preset IP section data;
importing the IP-region table into a project memory;
receiving an IP analysis request through a preset interface, and inquiring the region information of the IP to be inquired through the IP-region table based on the IP analysis request to obtain an IP analysis result; the IP analysis request comprises an IP to be inquired, and the IP analysis result comprises region information corresponding to the IP to be inquired.
Optionally, the receiving, by a preset interface, an IP analysis request, and querying, by the IP-geographic table, geographic information of an IP to be queried based on the IP analysis request, to obtain an IP analysis result includes:
positioning the IP to be inquired in the preset IP section data and the IP section to which the IP belongs;
and acquiring the region data of the IP section to which the IP section belongs, and determining the region data as the IP analysis result of the IP analysis request.
Optionally, the method further includes: and updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
Optionally, the method further includes displaying or returning the IP parsing result.
In a second aspect, an embodiment of the present application further provides an apparatus for quickly querying a geographic area according to an IP, including:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an IP analysis request, preset IP section data in a preset system and preset region data corresponding to the preset IP section data; the IP analysis request comprises an IP to be inquired;
the generation module is used for generating an IP-region table based on the preset IP section data and the preset region data corresponding to the preset IP section data;
and the processing module is used for loading the IP-region table when the project is started, and inquiring the region information corresponding to the IP to be inquired in the IP analysis request based on the IP-region table to obtain an IP analysis result.
Optionally, the processing module is configured to:
positioning the IP to be inquired in the preset IP section data and the IP section to which the IP belongs;
and acquiring the region data of the IP section to which the IP section belongs, and determining the region data as the IP analysis result of the IP analysis request.
Optionally, the system further comprises an updating module;
the updating module is used for updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
Optionally, the system further comprises a display return module;
and the display returning module is used for displaying or returning the IP analysis result.
The technical scheme provided by the embodiment of the application can have the following beneficial effects:
in the technical scheme provided by the embodiment of the application, an IP-region table is generated through preset IP section data in a preset system and preset region data corresponding to the preset IP section data; loading the IP-geographical table when the project is running; and when the IP analysis request with the IP to be inquired is obtained, inquiring the region information of the IP to be inquired through the IP-region table. Therefore, the IP-region table is firstly manufactured, and then the IP-region table is loaded when the project runs, so that the region information can be quickly inquired according to the IP when the IP analysis request is received, and the corresponding speed of the corresponding interface is increased.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and together with the description, serve to explain the principles of the application.
Fig. 1 is a schematic flowchart illustrating a method for quickly querying a geographic area according to an IP according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of an apparatus for quickly querying a domain according to an IP according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
Fig. 1 is a schematic flowchart of a method for quickly querying a geographical area according to an IP according to an embodiment of the present application, and as shown in fig. 1, the method for quickly querying a geographical area according to an IP according to an embodiment of the present application includes:
s101, generating an IP-geographical table based on preset IP section data and preset geographical data corresponding to the preset IP section data;
specifically, the IP segment data may be queried from a preset system or a database, and the IP segment data includes: the initial IP, the end IP and the corresponding region information in the IP section, such as the corresponding provincial and city information. After IP section data, namely IP sections and region data corresponding to the IP sections are obtained, all information is sorted according to the rules of IP-province and city, and an IP-region table is sorted out.
S102, importing the IP-region table into an item memory;
specifically, the generated IP-geographical table is imported into a memory, and is automatically loaded when a project is started, so that when an externally received IP needs to be analyzed, the IP-geographical table can be directly obtained from the memory through a preset interface, and an IP analysis request is analyzed more quickly.
S103, receiving an IP analysis request through a preset interface, and inquiring the region information of the IP to be inquired through the IP-region table based on the IP analysis request to obtain an IP analysis result; the IP analysis request comprises an IP to be inquired, and the IP analysis result comprises region information corresponding to the IP to be inquired.
Specifically, when an IP analysis request is received through a preset interface, an IP to be analyzed, that is, an IP of geographical information to be checked, included in the request is first acquired; according to the obtained information of the IP to be inquired, positioning the IP to be inquired into the IP section in the IP-region table; and finally correspondingly, taking the region information of the IP section as the region information of the IP to be inquired.
In a specific implementation process, if the IP is 010.000.000 in the received IP resolution request, the IP is located in the IP-geographic table, and if the IP belongs to segments 010.000.000.000 to 010.001.255.255 and the geographic information corresponding to the IP segment is the first city, the geographic information of the IP is determined to be the first city, the first province.
Further, the method for rapidly querying the region according to the IP provided by the present application further includes: and updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
Specifically, by setting, the IP segment data and the region data corresponding to the IP segment data in the preset system can be queried at each time, and after the IP segment data and the region data corresponding to the IP segment data change, the IP-region table is updated and replaced according to the change of the IP segment data and the region data corresponding to the IP segment data.
In addition, the method for rapidly querying the region according to the IP provided by the embodiment of the application further comprises displaying or returning the IP analysis result.
Specifically, after obtaining the regional information of the IP to be queried, that is, obtaining the IP analysis result, on one hand, the IP analysis result may be returned through the above interface, and on the other hand, the information may be displayed through other interfaces or devices.
Based on the same inventive concept, an embodiment of the present application further provides a device for quickly querying a region according to an IP, including:
the system comprises an acquisition module 1, a storage module and a processing module, wherein the acquisition module 1 is used for acquiring an IP analysis request, preset IP section data in a preset system and preset region data corresponding to the preset IP section data; the IP analysis request comprises an IP to be inquired;
a generating module 2, configured to generate an IP-geographic table based on the preset IP segment data and the preset geographic data corresponding to the preset IP segment data;
and the processing module 3 is used for loading the IP-region table when the project is started, and inquiring the region information corresponding to the IP to be inquired in the IP analysis request based on the IP-region table to obtain an IP analysis result.
It should be noted that the specific process of the processing module obtaining the IP parsing result may be: firstly, an IP to be inquired is positioned in the preset IP section data, and the IP section to which the IP belongs; and then, acquiring the region data of the IP section to which the IP section belongs, and determining the region data as the IP analysis result of the IP analysis request.
Further, the apparatus for quickly querying a geographic area according to an IP provided in the embodiment of the present application further includes an update module; the updating module is used for updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
Further, the device for rapidly querying the region according to the IP provided by the embodiment of the application further comprises a display return module; and the display returning module is used for displaying or returning the IP analysis result.
It is understood that the same or similar parts in the above embodiments may be mutually referred to, and the same or similar parts in other embodiments may be referred to for the content which is not described in detail in some embodiments.
It should be noted that, in the description of the present application, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance. Further, in the description of the present application, the meaning of "a plurality" means at least two unless otherwise specified.
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 specific logical functions or steps of the process, and the scope of the preferred embodiments of the present application includes other implementations 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 application.
It should be understood that portions of the present application 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. For example, 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 application 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.
In the description herein, reference to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., means 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 application. In this specification, the schematic representations of the terms used above do not necessarily 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.
Although embodiments of the present application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present application, and that variations, modifications, substitutions and alterations may be made to the above embodiments by those of ordinary skill in the art within the scope of the present application.

Claims (8)

1. A method for quickly querying a region according to an IP (Internet protocol) is characterized by comprising the following steps:
generating an IP-geographical table based on the preset IP section data and the preset geographical data corresponding to the preset IP section data;
importing the IP-region table into a project memory;
receiving an IP analysis request through a preset interface, and inquiring the region information of the IP to be inquired through the IP-region table based on the IP analysis request to obtain an IP analysis result; the IP analysis request comprises an IP to be inquired, and the IP analysis result comprises region information corresponding to the IP to be inquired.
2. The method of claim 1, wherein the receiving an IP resolution request through a predetermined interface, and querying the geographical information of the IP to be queried through the IP-geographical table based on the IP resolution request to obtain an IP resolution result comprises:
positioning the IP to be inquired in the preset IP section data and the IP section to which the IP belongs;
and acquiring the region data of the IP section to which the IP section belongs, and determining the region data as the IP analysis result of the IP analysis request.
3. The method for fast querying the territory according to the IP as recited in claim 1, further comprising: and updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
4. The method of claim 1, further comprising displaying or returning the IP parsing result.
5. An apparatus for quickly querying a geographical area according to an IP, comprising:
the system comprises an acquisition module, a storage module and a processing module, wherein the acquisition module is used for acquiring an IP analysis request, preset IP section data in a preset system and preset region data corresponding to the preset IP section data; the IP analysis request comprises an IP to be inquired;
the generation module is used for generating an IP-region table based on the preset IP section data and the preset region data corresponding to the preset IP section data;
and the processing module is used for loading the IP-region table when the project is started, and inquiring the region information corresponding to the IP to be inquired in the IP analysis request based on the IP-region table to obtain an IP analysis result.
6. The apparatus for fast querying geographical areas according to IP as claimed in claim 5, wherein the processing module is configured to:
positioning the IP to be inquired in the preset IP section data and the IP section to which the IP belongs;
and acquiring the region data of the IP section to which the IP section belongs, and determining the region data as the IP analysis result of the IP analysis request.
7. The apparatus for fast querying geographical areas according to IP as claimed in claim 5, further comprising an update module;
the updating module is used for updating the IP-region table according to IP data in a preset system and region data corresponding to the IP data in preset time.
8. The apparatus for fast querying geographical areas according to IP as claimed in claim 5, further comprising a display return module;
and the display returning module is used for displaying or returning the IP analysis result.
CN202110505089.7A 2021-05-10 2021-05-10 Method and device for quickly querying region according to IP Pending CN113157705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110505089.7A CN113157705A (en) 2021-05-10 2021-05-10 Method and device for quickly querying region according to IP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110505089.7A CN113157705A (en) 2021-05-10 2021-05-10 Method and device for quickly querying region according to IP

Publications (1)

Publication Number Publication Date
CN113157705A true CN113157705A (en) 2021-07-23

Family

ID=76874080

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110505089.7A Pending CN113157705A (en) 2021-05-10 2021-05-10 Method and device for quickly querying region according to IP

Country Status (1)

Country Link
CN (1) CN113157705A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160021114A1 (en) * 2014-07-17 2016-01-21 Alibaba Group Holding Limited Method and Server of Remote Information Query
WO2016107155A1 (en) * 2014-12-31 2016-07-07 中兴通讯股份有限公司 Asset management method and system
CN107613043A (en) * 2017-09-26 2018-01-19 小草数语(北京)科技有限公司 The regional information searching method and its device of IP address
CN107682466A (en) * 2017-09-26 2018-02-09 小草数语(北京)科技有限公司 The regional information searching method and its device of IP address

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160021114A1 (en) * 2014-07-17 2016-01-21 Alibaba Group Holding Limited Method and Server of Remote Information Query
WO2016107155A1 (en) * 2014-12-31 2016-07-07 中兴通讯股份有限公司 Asset management method and system
CN107613043A (en) * 2017-09-26 2018-01-19 小草数语(北京)科技有限公司 The regional information searching method and its device of IP address
CN107682466A (en) * 2017-09-26 2018-02-09 小草数语(北京)科技有限公司 The regional information searching method and its device of IP address

Similar Documents

Publication Publication Date Title
WO2016062099A1 (en) Searching method and searching apparatus
CN106874176B (en) Intelligent test method and device
CN105760380A (en) Database query method, device and system
CN115495133B (en) DBC dynamic self-adaptive updating method and device, electronic equipment and storage medium
CN110737747A (en) data operation method, device and system
CN114661736B (en) Electronic map updating method and device, electronic equipment, storage medium and product
CN102968497B (en) dynamic data processing method and system
CN109634986B (en) System monitoring method, device, computer and computer readable storage medium
EP3819789A2 (en) Method, apparatus, device and storage medium for map retrieval test
US20170124219A1 (en) Determining data field offsets using a document object model representation
CN111641690B (en) Session message processing method and device and electronic equipment
CN107239568B (en) Distributed index implementation method and device
JP3495641B2 (en) Updated map information distribution system, updated map information distribution server system, updated map information distribution client system, method, and recording medium recording the method
CN113157705A (en) Method and device for quickly querying region according to IP
CN105117260A (en) Method and system for installing hardware device driver
CN111190923A (en) Electronic bill query method and device, storage medium and electronic equipment
CN110928895B (en) Data query and data table establishment method, device and equipment
CN113779165B (en) IP address geographic position ambiguity judging method and related equipment
CN113420088B (en) Method, device and terminal for synchronizing cache database and database
CN114329091A (en) Data directory generation method, device and equipment
CN114357318A (en) Multi-dimensional track data display method and device and electronic equipment
CN113918728A (en) Industrial Internet post-service knowledge map analysis platform
CN109460255B (en) Memory address query method and device
CN108241497B (en) Dynamic updating method, device, equipment and medium for vehicle-mounted client development interface
CN111737600B (en) Information providing method, device and equipment and system for displaying customer information

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