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 method for managing a registered IP address, which is used for obtaining an accurate domain name IP address field, a domain name user name and domain name owner information, sorting the domain name IP address field, the domain name user name and the domain name owner information according to the domain name owner, uniformly storing the domain name user name, the domain name owner information in a database and facilitating query, and as shown in figure 1, the method comprises the following steps:
step 101: acquiring an APNIC data file of an Athetic internet information center;
step 102: extracting domain name registration information based on whois inquiry instruction according to the acquired APNIC data file; the domain name registration information comprises a domain name user name netname and a domain name IP address field;
step 103: converting the extracted netname into a netname in a standard format based on the netname alias database; the netname alias database records the corresponding relation between the extracted netname and the netname in the standard format;
step 104: analyzing to obtain domain name owner information according to the netname in the standard format;
step 105: storing domain name owner information, the extracted netname and the domain name IP address field into a registered IP address management database;
the registered IP address management database records the corresponding relation among the domain name owner information, the extracted netname and the domain name IP address field.
As can be seen from fig. 1, the data file of the asia-pacific internet information center APNIC is obtained; extracting domain name registration information based on whois inquiry instruction according to the acquired APNIC data file; the domain name registration information comprises a domain name user name netname and a domain name IP address field; converting the extracted netname into a netname in a standard format based on the netname alias database; analyzing to obtain domain name owner information according to the netname in the standard format; storing domain name owner information, the extracted netname and the domain name IP address field into a registered IP address management database; the domain name user name, the domain name IP address field and the domain name owner information are obtained, sorted according to the domain name owner, and uniformly stored in a database for convenient query; and the extracted netname is converted into the netname in the standard format through the netname alias database, so that accurate domain name owner information can be analyzed and obtained more quickly according to the netname in the standard format, and the speed and the accuracy of registered IP address management are improved.
In specific implementation, an Athetic Internet information center APNIC data file is obtained firstly. Among them, the Asia-Pacific Network Information Center (apic) is one of five global regional internet registration authorities, and is responsible for the distribution of Asia-Pacific IP addresses and ASN (autonomous system number) and manages the international organization of a part of root domain name server images. Established in 1993, headquarters located in brisbane, australia. It provides a dispatch and registration service that supports internet operations globally. Organization members include network service providers, national internet registries, and similar internet registration management organizations. The apic is responsible for the asian pacific region, containing 56 economic zones.
After the APNIC data file is obtained, domain name registration information is extracted and obtained based on whois inquiry instructions according to the obtained APNIC data file. The acquired APNIC data file comprises a plurality of pieces of domain name registration information, the domain name registration information comprises a domain name user name netname and a domain IP address field, the netname is a legal name registered in the APNIC by the domain name user, and the domain IP address field is an IP address field registered in the APNIC by the registered domain name.
Because the netnames in the apic data file are not uniform, and a plurality of netnames exist in the same domain name user, after domain name registration information is extracted, the extracted netnames are converted into the netnames in the standard format based on the netname alias database, wherein the netname alias database records the corresponding relationship between the extracted netnames and the netnames in the standard format, and in a specific embodiment, the netname alias database is manually maintained by the user.
And analyzing to obtain the domain name owner information according to the netname in the standard format. In specific implementation, the netname in the standard format includes a prefix and a suffix, and the specific flow ofstep 104 is shown in fig. 2, and includes:
step 201: judging whether the prefix is a first preset value or not;
step 202: if the prefix is a first preset value, determining that all the domain names are first-class companies to obtain company information of the first-class companies;
step 203: if the prefix is not the first preset value, determining that all domain names are second companies, and obtaining company information of the second companies according to the suffix and the prefix.
In a specific embodiment, the netname in the standard format may be XXXXXX-SS, for example, and includes a prefix XXXXXX and a suffix SS, and if the prefix XXXXXX is a first preset value, the domain name owner is determined to be a first type company, which may be, for example, an independent company other than the operator. If the prefix XXXXXXX is not the first preset value, it is determined that the domain name owner is a second type company, the second type company may be a network operator, and company information of the second type company is obtained according to the suffix SS and the prefix XXXXXXX, and may include an operator name, a affiliation subsidiary name, and the like.
After the domain name owner information is obtained, storing the domain name owner information, the extracted netname and the domain name IP address field into a registered IP address management database; the registered IP address management database records the corresponding relation among the domain name owner information, the extracted netname and the domain name IP address field. In the specific storage, one domain name owner has a plurality of registered domain names, that is, a plurality of extracted netnames and a plurality of domain name IP address fields may correspond to the same domain name owner, and for example, the extracted netnames and domain name IP address fields of the same domain name owner may be stored in a data list of the domain name owner.
In a specific embodiment, a method for managing a registered IP address is further provided, as shown in fig. 3, on the basis of fig. 1, the method further includes:
step 301: calculating to obtain a network code NetID according to the extracted netname;
step 302: storing the NetID into a registered IP address management database; the registered IP address management database records a correspondence between domain name owner information and NetID.
In specific implementation, according to the extracted netname, the network code NetID is calculated according to the following formula:
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 operator codes, the codes are represented by [1-9999], wherein 9999 represents that the code does not belong to any operator and represents a first type company;
c represents 4-bit province code, the code range is represented by [ 0000-: 351, a step of; 9999 represents no province found;
d represents the sequence code, the coding range is represented by [1-999999], if the netname obtained by extraction corresponds to an operator, the segment is 0, and the sequence is sequentially increased for the first type company.
After calculating to obtain the NetID, storing the NetID into a registered IP address management database; the method comprises the steps that the corresponding relation between domain name owner information and a NetID is recorded in a registered IP address management database, and one domain name owner corresponds to a unique NetID, so that when registered IP address management of at least one piece of domain name registration information is completed and the registered IP address management of unmanaged domain name registration information is carried out, the NetID of the unmanaged domain name registration information is obtained through calculation according to the netname extracted from the unmanaged domain name registration information; if there is a NetID identical to the NetID of the unmanaged domain name registration information in the registered IP address management database, the domain name owner information corresponding to the identical NetID is stored as the domain name owner information of the unmanaged domain name registration information. By setting the NetID, the domain name owner is uniquely identified, and after the same NetID is detected to exist in the database, the domain name owner information does not need to be analyzed again, so that the processing flow is saved, and the processing speed is increased.
A specific example is given below to illustrate how embodiments of the present invention perform registered IP address management. This example is a registered IP address management software system developed for application to the above-described registered IP address management method.
The registered IP address management software system provided in this example is divided into 4 subsystems: the system comprises a data file acquisition subsystem, a registration information acquisition and analysis subsystem (core subsystem), a netname alias maintenance subsystem and a registration information storage subsystem.
First, the data file acquisition subsystem instructs, 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 an APNIC data file, this file is currently IPV4(Internet Protocol version 4), and it may be extended to support obtaining IPV6(Internet Protocol version 6) file in the future. Through Cron (a timing execution tool under linux) scheduling, once a week, for example, once every 24 nights of a sunday, the specific execution logic is as shown in fig. 4.
After the data file is successfully acquired, calling a registration information acquisition and analysis subsystem interface, and extracting and acquiring domain name registration information through a whois3-L IP command; the domain name registration information comprises a domain name user name netname and a domain name IP address field, and the returned domain name registration information is analyzed by combining with a netname alias maintenance subsystem.
The netname alias maintenance subsystem is configured to maintain a netname alias database, for example, a domain owner may have a plurality of different netnames, for example:
china telecom: CHINANET, CHINANET-BB
China telecommunication Guangxi division: CHINANET-QH
China Unicom: UNICOM
UNICOM-NM, a division of inner Mongolia, Unicom, China
Moving in China: CMNET
China mobile guangdong division: CMNET-guangdong
China netcom: CNCGROUP
Chinese iron Tong: CRTC
China sidepitong beijing division: CRBjB
Independent company: TimeNet
It can be seen that the format of the netname is not standard, so that the originally extracted netname brings certain difficulty to the analysis of the registration information. Therefore, the netname alias maintenance subsystem designs a netname alias database, and converts the extracted netname into a standard format XXXXX-SS, so that the subsequent analysis is simplified.
As shown in fig. 5, a specific execution logic of the registration information acquisition and analysis subsystem initializes a global NetInfo (global network IP information data) data structure in a system memory, which may be implemented by using a Hash Table, where the NetInfo data structure includes all fields of Table NetInfo, and adds a flag field flag [0|1], where 0 indicates that the domain name registration information is not stored in the database, and 1 indicates that the domain name registration information is stored. And simultaneously reading all records in the NetInfo table, wherein the flag ofNetLevel 1 and 2 is 1, and the record flag of NetLevel 3 is 0. The NetIpInfo data structure contains all the fields of table NetIpInfo and is not read into a record in the table.
Reading a country information record in a country code table (national info), reading domain name registration information only when the country of the current domain name registration information is judged to be China, and performing subsequent operation by using an APINC IP registration information extraction module; otherwise, directly calling the interface of the registered information warehousing subsystem, warehousing the information which does not need to be processed, and finishing the analysis.
The registration information analysis module is mainly used for converting the extracted netname into a netname in a standard format based on a netname alias database, and analyzing to obtain domain name owner information according to the netname in the standard format. Fig. 6 and 7 show a logic processing flow for analyzing and obtaining domain name owner information according to a netname in a standard format, where fig. 6 is a diagram for determining whether a domain name owner is an independent company, and after it is determined in fig. 6 that the domain name owner is not an independent company, it is determined by using fig. 7 that operator information of the domain name owner, including a branch company, is a provincial company or a group company.
The registration information acquisition and analysis subsystem is further configured to calculate a network code NetID according to the extracted netname, for example, a specific NetID is shown in fig. 8.
The registration information warehousing subsystem stores the domain name owner information, the extracted netname and the domain name IP address field into a registration IP address management database, the registration IP address management database records the corresponding relation among the domain name owner information, the extracted netname and the domain name IP address field, and stores the NetID into the registration IP address management database, and the registration IP address management database records the corresponding relation among the domain name owner information and the NetID.
The time for acquiring the APNIC address information is long, so that when the registration information is extracted, the data is directly recorded in the memory data structure, after all the information is extracted, the information in the table NetInfo is deleted, and meanwhile, the data in the memory data structure is stored in the database.
The specific processing logic is as follows:
deleting all records in the NetInfo table;
and saving all records offlag 1 in the NetInfo data structure into a NetInfo table.
User usage interface of the netname alias maintenance subsystem as shown in fig. 9, a user may maintain a netname database, such as add, delete, modify, query, etc.
Inputting alias, standard name, description (domain name user name), clicking to add, and storing in netname database named netname alias.
Inputting alias names or standard names, clicking for query, and querying all alias names;
selecting one or more alias records in the list returned by the query, and clicking to delete the alias records;
in the list returned by the query, the standard name and description of this record may be modified.
Based on the same inventive concept, embodiments of the present invention further provide a registered IP address management apparatus, and since the principle of the problem solved by the registered IP address management apparatus is similar to that of the registered IP address management method, the implementation of the registered IP address management apparatus may refer to the implementation of the registered IP address management method, and repeated details are not repeated, and the specific structure is as shown in fig. 10:
afile obtaining module 1001, configured to obtain an APNIC data file of an atsi information center;
a domain name registrationinformation extracting module 1002, configured to extract domain name registration information based on a whois query instruction according to the obtained apic data file; the domain name registration information comprises a domain name user name netname and a domain name IP address field;
anetname standardization module 1003, configured to convert the extracted netname into a netname in a standard format based on a netname alias database; the netname alias database records the corresponding relation between the extracted netname and the netname in the standard format;
a domain nameowner determining module 1004, configured to analyze, according to the netname in the standard format, to obtain domain name owner information;
aninformation storage module 1005, configured to store the domain name owner information, the extracted netname, and the domain name IP address field into a registered IP address management database; the registered IP address management database records the corresponding relationship among the domain name owner information, the extracted netname and the domain name IP address field.
In a specific embodiment, there is further provided a registered IP address management apparatus, as shown in fig. 11, on the basis of fig. 10, the apparatus further includes: a networkcode determination module 1101 for:
calculating to obtain a network code NetID according to the extracted netname;
storing the NetID into a registered IP address management database; the registered IP address management database records a correspondence between domain name owner information and NetID.
In specific implementation, the obtained apic data file includes a plurality of pieces of domain name registration information, and when the registration IP address management of at least one piece of domain name registration information is completed and the registration IP address management is performed on the unmanaged domain name registration information, the networkcode determining module 1101 is further configured to:
calculating the NetID of the unmanaged domain name registration information according to the netname extracted from the unmanaged domain name registration information;
theinformation storage module 1005 is further configured to: if there is a NetID identical to the NetID of the unmanaged domain name registration information in the registered IP address management database, the domain name owner information corresponding to the identical NetID is stored as the domain name owner information of the unmanaged domain name registration information.
In a specific implementation, the netname in the standard format includes a prefix and a suffix, and the domain nameowner determining module 1004 is specifically configured to:
judging whether the prefix is a first preset value or not;
if the prefix is a first preset value, determining that all the domain names are first-class companies to obtain company information of the first-class companies;
if the prefix is not the first preset value, determining that all domain names are second companies, and obtaining company information of the second companies according to the suffix and the prefix.
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 registration IP address management method when executing the computer program.
An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program for executing the above-mentioned registration IP address management method is stored.
In summary, the method and apparatus for managing a registered IP address provided in the embodiments of the present invention have the following advantages:
obtaining an APNIC data file of an Athetic internet information center; extracting domain name registration information based on whois inquiry instruction according to the acquired APNIC data file; the domain name registration information comprises a domain name user name netname and a domain name IP address field; converting the extracted netname into a netname in a standard format based on the netname alias database; analyzing to obtain domain name owner information according to the netname in the standard format; storing domain name owner information, the extracted netname and the domain name IP address field into a registered IP address management database; the domain name user name, the domain name IP address field and the domain name owner information are obtained, sorted according to the domain name owner, and uniformly stored in a database for convenient query; and the extracted netname is converted into the netname in the standard format through the netname alias database, so that accurate domain name owner information can be analyzed and obtained more quickly according to the netname in the standard format, and the speed and the accuracy of registered IP address management are improved. By setting the netID as the unique identifier of the extracted netname, as long as the netID of certain domain name registration information is detected to exist in the registration IP address management database, the domain name registration information does not need to be analyzed repeatedly, and only the domain name owner information corresponding to the netID and the extracted netname in the database are stored in the database as the analysis result of the local name registration information, so that the processing flow is saved, and the efficiency of managing the registration IP address is improved.
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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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.