[go: up one dir, main page]

CN103631905A - Webpage loading method and browser - Google Patents

Webpage loading method and browser Download PDF

Info

Publication number
CN103631905A
CN103631905A CN201310598267.0A CN201310598267A CN103631905A CN 103631905 A CN103631905 A CN 103631905A CN 201310598267 A CN201310598267 A CN 201310598267A CN 103631905 A CN103631905 A CN 103631905A
Authority
CN
China
Prior art keywords
webpage
resource
browser
search engine
web page
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
Application number
CN201310598267.0A
Other languages
Chinese (zh)
Inventor
耿兆贺
任寰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201310598267.0A priority Critical patent/CN103631905A/en
Publication of CN103631905A publication Critical patent/CN103631905A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/951Indexing; Web crawling techniques

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种网页的加载方法和浏览器。本发明实施例提供的一种网页的加载方法包括:根据网页地址从网络中下载网页中指定的网页资源;监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引第一原始地址对应的第二网页资源;从搜索引擎服务器侧获取第一原始地址对应的第二网页资源;在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。

Figure 201310598267

The invention discloses a webpage loading method and a browser. A method for loading a webpage provided by an embodiment of the present invention includes: downloading a specified webpage resource from the network according to the webpage address; The original address is sent to the corresponding search engine server side of the browser to index the second webpage resource corresponding to the first original address on the search engine server side; obtain the second webpage resource corresponding to the first original address from the search engine server side; When the downloaded webpage resource is loaded into the webpage of the browser, the second webpage resource is used to replace the first webpage resource and loaded to the corresponding position of the webpage.

Figure 201310598267

Description

一种网页的加载方法和浏览器A web page loading method and browser

技术领域technical field

本发明涉及计算机网络技术领域,特别涉及一种网页的加载方法和浏览器。The invention relates to the technical field of computer networks, in particular to a webpage loading method and a browser.

背景技术Background technique

网页浏览器是一种能够显示网站服务器或文件系统内的文件,并让用户与这些文件交互的应用软件。网页浏览器是最常用的客户端程序,它用来显示在万维网或局域网等内的文字、图像及其他信息。这些文字或图像,可以是连接其他网址的超链接,用户可迅速及轻易地浏览各种信息。A web browser is an application software that displays files on a web server or file system and allows users to interact with those files. A web browser is the most commonly used client program, which is used to display text, images and other information on the World Wide Web or a local area network, etc. These texts or images can be hyperlinks to other websites, and users can quickly and easily browse various information.

大部分网页为HTML(Hyper Text Mark-up Language,超文本标记语言)格式。对于HTML网页中的各种资源的下载,都是从服务器侧进行下载的。如果服务器侧的数据提供有问题,一般会使用缓存的网页进行响应,例如多台分布式的缓存服务器中会保存有该HTML网页。如果网页中的网页元素出现问题,一般只能去查看网页快照,然而网页快照仅对文本文件进行保存。Most web pages are in HTML (Hyper Text Mark-up Language) format. The download of various resources in the HTML webpage is all downloaded from the server side. If there is a problem with the data provided on the server side, the cached webpage will generally be used to respond, for example, the HTML webpage will be stored in multiple distributed cache servers. If there is a problem with a webpage element in the webpage, generally only the snapshot of the webpage can be viewed, but the snapshot of the webpage only saves the text file.

因此,对于包括损坏了的图片、视频、音频等多媒体格式网页元素的网页,现有技术存在即使是使用搜索公司提供的网页快照也无法对该受损网页进行修复的问题,降低了浏览器向用户所提供内容的有效性,用户体验较差。Therefore, for webpages including damaged pictures, videos, audio and other multimedia format webpage elements, there is a problem in the prior art that the damaged webpage cannot be repaired even if the webpage snapshot provided by the search company is used, which reduces the browser's ability to The effectiveness of the content provided by the user, the user experience is poor.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种网页的加载方法和相应的浏览器。In view of the above problems, the present invention is proposed to provide a webpage loading method and a corresponding browser that overcome the above problems or at least partially solve the above problems.

依据本发明的一个方面,本发明实施例提供了一种网页的加载方法,包括:According to one aspect of the present invention, an embodiment of the present invention provides a method for loading a web page, including:

根据网页地址从网络中下载网页中指定的网页资源;Download the web resource specified in the web page from the network according to the web page address;

监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引第一原始地址对应的第二网页资源;When it is detected that the download of the first webpage resource in the webpage fails, the first original address of the first webpage resource is sent to the search engine server side corresponding to the browser, so as to index the second webpage corresponding to the first original address on the search engine server side. web resources;

从搜索引擎服务器侧获取第一原始地址对应的第二网页资源;Obtaining the second web page resource corresponding to the first original address from the search engine server side;

在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。When the downloaded webpage resource is loaded into the webpage of the browser, the second webpage resource is used to replace the first webpage resource and loaded to a corresponding position of the webpage.

可选的,上述方法还包括:根据网页、第一网页资源和第二网页资源生成一条数据记录;将数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;当再次监测到浏览器用户下载网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取数据记录,利用该数据记录加载网页。Optionally, the above method also includes: generating a data record according to the webpage, the first webpage resource and the second webpage resource; storing the data record in the browser user data on the browser side or the search engine server side; When the browser user fails to download the first webpage resource in the webpage, the data record is extracted from the browser user data on the browser side or the search engine server side, and the webpage is loaded using the data record.

可选的,上述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:Optionally, when it is detected that the download of the first webpage resource in the webpage fails, sending the first original address of the first webpage resource to the search engine server side corresponding to the browser includes:

判断下载失败的第一网页资源的类型;确定与浏览器对应且与类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与类型相匹配的搜索引擎服务器侧。Judging the type of the first webpage resource that failed to download; determining the search engine server corresponding to the browser and matching the type; sending the first original address of the first webpage resource to the search engine server side matching the type.

可选的,上述方法还包括:获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至从任一与浏览器对应的搜索引擎服务器侧获取到第二网页资源。Optionally, the above method further includes: obtaining the priority levels of the search engine servers corresponding to the browser; and sending the first original address of the first web page resource to each search engine server successively according to the order of priority levels from high to low side until the second webpage resource is obtained from any search engine server side corresponding to the browser.

可选的,上述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:Optionally, when it is detected that the download of the first webpage resource in the webpage fails, sending the first original address of the first webpage resource to the search engine server side corresponding to the browser includes:

获取下载失败的第一网页资源的描述信息;将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧;在无法从搜索引擎服务器侧获取第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与描述信息关联的第三网页资源,用该第三网页资源替代第二网页资源。Obtain the description information of the first web page resource that failed to download; send the first original address and description information of the first web page resource to the search engine server side corresponding to the browser; if the first original address cannot be obtained from the search engine server side If the second webpage resource is the second webpage resource, the third webpage resource associated with the description information is obtained from the search engine server side, and the second webpage resource is replaced by the third webpage resource.

可选的,上述监测到网页中的第一网页资源下载失败包括:Optionally, the detected failure to download the first webpage resource in the webpage includes:

获取浏览器内核的当前类型;若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。Obtain the current type of the browser kernel; if the browser is the Webkit kernel, learn that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event; if the browser is the IE kernel, learn the first webpage resource download failure by monitoring the navigation error event The download of the web page resource fails; if the browser is an IE kernel and the JS script is embedded in the browser, it is learned that the download of the first web page resource in the web page fails by monitoring an error occurrence event.

可选的,上述将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:Optionally, the above-mentioned sending the first original address of the first webpage resource to the search engine server side corresponding to the browser includes:

选取第一网页资源的第一原始地址为第一网页资源的统一资源定位符URL;对第一网页资源的URL进行编码,将编码后的URL发送至浏览器对应的搜索引擎服务器侧。Selecting the first original address of the first webpage resource as the Uniform Resource Locator URL of the first webpage resource; encoding the URL of the first webpage resource, and sending the encoded URL to the corresponding search engine server side of the browser.

可选的,上述从搜索引擎服务器侧获取第一原始地址对应的第二网页资源包括:Optionally, the acquisition of the second web page resource corresponding to the first original address from the search engine server side includes:

通过网页浏览器IWebbrowser接口从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用Html元素IHtmlElement接口将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。Obtain the second cache address on the search engine server side of the second web resource indexed by the first original address from the search engine server side through the web browser IWebbrowser interface; use the Html element IHtmlElement interface to replace the first original address with the second cache Address; the second webpage resource is obtained by downloading from the search engine server according to the second cache address.

可选的,上述从搜索引擎服务器侧获取第一原始地址对应的第二网页资源包括:通过浏览器中嵌入的JS脚本从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用JS脚本将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。Optionally, obtaining the second webpage resource corresponding to the first original address from the search engine server side includes: obtaining the second webpage resource indexed by the first original address from the search engine server side through a JS script embedded in the browser. The second cache address on the search engine server side; using the JS script to replace the first original address with the second cache address; downloading the second webpage resource from the search engine server according to the second cache address.

可选的,第一网页资源包括图片、音频和视频中的一种或多种网页元素。Optionally, the first webpage resource includes one or more webpage elements among picture, audio and video.

依据本发明的另一个方面,本发明实施例提供了一种浏览器,包括:According to another aspect of the present invention, an embodiment of the present invention provides a browser, including:

网页资源下载单元,适于根据网页地址从网络中下载网页中指定的网页资源;The web page resource downloading unit is suitable for downloading the web page resource specified in the web page from the network according to the web page address;

