CN106777163B - IP address belonged place query method and system based on red and black trees - Google Patents

IP address belonged place query method and system based on red and black trees Download PDF

Info

Publication number
CN106777163B
CN106777163B CN201611186707.1A CN201611186707A CN106777163B CN 106777163 B CN106777163 B CN 106777163B CN 201611186707 A CN201611186707 A CN 201611186707A CN 106777163 B CN106777163 B CN 106777163B
Authority
CN
China
Prior art keywords
field
data
index
address
address information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611186707.1A
Other languages
Chinese (zh)
Other versions
CN106777163A (en
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.)
Ctrip Travel Network Technology Shanghai Co Ltd
Original Assignee
Ctrip Travel Network Technology Shanghai 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 Ctrip Travel Network Technology Shanghai Co Ltd filed Critical Ctrip Travel Network Technology Shanghai Co Ltd
Priority to CN201611186707.1A priority Critical patent/CN106777163B/en
Publication of CN106777163A publication Critical patent/CN106777163A/en
Application granted granted Critical
Publication of CN106777163B publication Critical patent/CN106777163B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • G06F16/2246Trees, e.g. B+trees

Abstract

The invention discloses a method and a system for inquiring the belonged place of an IP address based on a red-black tree, wherein the method for inquiring the belonged place of the IP address based on the red-black tree comprises the following steps: s1Storing the IP address information into a database; s2Reading IP address information in the database to a computer memory; s3Converting the IP address information in an index form; s4Storing the IP address information in the index form into the red-black tree; s5Inquiring nodes corresponding to the IP addresses to be inquired from the red and black trees; s6And acquiring the information of the IP address to be inquired according to the node. The invention is based on computer memory, red and black tree algorithm and relational database, and has good expandability, real-time performance and high concurrency performance.

Description

