IP geographical location information query method, terminal device and storage medium

A technology of geographic location information and query method, applied in the field of IP geographic location information query method, terminal equipment and storage medium, can solve the problems of long time consumption, memory consumption, large proportion of network transmission time consumption, etc., so as to reduce the query volume , the effect of reducing loading time and query speed

Active Publication Date: 2021-06-11
XIAMEN FUYUN INFORMATION TECH CO LTD
View PDF7 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003]However, the above method has the following disadvantages: 1. Directly use the method of querying the database, which is limited to the performance and concurrency of database query, and is only suitable for low query frequency and the number of IPs Second, the way to put it into the Redis cache, the system must use Redis components, and at the same time, if there is no good data structure, but directly save all IP geographic location records to Redis, it will not only consume a lot of Redis resources but also initialize It will take a long time for the data to reach Redis. At the same time, in the scenario of extremely high QPS, the proportion of Redis network transmission time consumption is very large; 3. Directly storing IP geographic location records into JVM memory without using compression algorithm will consume a lot of time. large amount of memory

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • IP geographical location information query method, terminal device and storage medium
  • IP geographical location information query method, terminal device and storage medium
  • IP geographical location information query method, terminal device and storage medium

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0039] Embodiments of the present invention provide a method for querying IP geographic location information, such as figure 1 As shown, the method includes the following steps:

[0040] S1: traverse the IP information database, and convert each piece of IP information in it into the format of starting IP, ending IP and geographic location information.

[0041] Geographical location information may be composed of countries, provinces, cities, counties, and townships, which can be set by those skilled in the art without limitation here.

[0042] The format after conversion in this embodiment is: Long-type start IP|Long-type end IP|country|province|city|county|township.

[0043] S2: After sorting all the IP information, store it in the intermediate file.

[0044] In this embodiment, sort according to the size of the initial IP in the IP information. Specifically, after the initial IP is set as a key and stored in the TreeMap for sorting, the TreeMap is traversed, and the IP in...

Embodiment 2

[0073] The present invention also provides an IP geographic location information query terminal device, including a memory, a processor, and a computer program stored in the memory and operable on the processor, and the computer program is implemented when the processor executes the computer program. Steps in the above method embodiment of Embodiment 1 of the present invention.

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to an IP geographic position information query method, a terminal device and a storage medium, and the method comprises the steps: S1, traversing an IP information base, and converting each piece of IP information in the IP information base into a format in which a starting IP, an ending IP and geographic position information are spliced; S2, after all IP information is sorted, storing the IP information into an intermediate file; S3, reading each piece of IP information in the intermediate file in sequence, and generating a db file; S4, when the application system is started, obtaining an end offset address of the data area and an end offset address of the search info area; S5, reading the data in the data area and the search info area into a data Region list in the memory, S6, querying a starting IP and an ending IP corresponding to the IP to be searched in the ipSegments data table according to the received IP to be searched; S7, acquiring the initial offset address length of the geographic position information from the ipRegionPtr data table and the ipRegionLen data table; and S8, searching the geographical location information of the IP to be searched from the dataRegion. The problems of high Redis resource consumption and overlarge JVM memory occupation when the IP geographical location information is excessive can be well solved.

Description

technical field [0001] The invention relates to the field of IP information, in particular to an IP geographic location information query method, a terminal device and a storage medium. Background technique [0002] In the security protection system and attack log analysis system, it is often necessary to trace the geographical location of the attack IP. Several commonly used methods to find the geographic location of provinces and cities through IP are: 1. Directly query the database: put the IP start segment and geographic location into a commonly used database (such as MySql, Oracle, etc.), and query the database when using it; 2. 1. Put it into the Redis cache: store the data in the database in Redis in advance according to a certain data structure, and query Redis when using it; 3. Put it directly into the JVM memory: read the data in the database, store it in the memory, and use it Query memory directly. [0003] However, the above method has the following disadvanta...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F16/22G06F16/2453G06F16/29
CPCG06F16/2282G06F16/2453G06F16/29
Inventor 钟月明陈奋陈荣有李伟彬
Owner XIAMEN FUYUN INFORMATION TECH CO LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products