CN107800816A - A kind of IP address database method for building up and terminal device - Google Patents
A kind of IP address database method for building up and terminal device Download PDFInfo
- Publication number
- CN107800816A CN107800816A CN201710905017.5A CN201710905017A CN107800816A CN 107800816 A CN107800816 A CN 107800816A CN 201710905017 A CN201710905017 A CN 201710905017A CN 107800816 A CN107800816 A CN 107800816A
- Authority
- CN
- China
- Prior art keywords
- address
- current
- network segment
- domain
- value
- 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.)
- Granted
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/22—Indexing; Data structures therefor; Storage structures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
- G06F16/258—Data format conversion from or to a database
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Software Systems (AREA)
- Small-Scale Networks (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
The invention belongs to technical field of network security, more particularly to a kind of IP address database method for building up and terminal device.Methods described includes:Obtain the IP address that each operation system provides;The IP address of acquisition is collected, the IP address after being collected;An IP address being not yet selected is chosen from the IP address after described collect as current IP address;The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified database;Return and perform described the step of one IP address being not yet selected of selection is as current IP address from the IP address after described collect and subsequent step, untill the IP address being not yet selected is not present in the IP address after collecting described in.Different IP address formats is converted to the IP address of preset format, so that when carrying out IP address identification and matching again, the automation matching of same pattern can be directly carried out, greatly improve matching efficiency.
Description
Technical field
The invention belongs to technical field of network security, more particularly to a kind of IP address database method for building up and terminal to set
It is standby.
Background technology
In order to ensure the safety of network system, many units or company can all establish the IP address blacklist data of oneself
Storehouse, it is recorded in the inside there will be the IP address of security risk and forbids these IP address to access the network system of oneself, correspondingly,
Many units or company can also establish the IP address white list database of oneself, by organization internal or other reliable sources
IP address is recorded in the inside, when the IP address in white list accesses network system without being detected to it.But these IP
IP address in address black list database or IP address white list database is typically all to derive from many different channels,
Its form often differs greatly, some be according to full IP forms (such as:101.89.64.228), some are according to whole 8 network segments
Form (such as:43.230.222.0/24), some be according to non-whole 8 network segment forms (such as:43.230.220.0/22), need
Manually it is identified and matched, efficiency is extremely inefficient.
The content of the invention
In view of this, the embodiments of the invention provide a kind of IP address database method for building up and terminal device, to solve
Need that manually the IP address of different-format is identified and matched, the problem of efficiency is extremely inefficient.
The first aspect of the embodiment of the present invention provides a kind of IP address database method for building up, can include:
Obtain the IP address that each operation system provides;
The IP address of acquisition is collected, the IP address after being collected;
An IP address being not yet selected is chosen from the IP address after described collect as current IP address;
The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified number
According in storehouse;
Return to perform described one IP address being not yet selected of selection from the IP address after described collect and be used as and work as
The step of preceding IP address and subsequent step, until it is described collect after IP address in the IP address being not yet selected is not present
Untill;
Wherein, the IP address that the current IP address is converted to preset format includes:
If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment are obtained
Digit for IP address binary system subnet mask in character " 1 " total number;
If the network segment digit of the current IP address is more than 16 and is less than 24, the current IP address is split as some
Individual 24 network segment IP address, the number of 24 network segment IP address are to be determined according to the network segment digit of the current IP address
First number;
If the network segment digit of the current IP address is more than 24, by the current IP address with being split as several full IP
Location, the number of the full IP address is the second number determined according to the network segment digit of the current IP address.
The second aspect of the embodiment of the present invention provides a kind of computer-readable recording medium, the computer-readable storage
Media storage has computer program, and the computer program realizes following steps when being executed by processor:
Obtain the IP address that each operation system provides;
The IP address of acquisition is collected, the IP address after being collected;
An IP address being not yet selected is chosen from the IP address after described collect as current IP address;
The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified number
According in storehouse;
Return to perform described one IP address being not yet selected of selection from the IP address after described collect and be used as and work as
The step of preceding IP address and subsequent step, until it is described collect after IP address in the IP address being not yet selected is not present
Untill;
Wherein, the IP address that the current IP address is converted to preset format includes:
If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment are obtained
Digit for IP address binary system subnet mask in character " 1 " total number;
If the network segment digit of the current IP address is more than 16 and is less than 24, the current IP address is split as some
Individual 24 network segment IP address, the number of 24 network segment IP address are to be determined according to the network segment digit of the current IP address
First number;
If the network segment digit of the current IP address is more than 24, by the current IP address with being split as several full IP
Location, the number of the full IP address is the second number determined according to the network segment digit of the current IP address.
The third aspect of the embodiment of the present invention provides a kind of IP address database and establishes terminal device, including memory,
Processor and it is stored in the computer program that can be run in the memory and on the processor, the computing device
Following steps are realized during the computer program:
Obtain the IP address that each operation system provides;
The IP address of acquisition is collected, the IP address after being collected;
An IP address being not yet selected is chosen from the IP address after described collect as current IP address;
The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified number
According in storehouse;
Return to perform described one IP address being not yet selected of selection from the IP address after described collect and be used as and work as
The step of preceding IP address and subsequent step, until it is described collect after IP address in the IP address being not yet selected is not present
Untill;
Wherein, the IP address that the current IP address is converted to preset format includes:
If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment are obtained
Digit for IP address binary system subnet mask in character " 1 " total number;
If the network segment digit of the current IP address is more than 16 and is less than 24, the current IP address is split as some
Individual 24 network segment IP address, the number of 24 network segment IP address are to be determined according to the network segment digit of the current IP address
First number;
If the network segment digit of the current IP address is more than 24, by the current IP address with being split as several full IP
Location, the number of the full IP address is the second number determined according to the network segment digit of the current IP address.
Existing beneficial effect is the embodiment of the present invention compared with prior art:The embodiment of the present invention obtains each business system
The IP address that system provides;The IP address of acquisition is collected, the IP address after being collected;IP after described collect
An IP address being not yet selected is chosen in address as current IP address;The current IP address is converted into default lattice
The IP address of formula, and the IP address after conversion is stored into specified database;Return described in performing from the IP after described collect
A step of IP address being not yet selected is as current IP address and subsequent step are chosen in address, until the remittance
Untill the IP address being not yet selected is not present in the IP address of the General Logistics Department;Wherein, it is described to be converted to the current IP address
The IP address of preset format includes:If the current IP address is non-full IP address, the network segment of the current IP address is obtained
Digit, the network segment digit for IP address binary system subnet mask in character " 1 " total number;If the current IP address
When network segment digit is more than 16 and is less than 24, the current IP address is split as several 24 network segment IP address;If described work as
When the network segment digit of preceding IP address is more than 24, the current IP address is split as several full IP address.Namely for difference
IP address format take corresponding conversion method, the IP address of preset format is converted into, so as to again with carrying out IP
When location identifies and matched, the automation matching of same pattern can be directly carried out, greatly improves matching efficiency.
Brief description of the drawings
Technical scheme in order to illustrate the embodiments of the present invention more clearly, below will be to embodiment or description of the prior art
In the required accompanying drawing used be briefly described, it should be apparent that, drawings in the following description be only the present invention some
Embodiment, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these
Accompanying drawing obtains other accompanying drawings.
Fig. 1 is a kind of one embodiment flow chart of IP address database method for building up in the embodiment of the present invention;
Fig. 2 is the exemplary flow that current IP address is split as to several 24 network segment IP address in the embodiment of the present invention
Figure;
Fig. 3 is the schematic flow diagram that current IP address is split as to several full IP address in the embodiment of the present invention;
Fig. 4 is the schematic flow diagram being stored into the IP address after conversion in the embodiment of the present invention in specified database;
Fig. 5 is the schematic block diagram that IP address database provided in an embodiment of the present invention establishes terminal device;
Fig. 6 is the Program modual graph that IP address database provided in an embodiment of the present invention establishes program.
Embodiment
To enable goal of the invention, feature, the advantage of the present invention more obvious and understandable, below in conjunction with the present invention
Accompanying drawing in embodiment, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that disclosed below
Embodiment be only part of the embodiment of the present invention, and not all embodiment.Based on the embodiment in the present invention, this area
All other embodiment that those of ordinary skill is obtained under the premise of creative work is not made, belongs to protection of the present invention
Scope.
Referring to Fig. 1, a kind of one embodiment of IP address database method for building up can include in the embodiment of the present invention:
Step S101, the IP address that each operation system provides is obtained.
Step S102, the IP address of acquisition is collected, the IP address after being collected.
If for example, currently sharing 2 operation systems, the IP address that wherein interior employee uses in operation system 1 shares 100
Individual, the IP address that cooperation unit uses shares 200, then this 300 IP address are supplied to total system to make as white list by it
With, the IP address that interior employee uses in operation system 2 shares 50, and the IP address that cooperation unit uses shares 300, then its
It is supplied to total system to be used as white list this 350 IP address.
The IP address that these operation systems provide is collected, then can obtain 650 IP used as white list altogether
Address.
Certainly, the IP address that each operation system provides can also be the IP address used as blacklist.
Step S103, an IP address being not yet selected is chosen from the IP address after described collect as current IP
Address.
Step S104, the current IP address is converted to the IP address of preset format.
Because the IP address of non-whole 8 network segment forms is not easy to be allocated and manages, thus it is general rarely needed, and
In the IP address of whole 8 network segment forms, the IP address that network segment digit is 24 and the IP address that network segment digit is 32 (i.e. full IP
Address) the real ip address number that is included is less, and it is easy to quickly be identified and match, therefore, in the present embodiment, preferably will
Network segment digit is the IP address of the IP address and full IP address of 24 as the preset format.
If the current IP address is full IP address, without handling it.
If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment are obtained
Digit for IP address binary system subnet mask in character " 1 " total number, for example, in the IP shaped like 43.230.220.0/22
In address, the numeral 22 behind "/" represents the network segment digit.
If the network segment digit of the current IP address is 24, without handling it.
If the network segment digit of the current IP address is more than 16 and is less than 24, the current IP address is split as some
Individual 24 network segment IP address, the number of 24 network segment IP address are to be determined according to the network segment digit of the current IP address
First number.
If the network segment digit of the current IP address is more than 24, by the current IP address with being split as several full IP
Location, the number of the full IP address is the second number determined according to the network segment digit of the current IP address.
Step S105, the IP address after conversion is stored into specified database.
Step S106, with the presence or absence of the IP address being not yet selected in the IP address after collecting described in judging.
If it is described collect after IP address in the IP address that was not yet selected be present, return perform step S103 and its
Subsequent step, if it is described collect after IP address in the IP address that was not yet selected is not present, perform step S107.
Step S107, judge that IP address database is established to complete.
Preferably, several 24 network segment IP address that are split as the current IP address in step S104 specifically can be with
Including step as shown in Figure 2:
Step S201, the value in the 3rd domain of current IP address is obtained.
Step S202, according to the value meter in the 3rd domain of the network segment digit of the current IP address and the current IP address
Calculate the initial value in the 3rd domain of IP address after splitting.
Specifically calculation formula is:NewIP3=(256-224-Net) &IP3, wherein, Net is the network segment position of current IP address
Number, IP3 be the 3rd domain of current IP address value, NewIP3 be split after the 3rd domain of IP address initial value, & be by
Position AND operator, will participate in two data of computing, and AND operation is carried out by binary digit.
Step S203, first number is calculated according to the network segment digit of the current IP address.
Specifically calculation formula is:IPcount1=224-Net, wherein, IPcount1 is first number.
Step S204, the value in current IP address the first two domain is obtained.
Step S205, rising according to the 3rd domain of IP address after the value in current IP address the first two domain, fractionation
Initial value and first number calculate 24 network segment IP address after each fractionation respectively.
Illustrated by taking IP address 200.16.23.15/22 as an example, obtain the value in the 3rd domain of the IP address first
(IP3=23), then according to the value meter in the 3rd domain of the network segment digit (Net=22) of the IP address and the current IP address
Calculate the initial value in the 3rd domain of IP address after splitting, NewIP3=(256-224-Net) &IP3=252&23=(11111100) &
(00010111)=00010100=20, first number, IPcount1=2 are calculated according to the network segment digit of the IP address24 -Net=4, then understand that 24 network segment IP address after splitting share 4, and its 3rd domain is respectively 20,21,22,23, is kept
The value 200.16 in the first two domain and the value 15 in last domain are constant, and network segment digit is changed into 24, then finally obtains fractionation
24 network segment IP address afterwards are:
200.16.20.15/24
200.16.21.15/24
200.16.22.15/24
200.16.23.15/24
Preferably, several full IP address that are split as the current IP address in step S104 specifically can be including such as
Step shown in Fig. 3:
Step S301, the value in the 4th domain of current IP address is obtained.
Step S302, according to the value meter in the 4th domain of the network segment digit of the current IP address and the current IP address
Calculate the initial value in the 4th domain of IP address after splitting.
Specifically calculation formula is:NewIP4=(256-224-Net) &IP4, wherein, Net is the network segment position of current IP address
Number, IP4 be the 4th domain of current IP address value, NewIP4 be split after the 4th domain of IP address initial value, & be by
Position AND operator, will participate in two data of computing, and AND operation is carried out by binary digit.
Step S303, second number is calculated according to the network segment digit of the current IP address.
Specifically calculation formula is:IPcount2=232-Net, wherein, IPcount2 is second number.
Step S304, the value in first three domain of current IP address is obtained.
Step S305, rising according to the 4th domain of IP address after the value in first three domain of current IP address, fractionation
Initial value and second number calculate the full IP address after each fractionation respectively.
Illustrated by taking IP address 200.16.23.253/30 as an example, obtain the value in the 4th domain of the IP address first
(IP4=253), then according to the value in the 4th domain of the network segment digit (Net=30) of the IP address and the current IP address
Calculate the initial value in the 4th domain of IP address after splitting, NewIP4=(256-232-Net) &IP4=252&253=
(11111100) & (11111101)=11111100=252, second number is calculated according to the network segment digit of the IP address,
IPcount2=232-Net=4, then understand that the full IP address after splitting shares 4, and its 4th domain is respectively 252,253,
254th, 255, keep the value 200.16.23 in first three domain constant, then finally obtaining the full IP address after splitting is:
200.16.23.252
200.16.23.253
200.16.23.254
200.16.23.255
Preferably, step S105 can specifically include step as shown in Figure 4:
Step S401, the start physical address of the specified database is obtained.
Step S402, latter two domain value of the IP address after the conversion is obtained.
Step S403, according to the IP address after the start physical address of the specified database, the conversion latter two
The storage byte number that domain value and default single ip address occupy determines storage corresponding with the IP address after the conversion
Space.
Step S404, the IP address after the conversion is stored into the corresponding memory space.
If for example, the start physical address of the specified database is Address_start, the IP address after the conversion
200.16.23.12, it is respectively 23 and 12 to obtain its latter two domain value, less than 3 decimal systems of value in last domain,
It is mended 0, final 012 in a high position, the value in the two domains is then sequentially connected with, obtains 23012.What if single ip address occupied
Storage byte number is arranged to 6, then memory space corresponding to the IP address after the conversion is from Address_start+
23012*6 to Address_start+23012*6+5 memory space.
The value of IP address and its memory space in database are namely established into one-to-one relation,
In the case of known IP address, you can know its storage location in database.Carried out to an IP address to be detected
When matching, without the IP address in whole database is matched with it one by one, and it is only used in corresponding to the IP address
Extract that the IP address of storage is matching in storage location, greatly reduce the amount of calculation of IP address matching, save
With the time.
Preferably, it can also be constantly updated after the IP address database establishes completion:Every default
Time interval obtain the newly-increased IP address of each operation system and delete IP address;It is default by the newly-increased IP address conversion
The IP address of form, and the IP address after conversion is stored into the specified database;It is by the IP address conversion of deleting
The IP address of preset format, searched in the specified database with change after described in IP address that to delete IP address consistent,
And memory space corresponding with the IP address found is emptied.By being constantly updated to the IP address database,
The accuracy of the IP address in database is remained, is used in this, as blacklist or white list, can be maximum
The security of guarantee system.
In summary, the embodiment of the present invention obtains the IP address that each operation system provides;To the IP address of acquisition
Collected, the IP address after being collected;An IP being not yet selected is chosen from the IP address after described collect
Location is as current IP address;The current IP address is converted to the IP address of preset format, and the IP address after conversion is deposited
Store up in specified database;Return with performing described one IP being not yet selected of selection from the IP address after described collect
The step of location is as current IP address and subsequent step, until it is described collect after IP address in be not present and be not yet selected
IP address untill;Wherein, the IP address that the current IP address is converted to preset format includes:If the current IP
Address is non-full IP address, then obtains the network segment digit of the current IP address, and the network segment digit is the binary system of IP address
The total number of character " 1 " in subnet mask;If the network segment digit of the current IP address is more than 16 and is less than 24, described it will work as
Preceding IP address is split as several 24 network segment IP address;If the network segment digit of the current IP address is more than 24, by described in
Current IP address is split as several full IP address.Namely take corresponding conversion side for different IP address formats
Method, the IP address of preset format is converted into, so that when carrying out IP address identification and matching again, can directly carry out same mould
The automation matching of formula, greatly improves matching efficiency.
Corresponding to the IP address database method for building up described in foregoing embodiments, Fig. 5 shows that the embodiment of the present invention provides
IP address database establish the schematic block diagram of terminal device, for convenience of description, illustrate only related to the embodiment of the present invention
Part.
In the present embodiment, it can be desktop PC, notebook, the palm that the IP address database, which establishes terminal device,
The computing devices such as upper computer and cloud server.The IP address database, which establishes terminal device, may include:Processor 50, memory
51 and it is stored in the computer program 52 that can be run in the memory 51 and on the processor 50.
The processor 50 can be CPU (Central Processing Unit, CPU), can also be
Other general processors, digital signal processor (Digital Signal Processor, DSP), application specific integrated circuit
(Application Specific Integrated Circuit, ASIC), field programmable gate array (Field-
Programmable Gate Array, FPGA) either other PLDs, discrete gate or transistor logic,
Discrete hardware components etc..General processor can be microprocessor or the processor can also be any conventional processor
Deng.
The memory 51 can be the internal storage unit that the IP address database establishes terminal device 5, such as IP
Address database establishes the hard disk or internal memory of terminal device 5.The memory 51 can also be that the IP address database is established
The External memory equipment of terminal device 5, such as the IP address database establish on terminal device 5 the plug-in type hard disk being equipped with,
Intelligent memory card (Smart Media Card, SMC), secure digital (Secure Digital, SD) card, flash card (Flash
Card) etc..Further, the memory 51 can also both include the inside that the IP address database establishes terminal device 5
Memory cell also includes External memory equipment.The memory 51 is used to store the computer program and the IP address number
The other programs and data needed for terminal device 5 are established according to storehouse.The memory 51 can be also used for temporarily storing defeated
The data that goes out or will export.
Referring to Fig. 6, it is the Program modual graph of computer program 52 provided in an embodiment of the present invention.In the present embodiment,
Described computer program 52 can be divided into one or more program modules, and one or more of program modules are deposited
It is stored in the memory 51, and as performed by the processor 50, to complete the present invention.For example, in figure 6, described meter
Calculation machine program 52, namely IP address database establish that program can be divided into IP address acquisition module 601, IP address collects mould
Block 602, current IP address choose module 603, IP address format modular converter 604, IP address memory module 605.Describe below
The function of the program module 601-605 will specifically be introduced.
IP address acquisition module 601, the IP address provided for obtaining each operation system;
IP address summarizing module 602, for collecting to the IP address of acquisition, the IP address after being collected;
Current IP address chooses module 603, is not yet selected for choosing one from the IP address after described collect
IP address as current IP address;
IP address format modular converter 604, for the current IP address to be converted to the IP address of preset format;
IP address memory module 605, it is used for and the IP address after conversion is stored into specified database.
Wherein, the IP address format modular converter 604 can include:
Network segment digit acquiring unit, if being non-full IP address for the current IP address, with obtaining the current IP
The network segment digit of location, the network segment digit for IP address binary system subnet mask in character " 1 " total number;
First split cells, if the network segment digit for the current IP address is more than 16 and is less than 24, described it will work as
Preceding IP address is split as several 24 network segment IP address, and the number of 24 network segment IP address is according to the current IP
The first number that the network segment digit of location determines;
Second split cells, if the network segment digit for the current IP address is more than 24, by the current IP address
It is split as several full IP address, the number of the full IP address is the determined according to the network segment digit of the current IP address
Two numbers.
Further, first split cells can include:
First domain value obtains subelement, for obtaining the value in the 3rd domain of the current IP address;
First initial value computation subunit, for the network segment digit according to the current IP address and the current IP address
The initial value in the 3rd domain of IP address after the exploitation fractionation in the 3rd domain;
First number computation subunit, for calculating first number according to the network segment digit of the current IP address;
Second domain value obtains subelement, for obtaining the value in current IP address the first two domain;
First IP address computation subunit, for the IP after the value according to current IP address the first two domain, fractionation
The initial value and first number in the domain of address the 3rd calculate 24 network segment IP address after each fractionation respectively.
Further, second split cells can include:
Second domain value obtains subelement, for obtaining the value in the 4th domain of the current IP address;
Second initial value computation subunit, for the network segment digit according to the current IP address and the current IP address
The initial value in the 4th domain of IP address after the exploitation fractionation in the 4th domain;
Second number computation subunit, for calculating second number according to the network segment digit of the current IP address;
3rd domain value obtains subelement, for obtaining the value in first three domain of current IP address;
Second IP address computation subunit, for the IP after the value according to first three domain of current IP address, fractionation
The initial value and second number in the domain of address the 4th calculate the full IP address after each fractionation respectively.
Further, the IP address memory module 605 can include:
Start physical address acquiring unit, for obtaining the start physical address of the specified database;
Domain value acquiring unit, for obtaining latter two domain value of the IP address after the conversion;
Memory space determining unit, for the IP after the start physical address according to the specified database, the conversion
The storage byte number that latter two domain value of address and default single ip address occupy determines with the IP after the conversion
Memory space corresponding to location;
Memory cell, for the IP address after the conversion to be stored into the corresponding memory space.
Further, can also include in the computer program 52:
Increase and decrease IP address acquisition module, for obtaining the newly-increased IP address of each operation system every default time interval
With delete IP address;
Newly-increased IP address processing module, for the IP address by the newly-increased IP address conversion for preset format, and it will turn
IP address after changing is stored into the specified database;
IP address processing module is deleted, for deleting the IP address that IP address conversion is preset format by described, described
Searched in specified database with after conversion described in IP address that to delete IP address consistent, and will be corresponding with the IP address found
Memory space empty.
It is apparent to those skilled in the art that for convenience and simplicity of description, the system of foregoing description,
The specific work process of device and unit, the corresponding process in preceding method embodiment is may be referred to, will not be repeated here.
In the above-described embodiments, the description to each embodiment all emphasizes particularly on different fields, and is not described in detail or remembers in some embodiment
The part of load, it may refer to the associated description of other embodiments.
Those of ordinary skill in the art are it is to be appreciated that each embodiment described with reference to the embodiments described herein
Module, unit and/or method and step, it can be realized with the combination of electronic hardware or computer software and electronic hardware.This
A little functions are performed with hardware or software mode actually, application-specific and design constraint depending on technical scheme.Specially
Industry technical staff can realize described function using distinct methods to each specific application, but this realization is not
It is considered as beyond the scope of this invention.
In several embodiments provided herein, it should be understood that disclosed system, apparatus and method can be with
Realize by another way.For example, device embodiment described above is only schematical, for example, the unit
Division, only a kind of division of logic function, can there is other dividing mode, such as multiple units or component when actually realizing
Another system can be combined or be desirably integrated into, or some features can be ignored, or do not perform.It is another, it is shown or
The mutual coupling discussed or direct-coupling or communication connection can be the indirect couplings by some interfaces, device or unit
Close or communicate to connect, can be electrical, mechanical or other forms.
The unit illustrated as separating component can be or may not be physically separate, show as unit
The part shown can be or may not be physical location, you can with positioned at a place, or can also be distributed to multiple
On NE.Some or all of unit therein can be selected to realize the mesh of this embodiment scheme according to the actual needs
's.
In addition, each functional unit in each embodiment of the present invention can be integrated in a processing unit, can also
That unit is individually physically present, can also two or more units it is integrated in a unit.Above-mentioned integrated list
Member can both be realized in the form of hardware, can also be realized in the form of SFU software functional unit.
If the integrated unit is realized in the form of SFU software functional unit and is used as independent production marketing or use
When, it can be stored in a computer read/write memory medium.Based on such understanding, technical scheme is substantially
The part to be contributed in other words to prior art or all or part of the technical scheme can be in the form of software products
Embody, the computer software product is stored in a storage medium, including some instructions are causing a computer
Equipment (can be personal computer, server, or network equipment etc.) performs the complete of each embodiment methods described of the present invention
Portion or part steps.And foregoing storage medium includes:USB flash disk, mobile hard disk, read-only storage (ROM, Read-Only
Memory), random access memory (RAM, Random Access Memory), magnetic disc or CD etc. are various can store journey
The medium of sequence code.
Embodiment described above is merely illustrative of the technical solution of the present invention, rather than its limitations;Although with reference to foregoing reality
Example is applied the present invention is described in detail, it will be understood by those within the art that:It still can be to foregoing each
Technical scheme described in embodiment is modified, or carries out equivalent substitution to which part technical characteristic;And these are changed
Or replace, the essence of appropriate technical solution is departed from the spirit and scope of various embodiments of the present invention technical scheme.
Claims (10)
- A kind of 1. IP address database method for building up, it is characterised in that including:Obtain the IP address that each operation system provides;The IP address of acquisition is collected, the IP address after being collected;An IP address being not yet selected is chosen from the IP address after described collect as current IP address;The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified database In;Return and perform one IP address being not yet selected of selection from the IP address after described collect as current IP The step of address and subsequent step, until it is described collect after IP address in the IP address being not yet selected be not present be Only;Wherein, the IP address that the current IP address is converted to preset format includes:If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment digit are obtained For the total number of character " 1 " in the binary system subnet mask of IP address;If the network segment digit of the current IP address be more than 16 and less than 24, by the current IP address be split as several 24 Position network segment IP address, the number of 24 network segment IP address are determined according to the network segment digit of the current IP address first Number;If the network segment digit of the current IP address is more than 24, the current IP address is split as several full IP address, The number of the full IP address is the second number determined according to the network segment digit of the current IP address.
- 2. IP address database method for building up according to claim 1, it is characterised in that described by the current IP address Being split as several 24 network segment IP address includes:Obtain the value in the 3rd domain of the current IP address;IP after being split according to the exploitation in the 3rd domain of the network segment digit of the current IP address and the current IP address The initial value in the 3rd domain in address;First number is calculated according to the network segment digit of the current IP address;Obtain the value in current IP address the first two domain;According to the value in current IP address the first two domain, split after the 3rd domain of IP address initial value and described the One number calculates 24 network segment IP address after each fractionation respectively.
- 3. IP address database method for building up according to claim 1, it is characterised in that described by the current IP address Being split as several full IP address includes:Obtain the value in the 4th domain of the current IP address;IP after being split according to the exploitation in the 4th domain of the network segment digit of the current IP address and the current IP address The initial value in the 4th domain in address;Second number is calculated according to the network segment digit of the current IP address;Obtain the value in first three domain of current IP address;According to the value in first three domain of current IP address, split after the 4th domain of IP address initial value and described the Two numbers calculate the full IP address after each fractionation respectively.
- 4. according to the IP address database method for building up described in claim 1, it is characterised in that the IP by after conversion Location, which is stored into specified database, to be included:Obtain the start physical address of the specified database;Obtain latter two domain value of the IP address after the conversion;According to latter two domain value of the IP address after the start physical address of the specified database, the conversion and preset The storage byte number that occupies of single ip address determine corresponding with the IP address after conversion memory space;IP address after the conversion is stored into the corresponding memory space.
- 5. IP address database method for building up according to any one of claim 1 to 4, it is characterised in that also include:The newly-increased IP address of each operation system is obtained every default time interval and deletes IP address;The newly-increased IP address conversion is the IP address of preset format, and the IP address after conversion is stored into the specified number According in storehouse;The IP address that IP address conversion is preset format is deleted by described, is searched in the specified database and the institute after conversion State and delete the consistent IP address of IP address, and memory space corresponding with the IP address found is emptied.
- 6. a kind of computer-readable recording medium, the computer-readable recording medium storage has computer program, and its feature exists In IP address database of the realization as any one of claim 1 to 5 is built when the computer program is executed by processor The step of cube method.
- 7. a kind of IP address database establishes terminal device, including memory, processor and it is stored in the memory simultaneously The computer program that can be run on the processor, it is characterised in that real during computer program described in the computing device Existing following steps:Obtain the IP address that each operation system provides;The IP address of acquisition is collected, the IP address after being collected;An IP address being not yet selected is chosen from the IP address after described collect as current IP address;The current IP address is converted to the IP address of preset format, and the IP address after conversion is stored into specified database In;Return and perform one IP address being not yet selected of selection from the IP address after described collect as current IP The step of address and subsequent step, until it is described collect after IP address in the IP address being not yet selected be not present be Only;Wherein, the IP address that the current IP address is converted to preset format includes:If the current IP address is non-full IP address, the network segment digit of the current IP address, the network segment digit are obtained For the total number of character " 1 " in the binary system subnet mask of IP address;If the network segment digit of the current IP address be more than 16 and less than 24, by the current IP address be split as several 24 Position network segment IP address, the number of 24 network segment IP address are determined according to the network segment digit of the current IP address first Number;If the network segment digit of the current IP address is more than 24, the current IP address is split as several full IP address, The number of the full IP address is the second number determined according to the network segment digit of the current IP address.
- 8. IP address database according to claim 7 establishes terminal device, it is characterised in that described by the current IP Address dividing is that several 24 network segment IP address include:Obtain the value in the 3rd domain of the current IP address;IP after being split according to the exploitation in the 3rd domain of the network segment digit of the current IP address and the current IP address The initial value in the 3rd domain in address;First number is calculated according to the network segment digit of the current IP address;Obtain the value in current IP address the first two domain;According to the value in current IP address the first two domain, split after the 3rd domain of IP address initial value and described the One number calculates 24 network segment IP address after each fractionation respectively.
- 9. IP address database according to claim 7 establishes terminal device, it is characterised in that described by the current IP Address dividing is that several full IP address include:Obtain the value in the 4th domain of the current IP address;IP after being split according to the exploitation in the 4th domain of the network segment digit of the current IP address and the current IP address The initial value in the 4th domain in address;Second number is calculated according to the network segment digit of the current IP address;Obtain the value in first three domain of current IP address;According to the value in first three domain of current IP address, split after the 4th domain of IP address initial value and described the Two numbers calculate the full IP address after each fractionation respectively.
- 10. the IP address database according to any one of claim 7 to 9 establishes terminal device, it is characterised in that described IP address after conversion is stored into specified database includes:Obtain the start physical address of the specified database;Obtain latter two domain value of the IP address after the conversion;According to latter two domain value of the IP address after the start physical address of the specified database, the conversion and preset The storage byte number that occupies of single ip address determine corresponding with the IP address after conversion memory space;IP address after the conversion is stored into the corresponding memory space.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710905017.5A CN107800816B (en) | 2017-09-29 | 2017-09-29 | IP address database establishing method and terminal equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710905017.5A CN107800816B (en) | 2017-09-29 | 2017-09-29 | IP address database establishing method and terminal equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107800816A true CN107800816A (en) | 2018-03-13 |
CN107800816B CN107800816B (en) | 2020-11-03 |
Family
ID=61533878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710905017.5A Active CN107800816B (en) | 2017-09-29 | 2017-09-29 | IP address database establishing method and terminal equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107800816B (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109246014A (en) * | 2018-09-10 | 2019-01-18 | 中通服咨询设计研究院有限公司 | The method that a kind of pair of IP address carries out Fast Classification |
CN111698231A (en) * | 2020-06-02 | 2020-09-22 | 浙江宇视科技有限公司 | Address data management method, device, equipment and storage medium |
CN112714204A (en) * | 2020-12-22 | 2021-04-27 | 赛尔网络有限公司 | IPv6 address and network segment matching method and device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102523196A (en) * | 2011-11-21 | 2012-06-27 | 北京神州绿盟信息安全科技股份有限公司 | Information identification method, device and system |
CN104767839A (en) * | 2015-03-25 | 2015-07-08 | 五八有限公司 | IP positioning method and device |
CN105630654A (en) * | 2014-11-07 | 2016-06-01 | 昆达电脑科技(昆山)有限公司 | System and method for displaying IP address of BMC |
CN105744010A (en) * | 2014-12-12 | 2016-07-06 | 中兴通讯股份有限公司 | Method and device for realizing network address translation and access control list rule polymerization |
-
2017
- 2017-09-29 CN CN201710905017.5A patent/CN107800816B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102523196A (en) * | 2011-11-21 | 2012-06-27 | 北京神州绿盟信息安全科技股份有限公司 | Information identification method, device and system |
CN105630654A (en) * | 2014-11-07 | 2016-06-01 | 昆达电脑科技(昆山)有限公司 | System and method for displaying IP address of BMC |
CN105744010A (en) * | 2014-12-12 | 2016-07-06 | 中兴通讯股份有限公司 | Method and device for realizing network address translation and access control list rule polymerization |
CN104767839A (en) * | 2015-03-25 | 2015-07-08 | 五八有限公司 | IP positioning method and device |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109246014A (en) * | 2018-09-10 | 2019-01-18 | 中通服咨询设计研究院有限公司 | The method that a kind of pair of IP address carries out Fast Classification |
CN109246014B (en) * | 2018-09-10 | 2021-04-20 | 中通服咨询设计研究院有限公司 | Method for rapidly classifying IP addresses |
CN111698231A (en) * | 2020-06-02 | 2020-09-22 | 浙江宇视科技有限公司 | Address data management method, device, equipment and storage medium |
CN111698231B (en) * | 2020-06-02 | 2022-06-24 | 浙江宇视科技有限公司 | Address data management method, device, equipment and storage medium |
CN112714204A (en) * | 2020-12-22 | 2021-04-27 | 赛尔网络有限公司 | IPv6 address and network segment matching method and device, electronic equipment and storage medium |
CN112714204B (en) * | 2020-12-22 | 2022-09-20 | 赛尔网络有限公司 | IPv6 address and network segment matching method and device, electronic equipment and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN107800816B (en) | 2020-11-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109772714A (en) | Cargo picking method and device, storage medium, electronic equipment | |
CN109533756B (en) | Substrate warehousing method and device and warehousing control system | |
CN107800816A (en) | A kind of IP address database method for building up and terminal device | |
CN108062367A (en) | The method for uploading and its terminal of a kind of data list | |
CN107657051A (en) | A kind of generation method of picture tag, terminal device and storage medium | |
CN107679208A (en) | A kind of searching method of picture, terminal device and storage medium | |
CN108520471A (en) | It is overlapped community discovery method, device, equipment and storage medium | |
CN110201393A (en) | Configuration data storage method and device and electronic equipment | |
CN111966712A (en) | Data processing method, device, server and storage medium | |
CN107492215A (en) | The method and ATM terminals of banknote are shared in ATM | |
CN107944731A (en) | The method for building up and device of typical project cost template | |
CN107506494A (en) | Document handling method, mobile terminal and computer-readable recording medium | |
CN107508687A (en) | A kind of method, apparatus of charging, Internet of Things application platform and accounting server | |
CN109981697B (en) | File unloading method, system, server and storage medium | |
CN110008020A (en) | EMS memory management process, device, electronic equipment and computer readable storage medium | |
CN107783787A (en) | A kind of software systems method for splitting and terminal device | |
CN110278565B (en) | Base station design method and device | |
CN108255950A (en) | Date storage method and terminal device | |
CN117391596A (en) | Material and procedure matching method and device, communication equipment and storage medium | |
CN104933453A (en) | Information management system and method of ring main unit (RMU) | |
CN109359146A (en) | A kind of automating ETL data processing tools and its application method | |
CN107506386A (en) | A kind of data aggregation method based on NAS, device, terminal device and storage medium | |
CN104125283B (en) | A kind of message queue method of reseptance and system for cluster | |
CN108400887A (en) | The structural recognition method and device of symbolic network | |
CN114282029A (en) | Primitive management method and device, electronic equipment and storage medium |
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 |