Summary of the invention
In order to address the above problem; The present invention proposes a kind of system of the visitor's of obtaining home domain name resolution server; It can solve when adopting the DNS mode to carry out the CDN service can't obtain visitor's IP and the corresponding data of Local DNS, thus the further accurate optimization CDN defective of serving.
The technical scheme that the present invention adopts is following:
A kind of system that obtains visitor's home domain name resolution server comprises following subsystem:
Survey the guide system that weighs; Realize that by Web server its effect is the request that receives client, note the IP address of client computer with HTTP service function; Be that this time request generates an overall unique identification code then; Identification code is saved in the data record subsystem, and generates specific, a unique subdomain name, return to this java script instruction specific, unique subdomain name of client browser visit with this identification code;
Intelligence DNS subsystem; Receive the analysis request of home domain name resolution server; The IP address of minute book region name resolution server; And analyze specific, unique subdomain name of home domain name resolution server request, and obtain by surveying globally unique identifier's sign indicating number that heavy guide system generates, IP address and globally unique identifier's sign indicating number of home domain name resolution server is saved in the data record subsystem;
The data record subsystem; Preservation weighs client ip address and the globally unique identifier's sign indicating number that the guide system sends by surveying; And the IP address and the overall unique identification code of the home domain name resolution server that sends by intelligent DNS subsystem; And will survey the data based globally unique identifier sign indicating number that heavy guide system and intelligent DNS subsystem send and mate, merge, the data that merge are saved in supply the statistical analysis use in the database;
The statistical analysis subsystem carries out statistics and analysis to the detection data in the data recording subsystem, and statistics uses certain home domain name resolution server to carry out the IP address of the computer of analysis service.
The present invention has the following advantages: can solve when adopting the DNS mode to carry out the CDN service and can't obtain visitor's IP and the corresponding data of Local DNS, thus the further accurate optimization CDN defective of serving.Through adopting system of the present invention, can obtain Local DNS and pairing actual visitor IP thereof, through the IP data are analyzed, it is resolved to more suitably service node, thereby promotes service quality.
Embodiment
The present invention proposes a kind of system of the visitor's of obtaining home domain name resolution server.This system is made up of following subsystem:
(1) surveys the guide system that weighs.Surveying heavy guide system is realized by a Web server with HTTP service function; Its effect is the request that receives client; Noting the IP address of client computer, is that this time request generates an overall unique identification code then, and identification code is saved in the data record subsystem; And, return to this java script instruction specific, unique subdomain name of client browser visit with specific, unique subdomain name of this identification code generation.
(2) intelligent DNS subsystem.Receive the analysis request of Local DNS; The IP address of record Local DNS; And specific, unique subdomain name of analysis Local DNS request; Obtain by surveying globally unique identifier's sign indicating number that heavy guide system generates, IP address and the globally unique identifier's sign indicating number of Local DNS is saved in the data record subsystem.
(3) data record subsystem.The Core Feature of data record subsystem is a database, preserves by surveying client ip address and the globally unique identifier's sign indicating number that heavy guide system sends, and by the Local DNS IP address and the overall unique identification code of intelligent DNS subsystem transmission.And will survey the data based globally unique identifier sign indicating number that heavy guide system and intelligent DNS subsystem send and mate, merge, the data that merge are saved in supply the statistical analysis use in the database.
(4) statistical analysis subsystem.Main being responsible for carried out statistics and analysis to the detection data in the data recording subsystem, and system finally adds up and uses some concrete Local DNS to carry out the IP address of the computer of analysis service.
Adopt system of the present invention can obtain visitor's home domain name resolution server, the general steps of enforcement is:
At first on the website that needs are surveyed, embed the JavaScript code, browser resolves JavaScript code asks the detection of detection system to weigh guide module then; Survey the IP address that heavy guide module at first writes down the browser end computer; Return directive script then, make browser ask the intelligent DNS module of detection system once more, the IP of LocalDNS under the intelligent DNS module records; Data recordin module merges the data of twice request, deposits to data warehouse.Through the certain hour section, after detection finishes, add up IP address information of each LocalDNS back correspondence at last by analysis module.
Specify below in conjunction with Fig. 1:
(1) by detection system specific HTML code is provided, it is embedded on the Website page of being surveyed.The address of supposing the website does
Http:// www.website.com, the address of service of surveying heavy guide module in the detection system does
Http:// www.trace.com/redirect.cgi, then exist
Http:// www.website.com/index.htmlEmbed following HTML code:
<iframe?height=”0”width=”0”src=”http://www.trace.com/redirect.cgi”></iframe>
Guest access when the website
Http:// www.website.com/index.htmlDuring the page, browser can be resolved above-mentioned HTML code, thereby from trend
Http:// www.trace.com/redirect.cgiSend request.
(2) survey heavy guide module and receive the request of sending from guest browser after; At first; Obtain the IP address of client computer, generate one through program then and close an innings unique identification code, suppose that client's in this request IP address is 4.4.4.4; The unique identification sign indicating number that generates is: 000001, IP and globally unique identifier's sign indicating number are saved in the data record subsystem.
(3) suppose that intelligent DNS subsystem has the mandate of * .dns.trace.com subdomain name.The subdomain name that the overall situation is unique: 000001.dns.trace.com of then heavy guide system's generation, and return following page code:
<script>window.location.href=’http://000001.dns.trace.com’</script>
(4) after client's browser is received the page code that heavily the guide system returns, attempt loading
Http: // 000001.dns.trace.com, because this domain name is a brand-new overall unique domain name that is generated by detection system, so the A record of this domain name is browsed and do not known to client, thereby to the parsing of its this domain name of Local DNS request.
(5) in like manner, Local DNS does not have the data cached of this domain name yet, so to the parsing of intelligent DNS subsystem request 000001.dns.trace.com domain name.
(6) because intelligent DNS system has the mandate of * .dns.trace.com subdomain name; Therefore after receiving the analysis request of Local DNS for subdomain 000001.dns.trace.com; At first obtain the IP address of Local DNS; The IP address of supposing Local DNS is 4.4.4.5, and first section of subdomain of request converts globally unique identifier's sign indicating number into then: 000001, at last with the IP of Local DNS with close innings unique identification sign indicating number and be saved in the data record subsystem.The data record subsystem is followed according to globally unique identifier's sign indicating number and automatically its preceding with it visitor IP record that writes down is merged, and obtains following record:
The unique identification sign indicating number |
Visitor IP |
Local?DNS?IP |
000001 |
4.4.4.4 |
4.4.4.5 |
(7) after detection after a while; The data record subsystem can be collected a large amount of detection datas; Transfer to the statistical analysis subsystem then the record of identical Local DNS IP is carried out polymerization; Utilize this Local DNS to carry out all IP set of analysis request thereby obtain, behind the acquisition IP collective data, carry out the analytical work of following steps:
A. the repetition IP data in will tabulating merge, and number of repetition is counted the weight of this IP.Suppose that the IP data in the initial list are following:
Visitor IP |
3.3.3.3 |
3.3.3.3 |
7.7.7.7 |
9.9.9.9 |
7.7.7.7 |
7.7.7.7 |
The data that then merge after handling are:
Visitor IP |
Weight |
3.3.3.3 |
2 |
7.7.7.7 |
3 |
9.9.9.9 |
1 |
B. inquire about IP geographic position data storehouse, inquire about the zone and the ISP at each IP place, obtain similar following form:
Visitor IP |
Weight |
The region |
ISP |
3.3.3.3 |
2 |
Jiangsu |
China Telecom |
7.7.7.7 |
3 |
Jiangsu |
China Telecom |
9.9.9.9 |
1 |
Anhui |
CHINAUNICOM |
C. the weight that merges same area IP obtains similar following form:
Weight |
The region |
ISP |
5 |
Jiangsu |
China Telecom |
1 |
Anhui |
CHINAUNICOM |
D. obtain weight maximum region and ISP, this zone is the primary service area of this Local DNS of 4.4.4.5, and the result is following:
The region |
ISP |
Jiangsu |
China Telecom |
E. upgrade the CDN parses policy, all IP addresses are the Local dns resolution request of 4.4.4.5 later on, and the node IP address of serving the user of Jiangsu China Telecom in the CDN system is returned as the A record.Thereby the CDN that more optimizes is provided service.