IP address belonged place query method and system based on red and black trees
Technical Field
The invention relates to a method and a system for inquiring the belonged place of an IP address based on a red-black tree.
Background
In daily work, the information of the location of a certain IP address needs to be queried frequently, and the traditional method for querying the information of the location of the IP address is to store the information of the IP address into a relational database (such as MySQL), so that the method is available under the conditions of less concurrency and low real-time requirement, but once the concurrency is increased, great pressure is generated on the relational database, and the access speed is obviously reduced, so that the query method is very successful for occasions with high concurrency and high real-time requirement.
Disclosure of Invention
The invention provides a method and a system for inquiring an IP address belonged place based on a red-black tree, aiming at overcoming the defect that the traditional method for realizing information inquiry of the IP belonged place in the prior art generates great pressure on a relational database when the concurrency is increased, so that the access speed is reduced.
The invention solves the technical problems through the following technical scheme:
the invention provides a method for inquiring the belonged place of an IP address based on a red-black tree, which is characterized by comprising the following steps of:
S1storing the IP address information into a database;
S2reading IP address information in the database to a computer memory;
S3converting the IP address information in an index form;
S4storing the IP address information in the index form into the red-black tree;
S5inquiring nodes corresponding to the IP addresses to be inquired from the red and black trees;
S6and acquiring the information of the IP address to be inquired according to the node.
Preferably, step S2Comprises the following steps: reading the IP address information in the database into a computer memory by character string data in a JSON format (a lightweight data exchange format);
the string data includes a country field, a region field, a city field, and start and end IPs of consecutive IP segments of the city.
Preferably, step S3Comprises the following steps:
S31the IP address information is encapsulated into a set of Area data;
the Area type data comprises a type field and a name field, wherein the name field is used for representing the name of a country, a region or a city, and the type field is used for representing the combination of the country, the region and the city;
S32converting the Area data into first data;
the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data;
S33generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field;
S34merging second data with the same country index field, region index field and city index field to generate third data;
the third data comprises a country index field, a region index field, a city index field and an index field of the second data;
S35generating fourth data according to the IP address information and the third data;
wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data;
S36and converting the IP addresses in the start IP field and the end IP field in the fourth data into long type integers to generate fifth data.
Preferably, step S4The nodes of the red and black tree comprise a from field, an end field and a second index field;
the from field represents the long integer after the IP address translation is started, the end field represents the long integer after the IP address translation is ended, and the second index field is the index field of the third data.
The invention also provides a system for inquiring the place of the IP address based on the red and black tree, which is characterized by comprising the following steps:
the storage module is used for storing the IP address information into a database;
the reading module is used for reading the IP address information in the database into the memory of the computer;
the conversion module is used for converting the index form of the IP address information;
the storage module is used for storing the IP address information in the index form into the red and black tree;
the query module is used for querying a node corresponding to the IP address to be queried from the red and black tree;
and the acquisition module is used for acquiring the information of the IP address to be inquired according to the node.
Preferably, the reading module is configured to read the IP address information in the database into the computer memory in JSON-formatted character string data;
the string data includes a country field, a region field, a city field, and start and end IPs of consecutive IP segments of the city.
Preferably, the conversion module comprises:
the first conversion unit is used for encapsulating the IP address information into a set of Area data;
the Area type data comprises a type field and a name field, wherein the name field is used for representing the name of a country, a region or a city, and the type field is used for representing the combination of the country, the region and the city;
the second conversion unit is used for converting the Area data into first data;
the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data;
the third conversion unit is used for generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field;
the fourth conversion unit is used for merging the second data with the same country index field, region index field and city index field to generate third data;
the third data comprises a country index field, a region index field, a city index field and an index field of the second data;
a fifth conversion unit, configured to generate fourth data according to the IP address information and the third data;
wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data;
a sixth converting unit, configured to convert the IP addresses in the start IP field and the end IP field in the fourth data into long type integers, so as to generate fifth data.
Preferably, the nodes of the red-black tree include a from field, an end field and a second index field;
the from field represents the long integer after the IP address translation is started, the end field represents the long integer after the IP address translation is ended, and the second index field is the index field of the third data.
The positive progress effects of the invention are as follows: the invention is based on computer memory, red and black tree algorithm and relational database, and has good expandability, real-time performance and high concurrency performance. When the system is started, the IP address information data stored in the relational database in advance is read, and the IP address information data is read at one time, so that when a user searches the information of the IP address, the data in the red and black tree stored in the memory of the computer is directly inquired, the relational database does not need to be accessed, the inquiry speed is very high, and when the IP address information data changes, the IP address information only needs to be recorded into the relational database, the application is restarted, and the system is simple, convenient and efficient and is convenient to expand.
Drawings
FIG. 1 is a block diagram of a query system based on red and black tree IP addresses according to a preferred embodiment of the present invention.
FIG. 2 is a flowchart illustrating a method for querying the IP address based on the Red and Black Tree according to a preferred embodiment of the present invention.
Fig. 3 is a schematic structural diagram of a red-black tree generated by a query method to which an IP address based on the red-black tree belongs according to a preferred embodiment of the present invention.
Detailed Description
The invention is further illustrated by the following examples, which are not intended to limit the scope of the invention.
As shown in fig. 1, the query system for the IP address based on the red and black tree of the present embodiment includes a storage module 1, a reading module 2, a conversion module 3, a storage module 4, a query module 5, and an obtaining module 6.
The storage module 1 is used for storing the IP address information into a database; the reading module 2 is used for reading the IP address information in the database into the memory of the computer; the conversion module 3 is used for converting the index form of the IP address information; the storage module 4 is used for storing the IP address information in the index form into the red and black tree; the query module 5 is configured to query a node corresponding to the IP address to be queried from the red and black tree; the obtaining module 6 is configured to obtain the location information of the IP address to be queried according to the node.
Specifically, the reading module 2 is configured to read the IP address information in the database into a computer memory in JSON-formatted character string data; the string data includes a country field, a region field, a city field, and start and end IPs of consecutive IP segments of the city.
The conversion module comprises a first conversion unit, a second conversion unit, a third conversion unit, a fourth conversion unit, a fifth conversion unit and a sixth conversion unit;
the first conversion unit is used for encapsulating the IP address information into a set of Area data;
the Area type data comprises a type field and a name field, wherein the name field is used for representing the name of a country, a region or a city, and the type field is used for representing the combination of the country, the region and the city;
the second conversion unit is used for converting the Area data into first data;
the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data;
the third conversion unit is used for generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field;
the fourth conversion unit is used for merging second data with the same country index field, region index field and city index field to generate third data;
the third data comprises a country index field, a region index field, a city index field and an index field of the second data;
the fifth conversion unit is used for generating fourth data according to the IP address information and the third data;
wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data;
the sixth converting unit is configured to convert the IP addresses in the start IP field and the end IP field in the fourth data into long type integers to generate fifth data.
Specifically, the nodes of the red-black tree include a from field, an end field, and a second index field; the from field represents the long integer after the IP address translation is started, the end field represents the long integer after the IP address translation is ended, and the second index field is the index field of the third data.
The embodiment also provides a method for querying the IP address belonged to based on the red and black tree, as shown in fig. 2, which includes the following steps:
step 101, storing IP address information into a database;
step 102, reading IP address information in a database into a computer memory;
103, converting the IP address information in an index form;
step 104, storing the IP address information in the index form into a red-black tree;
step 105, inquiring a node corresponding to the IP address to be inquired from the red and black tree;
and 106, acquiring the information of the IP address to be inquired according to the node.
In the invention, IP address information is firstly recorded into a database for storage, the system reads the recorded IP address information from the database to a computer memory, a final index and an IP address are converted into an integer in a long form and then stored into a red-black tree in the computer memory after a series of conversion in an index form, when an access request acquires the IP belonging place information, a specific IP address is firstly converted into an integer in a long form, a node corresponding to the IP address is inquired in the red-black tree according to the integer, index data of the node is acquired, the IP belonging place information is acquired according to the index data, and the IP belonging place information is returned to a user.
In the TCP/IP protocol (transmission control protocol/internet protocol), the IP address appears in the form of binary digits, and a total of 4 bytes, that is, 32 bits, are composed of a network number (N-ID) and a host number (H-ID). According to the difference of network addresses, IP addresses can be divided into five categories: a class A address, a class B address, a class C address, a class D address, and a class E address. For the computer hosts on the same physical network, the network numbers are the same, except for the host number. When allocating IP addresses to cities, it is common to allocate a number of consecutive segments of IP addresses to a city, for example: 1.12.0.0 through 1.12.255.255, 1.15.168.0 through 1.15.191.255, etc., all belong to the IP addresses of Beijing. Usually each city contains a plurality of consecutive IP address fields, the IP addresses in these IP address fields all belong to the IP address of the city, and since IP is composed of 4 bytes and has no negative number, the IP address field can be converted into two 8-byte long type integers, and the numbers between the two integers all belong to the IP address of the city.
The IP address is composed of 4 segments, such as 1.15.168.0, the corresponding 4-byte binary form is 00000001.00001111.10101000.00000000, according to the calculation characteristics of the computer, the first segment can be left-shifted by 24 bits, the second segment can be left-shifted by 16 bits, the third segment can be left-shifted by 8 bits, the fourth segment can not be moved, the obtained integer summation is the integer value after the IP address conversion,
i.e., 16777216+983040+43008+0 ═ 17803264.
The red-black tree is a very mature data structure, is a binary search tree with red or black color on each node, is relatively efficient, and can perform search, insertion and deletion in O (log n) time, wherein n is the number of elements in the tree. The red and black tree must satisfy the following requirements in addition to the requirement of the binary search tree:
1. the nodes are red or black.
2. The roots are black.
3. All leaves were black (leaves were NIL nodes).
4. Each red node must have two black sub-nodes. (there cannot be two consecutive red nodes on all paths from each leaf to the root.)
5. All simple paths from any node to each of its leaves contain the same number of black nodes.
JSON is a data format, is mainly used for data exchange, is easy to read and write, and is easy for computer analysis and generation.
In the step 102, the IP address information in the database is specifically read into the computer memory as the character string data in the JSON format; the string data includes a country field, a region field, a city field, and start and end IPs of consecutive IP segments of the city.
Firstly, reading the IP address information from a database into a computer memory in a JSON format, for example:
{ "region": Tianjin "," start ": 1.15.232.0", "end": 1.15.232.255"," city ": Tianjin", "country": Chinese "},
{ "region": Liaoning "," start ": 1.14.33.0", "end": 1.14.33.255"," city ": Dalian", "country": Chinese "},
{ "region": Beijing "," start ": 1.15.186.0", "end": 1.15.186.255"," city ": Beijing", "country": China "},
{ "region": Beijing "," start ": 1.12.27.0", "end": 1.12.27.255"," city ": Beijing", "country": China "},
wherein start is the start IP of the continuous IP section of the data city, and end is the end IP.
Step 103 specifically comprises the following steps:
encapsulating the IP address information into a set of Area data; the Area data includes a type field and a name field, the name field is used to represent names of countries, regions or cities, such as china, tianjin, beijing, liaoning and grand junior in the above IP address information, and the type field is used to represent combinations among countries, regions and cities, that is, the combinations are composed of county (country), region and city (city) individually or randomly, where county, region and city are respectively represented by 1, 2 and 4, so that when the type is 1, a country is represented, a region is represented, when the type is 4, a city is represented, when the type is 3, the country name and the region name are the same, when the type is 5, the country name and the city name are the same, and when the type is 7, the country, the region and the city name are the same. The converted data are shown in table 1:
TABLE 1
type name
1 China (China)
6 Tianjin
2 Liaoning medicine
4 Large connecting piece
6 Beijing
Then, converting the Area data into first data; the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data; the converted data are shown in table 2:
TABLE 2
type name First index
1 China (China) 0
6 Tianjin 1
2 Liaoning medicine 2
4 Large connecting piece 3
6 Beijing 4
Then, generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field; wherein the country index field is a corresponding value of a first index column in table 2 corresponding to a count field in the IP address information, the region index field is a corresponding value of a first index column in table 2 corresponding to a region field, the city index field is a corresponding value of a first index column in table 2 corresponding to a city field, and the specifically generated data is shown in table 3:
TABLE 3
Figure BDA0001185882470000091
Figure BDA0001185882470000101
Then, merging second data with the same country index field, region index field and city index field to generate third data; the third data comprises a country index field, a region index field, a city index field and an index field of the second data; for example, for rows 3 and 4 in table 3, the country index field, the region index field, and the city index field are all the same, and are all china, beijing, and in order to eliminate duplicate data, third data is generated according to the second data, and the specifically generated data is as shown in table 4:
TABLE 4
National index Regional index City index Indexing of second data
0 1 1 0
0 2 3 1
0 4 4 2
Then, generating fourth data according to the IP address information and the third data; wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data; the specifically generated data are shown in table 5:
TABLE 5
Indexing of third data Initiating IP Terminating IP
0 1.15.232.0 1.15.232.255
1 1.14.33.0 1.14.33.255
2 1.12.27.0 1.12.27.255
2 1.15.186.0 1.15.186.255
Finally, the IP addresses in the start IP field and the end IP field in the fourth data are converted into long type integers to generate fifth data, and the specifically generated data is shown in table 6:
TABLE 6
Indexing of third data Initiating IP Terminating IP
0 17819648 17819903
1 17703168 17703423
2 17570560 17570815
2 17807872 17808127
Then, converting the IP in the index form into a red-black tree and storing the red-black tree in a computer memory, wherein each red-black tree node comprises a parent field, a left field, a right field, a color field, a from field, an end field and a second index field; the parent is a father node, left is a left node, right is a right node, and color indicates that the node is red or black, the from field represents a long integer after the start IP address conversion, the end field represents a long integer after the end IP address conversion, the second index field is an index field of the third data, namely a first column of table 6, and a specific red-black tree is shown in fig. 3, wherein a square represents a black node, and an ellipse represents a red node.
The red and black tree stores integers after the initial IP conversion and integers after the termination IP conversion of the IP section, and the specific integers after the IP address conversion need to be inquired, so the inquiry rule is as follows: the IP is converted into an integer, the IP is searched from a root node of the red-black tree, when the integer is smaller than a from integer in the nodes, the searching is continued along the left side of the node in the red-black tree, when the integer is larger than an end integer in the nodes, the searching is continued along the right side of the node in the red-black tree, otherwise, the searched node is the node corresponding to the IP information to be searched. If the node is NIL node in the searching process, the IP address is not valid IP. For example, IP address 1.15.186.10, the IP is first converted to an integer of long type, 17807882. Then, the red black tree is searched for nodes in the red black tree corresponding to the integer as 2, 17807872 and 17808127, and then index 2, namely the index of the third data, is obtained, and data 0, 4, 4 and 2 are obtained according to table 4, wherein 2 is the index of the second data, 0, 4 and 4 are the last column of the first data, namely the index of the Area class set, so that a counter is found as 0, namely China, region is 4, namely Beijing, and city is 4, namely Beijing. Therefore, the country corresponding to the IP is China, the region is Beijing, and the city is Beijing.
After the red and black trees are formed, in a specific IP query process, JSON format data of IP address information read from a database is not needed any more, and can be deleted from a memory. The data finally left in the memory is the set of Area classes, the third data and the red and black trees, so that the use of the memory of the computer can be reduced. Through statistics, the total number of the IP address information in the system is 719296, and through comparison of computer memories before and after the system is started, the system occupies about 20 Megabytes (MB) of memory after the system is started, in the era of rapid development of computer technology at present, the memory of a common household computer also has 2 Gigabytes (GB) or more, and the memory of a server special for a company is even up to dozens of GB, so that the memory occupation amount of the data can be regarded as negligible.
When the number of the IP address information is increased, the IP address information only needs to be added into the database in the current format and then the application program is restarted.
The invention reads the information data of the IP belonged to the computer memory pre-stored in the relational database, and then the data are subjected to index conversion for many times to form data of a red-black tree structure and stored in the computer memory. When inquiring a specific IP belonging to the information, firstly converting the IP address into a long type integer, then inquiring a specific node from a red-black tree according to the integer, and then acquiring the index information in the inquired node, thereby acquiring the specific IP belonging to the information corresponding to the index. The IP address information of the relational database is read when the system is started, and is finally stored in the memory of the computer in the structure of the red and black trees after multiple index conversions.
While specific embodiments of the invention have been described above, it will be appreciated by those skilled in the art that these are by way of example only, and that the scope of the invention is defined by the appended claims. Various changes and modifications to these embodiments may be made by those skilled in the art without departing from the spirit and scope of the invention, and these changes and modifications are within the scope of the invention.

Claims (4)

1. A method for inquiring the belonged place of an IP address based on a red and black tree is characterized by comprising the following steps:
S1storing the IP address information into a database;
S2reading IP address information in the database to a computer memory;
S3converting the IP address information in an index form;
S4storing the IP address information in the index form into the red-black tree;
S5inquiring nodes corresponding to the IP addresses to be inquired from the red and black trees;
S6acquiring the local information of the IP address to be inquired according to the node;
step S2Comprises the following steps: reading the IP address information in the database into a computer memory according to character string data in a JSON format;
the character string data comprises a country field, a region field, a city field and a starting IP and a terminating IP of a city continuous IP section;
step S3Comprises the following steps:
S31the IP address information is encapsulated into a set of Area data;
the Area type data comprises a type field and a name field, wherein the name field is used for representing the name of a country, a region or a city, and the type field is used for representing the combination of the country, the region and the city;
S32converting the Area data into first data;
the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data;
S33generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field;
S34merging second data with the same country index field, region index field and city index field to generate third data;
the third data comprises a country index field, a region index field, a city index field and an index field of the second data;
S35generating fourth data according to the IP address information and the third data;
wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data;
S36and converting the IP addresses in the start IP field and the end IP field in the fourth data into long type integers to generate fifth data.
2. The IP address local query method of claim 1, wherein step S4The nodes of the red and black tree comprise a from field, an end field and a second index field;
the from field represents the long integer after the IP address translation is started, the end field represents the long integer after the IP address translation is ended, and the second index field is the index field of the third data.
3. A IP address belonged to inquiry system based on red and black trees is characterized by comprising:
the storage module is used for storing the IP address information into a database;
the reading module is used for reading the IP address information in the database into the memory of the computer;
the conversion module is used for converting the index form of the IP address information;
the storage module is used for storing the IP address information in the index form into the red and black tree;
the query module is used for querying a node corresponding to the IP address to be queried from the red and black tree;
the acquisition module is used for acquiring the information of the IP address to be inquired according to the node;
the reading module is used for reading the IP address information in the database into the internal memory of the computer in a character string data in a JSON format;
the character string data comprises a country field, a region field, a city field and a starting IP and a terminating IP of a city continuous IP section;
the conversion module includes:
the first conversion unit is used for encapsulating the IP address information into a set of Area data;
the Area type data comprises a type field and a name field, wherein the name field is used for representing the name of a country, a region or a city, and the type field is used for representing the combination of the country, the region and the city;
the second conversion unit is used for converting the Area data into first data;
the first data comprises the type field, the name field and a first index field, and the first index field is an index of the Area data;
the third conversion unit is used for generating second data according to the IP address information and the first data;
wherein the second data comprises a country index field, a region index field, a city index field, a start IP field, and a stop IP field;
the fourth conversion unit is used for merging the second data with the same country index field, region index field and city index field to generate third data;
the third data comprises a country index field, a region index field, a city index field and an index field of the second data;
a fifth conversion unit, configured to generate fourth data according to the IP address information and the third data;
wherein the fourth data comprises a start IP field, a termination IP field, and an index field of the third data;
a sixth converting unit, configured to convert the IP addresses in the start IP field and the end IP field in the fourth data into long type integers, so as to generate fifth data.
4. The system of claim 3, wherein the nodes of the red-black tree include a from field, an end field, and a second index field;
the from field represents the long integer after the IP address translation is started, the end field represents the long integer after the IP address translation is ended, and the second index field is the index field of the third data.
CN201611186707.1A 2016-12-20 2016-12-20 IP address belonged place query method and system based on red and black trees Active CN106777163B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611186707.1A CN106777163B (en) 2016-12-20 2016-12-20 IP address belonged place query method and system based on red and black trees

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611186707.1A CN106777163B (en) 2016-12-20 2016-12-20 IP address belonged place query method and system based on red and black trees

Publications (2)

Publication Number Publication Date
CN106777163A CN106777163A (en) 2017-05-31
CN106777163B true CN106777163B (en) 2020-05-26

Family

ID=58896095

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611186707.1A Active CN106777163B (en) 2016-12-20 2016-12-20 IP address belonged place query method and system based on red and black trees

Country Status (1)

Country Link
CN (1) CN106777163B (en)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108523874A (en) * 2018-02-26 2018-09-14 广东工业大学 Signal base line drift correction method, apparatus based on red black tree and storage medium
CN110309137A (en) * 2018-02-28 2019-10-08 贵州白山云科技股份有限公司 A kind of data managing method and device
CN108875006B (en) * 2018-06-15 2021-03-30 泰康保险集团股份有限公司 Method and device for determining IP address region
CN109033347A (en) * 2018-07-23 2018-12-18 广州大学 A kind of real-time quick collision method of multidate information based on red black tree
CN110134834B (en) * 2019-05-15 2023-06-09 四川新网银行股份有限公司 Method for accelerating IP positioning by using dynamic AVL forest cache
CN112307138A (en) * 2019-07-30 2021-02-02 华扬联众数字技术股份有限公司 Storage and query method, system and medium of region information
CN110505322B (en) * 2019-08-28 2022-07-01 杭州迪普科技股份有限公司 IP address field searching method and device
CN110769079A (en) * 2019-10-30 2020-02-07 杭州迪普科技股份有限公司 Method and device for retrieving geographic position corresponding to IP
CN110928882B (en) * 2019-11-27 2023-08-25 上海金仕达软件科技股份有限公司 Memory database indexing method and system based on improved red black tree
CN111797180A (en) * 2020-05-21 2020-10-20 网宿科技股份有限公司 Method for establishing geographic position information index and inquiring information and electronic equipment
CN114201520B (en) * 2021-12-09 2023-04-28 北京航星永志科技有限公司 Method and device for rapidly retrieving IP address and electronic equipment
CN115801736B (en) * 2023-01-09 2023-04-18 北京天际友盟信息技术有限公司 IP address library construction loading method and device and IP address query method and device

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929484A (en) * 2006-09-25 2007-03-14 北京启明星辰信息技术有限公司 Method and system for IP address fast positioning
CN103561133A (en) * 2013-11-19 2014-02-05 中国科学院计算机网络信息中心 IP address ownership information indexing and fast querying method
CN104102707A (en) * 2014-07-10 2014-10-15 西安交通大学 Geographical attribution information inquiry method oriented to MapReduce frame
CN104133883A (en) * 2014-07-29 2014-11-05 深圳市鼎智通讯有限公司 Telephone number attribution data compression algorithm
CN105512229A (en) * 2015-11-30 2016-04-20 北京奇艺世纪科技有限公司 IP address regional information storage, query method and device
CN105843750A (en) * 2016-03-22 2016-08-10 深圳森格瑞通信有限公司 Linear data structure query efficiency improving method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929484A (en) * 2006-09-25 2007-03-14 北京启明星辰信息技术有限公司 Method and system for IP address fast positioning
CN103561133A (en) * 2013-11-19 2014-02-05 中国科学院计算机网络信息中心 IP address ownership information indexing and fast querying method
CN104102707A (en) * 2014-07-10 2014-10-15 西安交通大学 Geographical attribution information inquiry method oriented to MapReduce frame
CN104133883A (en) * 2014-07-29 2014-11-05 深圳市鼎智通讯有限公司 Telephone number attribution data compression algorithm
CN105512229A (en) * 2015-11-30 2016-04-20 北京奇艺世纪科技有限公司 IP address regional information storage, query method and device
CN105843750A (en) * 2016-03-22 2016-08-10 深圳森格瑞通信有限公司 Linear data structure query efficiency improving method

Also Published As

Publication number Publication date
CN106777163A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
CN106777163B (en) IP address belonged place query method and system based on red and black trees
CN102122285B (en) Data cache system and data inquiry method
CN108205577B (en) Array construction method, array query method, device and electronic equipment
CN111190904B (en) Method and device for hybrid storage of graph-relational database
US9292554B2 (en) Thin database indexing
CN109166615B (en) Medical CT image storage and retrieval method based on random forest hash
CN107025290B (en) Storage method and reading method of fault tree data
CN110825733B (en) Multi-sampling-stream-oriented time series data management method and system
CN105243162A (en) Relational database storage-based objective data model query method and device
CN110928882B (en) Memory database indexing method and system based on improved red black tree
CN104021123A (en) Method and system for data transfer
CN105574212A (en) Image retrieval method for multi-index disk Hash structure
US20230195769A1 (en) Computer system and method for indexing and retrieval of partially specified type-less semi-infinite information
CN103002061A (en) Method and device for mutual conversion of long domain names and short domain names
CN105912696A (en) DNS (Domain Name System) index creating method and query method based on logarithm merging
CN105740428A (en) B+ tree-based high-dimensional disc indexing structure and image search method
CN110020001A (en) Storage, querying method and the corresponding equipment of string data
Alam et al. Performance of point and range queries for in-memory databases using radix trees on GPUs
CN111522820A (en) Data storage structure, storage retrieval method, system, device and storage medium
CN113076334A (en) Data query method, index generation device and electronic equipment
CN113434511B (en) Clustering index method based on Hilbert curve
CN112800067B (en) Range query method, range query device, computer-readable storage medium and electronic device
CN110825747B (en) Information access method, device and medium
CN111859034A (en) Based on LR tree and B+Dual index structure of spatiotemporal data of tree
CN113111413A (en) BIM model attribute semi-structured light weight design method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant