Disclosure of Invention
The embodiment of the invention provides a domain name registration IP address query method, which is used for comprehensively and visually displaying a registration domain name, a domain name IP address field and domain name owner information and querying according to the requirements of a user, and comprises the following steps:
receiving a user query instruction;
inquiring in a registered IP address management database according to a user inquiry instruction to obtain an inquiry result; wherein the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of an Asia-Pacific Internet information center;
sending the query result to a user side;
the registered IP address management database is pre-established according to the following method:
acquiring an APNIC data file; the APNIC data file comprises a plurality of registration domain names;
extracting domain name registration information based on whois query instruction according to the APNIC data file; the domain name registration information comprises domain name owner information and a domain name IP address field;
storing the registered domain name, the information of the registered owner and the domain name IP address field into a registered IP address management database in a tree structure;
extracting and obtaining domain name registration information based on whois inquiry instruction according to the APNIC data file, wherein the domain name registration information comprises the following steps:
judging whether the extracted domain name registration information meets preset conditions or not according to the preset range of the IP address field;
if the range of the extracted domain name IP address field is smaller than the preset range of the IP address field, re-extracting the extracted domain name IP address field according to a first preset configuration parameter until the domain name registration information obtained by extraction meets a preset condition;
if the initial address of the extracted domain name IP address field is smaller than the initial address in the preset range of the IP address field, re-extracting the extracted domain name IP address field according to a second preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
and if the extracted domain name registration information meets the preset condition, not processing.
The embodiment of the invention also provides a domain name registration IP address query device, which is used for displaying the registration domain name, the domain name IP address field and the domain name owner information comprehensively and visually and querying according to the requirements of users, and comprises the following components:
the instruction receiving module is used for receiving a user query instruction;
the information query module is used for querying in the registered IP address management database according to the user query instruction to obtain a query result; wherein the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of an Asia-Pacific Internet information center;
the result sending module is used for sending the query result to the user side;
still include the database and preset the module, the database presets the module and includes:
the file acquisition unit is used for acquiring an APNIC data file; the APNIC data file includes a plurality of registered domain names;
the domain name analysis unit is used for extracting and obtaining domain name registration information based on whois inquiry instructions according to the APNIC data file; the domain name registration information comprises domain name owner information and a domain name IP address field;
a statistic storage unit, configured to store the registered domain name, the information of the registered owner, and the domain name IP address field in a registered IP address management database in a tree structure;
the domain name analyzing unit is specifically configured to:
judging whether the extracted domain name registration information meets preset conditions or not according to the preset range of the IP address field;
if the range of the extracted domain name IP address field is smaller than the preset range of the IP address field, re-extracting the extracted domain name IP address field according to a first preset configuration parameter until the domain name registration information obtained by extraction meets a preset condition;
if the initial address of the extracted domain name IP address field is smaller than the initial address in the preset range of the IP address field, re-extracting the extracted domain name IP address field according to a second preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
and if the extracted domain name registration information meets the preset condition, not processing.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the domain name registration IP address query method when executing the computer program.
An embodiment of the present invention also provides a computer-readable storage medium, in which a computer program for executing the above domain name registration IP address query method is stored.
In the embodiment of the invention, a user query instruction is received; inquiring in a registered IP address management database according to a user inquiry command to obtain an inquiry result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of the Asia-Pacific Internet information center; sending the query result to a user side; the registered domain name, the domain name IP address field and the domain name owner information can be comprehensively and visually displayed, and the query is carried out according to the received user query instruction, so that the query result meeting the user requirements is obtained.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The embodiment of the invention provides a domain name registration IP address query method, which is used for comprehensively and visually displaying a registration domain name, a domain name IP address field and domain name owner information and querying according to the requirements of a user, and as shown in figure 1, the method comprises the following steps:
step 101: receiving a user query instruction;
step 102: inquiring in a registered IP address management database according to a user inquiry command to obtain an inquiry result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of the Asia-Pacific Internet information center;
step 103: and sending the query result to the user side.
As can be seen from FIG. 1, in the embodiment of the present invention, a user query instruction is received; inquiring in a registered IP address management database according to a user inquiry instruction to obtain an inquiry result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of the Asia-Pacific Internet information center; sending the query result to the user side; the domain name IP address field and the domain name owner information of the registered domain name can be comprehensively and visually displayed, and the query is carried out according to the received user query instruction to obtain the query result meeting the user requirements.
In a specific implementation, a user query instruction is first received, where the user query instruction may include any known information of a registered domain name to be queried, such as a registered domain name, a domain name owner, a domain name IP address segment, or any combination.
After receiving a user query instruction, querying in a registered IP address management database according to the user query instruction to obtain a query result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is established in advance according to the APNIC data file of the Asia-Pacific Internet information center.
The registered IP address management database is pre-established according to the method shown in fig. 2, and includes:
step 201: acquiring an APNIC data file; the APNIC data file comprises a plurality of registration domain names;
step 202: extracting domain name registration information based on whois inquiry instruction according to the APNIC data file; the domain name registration information comprises domain name owner information and a domain name IP address field;
step 203: and storing the registered domain name, the information of the registered owner and the domain name IP address field into a registered IP address management database in a tree structure.
In specific implementation, the domain name owner information may be directly extracted according to the whois query instruction, or the domain name user name netname may be extracted according to the whois query instruction, and more detailed information about the registered owner may be obtained through analysis according to the extracted netname, for example, when the domain name owner is moved in china, the domain name owner is analyzed to obtain specific information about the domain name owner, i.e., the beijing division company and the detailed company information about the beijing mobile in china.
When extracting the domain IP address field in the domain registration information, there may be three cases:
the extracted domain name IP address field is completely the same as that which needs to be obtained currently, namely, the obtaining is completed at one time;
when the extracted domain name IP address field is a subsection of the current section which needs to be obtained, the domain name IP address field needs to be obtained for many times;
the initial address of the extracted domain name IP address segment is smaller than the initial address of the segment to be acquired, and multiple times of acquisition are required.
For the above three cases, step 202 specifically includes:
judging whether the extracted domain name registration information meets preset conditions or not according to the preset range of the IP address field;
if the range of the domain name IP address field obtained by extraction is smaller than the preset range of the IP address field, re-extracting the domain name IP address field obtained by extraction according to the first preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
if the initial address of the domain name IP address field obtained by extraction is smaller than the initial address in the preset range of the IP address field, re-extracting the domain name IP address field obtained by extraction according to a second preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
and if the extracted domain name registration information meets the preset condition, not processing.
In specific implementation, the extracted domain name IP address segment is re-extracted according to the first preset configuration parameter, for example, the integer value of the termination address of the extracted domain name IP address is added by 1, and then re-extracted repeatedly until the domain name registration information obtained by extraction meets the preset condition; and re-extracting the extracted domain name IP address segment according to a second preset configuration parameter, for example, adding 256 to the integer value of the initial address of the extracted domain name IP address, and re-extracting repeatedly until the extracted domain name registration information meets the preset condition.
For example, when domain name registration information is obtained for a certain large segment of IP address record, multiple segments of domain name IP addresses registered to each child node may be included, for example, beijing telecommunications, a plurality of domain name IP address subsections such as hai lake and daxing may be provided below, domain name registration information that is hai lake is returned for the first time, it is determined that the termination address of the hai lake is still within the preset range of the IP address segment (beijing), and the domain name registration information that is dawn is returned if the termination address needs to be searched again after the termination address +1 until all the domain name registration information corresponding to the preset range of the IP address segment is successfully obtained. And when the preset range of the IP address field is happy, returning the domain name registration information of the hai lake and the happy for the first time, wherein the initial address of the extracted domain name IP address field is smaller than the initial address in the preset range of the IP address field, the initial address needs to be shifted backwards by 1C (integer value plus 256), searching is carried out again, and the happy domain name registration information can be returned after repeating for many times.
In a specific embodiment, the implementation process ofstep 203 includes:
the information of registered owners is used as a root node of a tree structure and is stored in a registered IP address management database;
storing the registered domain name as a branch node of a tree structure into a registered IP address management database; the registered domain names of the same registered owner are stored under the same root node;
taking the domain name IP address field as a leaf node of a tree structure, and storing the leaf node in a registered IP address management database; and the domain name IP address fields of the same registered domain name are stored under the same branch node.
The tree structure is a nested structure of a hierarchy, and the outer layer and the inner layer of the tree structure have similar structures, so that the structure can be expressed recursively. The various dendrograms in the classic data structure are a typical tree structure: a tree can be simply represented as a root, subtree (branch), leaf. A tree structure is a data structure in which a "one-to-many" tree relationship exists between data elements.
After the storage is finished, the tree structure and the stored information can be displayed to the user so as to comprehensively and visually reflect the corresponding relation among the registered domain name, the domain name IP address field and the domain name owner information.
In a specific embodiment, the number of registered domain names of the same domain name owner, the number of domain name IP addresses, and the like may be counted, and the statistical result may be displayed to the user.
A specific example is given below to illustrate how embodiments of the present invention perform domain name registration IP address queries. The present example is a domain name registration IP address query system constructed by applying the above domain name registration IP address query method.
The system comprises a registration information browsing and inquiring subsystem, a data file acquiring subsystem, a registration information acquiring and analyzing subsystem and a registration information warehousing subsystem. The data file acquisition subsystem, the registration information acquisition and analysis subsystem and the registration information storage subsystem are used for pre-establishing a registration IP address management database, and the registration information browsing and query subsystem is used for managing the database according to the established registration IP address and querying corresponding information according to user requirements.
First, the data file acquisition subsystem commands, via wget (a free tool for automatically downloading files from the network):
http://ftp.apnic.net/apnic/dbase/data/country-ipv4.lst--output-document=/slview/nms/data/country-ipv4.lst
to obtain the APNIC data file, this file is IPV4 (Internet Protocol version 4 ) at present, and it may be extended to support obtaining IPV6 (Internet Protocol version 6 ) files in the future.
After the data file is successfully acquired, calling a registration information acquisition and analysis subsystem interface, extracting and acquiring domain name registration information through a whois3-L IP command, wherein the specific execution logic is shown in FIG. 3, and the registration information acquisition and analysis subsystem is divided into a plurality of sub-modules shown in FIG. 4 because the function of the subsystem is complex: the system comprises a registration information extraction module, a registration information segmentation searching module, a registration information analysis module, a registration information memory writing module and a segmentation searching exception handling module. By dividing a plurality of processing modules under the subsystem, nesting calling and organic coupling are realized among the modules, so that processing logic is more flexible, program errors are reduced, and extraction efficiency is improved.
An execution logic diagram of the registration information extraction module is shown in fig. 5, and is configured to extract and obtain domain name registration information based on a whois query instruction according to an APNIC data file, where the domain name registration information includes domain name owner information and a domain name IP address field. When the range of the extracted domain name IP address field is smaller than the preset range of the IP address field, the registration information segment search module is called in a nested manner, and a specific execution logic diagram is shown in fig. 6. When the initial address of the extracted domain name IP address field is smaller than the initial address in the preset range of the IP address field, the segment search exception handling module is called in a nested manner, and the specific execution logic is as shown in fig. 7. The processing procedures shown in fig. 5, fig. 6, and fig. 7 may all call a registration information analysis module in a nested manner, so as to analyze and obtain more detailed information of the registered owner, and a specific execution logic of the registration information analysis module is shown in fig. 8.
Since it takes a long time to obtain the APNIC address information, when extracting the registration information, as shown in fig. 9, the data may be directly recorded in the memory data structure by using the registration information memory writing module, and the registration information memory writing module is further configured to calculate the NetID of the network code of each registration domain name. The calculation formula is as follows:
NetID=a×1014 +b×1010 +c×106 +d
wherein a represents 4-bit national code and is represented by national prefix in international long term, for example, china is 0086;
b represents 4-bit operator code, the code range is represented by [1-9999], wherein 9999 represents independent company which does not belong to any operator and represents non-operator;
c represents 4-bit province code, the code range is represented from [0000-9999], wherein 0001 represents that the branch company of the operator is not a province company and represents a group company, the province code of China at present is represented by the long distance district number crown of a province city, such as Shanxi: 351, a step of; 9999 represents no province found;
d represents sequence coding, the coding range is represented by [1-999999], if the domain name owner is an operator, the segment is 0, and if the domain name owner is an independent company of a non-operator, the sequence is sequentially increased.
After extraction is completed, a registration information storage subsystem is called, a domain name, information of a registered owner and a domain name IP address field are registered in a memory data structure and stored in a database in a tree structure, and the network coding NetID can be stored in the database together.
After the storage is completed, the tree structure and the stored information can be displayed to the user, as shown in fig. 10, the interface adopts a Frame (label) separation mode, the tree structure on the left displays information of countries, domain name owners and the like, and the detailed information of corresponding levels is displayed on the right. After clicking China, all domain name owners in China and the registered domain names owned by all the owners can be seen, and the right side displays the registered domain name number counting result and the IP address number counting result of all the domain name owners.
In the tree structure on the left side, a certain operator, such as chinese telecommunications, is clicked, and a specific interface is displayed as shown in fig. 11, including all registered domain names (network names), specific domain user names (network chinese), network codes NetID, network descriptions, and domain IP address statistics of chinese telecommunications.
In the tree structure, clicking a branch company of a certain operator, such as china internet h-QH, or double-clicking the network code in fig. 11, displays an interface as shown in fig. 12, and displays a specific domain IP address, such as a start address, an end address, an address type, and the like.
In the tree structure, the independent company is clicked, the display interface is as shown in fig. 13, after the network name which the user wants to query is input in the network name, the query is clicked, the statistical list can be filtered, and the query is performed in a fuzzy matching mode. Double-clicking a certain network code in fig. 13, displaying an interface as shown in fig. 14, and displaying a specific domain IP address, such as a start address, an end address, an address type, a registered name, and the like.
Meanwhile, if it is desired to query information such as a registered domain name and a domain name owner corresponding to a certain IP address, the address query link in the page shown in fig. 10 may be clicked, and the display interface is as shown in fig. 15. When the IP address format of the desired query input by the user is a.b.c.d/mm, for example, the address segment of the desired query is 110.116.0.0/24, it needs to be converted into the start and end addresses in digital format (only one IP address is input, the start and end addresses are the same), and the conversion algorithm is:
neip (start) = a × 2563 +B×2562 +C×256+D;
nIP (end) = nIP (start) + mm
Wherein nIP (start) represents the integer number format of the start IP address; the naip (terminating) denotes an integer number format of a terminating IP address.
If the user inputs an IP address segment, the IP address is firstly converted into an integer format, then the difference is calculated, and the implementation code is as follows:
through the address conversion, IP addresses in various forms can be inquired, the inquiry is more flexible, and the operation of a user is facilitated.
According to a certain IP address, inquiring corresponding information, wherein the starting and ending address of the domain IP address in the returned inquiry result is (x, y), and the condition that the (x, y) and the starting and ending address (p, q) of the certain IP address in the inquiry condition are in crossed records needs to be ensured, namely that x is less than or equal to p, y is more than or equal to q.
The pages shown in fig. 10-15 can support functions of sorting by category, page display, excel export and the like.
Based on the same inventive concept, embodiments of the present invention further provide a domain name registration IP address query apparatus, and since the principle of the problem solved by the apparatus is similar to the domain name registration IP address query method, the implementation of the domain name registration IP address query apparatus can refer to the implementation of the domain name registration IP address query method, and the repeated parts are not repeated, and the specific structure is shown in fig. 16:
aninstruction receiving module 1601, configured to receive a user query instruction;
aninformation query module 1602, configured to query in the registered IP address management database according to the user query instruction, so as to obtain a query result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of the Asia-Pacific Internet information center;
aresult sending module 1603, configured to send the query result to the user side.
In specific implementation, the apparatus for querying a domain name registration IP address according to a specific embodiment further includes: the database presetting module, as shown in fig. 17, specifically includes:
afile acquiring unit 1701 for acquiring an apic data file; wherein, the APNIC data file comprises a plurality of registration domain names;
a domainname analyzing unit 1702, configured to extract domain name registration information based on the whois query instruction according to the apic data file; the domain name registration information comprises domain name owner information and a domain name IP address field;
astatistic storage unit 1703, configured to store the registered domain name, the information of the registered owner, and the domain name IP address field in a registered IP address management database in a tree structure.
In specific implementation, the domainname analysis unit 1702 is specifically configured to:
judging whether the extracted domain name registration information meets preset conditions or not according to the preset range of the IP address field;
if the range of the domain name IP address field obtained by extraction is smaller than the preset range of the IP address field, re-extracting the domain name IP address field obtained by extraction according to the first preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
if the initial address of the domain name IP address field obtained by extraction is smaller than the initial address in the preset range of the IP address field, re-extracting the domain name IP address field obtained by extraction according to a second preset configuration parameter until the domain name registration information obtained by extraction meets the preset condition;
and if the extracted domain name registration information meets the preset condition, not processing.
In specific implementation, thestatistical storage unit 1703 is specifically configured to:
the information of registered owners is used as a root node of a tree structure and is stored in a registered IP address management database;
taking the registered domain name as a branch node of a tree structure, and storing the branch node into a registered IP address management database; the registered domain names of the same registered owner are stored under the same root node;
taking the domain name IP address field as a leaf node of a tree structure, and storing the leaf node in a registered IP address management database; and the domain name IP address fields of the same registered domain name are stored under the same branch node.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the domain name registration IP address query method when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program for executing the domain name registration IP address query method.
In summary, in the embodiment of the present invention, a user query instruction is received; inquiring in a registered IP address management database according to a user inquiry command to obtain an inquiry result; wherein, the query result comprises: registering a domain name, domain name owner information and a domain name IP address field; the registered IP address management database is pre-established according to an APNIC data file of the Asia-Pacific Internet information center; sending the query result to the user side; the registered domain name, the domain name IP address field and the domain name owner information can be comprehensively and visually displayed, and the query is carried out according to the received user query instruction to obtain the query result meeting the user requirements. The registered IP address management database is established according to the APNIC data file, the data source is authoritative, the accuracy of the query result is high, the acquisition of the registered IP address information of all domestic operators, companies and other units which perform domain name registration on the APNIC can be supported, and the coverage is wide. The user can obtain all the associated information by inquiring according to any item of the IP address, the registered domain name and the domain name owner, and the user can conveniently inquire and use the information.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes may be made to the embodiment of the present invention by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.