CN107018210A - A kind of IP address base establishing method and device - Google Patents
A kind of IP address base establishing method and device Download PDFInfo
- Publication number
- CN107018210A CN107018210A CN201710236515.5A CN201710236515A CN107018210A CN 107018210 A CN107018210 A CN 107018210A CN 201710236515 A CN201710236515 A CN 201710236515A CN 107018210 A CN107018210 A CN 107018210A
- Authority
- CN
- China
- Prior art keywords
- address
- storehouse
- geographical location
- information
- location information
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
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
- H04L61/255—Maintenance or indexing of mapping tables
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/69—Types of network addresses using geographic information, e.g. room number
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Telephonic Communication Services (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
IP address base establishing method and device that the present embodiment is provided, obtain the daily record data that is produced during using APP of user, and obtain from daily record data IP address;When it is determined that not including the IP address in IP address storehouse, the corresponding geographical location information of the IP address is inquired about from IP information inquiry networks;Then, by IP address geographical location information corresponding with the IP address it is corresponding storage into IP address storehouse, so as to create the IP address storehouse that server is own, without obtaining geographical location information from IP information inquiry networks every time, the response speed positioned according to IP address is improved.
Description
Technical field
The invention belongs to technical field of the computer network, more particularly to a kind of IP address base establishing method and device.
Background technology
As intelligent terminal technology is developed rapidly, it is various based on intelligent terminal develop application program (Application,
APP) arise at the historic moment, many APP need the geographical position of positioning intelligent terminal, for example, it is desired to the city according to where intelligent terminal
Commodity or the APP of service are provided.
Many APP positioning function depends on global positioning system (the Global Positioning of intelligent terminal
System, GPS), i.e., intelligent terminal is opened after GPS, and background program obtains the longitude and latitude of intelligent terminal, so as to obtain APP use
Urban information where family;If active user is not turned on GPS location function, APP can be according to the IP address of active user
The urban information matched with the IP address is obtained, the geographical position of user how is quickly determined according to the IP address of user exactly again
Put, the technical problem as urgent need to resolve.
The content of the invention
In view of this, it is an object of the invention to provide a kind of IP address base establishing method and device, created in service end
IP address storehouse, to realize that the IP address according to the user for accessing APP is quickly and accurately positioned to user, its technical scheme is as follows:
In a first aspect, a kind of IP address base establishing method of the application, applied to service end, including:
Obtain the IP address in application program correspondence daily record data;
Judge whether include the IP address in IP address storehouse;
When not including the IP address in the IP address storehouse, from IP information inquiry networks, inquiry obtains the IP
The corresponding geographical location information in address;
By IP address storage corresponding with the geographical location information into the IP address storehouse.
Alternatively, it is described when not including the IP address in the IP address storehouse, from IP information inquiry networks, inquiry
The corresponding geographical location information of the IP address is obtained, including:
When not including the IP address in the IP address storehouse, three-stage IP data are extracted from the IP address;
IP inquiry requests are sent to the IP information inquiries network, the IP inquiry requests carry the three-stage IP numbers
According to;
Receive the corresponding geographical location information of the three-stage IP data that the IP information inquiries network is returned.
Alternatively, the geographical location information includes:National ID, province ID, province title, city ID, city name, area
County ID, district title, network operator information;Also include country identification information in the IP address storehouse;Methods described also includes:
When determined according to the national ID IP address belonging country for China outside it is other national when, by the state
Family's identification information is set to the first default mark;
When determining the IP address belonging country according to the national ID for China, the country identification information is set to
Second default mark.
Alternatively, it is described by the IP address it is corresponding with the geographical location information storage into the IP address storehouse, bag
Include:
Judge the volume of the coded format and the service end of the geographical location information obtained from the IP information inquiries net
Whether code form is identical;
If coded format is identical, directly by geographical location information storage corresponding with the IP address with arriving the IP
In the storehouse of location;
If coded format is different, the code conversion by the geographical location information obtained from the IP information inquiries net is
Coded format used in the service end, and will be encoded and the IP address pair after the corresponding conversion of the geographical location information
It should store in the IP address storehouse.
Alternatively, it is described by the IP address it is corresponding with the geographical location information storage into the IP address storehouse, bag
Include:
By in the IP address storehouse in IP address deposit Redis databases corresponding with the geographical location information, and,
By in the IP address storehouse in IP address deposit MySQL database corresponding with the geographical location information.
Alternatively, methods described also includes:
The corresponding geographical location information of IP address in the IP address storehouse is updated according to the specified cycle.
Second aspect, the application provides a kind of IP address storehouse creating device, applied to service end, including:
First acquisition unit, for obtaining the IP address in application program correspondence daily record data;
Judging unit, for judging whether include the IP address in IP address storehouse;
Query unit, for when not including the IP address in the IP address storehouse, from IP information inquiry networks, looking into
Inquiry obtains the corresponding geographical location information of the IP address;
Memory cell, for by the IP address it is corresponding with the geographical location information storage into the IP address storehouse.
Alternatively, the query unit includes:
Subelement is extracted, for when not including the IP address in the IP address storehouse, being extracted from the IP address
Three-stage IP data;
Subelement is asked, for sending IP inquiry requests to the IP information inquiries network, the IP inquiry requests are carried
The three-stage IP data;
Receiving subelement, for receiving the corresponding geography of the three-stage IP data that the IP information inquiries network is returned
Positional information.
Alternatively, the geographical location information includes:National ID, province ID, province title, city ID, city name, area
County ID, district title, network operator information;Also include country identification information in the IP address storehouse;Described device also includes:
First mark unit, determines that the IP address belonging country is its outside China for working as according to the national ID
When it is national, the country identification information is set to the first default mark;
Second mark unit, for when determining the IP address belonging country according to the national ID for China, by institute
State country identification information and be set to the second default mark.
Alternatively, described device also includes:
Believe in updating block, the corresponding geographical position of IP address for being updated according to the specified cycle in the IP address storehouse
Breath.
The IP address base establishing method that the present embodiment is provided, obtains the daily record data that user is produced during using APP,
And IP address is obtained from daily record data;When it is determined that not including the IP address in IP address storehouse, from IP information inquiry networks
Inquire about the corresponding geographical location information of the IP address;Then, it is IP address geographical location information corresponding with the IP address is corresponding
Store in IP address storehouse, so as to create the own IP address storehouse of server, without every time from IP information inquiry networks
Geographical location information is obtained, the response speed positioned according to IP address is improved.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing
There is the accompanying drawing used required in technology description to be briefly described, it should be apparent that, drawings in the following description are the present invention
Some embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis
These accompanying drawings obtain other accompanying drawings.
Fig. 1 shows a kind of flow chart of IP address base establishing method of the embodiment of the present application;
Fig. 2 shows the flow chart of another IP address base establishing method of the embodiment of the present application;
Fig. 3 shows the flow chart of another IP address base establishing method of the embodiment of the present application;
Fig. 4 shows the flow chart of another IP address base establishing method of the embodiment of the present application;
Fig. 5 shows a kind of block diagram of IP address storehouse creating device of the embodiment of the present application;
Fig. 6 shows a kind of block diagram of query unit of the embodiment of the present application;
Fig. 7 shows the block diagram of another IP address storehouse creating device of the embodiment of the present application;
Fig. 8 shows the block diagram of another IP address storehouse creating device of the embodiment of the present application.
Embodiment
To make the purpose, technical scheme and advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention
In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is
A part of embodiment of the present invention, rather than whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art
The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
Fig. 1 is referred to, a kind of flow chart of IP address base establishing method of the embodiment of the present application is shown, this method is applied to
On the server corresponding with the APP installed on intelligent terminal.As shown in figure 1, this method comprises the following steps:
S110, server obtains the IP address in application program correspondence daily record data.
As long as user will produce corresponding daily record data to the corresponding server request datas of APP, moreover, daily record number
According to the middle IP address necessarily used comprising user.Therefore, server at the appointed time pulls user in finger (for example, zero point daily)
The daily record data produced when accessing APP before fixing time, and the daily record data is parsed, with obtaining the IP that daily record data is included
Location.
S120, server judges whether include the IP address in IP address storehouse;If it is, terminating current process, continue
Obtain next IP address;If it is not, then performing S130.
Server contrasts the IP address that parsing is obtained with the IP address in IP address storehouse one by one, if IP address storehouse Zhong Bao
Containing the IP address, then continue to judge whether next IP address is included in IP address storehouse;Should if do not included in IP address storehouse
IP address, then the step of performing S130.
In one embodiment of the application, it is based respectively on Redis databases and MySQL database and respectively builds an IP address
Storehouse, the features such as Redis databases have fast storage speed, fast response time.Therefore, using being created based on Redis databases
It whether there is IP address to be checked in IP address library inquiry IP address storehouse.MySQL database has clearly data display work(
Can, it is adaptable to which off-line analysis data are used.
S130, from IP information inquiry networks, inquiry obtains the corresponding geographical location information of the IP address.
If not including the IP address in the IP address storehouse of server, the IP data of first three section of the IP address are obtained,
For example, IP address is 1.1.1.100, then the corresponding three-stage IP data of the IP address are 1.1.1.
The corresponding geographical location information of the IP address just generally can determine that by first three field of IP address, i.e. place city
City's information, therefore, only need to store three-stage IP data, in such manner, it is possible to save substantial amounts of memory space in IP address storehouse.
IP information inquiries network can be according to where IP address be accurately positioned out IP address position.
In one embodiment of the application, obtain after the corresponding three-stage IP data of IP address, to IP information inquiry nets
Network sends inquiry request, and the inquiry request carries the three-stage IP data, and IP information inquiry networks receive the inquiry request
Afterwards, the corresponding geographical location information of IP data is inquired about, wherein, the geographical location information can include:National ID, province ID,
The information such as province title, city ID, city name, district ID, district title, carrier ID, operator name.
S140, server is by IP address storage corresponding with the geographical location information into the IP address storehouse.
Server is received after the corresponding geographical location information of IP address of IP information inquiries network return, by the IP address
Storage corresponding with corresponding geographical location information is into the IP address storehouse of server.For example, each data bar in IP address storehouse
Mesh is stored in the form of " IP, province ID, province title, city ID, city's title, district ID, district title ".
The IP address entry in IP address storehouse is continuously increased, IP address storehouse is obtained.So, can be with when user accesses APP
The city according to where the IP address positioning user that user uses.
The IP address base establishing method that the present embodiment is provided, obtains the daily record data that user is produced during using APP,
And IP address is obtained from daily record data;When it is determined that not including the IP address in IP address storehouse, from IP information inquiry networks
Inquire about the corresponding geographical location information of the IP address;Then, it is IP address geographical location information corresponding with the IP address is corresponding
Store in IP address storehouse, so as to create the own IP address storehouse of server, without every time from IP information inquiry networks
Geographical location information is obtained, the response speed positioned according to IP address is improved.
Fig. 2 is referred to, the flow chart of another IP address base establishing method of the embodiment of the present application, this method application is shown
In the corresponding servers of APP, IP information inquiries net return geographical location information in comprising country ID, province ID, city ID,
The information such as district ID, the present embodiment increases country identification information in IP address storehouse.This method is on the basis of embodiment illustrated in fig. 1
It is upper further comprising the steps of:
S210, will be described when determining the IP address belonging country according to national ID for other national outside China
Country identification information is set to the first default mark.
If country ID is CN (China's Mainland), MO (Macao), HK (Hong Kong), TW (Taiwan), it is determined that belonging to the IP address
Country is China;If country ID is not above-mentioned four kinds of ID, it is determined that the IP address belonging country is other countries outside China.
First default mark can be binary number, if for example, country ID is not Chinese, can be by country identification information
It is set to binary number " 0 ".
S220, when determining the IP address belonging country according to national ID for China, the country identification information is put
For the second default mark.
Second default mark is identical with the first default mark, can use binary number representation, if country ID is China,
Country identification information can be set to binary number " 1 ".
The IP address base establishing method that the present embodiment is provided, country identification information is set in IP address storehouse, is subsequently used
During the IP address storehouse, the national position residing for IP just can accurately be judged by country identification information, it is not necessary to again to national ID
Matched, so as to improve search efficiency.
Fig. 3 is referred to, the flow chart of another IP address base establishing method of the embodiment of the present application, this method application is shown
In server, in the present embodiment, after the geographical location information of IP information inquiries net return is received, the ground received is judged
Whether the coded format for managing positional information is identical with coded format used in IP address storehouse.As shown in figure 3, this method can be wrapped
Include following steps:
S110, server obtains the IP address in application program correspondence daily record data.
S120, server judges whether include the IP address in IP address storehouse;If it is, terminating current process, continue
Obtain next IP address;If it is not, then performing S130.
S130, from IP information inquiry networks, inquiry obtains the corresponding geographical location information of the IP address.
Wherein, S110~S130 implementation process embodiment shown in Figure 1, here is omitted.
S141, judges the coded format and the IP address place for the geographical location information that the IP information inquiries net is returned
Whether the coded format used is identical;If it is, performing S142;If it is not, then performing S143.
Coded format is primarily referred to as the corresponding id information of location name, for example, judging the geography that IP information inquiries net is returned
Whether the corresponding province ID of province title and province ID corresponding to the province title in IP address storehouse is identical in positional information, such as
It is really identical, then show that both coded formats are identical;If it is not the same, then showing that both coded formats are differed.
S142, directly by geographical location information storage corresponding with the IP address into the IP address storehouse.
If the coded format for the geographical location information that IP information inquiries net is returned and coded format used in IP address storehouse
It is identical, then directly by the geographical location information received storage corresponding with IP address into IP address storehouse.
S143, is the service end institute by the code conversion of the geographical location information obtained from the IP information inquiries net
The coded format used.
If the coded format for the geographical location information that IP information inquiries net is returned and coded format used in IP address storehouse
Differ, then need the coded format in the geographical position that will be received to be changed.
In one embodiment of the application, position most detailed in the geographical location information returned according to IP information inquiries net
The dictionary table that the name information put searches IP address storehouse finds the corresponding ID of the title;For example, most detailed in geographical location information
Thin location name is city name, then queries dictionary table obtains the corresponding city ID of the city name and the affiliated province in the city
ID;If location name most detailed is province title in geographical location information, queries dictionary table obtains the province title pair
The province ID answered;If location name most detailed is district title in geographical location information, queries dictionary table obtains the area
The corresponding district ID of county's title, affiliated city ID, affiliated province ID.
S144, will encode storage corresponding with the IP address with arriving the IP after the corresponding conversion of the geographical location information
In the storehouse of location.
The id information that geographical position is obtained storage corresponding with IP address is into IP address storehouse.
IP address base establishing method that the present embodiment is provided, as coded format and the IP of the geographical location information received
When coded format used in the storehouse of location is differed, it will be encoded used in the code conversion in geographical position into IP address storehouse, then,
Geographical location information storage corresponding with IP address after coded format is changed again is into IP address storehouse.So as to realize IP address storehouse
In data and the full platform data of server unification.
Fig. 4 is referred to, the flow chart of another IP address base establishing method of the embodiment of the present application is shown, this method is upper
State the step of increasing more new IP address storehouse on the basis of embodiment of the method.As shown in figure 4, the present embodiment is in embodiment illustrated in fig. 1
On the basis of also include:
S310, the corresponding geographical location information of IP address in the IP address storehouse is updated according to the specified cycle.
The specified cycle can set according to demand, for example, one week, one month etc..
In one embodiment of the application, whole IP that reading is stored in the IP address storehouse based on MySQL database
Location, asks IP information inquiry nets, obtains the corresponding geographical location information of IP address and stores into the interim tables of MySQL, compares one by one
Geographical location information of the more same IP address in MySQL database in the corresponding interim table of geographical location information and MySQL be
It is no identical, if identical, it need not update;If it is different, then needing to update;Contrast obtains the IP letters for needing to update after terminating
Breath, then, the geographical location information in the interim tables of MySQL update IP address storehouse data and Redis in MySQL database
The IP address storehouse data of database.
The IP address base establishing method that the present embodiment is provided, regularly updates the existing IP data in IP address storehouse, so as to protect
The validity of the data in IP address storehouse is demonstrate,proved, the accuracy rate of IP address inquiry is improved.
For foregoing each method embodiment, in order to be briefly described, therefore it is all expressed as to a series of combination of actions, but
It is that those skilled in the art should know, the present invention is not limited by described sequence of movement, because according to the present invention, certain
A little steps can be carried out sequentially or simultaneously using other.Secondly, those skilled in the art should also know, be retouched in specification
The embodiment stated belongs to preferred embodiment, and involved action and the module not necessarily present invention are necessary.
Corresponding to above-mentioned IP address base establishing method embodiment, present invention also provides the implementation of IP address storehouse creating device
Example.
Fig. 5 is referred to, a kind of block diagram of IP address storehouse creating device of the embodiment of the present application is shown, the device is applied to clothes
It is engaged in device, as shown in figure 5, the device includes:First acquisition unit 110, judging unit 120, query unit 130 and memory cell
140。
First acquisition unit 110, for obtaining the IP address in application program correspondence daily record data.
As long as user will produce corresponding daily record data to the corresponding server request datas of APP, moreover, daily record number
According to the middle IP address necessarily used comprising user.At the appointed time (for example, daily zero point) pulls user when specified to server
Between before the daily record data that produces when accessing APP, and parse the daily record data, obtain the IP address that daily record data is included.
Judging unit 120, for judging whether include the IP address in IP address storehouse.
Server contrasts the IP address that parsing is obtained with the IP address in IP address storehouse one by one, if IP address storehouse Zhong Bao
Containing the IP address, then continue to judge whether next IP address is included in IP address storehouse;Should if do not included in IP address storehouse
IP address, then control query unit to perform corresponding step.
In one embodiment of the application, it is based respectively on Redis databases and MySQL data respectively builds an IP address
Storehouse, the features such as Redis data have fast storage speed, fast response time.Therefore, the IP created based on Redis databases is utilized
It whether there is IP address to be checked in the library inquiry IP address storehouse of address.
Query unit 130, for when not including the IP address in the IP address storehouse, from IP information inquiry networks
In, inquiry obtains the corresponding geographical location information of the IP address.
In one embodiment of the application, as shown in fig. 6, query unit includes extracting subelement 131, request subelement
132 and receiving subelement 133.
Subelement 131 is extracted, for when not including the IP address in IP address storehouse, three to be extracted from the IP address
Segmentation IP data.
The corresponding geographical location information of the IP address just generally can determine that by first three field of IP address, i.e. place city
City's information, therefore, only need to store three-stage IP data, in such manner, it is possible to save substantial amounts of memory space in IP address storehouse.
Subelement 132 is asked, for sending IP inquiry requests to IP information inquiries network, the IP inquiry requests carry institute
State three-stage IP data.
Receiving subelement 133, the corresponding geographical position of three-stage IP data for receiving the return of IP information inquiries network
Information.
Geographical location information can include:National ID, province ID, province title, city ID, city name, district ID, area
The information such as county's title, carrier ID, operator name.
Memory cell 140, for IP address storage corresponding with the geographical location information to be arrived into the IP address storehouse
In.
For example, each data entry is with " IP, province ID, province title, city ID, city's title, district in IP address storehouse
The form storage of ID, district title ".
In one embodiment of the application, after the geographical location information for receiving the return of IP information inquiries net, sentence first
Whether coding used in the coding of the disconnected geographical location information and IP address storehouse is identical, and (coded format is primarily referred to as location name
Corresponding id information), if coded format is identical, institute directly is arrived into geographical location information storage corresponding with the IP address
State in IP address storehouse;If coded format is different, by the coding of the geographical location information obtained from the IP information inquiries net
Coded format used in the service end is converted to, and will be encoded and the IP after the corresponding conversion of the geographical location information
Address correspondence storage is into the IP address storehouse.
The IP address storehouse creating device that the present embodiment is provided, obtains the daily record data that user is produced during using APP,
And IP address is obtained from daily record data;When it is determined that not including the IP address in IP address storehouse, from IP information inquiry networks
Inquire about the corresponding geographical location information of the IP address;Then, it is IP address geographical location information corresponding with the IP address is corresponding
Store in IP address storehouse, so as to create the own IP address storehouse of server, without every time from IP information inquiry networks
Geographical location information is obtained, the response speed positioned according to IP address is improved.
Fig. 7 is referred to, is shown in the block diagram of another IP address storehouse creating device of the embodiment of the present application, IP address storehouse also
Including country identification information.As shown in fig. 7, the device includes on the basis of embodiment illustrated in fig. 5:First mark unit 210
With the second mark unit 220.
First mark unit 210, for outside being determined the IP address belonging country for China according to the national ID
It is other national when, the country identification information is set to the first default mark.
If country ID is CN (China's Mainland), MO (Macao), HK (Hong Kong), TW (Taiwan), it is determined that belonging to the IP address
Country is China;If country ID is not above-mentioned four kinds of ID, it is determined that the IP address belonging country is other countries outside China.
First default mark can be binary number, if for example, country ID is not Chinese, can be by country identification information
It is set to binary number " 0 ".
Second mark unit 220, for when determining the IP address belonging country according to the national ID for China, inciting somebody to action
The country identification information is set to the second default mark.
Second default mark is identical with the first default mark, can use binary number representation, if country ID is China,
Country identification information can be set to binary number " 1 ".
The IP address storehouse creating device that the present embodiment is provided, country identification information is set in IP address storehouse, is subsequently used
During the IP address storehouse, the national position residing for IP just can accurately be judged by country identification information, it is not necessary to again to national ID
Matched, so as to improve search efficiency.
Fig. 8 is referred to, the block diagram of another IP address storehouse creating device of the embodiment of the present application is shown, the device is applied to
In server, as shown in figure 8, the device also includes updating block 310 on the basis of embodiment illustrated in fig. 5.
Updating block 310, for updating the corresponding geographical position of IP address in the IP address storehouse according to the specified cycle
Information.
The specified cycle can set according to demand, for example, one week, one month etc..
In one embodiment of the application, whole IP that reading is stored in the IP address storehouse based on MySQL database
Location, asks IP information inquiry nets, obtains the corresponding geographical location information of IP address and stores into the interim tables of MySQL, compares one by one
Geographical location information of the more same IP address in MySQL database in the corresponding interim table of geographical location information and MySQL be
It is no identical, if identical, it need not update;If it is different, then needing to update;Contrast obtains the IP letters for needing to update after terminating
Breath, then, the geographical location information in the interim tables of MySQL update IP address storehouse data and Redis in MySQL database
The IP address storehouse data of database.
The IP address storehouse creating device that the present embodiment is provided, regularly updates the existing IP data in IP address storehouse, so as to protect
The validity of the data in IP address storehouse is demonstrate,proved, the accuracy rate of IP address inquiry is improved.
It should be noted that each embodiment in this specification is described by the way of progressive, each embodiment weight
Point explanation be all between difference with other embodiment, each embodiment identical similar part mutually referring to.
For device class embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, related part is joined
See the part explanation of embodiment of the method.
Finally, in addition it is also necessary to explanation, herein, such as first and second or the like relational terms be used merely to by
One entity or operation make a distinction with another entity or operation, and not necessarily require or imply these entities or operation
Between there is any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant meaning
Covering including for nonexcludability, so that process, method, article or equipment including a series of key elements not only include that
A little key elements, but also other key elements including being not expressly set out, or also include be this process, method, article or
The intrinsic key element of equipment.In the absence of more restrictions, the key element limited by sentence "including a ...", is not arranged
Except also there is other identical element in the process including the key element, method, article or equipment.
The foregoing description of the disclosed embodiments, enables those skilled in the art to realize or using the present invention.To this
A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and generic principles defined herein can
Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited
It is formed on the embodiments shown herein, and is to fit to consistent with features of novelty with principles disclosed herein most wide
Scope.
Described above is only the preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art
For member, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improvements and modifications also should
It is considered as protection scope of the present invention.
Claims (10)
1. a kind of IP address base establishing method, applied to service end, it is characterised in that including:
Obtain the IP address in application program correspondence daily record data;
Judge whether include the IP address in IP address storehouse;
When not including the IP address in the IP address storehouse, from IP information inquiry networks, inquiry obtains the IP address
Corresponding geographical location information;
By IP address storage corresponding with the geographical location information into the IP address storehouse.
2. according to the method described in claim 1, it is characterised in that described to work as in the IP address storehouse not comprising the IP address
When, from IP information inquiry networks, inquiry obtains the corresponding geographical location information of the IP address, including:
When not including the IP address in the IP address storehouse, three-stage IP data are extracted from the IP address;
IP inquiry requests are sent to the IP information inquiries network, the IP inquiry requests carry the three-stage IP data;
Receive the corresponding geographical location information of the three-stage IP data that the IP information inquiries network is returned.
3. method according to claim 2, it is characterised in that the geographical location information includes:National ID, province ID,
Province title, city ID, city name, district ID, district title, network operator information;Also include in the IP address storehouse
Country identification information;Methods described also includes:
When determined according to the national ID IP address belonging country for China outside it is other national when, by it is described country mark
Know information and be set to the first default mark;
When determining the IP address belonging country according to the national ID for China, the country identification information is set to second
Default mark.
4. according to the method described in claim 1, it is characterised in that described by the IP address and the geographical location information pair
It should store in the IP address storehouse, including:
Judge the coding lattice of the coded format and the service end of the geographical location information obtained from the IP information inquiries net
Whether formula is identical;
If coded format is identical, the IP address storehouse directly is arrived into geographical location information storage corresponding with the IP address
In;
If coded format is different, the code conversion by the geographical location information obtained from the IP information inquiries net is described
Coded format used in service end, and deposit corresponding with the IP address will be encoded after the corresponding conversion of the geographical location information
Store up in the IP address storehouse.
5. the method according to claim any one of 1-4, it is characterised in that described by the IP address and the geographical position
Confidence breath correspondence is stored into the IP address storehouse, including:
By in the IP address storehouse in IP address deposit Redis databases corresponding with the geographical location information, and, by institute
State in the IP address storehouse in IP address deposit MySQL database corresponding with the geographical location information.
6. according to the method described in claim 1, it is characterised in that methods described also includes:
The corresponding geographical location information of IP address in the IP address storehouse is updated according to the specified cycle.
7. a kind of IP address storehouse creating device, applied to service end, it is characterised in that including:
First acquisition unit, for obtaining the IP address in application program correspondence daily record data;
Judging unit, for judging whether include the IP address in IP address storehouse;
Query unit, for when not including the IP address in the IP address storehouse, from IP information inquiry networks, inquiring about
To the corresponding geographical location information of the IP address;
Memory cell, for by the IP address it is corresponding with the geographical location information storage into the IP address storehouse.
8. device according to claim 7, it is characterised in that the query unit includes:
Subelement is extracted, for when not including the IP address in the IP address storehouse, three sections to be extracted from the IP address
Formulas I P data;
Subelement is asked, for sending IP inquiry requests to the IP information inquiries network, the IP inquiry requests carry described
Three-stage IP data;
Receiving subelement, for receiving the corresponding geographical position of the three-stage IP data that the IP information inquiries network is returned
Information.
9. device according to claim 8, it is characterised in that the geographical location information includes:National ID, province ID,
Province title, city ID, city name, district ID, district title, network operator information;Also include in the IP address storehouse
Country identification information;Described device also includes:
First mark unit, determines that the IP address belonging country is other states outside China for working as according to the national ID
During family, the country identification information is set to the first default mark;
Second mark unit, for when determining the IP address belonging country according to the national ID for China, by the state
Family's identification information is set to the second default mark.
10. device according to claim 7, it is characterised in that described device also includes:
Updating block, for updating the corresponding geographical location information of IP address in the IP address storehouse according to the specified cycle.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710236515.5A CN107018210A (en) | 2017-04-12 | 2017-04-12 | A kind of IP address base establishing method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710236515.5A CN107018210A (en) | 2017-04-12 | 2017-04-12 | A kind of IP address base establishing method and device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107018210A true CN107018210A (en) | 2017-08-04 |
Family
ID=59446001
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710236515.5A Pending CN107018210A (en) | 2017-04-12 | 2017-04-12 | A kind of IP address base establishing method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107018210A (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109756530A (en) * | 2017-11-02 | 2019-05-14 | 北京金山安全软件有限公司 | Target application server and method and device for determining geographic position information |
CN111414298A (en) * | 2019-01-08 | 2020-07-14 | 西安诺瓦电子科技有限公司 | Display device statistical method, device, system and computer readable medium |
CN112685072A (en) * | 2020-12-31 | 2021-04-20 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and storage medium for generating communication address knowledge base |
CN113127448A (en) * | 2021-04-23 | 2021-07-16 | 深圳市酷开网络科技股份有限公司 | Method, device, server and storage medium for generating domain dimension table |
CN113434553A (en) * | 2021-06-30 | 2021-09-24 | 青岛海尔科技有限公司 | Method, device, storage medium and computer equipment for acquiring information |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101295391A (en) * | 2007-04-27 | 2008-10-29 | 阿里巴巴集团控股有限公司 | On-line transaction method and on-line transaction system |
CN102104635A (en) * | 2009-12-17 | 2011-06-22 | 阿里巴巴集团控股有限公司 | Method and device for updating Internet protocol (IP) address base |
CN103678676A (en) * | 2013-12-25 | 2014-03-26 | 乐视网信息技术(北京)股份有限公司 | IP library processing method and system |
CN104994185A (en) * | 2015-06-25 | 2015-10-21 | 小米科技有限责任公司 | Method and apparatus for processing IP address database |
CN106302843A (en) * | 2015-05-26 | 2017-01-04 | 上海帝联信息科技股份有限公司 | A kind of IP address base update method and device |
-
2017
- 2017-04-12 CN CN201710236515.5A patent/CN107018210A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101295391A (en) * | 2007-04-27 | 2008-10-29 | 阿里巴巴集团控股有限公司 | On-line transaction method and on-line transaction system |
CN102104635A (en) * | 2009-12-17 | 2011-06-22 | 阿里巴巴集团控股有限公司 | Method and device for updating Internet protocol (IP) address base |
CN103678676A (en) * | 2013-12-25 | 2014-03-26 | 乐视网信息技术(北京)股份有限公司 | IP library processing method and system |
CN106302843A (en) * | 2015-05-26 | 2017-01-04 | 上海帝联信息科技股份有限公司 | A kind of IP address base update method and device |
CN104994185A (en) * | 2015-06-25 | 2015-10-21 | 小米科技有限责任公司 | Method and apparatus for processing IP address database |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109756530A (en) * | 2017-11-02 | 2019-05-14 | 北京金山安全软件有限公司 | Target application server and method and device for determining geographic position information |
CN111414298A (en) * | 2019-01-08 | 2020-07-14 | 西安诺瓦电子科技有限公司 | Display device statistical method, device, system and computer readable medium |
CN112685072A (en) * | 2020-12-31 | 2021-04-20 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and storage medium for generating communication address knowledge base |
CN112685072B (en) * | 2020-12-31 | 2023-08-01 | 恒安嘉新(北京)科技股份公司 | Method, device, equipment and storage medium for generating communication address knowledge base |
CN113127448A (en) * | 2021-04-23 | 2021-07-16 | 深圳市酷开网络科技股份有限公司 | Method, device, server and storage medium for generating domain dimension table |
CN113434553A (en) * | 2021-06-30 | 2021-09-24 | 青岛海尔科技有限公司 | Method, device, storage medium and computer equipment for acquiring information |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107018210A (en) | A kind of IP address base establishing method and device | |
CN109145169B (en) | Address matching method based on statistical word segmentation | |
CN101346000B (en) | System for providing local mobile geographic information service based on GPS and mobile terminal | |
US7283846B2 (en) | Integrating geographical contextual information into mobile enterprise applications | |
CN108959244B (en) | Address word segmentation method and device | |
CN101350012B (en) | Method and system for matching address | |
US7376636B1 (en) | Geocoding using a relational database | |
EP1598639B1 (en) | System and method for automatically managing geolocation information | |
CN101313300A (en) | Local search | |
CN105677793A (en) | Site database establishing method and device, and candidate riding site recommending method and device | |
WO2007040807A1 (en) | Automated concierge system and method | |
CN105430618B (en) | A kind of network registering method and device | |
US20020072379A1 (en) | Method and system for locating position for a mobile communication device | |
CN100334429C (en) | Data storage and update method for electronic map | |
CN101270992A (en) | Search device and search method of geographical coordinates | |
CN101159755A (en) | Mobile search system and mobile search method | |
CN101207880A (en) | Mobile phone indicating guidance system based on server client machine mode | |
CN102523273B (en) | System for providing location-based service | |
KR100404305B1 (en) | Facility management and consumer management system with digital map and mobile telecommunication terminals and the managing method thereof | |
CN101650192A (en) | Electronic navigation map destination setting method, mobile terminal and server terminal | |
EP3149978B1 (en) | System for providing location-based social networking services to users of mobile devices | |
CN113961563A (en) | Intelligent association fusion method for big data of multi-source environment | |
KR100678310B1 (en) | System and its Method for managing the position information of mobile terminals on real time | |
CN105117465A (en) | Evaluation information interaction method and system | |
US20190098442A1 (en) | Method of operating a device, the device shown carrying out the method, and a system including the deice and a server in a system providing location-based social networking services to users of mobile devices |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20170804 |
|
RJ01 | Rejection of invention patent application after publication |