监测发送单元,适于监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引第一原始地址对应的第二网页资源;The monitoring sending unit is adapted to send the first original address of the first webpage resource to the search engine server side corresponding to the browser when it detects that the download of the first webpage resource in the webpage fails, so as to index the first webpage resource on the search engine server side. the second web page resource corresponding to the original address;

网页资源获取单元,适于从搜索引擎服务器侧获取第一原始地址对应的第二网页资源;A webpage resource acquisition unit adapted to acquire a second webpage resource corresponding to the first original address from the search engine server side;

网页加载单元,适于在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。The web page loading unit is adapted to load the downloaded web page resource to the corresponding position of the web page with the second web page resource instead of the first web page resource when loading the downloaded web page resource into the web page of the browser.

可选的,还包括数据记录单元,适于根据网页、第一网页资源和第二网页资源生成一条数据记录;将数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;网页加载单元,适于当监测发送单元再次监测到浏览器用户下载网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取数据记录,利用该数据记录加载网页。Optionally, a data recording unit is also included, adapted to generate a data record according to the webpage, the first webpage resource and the second webpage resource; store the data record in the browser user data on the browser side or the search engine server side; The loading unit is adapted to extract the data record from the browser user data on the browser side or the search engine server side when the monitoring sending unit detects that the browser user fails to download the first webpage resource in the webpage again, and uses the data record to load Web page.

可选的,监测发送单元,适于判断下载失败的第一网页资源的类型;确定与浏览器对应且与类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与类型相匹配的搜索引擎服务器侧。Optionally, the monitoring sending unit is suitable for judging the type of the first web page resource that failed to download; determining the search engine server corresponding to the browser and matching the type; sending the first original address of the first web page resource to the Type matching search engine server side.

可选的,监测发送单元,适于获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至网页资源获取单元从任一与浏览器对应的搜索引擎服务器侧获取到第二网页资源。Optionally, the monitoring sending unit is adapted to obtain the priority levels of the search engine servers corresponding to the browser; according to the priority order from high to low, the first original address of the first web page resource is sent to each search engine successively On the server side, until the webpage resource acquiring unit acquires the second webpage resource from any search engine server side corresponding to the browser.

可选的,监测发送单元,适于获取下载失败的第一网页资源的描述信息;将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧;Optionally, the monitoring sending unit is adapted to obtain the description information of the first web page resource that failed to download; send the first original address and description information of the first web page resource to the search engine server side corresponding to the browser;

网页资源获取单元,适于在无法从搜索引擎服务器侧获取第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与描述信息关联的第三网页资源,用该第三网页资源替代第二网页资源。The web page resource obtaining unit is adapted to obtain a third web page resource associated with the description information from the search engine server side when the second web page resource corresponding to the first original address cannot be obtained from the search engine server side, and use the third web page resource instead The second web resource.

可选的,监测发送单元,适于获取浏览器内核的当前类型;若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。Optionally, the monitoring sending unit is suitable for obtaining the current type of the browser kernel; if the browser is a Webkit kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event; if the browser is an IE kernel, it is passed Monitor the navigation error event to learn that the download of the first webpage resource in the webpage failed; if the browser is an IE kernel and the JS script is embedded in the browser, it is learned that the download of the first webpage resource in the webpage failed by monitoring the error occurrence event.

可选的,网页资源获取单元,适于选取第一网页资源的第一原始地址为第一网页资源的统一资源定位符URL;对第一网页资源的URL进行编码,将编码后的URL发送至浏览器对应的搜索引擎服务器侧。Optionally, the webpage resource acquisition unit is adapted to select the first original address of the first webpage resource as the Uniform Resource Locator URL of the first webpage resource; encode the URL of the first webpage resource, and send the encoded URL to The server side of the search engine corresponding to the browser.

可选的,网页资源获取单元,适于通过网页浏览器IWebbrowser接口从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用Html元素IHtmlElement接口将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。Optionally, the webpage resource obtaining unit is adapted to obtain from the search engine server side the second cache address of the second webpage resource indexed by the first original address at the search engine server side through the web browser IWebbrowser interface; use the Html element IHtmlElement The interface replaces the first original address with the second cache address; the second web page resource is downloaded from the search engine server according to the second cache address.

可选的,网页资源获取单元,适于通过浏览器中嵌入的JS脚本从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用JS脚本将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。Optionally, the webpage resource obtaining unit is adapted to obtain the second cache address on the search engine server side of the second webpage resource indexed by the first original address from the search engine server side through the JS script embedded in the browser; The script replaces the first original address with the second cache address; the second web page resource is downloaded from the search engine server according to the second cache address.

可选的,网页资源包括图片、音频和视频中的一种或多种网页元素。Optionally, the webpage resource includes one or more webpage elements among picture, audio and video.

由上所述,本发明实施例通过当第一网页资源下载失败时,从与浏览器对应的搜索引擎服务器侧获取与第一网页资源关联的第二网页资源,并用第二网页资源替代第一网页资源加载至网页相应位置的技术手段,能够对受损网页中包括图片、视频、音频在内的各网页元素进行补偿性修复,提高了浏览器向用户提供的网页内容的有效性,使浏览器显示的网页内容更加丰富,改善了用户体验。From the above, the embodiment of the present invention obtains the second webpage resource associated with the first webpage resource from the search engine server side corresponding to the browser when the download of the first webpage resource fails, and replaces the first webpage resource with the second webpage resource. The technical means of loading webpage resources to the corresponding position of the webpage can perform compensatory repairs on various webpage elements including pictures, videos, and audios in the damaged webpage, improve the effectiveness of the webpage content provided by the browser to users, and make browsing The content of the webpage displayed by the browser is richer, which improves the user experience.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.

附图说明Description of drawings

通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:

图1示出了根据本发明一个实施例的一种网页的加载方法流程图;Fig. 1 shows a flow chart of a web page loading method according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的又一种网页的加载方法流程图;Fig. 2 shows a flow chart of another webpage loading method according to an embodiment of the present invention;

图3示出了根据本发明又一实施例的一种网页的加载方法流程图;Fig. 3 shows a flowchart of a method for loading a web page according to yet another embodiment of the present invention;

图4示出了根据本发明又一实施例的一种浏览器的结构示意图。Fig. 4 shows a schematic structural diagram of a browser according to yet another embodiment of the present invention.

具体实施方式Detailed ways

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

本发明一个实施例提供了一种网页的加载方法,参见图1,该方法包括如下步骤:An embodiment of the present invention provides a method for loading a webpage, referring to Fig. 1, the method includes the following steps:

S100:根据网页地址从网络中下载网页中指定的网页资源。S100: Download the webpage resource specified in the webpage from the network according to the webpage address.

上述指定的网页资源为需要下载的网页中包括的所有资源。The above specified webpage resources are all resources included in the webpage to be downloaded.

S102:监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引第一原始地址对应的第二网页资源。S102: When it is detected that the download of the first webpage resource in the webpage fails, send the first original address of the first webpage resource to the search engine server side corresponding to the browser, so as to index the first original address corresponding to the first webpage resource on the search engine server side. The second web resource.

第一网页资源为上述指定的网页资源中的任一网页资源,例如,第一网页资源包括图片、音频和视频中的一种或多种网页元素。然而,本实施例并不排除第一网页资源包括文本资源的情况。The first webpage resource is any one of the above specified webpage resources, for example, the first webpage resource includes one or more webpage elements of picture, audio and video. However, this embodiment does not exclude the situation that the first web page resource includes a text resource.

可选的,本实施例中选取第一网页资源的第一原始地址为第一网页资源的URL(Uniform Resource Locator,统一资源定位符)。Optionally, in this embodiment, the first original address of the first webpage resource is selected as the URL (Uniform Resource Locator, Uniform Resource Locator) of the first webpage resource.

注:在搜索引擎服务器侧会存储网页中的网页资源,以及网页资源在原始服务器的原始地址与该资源在搜索引擎服务器侧的缓存地址的索引关系,在搜索引擎服务器侧根据第一原始地址查询索引关系得到第一原始地址对应的第二资源的第二缓存地址。Note: The web page resource in the web page will be stored on the search engine server side, as well as the index relationship between the original address of the web page resource on the original server and the cache address of the resource on the search engine server side, and the search engine server side will query according to the first original address The index relationship obtains the second cache address of the second resource corresponding to the first original address.

本实施例可以配置多个浏览器对应的搜索引擎服务器,如第一搜索引擎服务器、第二搜索引擎服务器等,该第一搜索引擎服务器或第二搜索引擎服务器可以为百度的搜索引擎服务器、即刻图片搜索服务器和360搜索服务器等中的一种。对于存在多个搜索引擎服务器的场景至少包括如下两种处理方式:In this embodiment, search engine servers corresponding to multiple browsers can be configured, such as a first search engine server, a second search engine server, etc., and the first search engine server or the second search engine server can be Baidu's search engine server, instant One of image search server and 360 search server, etc. For scenarios where there are multiple search engine servers, at least the following two processing methods are included:

第一种方式:按照优先级别The first way: by priority

为各个搜索引擎服务器设置不同给的优先级别,在需要上传第一网页资源的第一原始地址时,获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至从任一与浏览器对应的搜索引擎服务器侧获取到第二网页资源。这种方式轮询各搜索引擎服务器直至获取到替代资源。Set different priority levels for each search engine server, and obtain the priority levels of each search engine server corresponding to the browser when the first original address of the first web page resource needs to be uploaded; The first original address of the first webpage resource is sent to each search engine server until the second webpage resource is obtained from any search engine server corresponding to the browser. In this way, each search engine server is polled until an alternative resource is obtained.

