A kind of browser and carry out the method for domain name mapping
Technical field
The present invention relates to Internet technical field, be specifically related to a kind of browser and carry out the method for domain name mapping.
Background technology
At present, browser is accessing the URL(UniformResourceLocator specified, URL(uniform resource locator)) time, obtain the root content of this URL, resolve this root content, set up corresponding network request.Visible, existing scheme waits user to input network address just to resolve, and after downloading root URL, analyze HTML(HTML, HypertextMarkupLanguage) data content, the object then just played up as required is downloaded.Wherein, download need the object played up before need to carry out parsings DNS, but time of dns resolution may from several millisecond to 100 seconds, so when adopting existing scheme to access a URL, the time of consumption is long.
In order to solve dns resolution problem consuming time, there is several DNS prefetching technique at present, being specially:
1) need to be DNS by meta information notification browser to look ahead.As: <metahttp-equiv=" x-dns-prefetch-control " content=" on "/>;
2) use Link label imposition to be DNS to look ahead.As: <linkrel=" dns-prefetch " href=" http://some-web-site.com "/>;
3) when address field changes, the relevant suffix of conjecture, as when user inputs www.sina, just conjecture inputs the domain names such as www.sina.com, www.sina.org, www.sina.gov.
But, in above-mentioned DNS prefetching technique, need to specify Link label, for webpage existing in a large number at present, DNS acceleration problem can not be solved.In addition, if only in order to DNS accelerate and webpage of upgrading, also do not calculate, and pre-read carried out for unwanted connection, waste Internet resources, add network traffics expense.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of method overcoming the problems referred to above or the browser solved the problem at least in part and carry out domain name mapping.
According to one aspect of the present invention, provide a kind of method that browser carries out domain name mapping, comprising:
Start browser, and call DNS expedited data information, wherein said DNS expedited data information comprises some domain names of obtaining in advance and IP address information corresponding to each domain name;
Receive Client-initiated to the access request of certain URL, resolve this access request, and extract domain name corresponding to described URL;
Detect in described DNS expedited data information and whether comprise domain name corresponding to described URL, if comprise, then obtain the IP address information that this domain name is corresponding, and utilize this IP address information to conduct interviews process.
Alternatively, in the method for the invention, the some domain names obtained in advance in described DNS expedited data information comprise some Main Domains, and the subdomain name that each Main Domain is corresponding.
Alternatively, in the method for the invention, the mode that in described DNS expedited data information, each information is shown with map stores, and includes the mapping relations between Main Domain with corresponding each subdomain name in described map table.
Alternatively, in the method for the invention, whether comprise domain name corresponding to described URL in described detection DNS expedited data information, comprise further:
Judge that the domain name that described URL is corresponding is Main Domain or subdomain name, if Main Domain, then directly in described map table, search this domain name; If subdomain name, then this subdomain name is split, after obtaining Main Domain corresponding to this subdomain name, with this Main Domain for search index, in described map table, search corresponding domain name.
Alternatively, in the method for the invention, before the domain name that the described URL of described extraction is corresponding, also comprise: judge described URL whether first delay by this locality, if non-buffer memory, then extract the domain name that described URL is corresponding.
Alternatively, the method for the invention also comprises:
When user browses webpage corresponding to the URL of access, detect user's mouse and whether hover on webpage, if so, obtain webpage subregion DIV element corresponding to mouse-over position;
Each URL in described DIV element is split, obtains the domain name that each URL is corresponding, and duplicate removal process is carried out to the domain name obtained;
Detect in described DNS expedited data information and whether comprise domain name corresponding to each described URL, if comprise, then extract the IP address information that each domain name is corresponding, and when user accesses the URL in described DIV element, directly utilize the IP address information of described extraction to conduct interviews process.
Alternatively, in the method for the invention, when detect in DNS expedited data information comprise domain name corresponding to URL time, extract the mode of IP address information corresponding to domain name, comprising:
Domain name corresponding for described URL is inserted into and waits to accelerate in list, and notification queue daemon thread;
Described queue daemon thread creates semaphore, and transfers the IP address information of the corresponding domain name of URL described in described DNS expedited data information, realizes the parsing to domain name.
Alternatively, in the method for the invention, when the IP address information that the multiple domain name of concurrent acquisition is corresponding, the thread pool utilizing described queue daemon thread to notify to be pre-created is for obtaining each request task distribution thread of IP address information, and each thread that utilization distributes transfers the IP address information in described DNS expedited data information, realizes the parsing to each domain name.
Alternatively, in the method for the invention, described in the DNS expedited data information called be the DNS expedited data information downloaded at server side; Or, described in the DNS expedited data information called be the DNS expedited data information of the server side active push received; And/or, described in the DNS expedited data information called be the DNS expedited data information that the URL of described browser statistic of user accessing obtains.
Alternatively, the mode of described browser acquisition DNS expedited data information comprises:
Obtain the URL of user's access, extract the Main Domain that this URL is corresponding;
The acquisition address information function of interception browser side computer system, obtains subdomain name corresponding to described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
According to described socket address structure, obtain Main Domain and IP address information corresponding to each subdomain name; By each subdomain name corresponding to described Main Domain, described Main Domain and IP address information corresponding to each domain name stored in DNS expedited data information.
According to a further aspect in the invention, provide a kind of browser, comprising:
Calling module, for starting browser, and calls DNS expedited data information, and wherein said DNS expedited data information comprises some domain names of obtaining in advance and IP address information corresponding to each domain name;
Accelerate trigger module, for receiving the access request of Client-initiated to certain URL, resolve this access request, and extract domain name corresponding to described URL, trigger and accelerate Executive Module;
Accelerating Executive Module, for detecting in described DNS expedited data information whether comprise domain name corresponding to described URL, if comprise, then obtaining the corresponding IP address information of this domain name, and utilize this IP address information to conduct interviews process.
Alternatively, in browser of the present invention, the some domain names obtained in advance in the DNS expedited data information that described calling module calls comprise some Main Domains, and the subdomain name that each Main Domain is corresponding.
Alternatively, in browser of the present invention, the mode that in the DNS expedited data information that described calling module calls, each information is shown with map stores, and includes the mapping relations between Main Domain with corresponding each subdomain name in described map table.
Alternatively, in browser of the present invention, described acceleration Executive Module, comprises further:
Domain name detection sub-module, for judging that the domain name that described URL is corresponding is Main Domain or secondary subdomain name, if Main Domain, triggering lookup submodule, if subdomain name, triggers domain name process submodule;
Domain name process submodule, for splitting subdomain name, after obtaining Main Domain corresponding to this subdomain name, and with this Main Domain for search index, triggering lookup submodule;
Search submodule, for searching corresponding domain name in described map table.
Alternatively, in browser of the present invention, described acceleration trigger module, also for before extracting domain name corresponding to described URL, judges described URL whether first delay by this locality, if non-buffer memory, then extracts the domain name that described URL is corresponding.
Alternatively, browser of the present invention also comprises:
Whether hovering data obtaining module, during webpage corresponding to the URL for browsing access as user, detect user's mouse and hover on webpage, the webpage subregion DIV element that if so, acquisition mouse-over position is corresponding;
Domain Name acquisition module, for being split by each URL in described DIV element, obtaining the domain name that each URL is corresponding, and carrying out duplicate removal process to the domain name obtained, and triggers described acceleration Executive Module and extracts IP address information corresponding to each domain name.
Alternatively, in browser of the present invention, described acceleration Executive Module, wait to accelerate in list specifically for domain name corresponding for described URL is inserted into, and notification queue daemon thread, create semaphore by described queue daemon thread, and transfer IP address information corresponding to the corresponding domain name of URL described in described DNS expedited data information, realize the parsing to domain name.
Optionally, in browser of the present invention, described acceleration Executive Module, be further used for when the IP address information that the multiple domain name of concurrent acquisition is corresponding, the thread pool utilizing described queue daemon thread to notify to be pre-created is for obtaining each request task distribution thread of IP address information, and each thread that utilization distributes transfers the IP address information in described DNS expedited data information, realizes the parsing to each domain name.
Alternatively, in browser of the present invention, described calling module, the DNS expedited data information called is for downloading DNS expedited data information at server side; Or be the DNS expedited data information of server side active push received; And/or, the DNS expedited data information obtained for the URL of described browser statistic of user accessing.
Alternatively, browser of the present invention comprises further:
Acquisition module, for obtaining the URL of user's access, extracts the Main Domain that this URL is corresponding;
Function call module, for tackling the acquisition address information function of browser side computer system, obtains subdomain name corresponding to described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
Data obtaining module, for according to described socket address structure, obtains Main Domain and IP address information corresponding to each subdomain name;
Information storage module, for by each subdomain name corresponding to described Main Domain, described Main Domain and IP address information corresponding to each domain name stored in DNS expedited data information.
Compared with prior art, beneficial effect of the present invention is as follows:
First, technical scheme of the present invention, by adding up for some Main Domains in advance, form DNS expedited data information, after this DNS expedited data information is called by user side browser, web page browsing can be realized and accelerate, this acceleration processing procedure is consuming time short, improves the efficiency that DNS accelerates;
Secondly, technical scheme of the present invention, can also carry out acceleration process to the URL at mouse-over place, applied widely.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of specification, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 carries out the flow chart of the method for domain name mapping for a kind of browser that the embodiment of the present invention one provides;
Fig. 2 carries out the flow chart of the method for domain name mapping for a kind of browser that the embodiment of the present invention two provides;
Fig. 3 is the mapping relations figure of the map table set up in the embodiment of the present invention three;
Fig. 4 is mouse-over schematic diagram in the embodiment of the present invention three;
The structural representation of a kind of browser that Fig. 5 provides for the embodiment of the present invention four;
The structural representation of a kind of browser that Fig. 6 provides for the embodiment of the present invention five;
The structural representation of a kind of server that Fig. 7 provides for the embodiment of the present invention six;
Fig. 8 carries out the structured flowchart of the system of domain name mapping for a kind of browser that the embodiment of the present invention seven provides.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
In order to solve the technical problem existed in prior art, the embodiment of the present invention provides a kind of browser and carries out the method for domain name mapping.The present invention, by carrying out DNS query request statistics for number of site in advance, forms DNS expedited data information, when user inputs station address, by calling DNS expedited data information, realizing web page browsing and accelerating, improve DNS acceleration efficiency.
Below by several specific embodiment, implementation procedure of the present invention is described in detail, specific as follows:
Embodiment one
As shown in Figure 1, the embodiment of the present invention provides a kind of browser to carry out the method for domain name mapping, specifically comprises the following steps:
Step S101, starts browser, and calls DNS expedited data information; Wherein, DNS expedited data information comprises some domain names of obtaining in advance and IP address information corresponding to each domain name;
In this step, the some domain names obtained in advance comprise some Main Domains, and the subdomain name that each Main Domain is corresponding (being preferably secondary subdomain name).
In this step, the described DNS expedited data information called is the information generated at server side, and/or, be the information generated in browser side.
When generating at server side, described in the DNS expedited data information called be the DNS expedited data information downloaded at server side, or, be the DNS expedited data information of server side active push received.Wherein, the mode of server side generation DNS expedited data information comprises:
(1) in pre-configured Main Domain pond, choose Main Domain one by one, obtain subdomain name corresponding to the Main Domain chosen and the Main Domain IP address information corresponding with each subdomain name;
(2) preserve the subdomain name of each described Main Domain and correspondence thereof and the IP address information of each domain name, generate DNS expedited data information.
Preferably, in step (1), the mode obtaining subdomain name corresponding to Main Domain and the Main Domain IP address information corresponding with each subdomain name comprises:
(11) in Main Domain pond, Main Domain is chosen one by one;
(12) tackle the acquisition address information function (such as: system function getaddrinfo ()) of browser side computer system, obtain subdomain name corresponding to each described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
(13) according to socket address structure, Main Domain and IP address information corresponding to each subdomain name is obtained.
Preferably, in step (2), the mode of preserving the subdomain name of each described Main Domain and correspondence thereof comprises: the map setting up mapping relations between described Main Domain with corresponding each subdomain name shows.
When generating in browser side, described DNS expedited data information is the DNS expedited data information that the URL of browser statistic of user accessing obtains.
Wherein, the mode of described browser acquisition DNS expedited data information comprises:
Obtain the URL of user's access, extract the Main Domain that this URL is corresponding;
The acquisition address information function (system function getaddrinfo ()) of interception browser side computer system, obtains subdomain name corresponding to described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
According to described socket address structure, obtain Main Domain and IP address information corresponding to each subdomain name;
By each subdomain name corresponding to described Main Domain, described Main Domain and IP address information corresponding to each domain name stored in DNS expedited data information.
Step S102, receives Client-initiated to the access request of certain URL, resolves this access request, and extract domain name corresponding to described URL;
Preferably, in this step, before extracting domain name corresponding to described URL, also comprise:
Judge described URL whether first delay by this locality, if non-buffer memory, then extract the domain name that described URL is corresponding, perform step S103; If buffer memory, do not carry out DNS and accelerate process.
Step S103, detects in DNS expedited data information whether comprise domain name corresponding to URL, if comprise, then obtains the IP address information that this domain name is corresponding, and utilizes this IP address information to conduct interviews process.
In this step, detect in DNS expedited data information whether comprise domain name corresponding to described URL, specifically comprise: judge that the domain name that described URL is corresponding is Main Domain or subdomain name, if Main Domain, then directly in map table, search this domain name; If subdomain name, then this subdomain name is split, obtain the Main Domain that this subdomain name is corresponding, and with this Main Domain for search index, in map table, search corresponding domain name.
In this step, when detect in DNS expedited data information comprise domain name corresponding to URL time, extract the mode of IP address information corresponding to domain name, comprising:
Domain name corresponding for described URL is inserted into and waits to accelerate in list, and notification queue daemon thread;
Described queue daemon thread creates semaphore, and transfers the IP address information of the corresponding domain name of URL described in described DNS expedited data information, realizes the parsing to domain name.
Further, in method described in the embodiment of the present invention, when the IP address information that the multiple domain name of concurrent acquisition is corresponding, the thread pool utilizing described queue daemon thread to notify to be pre-created is for obtaining each request task distribution thread of IP address information, and each thread that utilization distributes transfers the IP address information in described DNS expedited data information, realizes the parsing to each domain name.
In sum, technical scheme described in the embodiment of the present invention, by calling the DNS expedited data information generated in advance, realizing web page browsing and accelerating, improve DNS acceleration efficiency.
Embodiment two
As shown in Figure 2, the embodiment of the present invention provides a kind of browser to carry out the method for domain name mapping, and the method is the expansion scheme of the DNS pre-reading method described in embodiment one, and namely expansion adds mouse-over scheme.In following elaborate process, do not repeat at this for the processing mode identical with embodiment one, described method specifically comprises:
Step S201, starts browser, and calls DNS expedited data information, and wherein said DNS expedited data information comprises some domain names of obtaining in advance and IP address information corresponding to each domain name;
Step S202, receives Client-initiated to the access request of certain URL, resolves this access request, and extract domain name corresponding to described URL;
Step S203, detects in DNS expedited data information whether comprise domain name corresponding to URL, if comprise, then obtains the IP address information that this domain name is corresponding, and utilizes this IP address information to conduct interviews process;
Whether step S204, when user browses webpage corresponding to the URL of access, detect user's mouse and hover on webpage, if so, obtain webpage subregion DIV element corresponding to mouse-over position;
Step S205, splits each URL in described DIV element, obtains the domain name that each URL is corresponding, and carry out duplicate removal process to the domain name obtained;
Step S206, detects in DNS expedited data information whether comprise domain name corresponding to each described URL, if comprise, then extracts the IP address information that each domain name is corresponding;
Step S207, when user accesses the URL in described DIV element, directly utilizes the IP address information extracted to conduct interviews process.
In sum, technical scheme of the present invention, by adding up for some Main Domains in advance, form DNS expedited data information, after this DNS expedited data information is called by user side browser, can realize web page browsing to accelerate, this acceleration processing procedure is consuming time short, improves the efficiency that DNS accelerates;
In addition, technical scheme of the present invention, can also carry out acceleration process to the URL at mouse-over place, applied widely.
Embodiment three
The embodiment of the present invention provides a kind of browser to carry out the method for domain name mapping, and the method is elaborating further method described in embodiment one and embodiment two, specifically comprises:
One, DNS expedited data information generation step;
When generating at server side, comprising:
1) collect Main Domain, and utilize the Main Domain configuration Main Domain pond of collecting;
Wherein, the mode collecting Main Domain configuration Main Domain pond include but not limited to for: receive each Main Domain of reporting of user side, and/or, obtain the whole network focus domain-name information, utilize visit capacity top N Main Domain to configure described Main Domain pond; Described N is positive integer.
2) in Main Domain pond, choose each Main Domain one by one, intercepting system function getaddrinfo (), obtain the secondary subdomain name that corresponding Main Domain is corresponding, and the IP address information of Main Domain and each secondary subdomain name.
In this step, the system function of interception is getaddrinfo (constchar*nodename, constchar*service, conststructaddrinfo*hints, structaddrinfo**result) function.
Wherein, nodename: domain name (ASCII fromat) to be resolved; Service: the ANSI character string comprising service name or port; Hints: Netz ocket reminder-data structure, indicates family of network protocols, socket type, agreement etc.; Result: resolve return data structure, is used for the data that saved system resolves.
If getaddrinfo function returns successfully, the variable so pointed to by result parameter has been received in a pointer, and what it pointed to is the addrinfo structure chained list be together in series by ai_next member wherein.The situation returning multiple addrinfo structure can be caused to have following two:
1, have multiple with the address of nodename parameter association, each address being so applicable to institute's request address bunch returns a corresponding structure.
The multiple socket type of service support that 2, service parameter is specified, so each socket type may return a corresponding structure, specifically depends on the ai_socktype member of hints structure.
The embodiment of the present invention, before interception getaddrinfo function, first distribute a hints structure, the field of needs is filled in after it is reset, tackle getaddrinfo(again) function, obtain secondary subdomain name corresponding to corresponding Main Domain and the described Main Domain socket address structure corresponding with each secondary subdomain name, then according to socket address structure, obtain Main Domain and IP address information corresponding to each secondary subdomain name.
The embodiment of the present invention utilizes getaddrinfo() host name and Service name can convert to the technical characteristic of socket address structure by function, obtains the secondary subdomain name that each Main Domain in Main Domain pond is corresponding, and the IP address information that each domain name is corresponding.
3) by each Main Domain of acquisition and the secondary subdomain name of correspondence thereof, and the IP address information of Main Domain and each secondary subdomain name is saved in DNS expedited data information.
In this step, when preserving the secondary subdomain name of Main Domain and correspondence thereof, the map setting up mapping relations between Main Domain with corresponding each secondary subdomain name shows, and concrete mapping relations as shown in Figure 3.
When generating in browser side: described DNS expedited data information is the DNS expedited data information that the URL of browser statistic of user accessing obtains.
Wherein, the mode of described browser acquisition DNS expedited data information comprises:
Obtain the URL of user's access, extract the Main Domain that this URL is corresponding;
Intercepting system function getaddrinfo (), obtains secondary subdomain name corresponding to described Main Domain and the described Main Domain socket address structure corresponding with each secondary subdomain name;
According to described socket address structure, obtain Main Domain and IP address information corresponding to each secondary subdomain name;
By each secondary subdomain name corresponding to described Main Domain, described Main Domain and IP address information corresponding to each domain name stored in DNS expedited data information.Wherein, when preserving the secondary subdomain name of Main Domain and correspondence thereof, the map setting up mapping relations between Main Domain with corresponding each secondary subdomain name shows, and concrete mapping relations continue as shown in Figure 3.
Two, DNS accelerating step;
1, start browser, call DNS expedited data information;
Wherein, the DNS expedited data information called is the DNS expedited data information downloaded at server side, or, for the DNS expedited data information of server side active push received, and/or the DNS expedited data information called is the DNS expedited data information that the URL of browser statistic of user accessing obtains.
2, when browser address bar changes, namely user has initiated the access request to certain URL, resolves this access request, obtains URL to be visited;
Wherein, address field changes and refers to that user is at address field input or the URL that automatically recommended by address field.
3, judge whether URL to be visited is the URL that system has been cached, if so, illustrate that the object that URL is corresponding is not out of date, directly can use the information of local system buffer memory, now just need not carry out DNS and accelerate to have processed; If not, then step 4 is performed;
4, segmentation URL, obtains the domain name that this URL is corresponding, and search for this domain name in DNS expedited data information, when searching, performs step 5; If do not search, by normal browsing process process.
Such as, when user is at browsing page, the connection of the second level domain under Main Domain can be clicked, at this moment can get this second level domain and carry out the segmentation of URL, according to the map table in above-mentioned DNS expedited data information, searching of the Main Domain after splitting, the mapping relations of second level domain.
5, call DnsAccelerate () function, will wait that accelerating domain name is inserted in acceleration list.
This step is specially:
DnsAccelerate () function call Windows system function QueueUserWorkItem (), notification queue daemon thread has domain name to wait to accelerate.
Queue daemon thread calls ParallelGetAddrInfoProc () function, performs and operates as follows:
Call CreateSemaphore function, create semaphore;
Call:: QueueUserWorkItem (GetAddrInfoSysProc, & pParseDataArray [index], 0), resolves domain name; The invoked procedure of this function is the process of searching in DNS expedited data information and waiting to accelerate IP address corresponding to domain name;
Wait for that the task in all queues completes.
6, after domain name has been accelerated, get the IP address information that URL to be visited is corresponding, utilize this IP address information to conduct interviews process;
7, when user browses webpage corresponding to described URL, detect user's mouse and whether hover on the current webpage browsed, if so, obtain webpage subregion DIV element corresponding to mouse-over position; Wherein, mouse-over schematic diagram as shown in Figure 4;
8, each URL in described DIV element is split, obtains the domain name that each URL is corresponding, and duplicate removal process is carried out to the domain name obtained;
9, detect in DNS expedited data information and whether comprise domain name corresponding to each described URL, if comprise, then extract the IP address information that each domain name is corresponding, and when user accesses the URL in described DIV element, directly utilize the IP address information of described extraction to conduct interviews process.
Illustrate as follows for mouse-over scheme:
Detect the current location of mouse, and mouse cover the URL link of the daughter element in web page element.Such as mouse is current is in <divclass=" nav_2 " >
<ul>
<li><ahref=" http://news.sina.com.cn/ " ><b> news </b></aGreatT.Gr eaT.GT</li>
The military </a></liGreatT.G reaT.GT of <li><ahref=" http://mil.news.sina.com.cn " >
<li><ahref=" http://news.sina.com.cn/society/ " > society </a></liGreatT.G reaT.GT
</ul>
<ul>
<li><ahref=" http://finance.sina.com.cn/ " ><b> finance and economics </b></aGreatT.Gr eaT.GT</li>
<li><ahref=" http://finance.sina.com.cn/stock/ " > stock </a></liGreatT.G reaT.GT
<li><ahref=" http://finance.sina.com.cn/fund/ " > fund </a></liGreatT.G reaT.GT
</ul>
<ul>
<li><ahref=" http://tech.sina.com.cn/ " ><b> science and technology </b></aGreatT.Gr eaT.GT</li>
<li><ahref=" http://mobile.sina.com.cn/ " > mobile phone </a></liGreatT.G reaT.GT
The digital </a></liGreatT.G reaT.GT of <li><ahref=" http://digi.sina.com.cn/ " >
</ul>
</div>。
When the <ahref=of mouse-over in above-mentioned DIV element " http://mobile.sina.com.cn/ " > is upper, the acceleration process of DNS can be carried out to the URL at this DIV.
Hover over the URL which point is corresponding, this refers to the URL duplicate removal set in <div...>...</div >, as: news.sina.com.cn; Mil.news.sina.com.cn; Finance.sina.com.cn; Tech.sina.com.cn; Mobile.sina.com.cn; Digi.sina.com.cn.
Embodiment four
As shown in Figure 5, the embodiment of the present invention provides a kind of browser, comprising: calling module 510, acceleration trigger module 520 and acceleration Executive Module 530; Wherein:
Calling module 510, for starting browser, and calls DNS expedited data information, and wherein said DNS expedited data information comprises the IP address information of some domain names and each domain name obtained in advance;
Further, the some domain names obtained in advance of preserving in the DNS expedited data information that calling module 510 calls comprise some Main Domains, and the subdomain name that each Main Domain is corresponding.
Further, set up in the DNS expedited data information that calling module 510 calls and have map to show, in described map table, include the mapping relations between Main Domain with corresponding each subdomain name.
Further, calling module 510, the DNS expedited data information called is for downloading DNS expedited data information at server side; Or, be the DNS expedited data information of server side active push received; And/or, the DNS expedited data information obtained for the URL of browser statistic of user accessing.
When the DNS expedited data information that the URL that DNS expedited data information is browser statistic of user accessing obtains, browser realizes the generation of DNS expedited data information especially by such as lower module:
Acquisition module, for obtaining the URL of user's access, extracts the Main Domain that this URL is corresponding;
Function call module, for tackling the acquisition address information function of browser side computer system, obtains subdomain name corresponding to described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
Data obtaining module, for according to described socket address structure, obtains Main Domain and IP address information corresponding to each subdomain name;
Information storage module, for by each subdomain name corresponding to described Main Domain, described Main Domain and IP address information corresponding to each domain name stored in DNS expedited data information.
Accelerate trigger module 520, for receiving the access request of Client-initiated to certain URL, resolve this access request, and extract domain name corresponding to described URL, trigger and accelerate Executive Module 530;
Further, accelerate trigger module 520, also for before extracting domain name corresponding to described URL, judge described URL whether first delay by this locality, if non-buffer memory, then extract the domain name that described URL is corresponding.
Accelerating Executive Module 530, for detecting in described DNS expedited data information whether comprise domain name corresponding to described URL, if comprise, then obtaining the corresponding IP address information of this domain name, and utilize this IP address information to conduct interviews process.
Further, accelerate Executive Module 530, specifically comprise:
Domain name detection sub-module 531, for judging that the domain name that described URL is corresponding is Main Domain or subdomain name, if Main Domain, triggering lookup submodule, if subdomain name, triggers domain name process submodule;
Domain name process submodule 532, for splitting the subdomain name obtained, obtains the Main Domain that this subdomain name is corresponding, and with this Main Domain for search index, triggering lookup submodule;
Search submodule 533, for searching corresponding domain name in described map table.
Further, accelerate Executive Module 530, wait to accelerate in list specifically for domain name corresponding for described URL is inserted into, and notification queue daemon thread, semaphore is created by described queue daemon thread, and transfer the IP address that described in described DNS expedited data information, domain name is corresponding, realize the parsing to domain name.
Further, accelerate Executive Module 530, be further used for when the IP address information that the multiple domain name of concurrent acquisition is corresponding, the thread pool utilizing described queue daemon thread to notify to be pre-created is for obtaining each request task distribution thread of IP address information, and each thread that utilization distributes transfers the IP address information in described DNS expedited data information, realizes the parsing to each domain name.
In sum, browser described in the embodiment of the present invention, by adding up for some Main Domains in advance, form DNS expedited data information, after this DNS expedited data information is called by user side browser, can realize web page browsing to accelerate, this acceleration processing procedure is consuming time short, improves the efficiency that DNS accelerates.
Embodiment five
As shown in Figure 6, the embodiment of the present invention provides a kind of browser, and this browser is the scheme extension to browser described in embodiment four, and namely expansion adds mouse-over scheme.In following elaborate process, do not repeat at this for the processing mode identical with embodiment four, described browser specifically comprises: calling module 610, acceleration trigger module 620, acceleration Executive Module 630, hovering data obtaining module 640 and domain Name acquisition module 650; Wherein:
Calling module 610, for starting browser, and calls DNS expedited data information, and wherein said DNS expedited data information comprises the IP address information of some domain names and each domain name obtained in advance;
Accelerate trigger module 620, for receiving the access request of Client-initiated to certain URL, resolve this access request, and extract domain name corresponding to described URL, trigger and accelerate Executive Module 630;
Accelerating Executive Module 630, for detecting in described DNS expedited data information whether comprise domain name corresponding to described URL, if comprise, then obtaining the corresponding IP address information of this domain name, and utilize this IP address information to conduct interviews process.
Whether hovering data obtaining module 640, during webpage corresponding to the URL for browsing access as user, detect user's mouse and hover on browsing device net page, the webpage subregion DIV element that if so, acquisition mouse-over position is corresponding;
Domain Name acquisition module 650, for each URL in described DIV element is split, obtain the domain name that each URL is corresponding, and duplicate removal process is carried out to the domain name obtained, trigger acceleration Executive Module 630 and extract IP address information corresponding to each domain name, for each URL in user subsequent access DIV element.
In sum, browser of the present invention, by adding up for some Main Domains in advance, form DNS expedited data information, after this DNS expedited data information is called by user side browser, can realize web page browsing to accelerate, this acceleration processing procedure is consuming time short, improves the efficiency that DNS accelerates;
In addition, browser of the present invention, can also carry out acceleration process to the URL at mouse-over place, applied widely.
Embodiment six
As shown in Figure 7, the embodiment of the present invention also provides a kind of server, comprising: configuration module 710, spider module 720, information generating module 730 and calling interface module 740; Wherein:
Configuration module 710, for collecting Main Domain, and utilizes the Main Domain configuration Main Domain pond of collecting;
Further, configuration module 710, specifically for receiving each Main Domain that user side browser reports, configures described Main Domain pond based on each Main Domain; And/or, obtain the whole network focus domain-name information, utilize visit capacity top N Main Domain to configure described Main Domain pond; Described N is positive integer.
Further, configuration module 710, also for when there being new Main Domain to enter pond, and/or, when occurring when there being Main Domain in described Main Domain pond to change, trigger described data obtaining module and obtain described new Main Domain and subdomain name corresponding to Main Domain after changing and the Main Domain IP address information corresponding with each subdomain name, and trigger described information generating module 730 described DNS expedited data information is upgraded.
Spider module 720, for choosing Main Domain one by one in described Main Domain pond, obtains subdomain name corresponding to described Main Domain and the Main Domain IP address information corresponding with each subdomain name;
Further, spider module 720, specifically comprises:
Domain name traversal submodule 721, for choosing Main Domain one by one in described Main Domain pond;
Statistics submodule 722, for tackling the acquisition address information function (such as: system function getaddrinfo ()) of browser side computer system, obtain subdomain name corresponding to each described Main Domain and the described Main Domain socket address structure corresponding with each subdomain name;
Address acquisition submodule 723, for according to described socket address structure, obtains Main Domain and IP address information corresponding to each subdomain name.
Information generating module 730, for the IP address information of the subdomain name and each domain name of preserving each described Main Domain and correspondence thereof, generates DNS expedited data information;
Further, information generating module 730, when generating DNS expedited data information, the map also setting up mapping relations between described Main Domain with corresponding each secondary subdomain name shows.
Calling interface module 740, for being sent to user side browser by described DNS expedited data information.
Further, calling interface module 740, specifically for when user side browser starts, initiatively by described DNS expedited data information pushing extremely described user side browser; Or, when receiving the download request of user side browser, described DNS expedited data information is sent to described user side browser.
In sum, server described in the embodiment of the present invention is in order to generate DNS expedited data information, and this DNS expedited data information is called for user side browser, and the DNS achieving user side browser accelerates process.
Embodiment seven
As shown in Figure 8, the embodiment of the present invention also provides a kind of system of domain name system DNS being carried out to pre-read, comprising: the browser described in embodiment four or five, and the server described in embodiment six.
In sum, system of the present invention, in advance some Main Domains are added up at server side, form DNS expedited data information, after this DNS expedited data information is called by user side browser, can realize web page browsing to accelerate, this acceleration processing procedure is consuming time short, improves the efficiency that DNS accelerates;
In addition, system of the present invention, can also carry out acceleration process to the URL at mouse-over place, applied widely.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In specification provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand in each inventive aspect one or more, in the description above to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this specification (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary compound mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions of the some or all parts in the equipment such as browser, server that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computer of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.