Summary of the invention
The application provides method of attachment and the device linking in a kind of result of page searching, can not be connected to the problem of target pages to solve described link in result of page searching.
In order to address the above problem, the application discloses the method for attachment linking in a kind of result of page searching, comprising:
The search engine linking in result of page searching detected and lose connection, from described link, extract the address of target pages, wherein said target pages is the page corresponding to described link;
Generate the redirect executing data of browser, the address of the target pages extracting described in wherein said redirect executing data comprises;
Carry out described redirect executing data, be connected to the address of described target pages.
Preferably, before described address of extracting target pages from described link, also comprise:
Obtain in advance the link in result of page searching, and analyze the structure of described link;
The position that obtains target pages URL from link, the address of wherein said target pages URL for preserving target pages.
Preferably, described address of extracting target pages from described link, comprising:
From described link, the address of target pages is extracted in the position of target pages URL.
Preferably, the described address that target pages is extracted in the position of target pages URL from described link, comprising:
Use described regular expression from described link, to search the position of target pages URL, wherein, described regular expression is for searching the address that target pages is obtained in described link;
In the position of described target pages URL, extract the address of target pages.
Preferably, described redirect executing data is for opening a label at browser, and in described label the page corresponding to display label object, described method also comprises:
Obtain in advance and from local cache, obtain the first redirect executing data of browser and preserve;
Analyze the position of label object in described the first redirect executing data.
Preferably, the redirect executing data according to generating browser, comprising:
Extract the first redirect executing data of preserving in advance;
The position of label object in described the first redirect executing data is added to the address of described target pages;
Generate the second redirect executing data, and be kept in local cache.
Preferably, the described redirect executing data of described execution, is connected to the address of described target pages, comprising:
Extract and carry out the second redirect executing data of preserving in local cache;
In browser, open a new label;
In described new label, the address of the linking objective page is to open target pages.
Accordingly, disclosed herein as well is the coupling arrangement linking in a kind of result of page searching, comprising:
Extraction module, loses connection for detection of the search engine linking in result of page searching, from described link, extracts the address of target pages, and wherein said target pages is the page corresponding to described link;
Generation module, for generating the redirect executing data of browser, the address of the target pages extracting described in wherein said redirect executing data comprises;
Link block, for carrying out described redirect executing data, is connected to the address of described target pages.
Preferably, described device also comprises: the first pretreatment module, and described the first pretreatment module comprises:
Obtain and analyze submodule, for obtaining in advance result of page searching, link, and analyze the structure of described link;
Obtain submodule, for the position that obtains target pages URL from link, the address of wherein said target pages URL for preserving target pages.
Preferably, described extraction module, the address of extracting target pages for the position from described link target pages URL.
Preferably, described extraction module, comprising:
Search submodule, for using described regular expression to search the position of target pages URL from described link, wherein, described regular expression is for searching the address that target pages is obtained in described link;
Extract submodule, for the position at described target pages URL, extract the address of target pages.
Preferably, described redirect executing data is for opening a label at browser, and in described label the page corresponding to display label object, described device also comprises: the second pretreatment module,
Described the second pretreatment module, comprising:
Obtain submodule, for obtaining in advance from local cache, obtain the first redirect executing data of browser and preserve;
Analyze submodule, the position that obtains label object for analyzing described the first redirect executing data.
Preferably, described generation module, comprising:
Extract submodule, for extracting the first redirect executing data of preserving in advance;
Add submodule, for the position that described the first redirect executing data is obtained to label object, be added to the address of described target pages;
Generate and preserve submodule, for generating the second redirect executing data, and be kept in local cache.
Preferably, described link block, comprising:
Extract and implementation sub-module the second redirect executing data of preserving for extracting and carry out local cache;
Open submodule, for open a new label at browser;
Connexon module, for the address at the described new label linking objective page to open target pages.
Compared with prior art, the application comprises following advantage:
First, the search engine linking in result of page searching detected and lose connection, from described link, extract the address of target pages, wherein said target pages is the page corresponding to described link, generate the redirect executing data of browser, the address of the target pages extracting described in wherein said redirect executing data comprises, carries out described redirect executing data, is connected to the address of described target pages.The application, when search engine cannot jump to target pages, can oneself generate described redirect executing data, is then connected to the address of described target pages.The application is opening target pages, even if target pages corresponding to described link need to authenticate or safety encipher, also can not be affected, guarantee to jump in the target pages that user wants to see, the described link in Search Results there will not be the problem that can not be connected to target pages.
Embodiment
For the application's above-mentioned purpose, feature and advantage can be become apparent more, below in conjunction with the drawings and specific embodiments, the application is described in further detail.
When user clicks described link, due to the reason such as network condition is bad, cause the server of search engine to be connected disconnection with browser, browser does not receive return data, cannot the display-object page.
Now a kind of solution is to adopt redirected method.Described redirected method comprises: 1,301 redirect are permanent transfer (Permanently Moved); 2,302 redirect are temporary transfer (Temporarily Moved); 3, meta fresh, by the meta instruction in webpage, is redirected to new webpage after special time, if the time too short (within approximately 5 seconds) postponing can be judged as the information of cheating search engine.
But described redirected method can not guarantee to jump in the target pages that user wants to see, the described link in Search Results still can not be connected to target pages.
The application provides the method for attachment linking in a kind of result of page searching, target pages can opened, even if target pages corresponding to described link need to authenticate or safety encipher, can not be affected yet, guarantee to jump in the target pages that user wants to see, the described link in Search Results there will not be the problem that can not be connected to target pages.
With reference to Fig. 1, provided the method for attachment process flow diagram linking in a kind of result of page searching described in the embodiment of the present application.
Step 11, detects the search engine linking in result of page searching and loses connection, from described link, extracts the address of target pages, and wherein said target pages is the page corresponding to described link;
User gets after Search Results by the function of search of certain search engine, can click described link and check and want the page seen, now user is thought to the page seen, i.e. the page corresponding to described link is as target pages.
For example, user search xx net, in result of page searching, the descriptor of article one link is xx net homepage, and user clicks article one link, and described article one links the corresponding page, and xx net homepage is target pages.
User clicks after described link, can first connect search engine, if now browser loses and is connected with search engine, the search engine linking in result of page searching detected and lose connection, cannot receive the return data of search engine, as redirect executing data, therefore cannot the display-object page.Now browser can extract the address of target pages from described link.
Step 12, the redirect executing data of generation browser, wherein, the address of the target pages extracting described in described redirect executing data comprises;
The application carrys out the method for the display-object page by redirect executing data according to browser, in said extracted behind the address of target pages, can be according to the address of described target pages, generate the redirect executing data of browser, then use the redirect executing data of described generation to open and the display-object page.
Step 13, carries out described redirect executing data, is connected to the address of described target pages.
After generating redirect executing data, browser can be carried out described redirect executing data, can be connected to the address of described target pages according to described redirect executing data, shows described target pages.
In sum, the search engine linking in result of page searching detected and lose connection, from described link, extract the address of target pages, wherein said target pages is the page corresponding to described link, generate the redirect executing data of browser, the address of the target pages extracting described in wherein said redirect executing data comprises, carries out described redirect executing data, is connected to the address of described target pages.The application, when search engine cannot jump to target pages, can oneself generate described redirect executing data, is then connected to the address of described target pages.The application can open target pages, even if target pages corresponding to described link need to authenticate or safety encipher, also can not be affected, guarantee to jump in the target pages that user wants to see, the described link in Search Results there will not be the problem that can not be connected to target pages.
Conventionally caching mechanism is controlled by head response.HTTP specification description Header control buffer memory, The optional Cache-Control, Expires (expired).
In general, follow following basic rule:
If 1 head response information: tell buffer not retain buffer memory, buffer just can buffer memory corresponding contents;
If 2 solicited messages are to need authentication or safety encipher, corresponding contents can not be buffered yet;
If 3 do not exist checker (ETag or Last-Modified header) in response, caching server can think and lack directly renewal degree information, and content will be considered to can not buffer memory.
If 4, the copy of a buffer memory contains following information: content will be considered to enough new
1) contain complete expired time and life-span control head information, and content is still in freshness date;
2) browser had used cached copies, and in a session, had checked the freshness of content;
3) caching proxy server had been used cached copies at no distant date, and the final updating time of content was before operating period last time;
4) enough new copies will directly be sent from buffer memory, and can not send request to source server;
If the copy of 5 buffer memorys is too old, caching server will send request check request to source server, for determining whether, can continue to use current copy to continue service.
The application, by the HTTP caching mechanism of browser, can search for the new Javascript script of historical Javascript script dynamic construction that should ask according to user, and be placed in browser HTTP buffer memory.When search engine can not be served, browser is carried out the new Javascript script of dynamic construction, the linking objective page.
Preferably, described from the described link of clicking, extract the address of target pages before, also comprise:
Obtain in advance the link in result of page searching, and analyze the structure of described link;
The position that obtains target pages URL from link, the address of wherein said target pages URL for preserving target pages.
The application can obtain the link in result of page searching in advance, then analyzes the structure of described link.For example, in described link, may comprise the address that search engine is corresponding, the key word of search, the address of target pages etc.
After the structure analysis of described link, just can therefrom obtain the position of target pages URL, the address of wherein said target pages URL for preserving target pages.
Preferably, described redirect executing data is for opening a label at browser, and in described label the page corresponding to display label object,
Described method also comprises:
Obtain in advance and from local cache, obtain the first redirect executing data of browser and preserve;
Analyze the position of label object in described the first redirect executing data.
Browser, when connecting the page by redirect executing data, can be kept at described redirect executing data in local cache.Using the adjustment executing data in described local cache as the first redirect executing data, obtain in advance the first redirect executing data in local cache, and can preserve described the first redirect executing data, can still be kept in local cache, also can be kept at other position, the application is not construed as limiting this.
Wherein, the function of described redirect executing data is first in browser, to open a label, then in described label, connects and the page corresponding to display label object.
Therefore can analyze the structure of described the first redirect executing data, analyze the position of label object in described the first redirect executing data.The follow-up address that page address in the position of described label object is replaced to target pages, the linking objective page.
For example, in a kind of redirect executing data, concrete Javascript script is as follows:
<script>window.***JavaScriptRedirect=1</script><script>var?a=parent,b=parent.***,c=location;if(a!=window&&b){if(b.r){b.r=0;a.location.href=″http://ent.xx1.com.cn/s/m/f/lix2.html″;c.replace(″about:blank″);}}else{c.replace(″http://ent.xx1.com.cn/s/m/f/lix2.html″);};</script><noscript><METAhttp-equiv=″refresh″
content=″0;URL=′http://ent.xx1.com.cn/s/m/f/lix2.html′″></noscript>
Wherein, the page address in the position of label object is:
http://ent.xx1.com.cn/s/m/f/lix2.html。
Lower mask body is discussed the method for attachment linking in result of page searching:
With reference to Fig. 2, provided the method for attachment process flow diagram linking in a kind of result of page searching described in the application's preferred embodiment.
Step 201, from described link, the address of target pages is extracted in the position of target pages URL;
Behind the above-mentioned position that analyzes label object in described the first redirect executing data, can construct a regular expression or a function, the address that then target pages is extracted in the position of target pages URL from described link.
As, use described regular expression from described link, to search the position of target pages URL, wherein, described regular expression is for searching the address that target pages is obtained in described link
The article one of for example, searching for xx net in result of page searching is linked as:
http://www.***.com.hk/url?sa=t&rct=j&q=%E5%A5%87%E8%99%8E?&source=web&cd=1&ved=0CDoQFjAA&url=http%3A%2F%2Fwww.xx.com%2F&ei=bUJoT6_ALMPorQeI9rHdBw&usg=AFQjCNGjK7aOPd4q6SliFZugXwgb-M4DVQ
Can therefrom extract the address of target pages, i.e. the address of xx net: http://www.xx.com/
Step 202, extracts the first redirect executing data of preserving in advance;
Then place, preservation address that can the first redirect executing data extracts described redirect executing data, for example, if redirect executing data is kept in local cache, just can obtain described the first redirect executing data from local cache is various.
Certainly, also can preserve described the first redirect executing data at the server end of browser, the first redirect executing data described in can real-time update, then, when browser needs described the first redirect executing data, sends request to server and obtains described the first redirect executing data.Described the first redirect executing data is preserved to position to the application and acquisition methods is not construed as limiting.
Step 203, is added to the position of label object in described the first redirect executing data the address of described target pages;
After getting described the first redirect executing data, can be in the first redirect executing data the position of label object, use the address of described target pages to replace original page address.
For example, by above-mentioned page address: http://ent.xx1.com.cn/s/m/f/lix2.html, replaces with the address that xx nets: http://www.xx.com/.
Step 204, generates the second redirect executing data, and is kept in local cache;
After having revised the page address that label object is corresponding, can generate the second redirect executing data, and be kept in local cache.
Step 205, extracts and carries out the second redirect executing data of preserving in local cache;
Then extract the second redirect executing data of preserving in local cache, and carry out described the second redirect executing data.
Step 206 is opened a new label in browser;
First described the second redirect executing data opens a new label in browser, and described new label is for the display-object page.
Step 207, in described new label, the address of the linking objective page is to open target pages.
Then described the second redirect executing data connects described label object in new label, i.e. then the address of the linking objective page opens and show described target pages.
With reference to Fig. 3, provided the coupling arrangement structural drawing linking in a kind of result of page searching described in the embodiment of the present application.
Accordingly, the application provides the coupling arrangement linking in a kind of result of page searching, comprising: extraction module 13, generation module 14 and link block 15, wherein,
Extraction module 13, loses connection for detection of the search engine linking in result of page searching, from described link, extracts the address of target pages, and wherein said target pages is the page corresponding to described link;
Generation module 14, for generating the redirect executing data of browser, the address of the target pages extracting described in wherein said redirect executing data comprises;
Link block 15, for carrying out described redirect executing data, is connected to the address of described target pages.
Preferably, described device also comprises: the first pretreatment module 11,
Described the first pretreatment module 11 comprises:
Obtain and analyze submodule 111, for obtaining in advance result of page searching, link, and analyze the structure of described link;
Obtain submodule 112, for the position that obtains target pages URL from link, the address of wherein said target pages URL for preserving target pages.
Preferably, described extraction module 13, the address of extracting target pages for the position from described link target pages URL.
Preferably, extraction module 13, comprising:
Search submodule 131, for using described regular expression to search the position of target pages URL from described link, wherein, described regular expression is for searching the address that target pages is obtained in described link;
Extract submodule 132, for the position at described target pages URL, extract the address of target pages.
Preferably, described redirect executing data is for opening a label at browser, and in described label the page corresponding to display label object,
Described device also comprises: the second pretreatment module 12,
Described the second pretreatment module 12, comprising:
Obtain submodule 121, for obtaining in advance from local cache, obtain the first redirect executing data of browser and preserve;
Analyze submodule 122, the position that obtains label object for analyzing described the first redirect executing data.
Preferably, described generation module 14, comprising:
Extract submodule 141, for extracting the first redirect executing data of preserving in advance;
Add submodule 142, for the position that described the first redirect executing data is obtained to label object, be added to the address of described target pages;
Generate and preserve submodule 143, for generating the second redirect executing data, and be kept in local cache.
Preferably, described link block 15, comprising:
Extract and implementation sub-module 151 the second redirect executing data of preserving for extracting and carry out local cache;
Open submodule 152, for open a new label at browser;
Connexon module 153, for the address at the described new label linking objective page to open target pages.
For device embodiment, because it is substantially similar to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
Each embodiment in this instructions all adopts the mode of going forward one by one to describe, and each embodiment stresses is the difference with other embodiment, between each embodiment identical similar part mutually referring to.
The application can describe in the general context of the computer executable instructions of being carried out by computing machine, for example program module.Usually, program module comprises the routine carrying out particular task or realize particular abstract data type, program, object, assembly, data structure etc.Also can in distributed computing environment, put into practice the application, in these distributed computing environment, by the teleprocessing equipment being connected by communication network, be executed the task.In distributed computing environment, program module can be arranged in the local and remote computer-readable storage medium that comprises memory device.
Finally, also it should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, commodity or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, commodity or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, commodity or the equipment that comprises described key element and also have other identical element.
The method of attachment and the device that in a kind of result of page searching above the application being provided, link, be described in detail, applied specific case herein the application's principle and embodiment are set forth, the explanation of above embodiment is just for helping to understand the application's method and core concept thereof; Meanwhile, for one of ordinary skill in the art, the thought according to the application, all will change in specific embodiments and applications, and in sum, this description should not be construed as the restriction to the application.