例如,若第一搜索引擎服务器为优先级别最高的搜索引擎服务器,第二搜索引擎服务器为优先级别次高的搜索引擎服务器,则先将第一网页资源的第一原始地址发送至第一搜索引擎服务器,当在第一搜索引擎服务器侧索引到第一原始地址对应的第二网页资源时,结束轮询,执行后续的网页加载操作,当没有在第一搜索引擎服务器侧索引到第一原始地址对应的第二网页资源时,将第一网页资源的第一原始地址发送至第二搜索引擎服务器,在第二搜索引擎服务器侧获取第二网页资源,重复此操作,直至在与浏览器对应的搜索引擎服务器侧获取到第二网页资源。For example, if the first search engine server is the search engine server with the highest priority and the second search engine server is the search engine server with the second highest priority, the first original address of the first web page resource is first sent to the first search engine The server, when the second webpage resource corresponding to the first original address is indexed on the first search engine server side, ends the polling, and performs subsequent webpage loading operations, when the first original address is not indexed on the first search engine server side For the corresponding second web page resource, send the first original address of the first web page resource to the second search engine server, obtain the second web page resource on the second search engine server side, and repeat this operation until the web page corresponding to the browser The search engine server side obtains the second webpage resource.

第二种方式:按照资源类型The second way: by resource type

不同的搜索引擎服务器负责不同的网页资源,判断下载失败的第一网页资源的类型;确定与浏览器对应且与类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与类型相匹配的搜索引擎服务器侧。Different search engine servers are responsible for different webpage resources, determine the type of the first webpage resource that fails to download; determine the search engine server that corresponds to the browser and matches the type; send the first original address of the first webpage resource to Search engine server side that matches the type.

例如,当下载失败的第一网页资源的类型为图片时,将第一网页资源的第一原始地址发送至与图片类型相匹配的360图片搜索引擎服务器;或者,当下载失败的第一网页资源的类型为音频时,将第一网页资源的第一原始地址发送至与音频类型相匹配的360音乐搜索引擎服务器。For example, when the type of the first webpage resource that fails to download is a picture, the first original address of the first webpage resource is sent to the 360 image search engine server that matches the picture type; or, when the first webpage resource that fails to download When the type of audio is audio, the first original address of the first web page resource is sent to the 360 music search engine server that matches the audio type.

S104:从搜索引擎服务器侧获取第一原始地址对应的第二网页资源。S104: Obtain the second web page resource corresponding to the first original address from the search engine server side.

搜索引擎服务器侧根据上报的第一原始地址(如URL)在缓存的数据中索引与该URL相对应的第二资源的第二缓存地址,通过该第二缓存地址定位出第二资源并下发至浏览器侧,以使浏览器侧获取到该第二网页资源。The search engine server side indexes the second cache address of the second resource corresponding to the URL in the cached data according to the reported first original address (such as URL), locates the second resource through the second cache address, and delivers to the browser side, so that the browser side obtains the second webpage resource.

需要说明的是,对于在搜索引擎服务器侧无法索引到与第一原始地址对应的第二网页资源的情况,示例性的,本发明实施例采用如下处理方式:It should be noted that, for the case where the second web page resource corresponding to the first original address cannot be indexed on the search engine server side, for example, the embodiment of the present invention adopts the following processing method:

在步骤S102中,还包括:获取下载失败的第一网页资源的描述信息;将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧。网页资源的描述信息指示了网页资源的关键内容,例如该描述信息可以为标识网页资源的关键字,如当第一网页资源为名称为“蒋介石.jpg”的图片时,其关键字可以选取为“蒋介石”。In step S102, the method further includes: acquiring description information of the first webpage resource that fails to be downloaded; sending the first original address and description information of the first webpage resource to the search engine server side corresponding to the browser. The description information of the webpage resource indicates the key content of the webpage resource. For example, the description information can be a keyword identifying the webpage resource. For example, when the first webpage resource is a picture named "Chiang Kai-shek.jpg", the keyword can be selected as "Chiang Kai-shek".

则在步骤S104中,在无法从搜索引擎服务器侧获取第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与描述信息关联的第三网页资源,用该第三网页资源替代第二网页资源。当第三网页资源的描述信息与第二网页资源的描述信息具有较高相似度时且第三网页资源与第二网页资源属于同一资源类型时,第三网页资源为与第二网页资源的描述信息关联的网页资源,即寻找相近关键字的、同类型的网页资源进行替换,例如当索引到的“蒋介石.jpg”对应的第二网页资源“蒋介石1.jpg”下载失败或索引不到“蒋介石.jpg”对应的第二网页资源时,获取与关键字“蒋介石”相关联的第三网页资源“蒋介石2.jpg”,可以第三网页资源“蒋介石2.jpg”替换要获取的第二网页资源。Then in step S104, when the second webpage resource corresponding to the first original address cannot be obtained from the search engine server side, the third webpage resource associated with the description information is obtained from the search engine server side, and the third webpage resource is used to replace the first webpage resource. 2. Web resources. When the description information of the third webpage resource is highly similar to the description information of the second webpage resource and the third webpage resource and the second webpage resource belong to the same resource type, the third webpage resource is a description of the second webpage resource. Information-related web resources, that is, search for web resources of the same type with similar keywords to replace them. For example, when the second web resource "Jiang Jieshi 1.jpg" corresponding to the indexed "Jiang Jieshi.jpg" fails to download or cannot be indexed" When the second web page resource corresponding to Chiang Kai-shek.jpg" is obtained, the third web page resource "Chiang Kai-shek 2.jpg" associated with the keyword "Chiang Kai-shek" can be obtained, and the second Web resources.

这种操作保证了对受损网页中网页元素的补偿性修复,丰富了浏览器显示的网页内容。This operation ensures the compensatory repair of the webpage elements in the damaged webpage, and enriches the content of the webpage displayed by the browser.

S106:在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。S106: When loading the downloaded webpage resource into the webpage of the browser, replace the first webpage resource with the second webpage resource and load it into a corresponding position of the webpage.

可选的,在通过上述方法对网页进行了修复之后,参见图2,本实施例提供的又一种网页的加载方法还包括:Optionally, after the webpage is repaired by the above method, referring to FIG. 2, another method for loading a webpage provided in this embodiment also includes:

S200:根据网页、第一网页资源和第二网页资源生成一条数据记录。S200: Generate a data record according to the webpage, the first webpage resource and the second webpage resource.

数据记录中保存网页、第一网页资源和第二网页资源的对应关系,例如,网页URL、第一网页资源URL和第二网页资源URL的对应关系,以及,数据记录中还保存获取到的第二网页资源。可选的,数据记录中还可以包括将第二网页资源加载在网页中后的完整网页数据。The corresponding relationship between the webpage, the first webpage resource and the second webpage resource is stored in the data record, for example, the corresponding relationship between the URL of the webpage, the URL of the first webpage resource and the URL of the second webpage resource, and the acquired first webpage resource is also stored in the data record. 2. Web resources. Optionally, the data record may also include complete webpage data after the second webpage resource is loaded in the webpage.

需要说明的是,本实施例中的第二网页资源也可以是由与第一网页资源的描述信息关联的第三网页资源替换得到的。It should be noted that the second webpage resource in this embodiment may also be replaced by a third webpage resource associated with the description information of the first webpage resource.

S202:将数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中。S202: Store the data record in the browser user data on the browser side or the search engine server side.

对每个浏览器用户的网页访问行为记录在为该浏览器用户维护的专有用户数据中,该用户数据可以存储在浏览器侧,也可以存储在搜索引擎服务器侧。The webpage access behavior of each browser user is recorded in the exclusive user data maintained for the browser user, and the user data can be stored on the browser side or on the search engine server side.

S204:再次监测到浏览器用户下载网页中的第一网页资源失败。S204: It is detected again that the browser user fails to download the first webpage resource in the webpage.

S206:从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取数据记录,利用该数据记录加载网页。S206: Extract data records from the browser user data on the browser side or the search engine server side, and use the data records to load the webpage.

例如,当同一浏览器用户重复访问同一网页且出现相同的网页资源下载失败问题时,直接使用已经保存的第二网页资源加载到网页中,从而避免了资源的重复获取,提高了网页加载速度。For example, when the same browser user repeatedly visits the same webpage and the download failure of the same webpage resource occurs, the saved second webpage resource is directly loaded into the webpage, thereby avoiding repeated resource acquisition and improving the webpage loading speed.

本发明实施例通过当第一网页资源下载失败时,从与浏览器对应的搜索引擎服务器侧获取与第一网页资源关联的第二网页资源,并用第二网页资源替代第一网页资源加载至网页相应位置的技术手段,能够对受损网页中包括图片、视频、音频在内的各网页元素进行补偿性修复,提高了浏览器向用户提供的网页内容的有效性,使浏览器显示的网页内容更加丰富,改善了用户体验。In the embodiment of the present invention, when the download of the first webpage resource fails, the second webpage resource associated with the first webpage resource is obtained from the search engine server side corresponding to the browser, and the second webpage resource is used instead of the first webpage resource to load the webpage The technical means at the corresponding position can make compensatory repairs to various webpage elements including pictures, videos, and audios in the damaged webpage, improve the effectiveness of the webpage content provided by the browser to the user, and make the webpage content displayed by the browser Richer and improved user experience.

下面结合图3,对本发明又一实施例提供的网页的加载方法进行说明,具体包括如下步骤:The method for loading a web page provided by another embodiment of the present invention will be described below in conjunction with FIG. 3 , which specifically includes the following steps:

S300:接收在浏览器的地址栏中输入的URL1,打开HTML(HyperText Mark-up Language,超文本标记语言)页面。S300: Receive the URL1 input in the address bar of the browser, and open the HTML (HyperText Mark-up Language, hypertext markup language) page.

需要下载的网页的网页地址为URL1,根据该URL1启动对应HTML页面的打开操作。The web page address of the web page to be downloaded is URL1, and the opening operation of the corresponding HTML page is started according to the URL1.

S302:下载HTML页面中的图片等资源。S302: Download resources such as pictures in the HTML page.

可以利用浏览器中的网络模块从网页中下载网页资源。The webpage resource can be downloaded from the webpage by using the network module in the browser.

S304:判断是否存在原始地址为URL2的第一网页资源的下载失败事件,若是,执行步骤S308,若否,执行步骤S306。S304: Determine whether there is a download failure event of the first web page resource whose original address is URL2, if yes, perform step S308, if not, perform step S306.

在对网页中的网页资源下载时,判断是否存在下载失败的网页资源,如第一网页资源。本实施例中以下载原始地址为URL2的图片失败为例的场景进行说明。When downloading webpage resources in the webpage, it is determined whether there is a webpage resource that failed to be downloaded, such as the first webpage resource. In this embodiment, a scenario in which the download of the picture whose original URL is URL2 fails is taken as an example for description.

上述原始地址为在浏览器中刚开始打开网页时(执行步骤S300时),下载网页元素时使用的URL。The above original address is the URL used when downloading the webpage elements when the webpage is first opened in the browser (when step S300 is executed).

当浏览器采用不同内核时,监测网页元素下载失败的方式也不同,示例性的,本实施例提供如下处理方式:When the browsers use different kernels, the methods for monitoring the download failure of webpage elements are also different. For example, this embodiment provides the following processing methods:

获取浏览器内核的当前类型,如Webkit内核、IE内核等。Get the current type of browser kernel, such as Webkit kernel, IE kernel, etc.

若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败。该URL获取完成事件表示如下:If the browser is a Webkit kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event. The URL acquisition completion event is expressed as follows:

net.URLFetcherDelegate.OnURLFetchComplete(const URLFetcher*source),对该回调函数进行监测获知Webkit内核资源下载失败事件。例如,通过判断参数source的HTTP返回码来判断下载成功还是失败。net.URLFetcherDelegate.OnURLFetchComplete(const URLFetcher*source), monitor the callback function to know the failure event of Webkit kernel resource download. For example, judge whether the download is successful or failed by judging the HTTP return code of the parameter source.

若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败,该导航错误事件表示如下:If the browser is an IE kernel, by monitoring the navigation error event, it is known that the download of the first web page resource in the webpage fails, and the navigation error event is expressed as follows:

DWebBrowserEvents2::NavigateError(IDispatch*pDisp,DWebBrowserEvents2::NavigateError(IDispatch*pDisp,

VARIANT*URL,VARIANT*URL,

VARIANT*TargetFrameName,VARIANT*TargetFrameName,

VARIANT*StatusCode,VARIANT*StatusCode,

VARIANT_BOOL*Cancel)VARIANT_BOOL*Cancel)

对于网页加载图片资源失败时的场景,若浏览器为IE内核,HTML的img标签含有错误出现(onerror)事件,通过监测错误出现事件获知网页中的第一网页资源下载失败,该错误出现事件表示为:HTMLImgEvents::onerror()。For the scene when the webpage fails to load image resources, if the browser is the IE kernel, the HTML img tag contains an onerror event. By monitoring the error occurrence event, it is known that the first webpage resource in the webpage failed to download, and the error occurrence event indicates that For: HTMLImgEvents::onerror().

S306:对网页中的所有网页元素都下载成功时,直接将下载到的网页资源加载在网页中,结束网页打开操作。S306: When all the webpage elements in the webpage are successfully downloaded, directly load the downloaded webpage resources into the webpage, and end the operation of opening the webpage.

S308:将第一网页资源的原始地址URL2发送到搜索引擎服务器侧。S308: Send the original address URL2 of the first web page resource to the search engine server side.

例如,当确定需要从so.com的搜索引擎服务器获取替代网页资源时,将URL2发送至so.com。For example, when it is determined that a substitute web resource needs to be obtained from the search engine server of so.com, URL2 is sent to so.com.

可选的,在发送操作之前,本实施例对第一网页资源的URL2进行编码,将编码后的URL2发送至浏览器对应的搜索引擎服务器侧。Optionally, before the sending operation, this embodiment encodes the URL2 of the first webpage resource, and sends the encoded URL2 to the search engine server side corresponding to the browser.

S310:判断搜索引擎服务器侧是否索引了URL2对应的资源,即搜索引擎服务器侧是否存储了原始地址为URL2的第一网页资源对应的第二网页资源,若是,进入步骤S312,若否,进入步骤S318。S310: Determine whether the search engine server side has indexed the resource corresponding to URL2, that is, whether the search engine server side has stored the second webpage resource corresponding to the first webpage resource whose original address is URL2, if yes, go to step S312, if not, go to step S310 S318.

S312:接收从搜索引擎服务器侧返回的第二网页资源,即搜索引擎服务器向浏览器侧返回URL2所对应的资源。S312: Receive the second webpage resource returned from the search engine server side, that is, the search engine server returns the resource corresponding to URL2 to the browser side.

本实施例中从搜索引擎服务器侧获取第一原始地址对应的第二网页资源的操作可以包括如下方式:In this embodiment, the operation of obtaining the second webpage resource corresponding to the first original address from the search engine server side may include the following methods:

对IE内核的浏览器,可以通过网页浏览器(IWebbrowser)接口从搜索引擎服务器侧获取IHtmlDocument,以获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址,如图片在so.com中的缓存地址。利用HTML元素(IHtmlElement)接口(如IHtmlElement::SetInnerHtml)将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。For browsers with IE core, IHtmlDocument can be obtained from the search engine server side through the web browser (IWebbrowser) interface to obtain the second cache address on the search engine server side of the second web resource indexed by the first original address, such as The cache address of the picture in so.com. Using the HTML element (IHtmlElement) interface (such as IHtmlElement::SetInnerHtml) to replace the first original address with the second cache address; download the second web page resource from the search engine server according to the second cache address.

对IE内核的浏览器中嵌入由JS(JavaScript)脚本的场景,通过嵌入的JS脚本从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用JS脚本将第一原始地址替换为第二缓存地址,如将第一网页资源的原始地址URL2替换为第二网页资源在so.com中的URL3;根据第二缓存地址(URL3)从搜索引擎服务器下载得到第二网页资源。JS脚本对一个图片资源进行URL替换的代码可以表示如下:For the scenario where a JS (JavaScript) script is embedded in a browser with the IE kernel, the second cache address on the search engine server side of the second webpage resource indexed by the first original address is obtained from the search engine server side through the embedded JS script ; Use JS script to replace the first original address with the second cache address, such as replacing the original address URL2 of the first web page resource with the URL3 of the second web page resource in so.com; according to the second cache address (URL3) from the search The engine server downloads and obtains the second webpage resource. The code for replacing the URL of an image resource by a JS script can be expressed as follows:

<img id="img1"src="loading.gif"><img id="img1" src="loading.gif" >

从上述代码可以看出,替换后的下载URL已经为so.com中的地址。It can be seen from the above code that the replaced download URL is the address in so.com.

S314:将返回的资源作为URL2的资源,返回至浏览器中的渲染模块。S314: Return the returned resource to the rendering module in the browser as the resource of URL2.

将返回的第二网页资源替换了URL2对应的第一网页资源,对于图片的场景,需要将该图片发送至渲染模块,对图片进行渲染。The returned second webpage resource replaces the first webpage resource corresponding to URL2. For the scene of the picture, the picture needs to be sent to the rendering module to render the picture.

S316:继续后续对网页资源的加载操作。S316: Continue the subsequent loading operation on the web page resource.

将渲染后的图片加载在浏览器中,并继续执行网页中其他网页元素的加载操作,直至网页在浏览器中加载成功。Load the rendered image in the browser, and continue to perform loading operations of other webpage elements in the webpage until the webpage is successfully loaded in the browser.

S318:返回资源不存在的信息。图3示出的流程以无法获取到图片对应的第二网页资源为例进行说明。S318: Return information that the resource does not exist. The process shown in FIG. 3 is described by taking the second web page resource corresponding to the picture as an example that cannot be obtained.

S320:通知渲染模块URL2资源打开失败,无法在浏览器中显示该URL2对应的图片。S320: Notify the rendering module that the URL2 resource fails to be opened, and the picture corresponding to the URL2 cannot be displayed in the browser.

注:对于无法获取到第二网页资源的情况,还可以获取与第一网页资源相关联的其他同类型资源,来替代该第二网页资源,以避免在浏览器中显示下载错误提示的现象,具体内容参见本发明的其他实施例,在此不再赘述。Note: For the situation where the second webpage resource cannot be obtained, other resources of the same type associated with the first webpage resource can also be obtained to replace the second webpage resource, so as to avoid the phenomenon that the download error prompt is displayed in the browser. For details, refer to other embodiments of the present invention, and details are not repeated here.

本发明实施例通过当第一网页资源下载失败时,从与浏览器对应的搜索引擎服务器侧获取与第一网页资源关联的第二网页资源,并用第二网页资源替代第一网页资源加载至网页相应位置的技术手段,能够对受损网页中包括图片、视频、音频在内的各网页元素进行补偿性修复,提高了浏览器向用户提供的网页内容的有效性,使浏览器显示的网页内容更加丰富,改善了用户体验。In the embodiment of the present invention, when the download of the first webpage resource fails, the second webpage resource associated with the first webpage resource is obtained from the search engine server side corresponding to the browser, and the second webpage resource is used instead of the first webpage resource to load the webpage The technical means at the corresponding position can make compensatory repairs to various webpage elements including pictures, videos, and audios in the damaged webpage, improve the effectiveness of the webpage content provided by the browser to the user, and make the webpage content displayed by the browser Richer and improved user experience.

本发明又一个实施例提供了一种浏览器400。浏览器400包括网页资源下载单元410、监测发送单元412、网页资源获取单元414、网页加载单元416和数据记录单元418。数据记录单元418在一些场景中可以略去。下面分别进行说明。Yet another embodiment of the present invention provides a browser 400 . The browser 400 includes a webpage resource downloading unit 410 , a monitoring sending unit 412 , a webpage resource acquiring unit 414 , a webpage loading unit 416 and a data recording unit 418 . The data recording unit 418 can be omitted in some scenarios. Each will be described below.

网页资源下载单元410适于根据网页地址从网络中下载网页中指定的网页资源。可选的,网页资源包括图片、音频和视频中的一种或多种网页元素。本实施例并不排除第一网页资源包括文本资源的情况。The webpage resource downloading unit 410 is adapted to download the webpage resource specified in the webpage from the network according to the webpage address. Optionally, the webpage resource includes one or more webpage elements among picture, audio and video. This embodiment does not exclude the situation that the first web page resource includes a text resource.

监测发送单元412适于监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引第一原始地址对应的第二网页资源。可选的,监测发送单元412适于判断下载失败的第一网页资源的类型;确定与浏览器对应且与类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与类型相匹配的搜索引擎服务器侧。例如,当下载失败的第一网页资源的类型为图片时,将第一网页资源的第一原始地址发送至与图片类型相匹配的360图片搜索引擎服务器;或者,当下载失败的第一网页资源的类型为音频时,将第一网页资源的第一原始地址发送至与音频类型相匹配的360音乐搜索引擎服务器。The monitoring sending unit 412 is adapted to detect that the download of the first webpage resource in the webpage fails, and send the first original address of the first webpage resource to the search engine server side corresponding to the browser, so as to index the first webpage resource on the search engine server side. The second web page resource corresponding to the original address. Optionally, the monitoring sending unit 412 is suitable for judging the type of the first webpage resource that failed to download; determining the search engine server corresponding to the browser and matching the type; sending the first original address of the first webpage resource to the Type matching search engine server side. For example, when the type of the first webpage resource that fails to download is a picture, the first original address of the first webpage resource is sent to the 360 image search engine server that matches the picture type; or, when the first webpage resource that fails to download When the type of audio is audio, the first original address of the first web page resource is sent to the 360 music search engine server that matches the audio type.

可选的,监测发送单元412适于获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至网页资源获取单元从任一与浏览器对应的搜索引擎服务器侧获取到第二网页资源。这种方式轮询各搜索引擎服务器直至获取到替代资源。Optionally, the monitoring and sending unit 412 is adapted to obtain the priority levels of the search engine servers corresponding to the browser; and send the first original address of the first web page resource to each search engine successively according to the priority order from high to low On the server side, until the webpage resource acquiring unit acquires the second webpage resource from any search engine server side corresponding to the browser. In this way, each search engine server is polled until an alternative resource is obtained.

例如,若第一搜索引擎服务器为优先级别最高的搜索引擎服务器,第二搜索引擎服务器为优先级别次高的搜索引擎服务器,则先将第一网页资源的第一原始地址发送至第一搜索引擎服务器,当在第一搜索引擎服务器侧索引到第一原始地址对应的第二网页资源时,结束轮询,执行后续的网页加载操作,当没有在第一搜索引擎服务器侧索引到第一原始地址对应的第二网页资源时,将第一网页资源的第一原始地址发送至第二搜索引擎服务器,在第二搜索引擎服务器侧获取第二网页资源,重复此操作,直至在与浏览器对应的搜索引擎服务器侧获取到第二网页资源。For example, if the first search engine server is the search engine server with the highest priority and the second search engine server is the search engine server with the second highest priority, the first original address of the first web page resource is first sent to the first search engine The server, when the second webpage resource corresponding to the first original address is indexed on the first search engine server side, ends the polling, and performs subsequent webpage loading operations, when the first original address is not indexed on the first search engine server side For the corresponding second web page resource, send the first original address of the first web page resource to the second search engine server, obtain the second web page resource on the second search engine server side, and repeat this operation until the web page corresponding to the browser The search engine server side obtains the second webpage resource.

可选的,监测发送单元412适于获取下载失败的第一网页资源的描述信息;将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧。Optionally, the monitoring sending unit 412 is adapted to obtain the description information of the first webpage resource that fails to be downloaded; and send the first original address and description information of the first webpage resource to the search engine server side corresponding to the browser.

可选的,监测发送单元412适于获取浏览器内核的当前类型;若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。Optionally, the monitoring sending unit 412 is suitable for obtaining the current type of the browser kernel; if the browser is a Webkit kernel, it is known that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event; if the browser is an IE kernel, it is obtained by Monitor the navigation error event to learn that the download of the first webpage resource in the webpage failed; if the browser is an IE kernel and the JS script is embedded in the browser, it is learned that the download of the first webpage resource in the webpage failed by monitoring the error occurrence event.

网页资源获取单元414适于从搜索引擎服务器侧获取第一原始地址对应的第二网页资源。可选的,网页资源获取单元414适于在无法从搜索引擎服务器侧获取第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与关键字关联的第三网页资源,用该第三网页资源替代第二网页资源。可选的,网页资源获取单元414适于选取第一网页资源的第一原始地址为第一网页资源的统一资源定位符URL;对第一网页资源的URL进行编码,将编码后的URL发送至浏览器对应的搜索引擎服务器侧。可选的,网页资源获取单元414适于通过网页浏览器IWebbrowser接口从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用Html元素IHtmlElement接口将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。可选的,网页资源获取单元414适于通过浏览器中嵌入的JS脚本从搜索引擎服务器侧获取由第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用JS脚本将第一原始地址替换为第二缓存地址;根据第二缓存地址从搜索引擎服务器下载得到第二网页资源。The webpage resource acquiring unit 414 is adapted to acquire the second webpage resource corresponding to the first original address from the search engine server side. Optionally, the webpage resource obtaining unit 414 is adapted to obtain a third webpage resource associated with the keyword from the search engine server side when the second webpage resource corresponding to the first original address cannot be obtained from the search engine server side, and use the second webpage resource The third web resource replaces the second web resource. Optionally, the webpage resource acquisition unit 414 is adapted to select the first original address of the first webpage resource as the Uniform Resource Locator URL of the first webpage resource; encode the URL of the first webpage resource, and send the encoded URL to The server side of the search engine corresponding to the browser. Optionally, the webpage resource obtaining unit 414 is adapted to obtain the second cache address on the search engine server side of the second webpage resource indexed by the first original address from the search engine server side through the web browser IWebbrowser interface; use the Html element IHtmlElement The interface replaces the first original address with the second cache address; the second web page resource is downloaded from the search engine server according to the second cache address. Optionally, the webpage resource obtaining unit 414 is adapted to obtain the second cache address on the search engine server side of the second webpage resource indexed by the first original address from the search engine server side through the JS script embedded in the browser; The script replaces the first original address with the second cache address; the second web page resource is downloaded from the search engine server according to the second cache address.

网页加载单元416适于在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。The web page loading unit 416 is adapted to load the downloaded web page resource to a corresponding position of the web page with the second web page resource instead of the first web page resource when loading the downloaded web page resource into the web page of the browser.

数据记录单元418适于根据网页、第一网页资源和第二网页资源生成一条数据记录;将数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中。这时,网页加载单元416适于当监测发送单元412再次监测到浏览器用户下载网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取数据记录,利用该数据记录加载网页。The data recording unit 418 is adapted to generate a data record according to the webpage, the first webpage resource and the second webpage resource; and store the data record in the browser user data on the browser side or the search engine server side. At this time, the webpage loading unit 416 is suitable for extracting data records from the browser user data on the browser side or the search engine server side when the monitoring sending unit 412 detects that the browser user fails to download the first webpage resource in the webpage again, Load a web page with this data record.

本发明装置实施例中各单元的具体工作方式可以参见本发明方法实施例中的相关内容,在此不再赘述。For the specific working mode of each unit in the device embodiment of the present invention, reference may be made to the relevant content in the method embodiment of the present invention, and details are not repeated here.

本发明实施例通过当第一网页资源下载失败时,从与浏览器对应的搜索引擎服务器侧获取与第一网页资源关联的第二网页资源,并用第二网页资源替代第一网页资源加载至网页相应位置的技术手段,能够对受损网页中包括图片、视频、音频在内的各网页元素进行补偿性修复,提高了浏览器向用户提供的网页内容的有效性,使浏览器显示的网页内容更加丰富,改善了用户体验。In the embodiment of the present invention, when the download of the first webpage resource fails, the second webpage resource associated with the first webpage resource is obtained from the search engine server side corresponding to the browser, and the second webpage resource is used instead of the first webpage resource to load the webpage The technical means at the corresponding position can make compensatory repairs to various webpage elements including pictures, videos, and audios in the damaged webpage, improve the effectiveness of the webpage content provided by the browser to the user, and make the webpage content displayed by the browser Richer and improved user experience.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.

在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.

类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.

本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的浏览器中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the browser according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.

本发明实施例还公开了A1、一种网页的加载方法,包括:The embodiment of the present invention also discloses A1, a method for loading a webpage, comprising:

根据网页地址从网络中下载网页中指定的网页资源;Download the web resource specified in the web page from the network according to the web page address;

监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引所述第一原始地址对应的第二网页资源;When it is detected that the download of the first webpage resource in the webpage fails, the first original address of the first webpage resource is sent to the search engine server side corresponding to the browser, so as to index the first original address corresponding to the first webpage resource on the search engine server side. the second web resource;

从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源;Obtaining the second web page resource corresponding to the first original address from the search engine server side;

在加载下载到的网页资源至浏览器的网页中时,用所述第二网页资源替代第一网页资源加载至网页的相应位置。When the downloaded webpage resource is loaded into the webpage of the browser, the second webpage resource is used to replace the first webpage resource and loaded to a corresponding position of the webpage.

A2、根据A1所述的方法,其中,所述方法还包括:A2. The method according to A1, wherein the method also includes:

根据所述网页、第一网页资源和第二网页资源生成一条数据记录;generating a data record according to the webpage, the first webpage resource and the second webpage resource;

将所述数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;storing said data record in the browser user data on the browser side or the search engine server side;

当再次监测到浏览器用户下载所述网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取所述数据记录,利用该数据记录加载所述网页。When it is detected again that the browser user fails to download the first webpage resource in the webpage, the data record is extracted from the browser user data on the browser side or the search engine server side, and the webpage is loaded using the data record.

A3、根据A1所述的方法,其中,所述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:A3. The method according to A1, wherein, when the download of the first webpage resource in the webpage is detected to fail, sending the first original address of the first webpage resource to the corresponding search engine server side of the browser includes:

判断下载失败的第一网页资源的类型;Determine the type of the first web page resource that failed to download;

确定与浏览器对应且与所述类型相匹配的搜索引擎服务器;determining a search engine server corresponding to the browser and matching the type;

将该第一网页资源的第一原始地址发送至与所述类型相匹配的搜索引擎服务器侧。Sending the first original address of the first web page resource to the server side of the search engine matching the type.

A4、根据A1所述的方法,其中,所述方法还包括:A4. The method according to A1, wherein the method also includes:

获取浏览器对应的各搜索引擎服务器的优先级别;Obtain the priority level of each search engine server corresponding to the browser;

按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至从任一与浏览器对应的搜索引擎服务器侧获取到所述第二网页资源。According to the order of priority from high to low, the first original address of the first webpage resource is sent to each search engine server side successively, until the second webpage is obtained from any search engine server side corresponding to the browser resource.

A5、根据A1所述的方法,其中,所述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:A5. The method according to A1, wherein, when it is detected that the download of the first webpage resource in the webpage fails, sending the first original address of the first webpage resource to the corresponding search engine server side of the browser includes:

获取下载失败的第一网页资源的描述信息;Obtain the description information of the first web page resource that failed to be downloaded;

将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧;Sending the first original address and description information of the first webpage resource to the search engine server side corresponding to the browser;

在无法从所述搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与所述描述信息关联的第三网页资源,用该第三网页资源替代所述第二网页资源。When the second webpage resource corresponding to the first original address cannot be obtained from the search engine server side, obtain a third webpage resource associated with the description information from the search engine server side, and use the third webpage resource to replace the Describe the second webpage resource.

A6、根据A1所述的方法,其中,所述监测到网页中的第一网页资源下载失败包括:A6. The method according to A1, wherein the monitoring that the download of the first web page resource in the web page fails includes:

获取浏览器内核的当前类型;Get the current type of browser kernel;

若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;If the browser is a Webkit kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event;

若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;If the browser is an IE kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the navigation error event;

若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。If the browser is an IE kernel and a JS script is embedded in the browser, it is learned that the download of the first webpage resource in the webpage fails by monitoring an error occurrence event.

A7、根据A1所述的方法,其中,所述将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:A7. The method according to A1, wherein the sending the first original address of the first webpage resource to the search engine server side corresponding to the browser includes:

选取第一网页资源的第一原始地址为第一网页资源的统一资源定位符URL;Selecting the first original address of the first webpage resource as the Uniform Resource Locator URL of the first webpage resource;

对第一网页资源的URL进行编码,将编码后的URL发送至浏览器对应的搜索引擎服务器侧。The URL of the first web page resource is encoded, and the encoded URL is sent to the search engine server side corresponding to the browser.

A8、根据A1所述的方法,其中,所述从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源包括:A8. The method according to A1, wherein said obtaining the second web page resource corresponding to the first original address from the search engine server side includes:

通过网页浏览器IWebbrowser接口从搜索引擎服务器侧获取由所述第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;Obtain the second cache address on the search engine server side of the second web resource indexed by the first original address from the search engine server side through the web browser IWebbrowser interface;

利用Html元素IHtmlElement接口将所述第一原始地址替换为第二缓存地址;Using the Html element IHtmlElement interface to replace the first original address with the second cache address;

根据所述第二缓存地址从搜索引擎服务器下载得到第二网页资源。The second web page resource is downloaded from the search engine server according to the second cache address.

A9、根据A1所述的方法,其中,所述从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源包括:A9. The method according to A1, wherein said obtaining the second webpage resource corresponding to the first original address from the search engine server side includes:

通过浏览器中嵌入的JS脚本从搜索引擎服务器侧获取由所述第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;Obtaining the second cache address on the search engine server side of the second webpage resource indexed by the first original address from the search engine server side through the JS script embedded in the browser;

利用所述JS脚本将所述第一原始地址替换为第二缓存地址;Using the JS script to replace the first original address with a second cache address;

根据所述第二缓存地址从搜索引擎服务器下载得到第二网页资源。The second web page resource is downloaded from the search engine server according to the second cache address.

A10、根据A1至A9任一项所述的方法,其中,所述第一网页资源包括图片、音频和视频中的一种或多种网页元素。A10. The method according to any one of A1 to A9, wherein the first webpage resource includes one or more webpage elements of pictures, audio and video.

本发明实施例还公开了B11、一种浏览器,包括:The embodiment of the present invention also discloses B11, a browser, comprising:

网页资源下载单元,适于根据网页地址从网络中下载网页中指定的网页资源;The web page resource downloading unit is suitable for downloading the web page resource specified in the web page from the network according to the web page address;

监测发送单元,适于监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引所述第一原始地址对应的第二网页资源;The monitoring and sending unit is adapted to send the first original address of the first web page resource to the search engine server side corresponding to the browser when it detects that the download of the first web page resource in the web page fails, so as to index the said web page resource on the search engine server side. the second web resource corresponding to the first original address;

网页资源获取单元,适于从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源;A webpage resource acquisition unit adapted to acquire the second webpage resource corresponding to the first original address from the search engine server side;

网页加载单元,适于在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。The web page loading unit is adapted to load the downloaded web page resource to the corresponding position of the web page with the second web page resource instead of the first web page resource when loading the downloaded web page resource into the web page of the browser.

B12、根据B11所述的浏览器,其中,还包括数据记录单元,适于根据所述网页、第一网页资源和第二网页资源生成一条数据记录;将所述数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;B12, according to the described browser of B11, wherein, also comprise data record unit, be suitable for generating a data record according to described webpage, first webpage resource and second webpage resource; Described data record is stored in browser side or In the browser user data on the server side of the search engine;

所述网页加载单元,适于当所述监测发送单元再次监测到浏览器用户下载所述网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取所述数据记录,利用该数据记录加载所述网页。The webpage loading unit is adapted to extract the browser user data from the browser side or the search engine server side when the monitoring sending unit detects that the browser user fails to download the first webpage resource in the webpage again. The data record is used to load the webpage.

B13、根据B11所述的浏览器,其中,所述监测发送单元,适于判断下载失败的第一网页资源的类型;确定与浏览器对应且与所述类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与所述类型相匹配的搜索引擎服务器侧。B13. The browser according to B11, wherein the monitoring sending unit is adapted to judge the type of the first web page resource that failed to download; determine the search engine server corresponding to the browser and matching the type; The first original address of the first webpage resource is sent to the server side of the search engine matching the type.

B14、根据B11所述的浏览器,其中,所述监测发送单元,适于获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至所述网页资源获取单元从任一与浏览器对应的搜索引擎服务器侧获取到所述第二网页资源。B14. The browser according to B11, wherein the monitoring sending unit is adapted to obtain the priority levels of each search engine server corresponding to the browser; according to the order of priority levels from high to low, the first web page resource is successively The first original address is sent to each search engine server side until the webpage resource obtaining unit obtains the second webpage resource from any search engine server side corresponding to the browser.

B15、根据B11所述的浏览器,其中,B15. The browser according to B11, wherein,

所述监测发送单元,适于获取下载失败的第一网页资源的描述信息;将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧;The monitoring sending unit is adapted to obtain the description information of the first web page resource that failed to download; send the first original address and description information of the first web page resource to the search engine server side corresponding to the browser;

所述网页资源获取单元,适于在无法从所述搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与所述描述信息关联的第三网页资源,用该第三网页资源替代所述第二网页资源。The webpage resource obtaining unit is adapted to obtain a third webpage resource associated with the description information from the search engine server side when the second webpage resource corresponding to the first original address cannot be obtained from the search engine server side , using the third webpage resource to replace the second webpage resource.

B16、根据B11所述的浏览器,其中,所述监测发送单元,适于获取浏览器内核的当前类型;若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。B16, according to the described browser of B11, wherein, described monitoring sending unit is suitable for obtaining the current type of browser kernel; If browser is Webkit kernel, acquires the first web page resource download in the known web page by monitoring URL acquisition completion event Failed; if the browser is an IE kernel, learn that the download of the first webpage resource in the webpage fails by monitoring the navigation error event; Failed to download a web resource.

B17、根据B11所述的浏览器,其中,所述网页资源获取单元,适于选取第一网页资源的第一原始地址为第一网页资源的统一资源定位符URL;对第一网页资源的URL进行编码,将编码后的URL发送至浏览器对应的搜索引擎服务器侧。B17, according to the described browser of B11, wherein, described webpage resource acquiring unit is adapted to choose the first original address of the first webpage resource as the Uniform Resource Locator URL of the first webpage resource; to the URL of the first webpage resource Encoding is performed, and the encoded URL is sent to the search engine server side corresponding to the browser.

B18、根据B11所述的浏览器,其中,所述网页资源获取单元,适于通过网页浏览器IWebbrowser接口从搜索引擎服务器侧获取由所述第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;利用Html元素IHtmlElement接口将所述第一原始地址替换为第二缓存地址;根据所述第二缓存地址从搜索引擎服务器下载得到第二网页资源。B18. The browser according to B11, wherein the webpage resource obtaining unit is adapted to obtain the second webpage resource indexed by the first original address from the search engine server side through the webpage browser IWebbrowser interface in the search engine The second cache address on the server side; using the Html element IHtmlElement interface to replace the first original address with the second cache address; downloading the second webpage resource from the search engine server according to the second cache address.

B19、根据B11所述的浏览器,其中,所述网页资源获取单元,适于通过浏览器中嵌入的JS脚本从搜索引擎服务器侧获取由所述第一原始地址索引到的第二网页资源在搜索引擎服务器侧的第二缓存地址;B19. The browser according to B11, wherein the webpage resource obtaining unit is adapted to obtain the second webpage resource indexed by the first original address from the search engine server side through the JS script embedded in the browser. The second cache address on the server side of the search engine;

利用所述JS脚本将所述第一原始地址替换为第二缓存地址;Using the JS script to replace the first original address with a second cache address;

根据所述第二缓存地址从搜索引擎服务器下载得到第二网页资源。The second web page resource is downloaded from the search engine server according to the second cache address.

B20、根据B11至B19任一项所述的浏览器,其中,所述网页资源包括图片、音频和视频中的一种或多种网页元素。B20. The browser according to any one of B11 to B19, wherein the webpage resources include one or more webpage elements of pictures, audio and video.

Claims (10)

1.一种网页的加载方法,包括:1. A method for loading a webpage, comprising: 根据网页地址从网络中下载网页中指定的网页资源;Download the web resource specified in the web page from the network according to the web page address; 监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引所述第一原始地址对应的第二网页资源;When it is detected that the download of the first webpage resource in the webpage fails, the first original address of the first webpage resource is sent to the search engine server side corresponding to the browser, so as to index the first original address corresponding to the first webpage resource on the search engine server side. the second web resource; 从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源;Obtaining the second web page resource corresponding to the first original address from the search engine server side; 在加载下载到的网页资源至浏览器的网页中时,用所述第二网页资源替代第一网页资源加载至网页的相应位置。When the downloaded webpage resource is loaded into the webpage of the browser, the second webpage resource is used to replace the first webpage resource and loaded to a corresponding position of the webpage. 2.根据权利要求1所述的方法,其中,所述方法还包括:2. The method of claim 1, wherein the method further comprises: 根据所述网页、第一网页资源和第二网页资源生成一条数据记录;generating a data record according to the webpage, the first webpage resource and the second webpage resource; 将所述数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;storing said data record in the browser user data on the browser side or the search engine server side; 当再次监测到浏览器用户下载所述网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取所述数据记录,利用该数据记录加载所述网页。When it is detected again that the browser user fails to download the first webpage resource in the webpage, the data record is extracted from the browser user data on the browser side or the search engine server side, and the webpage is loaded using the data record. 3.根据权利要求1所述的方法,其中,所述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:3. The method according to claim 1, wherein, when the download of the first webpage resource in the webpage is detected to fail to download, sending the first original address of the first webpage resource to the corresponding search engine server side of the browser comprises : 判断下载失败的第一网页资源的类型;Determine the type of the first web page resource that failed to download; 确定与浏览器对应且与所述类型相匹配的搜索引擎服务器;determining a search engine server corresponding to the browser and matching the type; 将该第一网页资源的第一原始地址发送至与所述类型相匹配的搜索引擎服务器侧。Sending the first original address of the first web page resource to the server side of the search engine matching the type. 4.根据权利要求1所述的方法,其中,所述方法还包括:4. The method of claim 1, wherein the method further comprises: 获取浏览器对应的各搜索引擎服务器的优先级别;Obtain the priority level of each search engine server corresponding to the browser; 按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至从任一与浏览器对应的搜索引擎服务器侧获取到所述第二网页资源。According to the order of priority from high to low, the first original address of the first webpage resource is sent to each search engine server side successively, until the second webpage is obtained from any search engine server side corresponding to the browser resource. 5.根据权利要求1所述的方法,其中,所述监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧包括:5. The method according to claim 1, wherein, when it is detected that the download of the first webpage resource in the webpage fails, sending the first original address of the first webpage resource to the corresponding search engine server side of the browser comprises : 获取下载失败的第一网页资源的描述信息;Obtain the description information of the first web page resource that failed to be downloaded; 将该第一网页资源的第一原始地址和描述信息发送至浏览器对应的搜索引擎服务器侧;Sending the first original address and description information of the first webpage resource to the search engine server side corresponding to the browser; 在无法从所述搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源时,从搜索引擎服务器侧获取与所述描述信息关联的第三网页资源,用该第三网页资源替代所述第二网页资源。When the second webpage resource corresponding to the first original address cannot be obtained from the search engine server side, obtain a third webpage resource associated with the description information from the search engine server side, and use the third webpage resource to replace the Describe the second webpage resource. 6.根据权利要求1所述的方法,其中,所述监测到网页中的第一网页资源下载失败包括:6. The method according to claim 1, wherein the monitoring that the download of the first webpage resource in the webpage fails comprises: 获取浏览器内核的当前类型;Get the current type of browser kernel; 若浏览器为Webkit内核,通过监测URL获取完成事件获知网页中的第一网页资源下载失败;If the browser is a Webkit kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the URL acquisition completion event; 若浏览器为IE内核,通过监测导航错误事件获知网页中的第一网页资源下载失败;If the browser is an IE kernel, it is learned that the download of the first webpage resource in the webpage fails by monitoring the navigation error event; 若浏览器为IE内核且浏览器中嵌入了JS脚本,通过监测错误出现事件获知网页中的第一网页资源下载失败。If the browser is an IE kernel and a JS script is embedded in the browser, it is learned that the download of the first webpage resource in the webpage fails by monitoring an error occurrence event. 7.一种浏览器,包括:7. A browser comprising: 网页资源下载单元,适于根据网页地址从网络中下载网页中指定的网页资源;The web page resource downloading unit is suitable for downloading the web page resource specified in the web page from the network according to the web page address; 监测发送单元,适于监测到网页中的第一网页资源下载失败时,将该第一网页资源的第一原始地址发送至浏览器对应的搜索引擎服务器侧,以在搜索引擎服务器侧索引所述第一原始地址对应的第二网页资源;The monitoring and sending unit is adapted to send the first original address of the first web page resource to the search engine server side corresponding to the browser when it detects that the download of the first web page resource in the web page fails, so as to index the said web page resource on the search engine server side. the second web page resource corresponding to the first original address; 网页资源获取单元,适于从搜索引擎服务器侧获取所述第一原始地址对应的第二网页资源;A webpage resource acquisition unit adapted to acquire the second webpage resource corresponding to the first original address from the search engine server side; 网页加载单元,适于在加载下载到的网页资源至浏览器的网页中时,用第二网页资源替代第一网页资源加载至网页的相应位置。The web page loading unit is adapted to load the downloaded web page resource to the corresponding position of the web page with the second web page resource instead of the first web page resource when loading the downloaded web page resource into the web page of the browser. 8.根据权利要求7所述的浏览器,其中,还包括数据记录单元,适于根据所述网页、第一网页资源和第二网页资源生成一条数据记录;将所述数据记录存储在浏览器侧或搜索引擎服务器侧的浏览器用户数据中;8. The browser according to claim 7, further comprising a data recording unit adapted to generate a data record according to the webpage, the first webpage resource and the second webpage resource; and storing the data record in the browser In the browser user data on the side or the server side of the search engine; 所述网页加载单元,适于当所述监测发送单元再次监测到浏览器用户下载所述网页中的第一网页资源失败时,从浏览器侧或搜索引擎服务器侧的浏览器用户数据中提取所述数据记录,利用该数据记录加载所述网页。The webpage loading unit is adapted to extract the browser user data from the browser side or the search engine server side when the monitoring sending unit detects that the browser user fails to download the first webpage resource in the webpage again. The data record is used to load the webpage. 9.根据权利要求7所述的浏览器,其中,所述监测发送单元,适于判断下载失败的第一网页资源的类型;确定与浏览器对应且与所述类型相匹配的搜索引擎服务器;将该第一网页资源的第一原始地址发送至与所述类型相匹配的搜索引擎服务器侧。9. The browser according to claim 7, wherein the monitoring sending unit is adapted to judge the type of the first webpage resource that failed to download; determine the search engine server corresponding to the browser and matching the type; Sending the first original address of the first web page resource to the server side of the search engine matching the type. 10.根据权利要求7所述的浏览器,其中,所述监测发送单元,适于获取浏览器对应的各搜索引擎服务器的优先级别;按照优先级别从高到低的次序,逐次将该第一网页资源的第一原始地址发送至各搜索引擎服务器侧,直至所述网页资源获取单元从任一与浏览器对应的搜索引擎服务器侧获取到所述第二网页资源。10. The browser according to claim 7, wherein, the monitoring sending unit is adapted to obtain the priority levels of each search engine server corresponding to the browser; The first original address of the webpage resource is sent to each search engine server until the webpage resource obtaining unit obtains the second webpage resource from any search engine server corresponding to the browser.
CN201310598267.0A 2013-11-22 2013-11-22 Webpage loading method and browser Pending CN103631905A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310598267.0A CN103631905A (en) 2013-11-22 2013-11-22 Webpage loading method and browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310598267.0A CN103631905A (en) 2013-11-22 2013-11-22 Webpage loading method and browser

Publications (1)

Publication Number Publication Date
CN103631905A true CN103631905A (en) 2014-03-12

Family

ID=50212946

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310598267.0A Pending CN103631905A (en) 2013-11-22 2013-11-22 Webpage loading method and browser

Country Status (1)

Country Link
CN (1) CN103631905A (en)

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038549A (en) * 2014-06-18 2014-09-10 广州金山网络科技有限公司 Method, device and terminal for downloading data
CN104135685A (en) * 2014-07-18 2014-11-05 北京奇虎科技有限公司 Display method and display device for play information of webpage video
CN104462400A (en) * 2014-12-10 2015-03-25 北京奇虎科技有限公司 Method, device and browser client for downloading files in mobile terminals
CN104504071A (en) * 2014-12-22 2015-04-08 北京奇虎科技有限公司 SE (search engine)-based web cache providing method and web search client and server
CN105488178A (en) * 2015-11-30 2016-04-13 青岛海信移动通信技术股份有限公司 Network picture processing method and device
CN106980694A (en) * 2017-04-01 2017-07-25 北京奇虎科技有限公司 Browser page information interacting method, device and mobile terminal
CN108600342A (en) * 2018-03-30 2018-09-28 连尚(新昌)网络科技有限公司 A kind of message display method, equipment and storage medium
CN108804515A (en) * 2018-04-25 2018-11-13 网宿科技股份有限公司 A kind of webpage loading method, webpage loading system and server
CN109344351A (en) * 2018-10-18 2019-02-15 网宿科技股份有限公司 Web page loading method, intermediate server and web page loading system
CN109495553A (en) * 2018-10-31 2019-03-19 腾讯科技(深圳)有限公司 A kind of webpage display control method, system and Reverse Proxy
CN109726339A (en) * 2018-12-19 2019-05-07 西安四叶草信息技术有限公司 Resource request method and equipment
CN109857649A (en) * 2019-01-14 2019-06-07 珠海金山网络游戏科技有限公司 A kind of resource testing method and system
WO2019127881A1 (en) * 2017-12-30 2019-07-04 平安科技(深圳)有限公司 Webpage data processing method and device, computer device and computer storage medium
CN112818197A (en) * 2021-01-22 2021-05-18 北京百度网讯科技有限公司 Search method, search device, electronic equipment and storage medium
CN113626738A (en) * 2020-05-08 2021-11-09 北京奇虎科技有限公司 Method, system, browser, storage medium and computer device for configuring browser to be compatible with webpage

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1504928A (en) * 2002-12-02 2004-06-16 �Ҵ���˾ System and method for accessing content of a web page
CN102200980A (en) * 2010-03-25 2011-09-28 北京搜狗科技发展有限公司 Method and system for providing network resources
CN103024038A (en) * 2012-12-12 2013-04-03 北京奇虎科技有限公司 Method and device for browsing webpage

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1504928A (en) * 2002-12-02 2004-06-16 �Ҵ���˾ System and method for accessing content of a web page
CN102200980A (en) * 2010-03-25 2011-09-28 北京搜狗科技发展有限公司 Method and system for providing network resources
CN103024038A (en) * 2012-12-12 2013-04-03 北京奇虎科技有限公司 Method and device for browsing webpage

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038549A (en) * 2014-06-18 2014-09-10 广州金山网络科技有限公司 Method, device and terminal for downloading data
CN104135685A (en) * 2014-07-18 2014-11-05 北京奇虎科技有限公司 Display method and display device for play information of webpage video
CN104135685B (en) * 2014-07-18 2017-12-19 北京奇虎科技有限公司 The display methods and display device of the broadcast information of video web page
CN104462400A (en) * 2014-12-10 2015-03-25 北京奇虎科技有限公司 Method, device and browser client for downloading files in mobile terminals
CN104504071A (en) * 2014-12-22 2015-04-08 北京奇虎科技有限公司 SE (search engine)-based web cache providing method and web search client and server
CN105488178A (en) * 2015-11-30 2016-04-13 青岛海信移动通信技术股份有限公司 Network picture processing method and device
CN106980694A (en) * 2017-04-01 2017-07-25 北京奇虎科技有限公司 Browser page information interacting method, device and mobile terminal
WO2019127881A1 (en) * 2017-12-30 2019-07-04 平安科技(深圳)有限公司 Webpage data processing method and device, computer device and computer storage medium
CN108600342B (en) * 2018-03-30 2020-01-10 连尚(新昌)网络科技有限公司 Message display method, device and storage medium
CN108600342A (en) * 2018-03-30 2018-09-28 连尚(新昌)网络科技有限公司 A kind of message display method, equipment and storage medium
CN108804515B (en) * 2018-04-25 2021-05-28 网宿科技股份有限公司 Web page loading method, web page loading system and server
CN108804515A (en) * 2018-04-25 2018-11-13 网宿科技股份有限公司 A kind of webpage loading method, webpage loading system and server
WO2019205192A1 (en) * 2018-04-25 2019-10-31 网宿科技股份有限公司 Webpage loading method, webpage loading system, and server
CN109344351A (en) * 2018-10-18 2019-02-15 网宿科技股份有限公司 Web page loading method, intermediate server and web page loading system
CN109495553A (en) * 2018-10-31 2019-03-19 腾讯科技(深圳)有限公司 A kind of webpage display control method, system and Reverse Proxy
CN109495553B (en) * 2018-10-31 2020-12-22 腾讯科技(深圳)有限公司 Webpage display control method and system and reverse proxy server
CN109726339A (en) * 2018-12-19 2019-05-07 西安四叶草信息技术有限公司 Resource request method and equipment
CN109857649A (en) * 2019-01-14 2019-06-07 珠海金山网络游戏科技有限公司 A kind of resource testing method and system
CN109857649B (en) * 2019-01-14 2022-07-26 珠海金山网络游戏科技有限公司 Resource testing method and system
CN113626738A (en) * 2020-05-08 2021-11-09 北京奇虎科技有限公司 Method, system, browser, storage medium and computer device for configuring browser to be compatible with webpage
CN112818197A (en) * 2021-01-22 2021-05-18 北京百度网讯科技有限公司 Search method, search device, electronic equipment and storage medium
CN112818197B (en) * 2021-01-22 2024-02-23 北京百度网讯科技有限公司 Search method, search device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN103631905A (en) Webpage loading method and browser
CN104036011B (en) Webpage element display method and browser device
CN104063460B (en) A kind of method and apparatus loading webpage in a browser
CN103500194A (en) Method, device and browser for loading webpage
US20170199850A1 (en) Method and system to decrease page load time by leveraging network latency
US20100180192A1 (en) Dynamically configuring a presentation layer associated with a webpage delivered to a client device
CN103678487B (en) Method and device for generating web page snapshot
CN107807937B (en) Website SEO processing method, device and system
CN103024038B (en) For browsing the method and device of webpage
CN103500210A (en) Method, device and browser for carrying out webpage loading
US9984052B2 (en) Verifying content of resources in markup language documents
CN103678639B (en) The method and apparatus of information updating prompting is carried out in browser
CN104615700A (en) Method for collecting webpage objects in browser, browser client side and system
CN106844486A (en) Crawl the method and device of dynamic web page
US9465814B2 (en) Annotating search results with images
CN103248707B (en) File access method, system and equipment
CN103024036A (en) Method and device for browsing web page
CN104980464B (en) A kind of network request processing method, network server and network system
CN103269370A (en) Display method, client, server and system recommended by browser extension
CN106991117B (en) Snapshot processing method, snapshot display method, server, browser and system
CN104361007A (en) Browser and processing method for browser favorites
CN103258055B (en) A file downloading device and method
CN108108381B (en) Page monitoring method and device
CN104537020B (en) Browser downloads method, browser client and the device of file
CN106844475A (en) It is determined that the method and device of hiding URL

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20140312

RJ01 Rejection of invention patent application after publication