WO2012116589A1 - 一种浏览器引擎模式的切换方法及浏览器 - Google Patents

一种浏览器引擎模式的切换方法及浏览器 Download PDF

Info

Publication number
WO2012116589A1
WO2012116589A1 PCT/CN2012/070842 CN2012070842W WO2012116589A1 WO 2012116589 A1 WO2012116589 A1 WO 2012116589A1 CN 2012070842 W CN2012070842 W CN 2012070842W WO 2012116589 A1 WO2012116589 A1 WO 2012116589A1
Authority
WO
WIPO (PCT)
Prior art keywords
webpage
engine mode
browser
feature library
internal information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2012/070842
Other languages
English (en)
French (fr)
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
Original Assignee
Beijing Qihoo Technology 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 filed Critical Beijing Qihoo Technology Co Ltd
Priority to US14/002,032 priority Critical patent/US20130339842A1/en
Publication of WO2012116589A1 publication Critical patent/WO2012116589A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/14Tree-structured documents
    • 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/957Browsing optimisation, e.g. caching or content distillation

Definitions

  • the present invention belongs to the field of the Internet, and in particular, to a method and a browser for switching a browser engine mode.
  • the kernel of the browser which can be called the kernel or typesetting engine, can also be called a page rendering engine. It is responsible for getting the content of the web page (HTML, XML, images, etc.), organizing the information (such as adding CSS, etc.) and calculating how the web page is displayed, and then outputting the web page that the user can see.
  • Different browser kernels have different interpretations of web page writing syntax, so the rendering effect of the same web page in different kernel browsers may be different. This is why web page writers need to test web page display effects in different kernel browsers.
  • the kernel of the browser mainly includes: Trident kernel, ie IE kernel, for IE browser; Gecko kernel, mainly used by Firefox browser; WebKit kernel, for Safari browser, Google Chrome browser, Sogou browser
  • Trident kernel ie IE kernel
  • Gecko kernel mainly used by Firefox browser
  • WebKit kernel for Safari browser, Google Chrome browser
  • Sogou browser The Presto kernel is mainly used in the Opera mini browser of the mobile phone platform.
  • the following mainly uses WebKit and Trident as an example.
  • WebKit is an open source browser kernel with efficient and stable engine structure, clear source code, fast rendering and easy maintenance. Its most important advantage is extremely fast speed. Trident is the kernel of IE browser, hereinafter referred to as IE kernel. Websites are generally based on the content of web pages carried by this engine, and it is the most widely supported in this regard; its most important advantage is the best compatibility.
  • the IE kernel is prone to slow, unsmooth, and crashing problems when accessing complex web pages, while WebKit is more adaptable to complex web pages.
  • the IE kernel still has an absolute position in the market, it still cannot directly abandon the IE kernel. Therefore, some websites on the market currently design Web pages of WebKit and IE, and a version of the webpage is displayed by the browser based on the WebKit kernel. Another version of the web page is displayed for browsers based on the IE kernel, but due to the speed advantage of the WebKit kernel, users will have a better user experience when using the browser of the WebKit kernel, so these sites are generally provided by default. The web page of the WebKit kernel.
  • This webpage is displayed as a disordered page structure in the current engine mode, but the user may think that the webpage is originally like this, Judging whether there is a problem, it is even more difficult to determine that the browser's engine mode is not adapted and causes a problem;
  • This dual-engine browser needs to upload this URL to the server side.
  • the official manual verification of the URL is indeed a problem in the current engine mode. If there is a problem, then the URL is added to the list according to the applicable engine mode, from the server side.
  • the browser release list upgrade on each terminal.
  • the user-entered URL itself is identified in a single way, and the reliability is poor. Because the URL itself cannot be exhausted, many webpages are added every day, and the update of the webpage list is always lagging behind the new webpage. The resulting, and the list needs to be manually maintained, inefficient and costly.
  • the technical problem to be solved by the present invention is to provide a browser engine mode switching method and a browser, which can effectively detect which kernel the current web page is, thereby switching the browser to the corresponding engine mode.
  • the present invention discloses a method for switching a browser engine mode, including: constructing a feature library, including a correspondence between internal information of each web page and an adapted engine mode; the browser has been in the current engine mode Opening a webpage, collecting at least one webpage internal information of the webpage, and switching to the adapted engine mode in combination with the feature library.
  • the method further includes: the feature library further includes a correspondence between each URL attribute and an adapted engine mode; and when the browser opens a webpage in the current engine mode, collecting at least one URL of the webpage The attribute is combined with the feature library to switch to the adapted engine mode.
  • the method further includes: the feature library further includes a corresponding relationship between the address format and the adapted engine mode; the browser further collects an address of the server where the webpage is located, and switches to the adapted engine mode in combination with the feature library.
  • the feature library further includes a duration threshold; when the browser opens a webpage in the current engine mode, the browser detects an opening duration of the webpage, and determines, according to the feature library, that the duration exceeds the length The duration threshold switches to the adapted engine mode, otherwise it remains in the current engine mode.
  • the step of switching to the adapted engine mode in combination with the feature library includes: setting a priority to the engine mode, collecting various webpage internal information and/or URL attributes of the webpage and / or the address of the server and / or open the length and hit in the feature library, identify the internal information and / or URL attributes of the hit pages and / or the engine mode of the server's address and / or open time respectively The highest priority one engine mode, the browser working in the engine mode.
  • the step of switching to the adapted engine mode in combination with the feature library includes: setting a priority for the various webpage internal information and/or the URL attribute and/or the address of the server and/or the opening duration, according to The priority order sequentially collects the webpage internal information or the webpage attribute of the webpage and/or the address of the server and/or the opening duration of the webpage in the signature database, if hit and matches an engine mode different from the current engine mode , then stop collecting and switch to the engine mode.
  • the step of switching to the adapted engine mode in combination with the feature library includes: setting weights on the various webpage internal information and/or webpage attributes and/or the address and/or opening duration of the server, the collection center Identifying various web page internal information and/or web address attributes of the web page and/or the address and/or opening time of the server in which it is located and hitting in the feature library, identifying internal web page information and/or web address attributes and/or hits of the hit pages
  • the engine mode of the server's address and/or open duration respectively, and analyzes the internal engine information and/or URL attribute of the hit and/or the address of the server and/or the weight of the open duration to analyze the engine mode with the highest weight.
  • the browser operates in the engine mode.
  • the browser detects a webpage script initiated by the webpage, hits the signature database according to the identifier of the control initiated by the webpage script, and obtains a corresponding ⁇ ] Engine mode.
  • the browser detects an object identifier that the webpage attempts to invoke, performs a hit in the feature library according to the object identifier, and acquires a corresponding engine mode.
  • the browser detects a web standard held, and hits the feature library according to the web standard and acquires a corresponding engine mode.
  • the browser Detecting a file related to the webpage, acquiring the webpage page structure according to the source code of the file, performing a hit in the feature library according to the webpage page structure, and acquiring a corresponding engine mode.
  • the feature library includes a quantity threshold
  • the browser detects the number of the webpage elements and determines the number and threshold of the webpage elements in combination with the feature database. Relationship, obtaining a corresponding engine mode according to the relationship.
  • the relationship between the size of the webpage element and the size threshold of the feature database obtains the corresponding engine mode according to the relationship.
  • the browser detects a web address of the webpage, obtains a protocol used by the webpage according to the webpage, hits the signature database, and obtains a corresponding ⁇ 1 engine mode.
  • the browser detects that the webpage port number hits a standard port number in the feature library and acquires a corresponding engine mode.
  • the browser detects the file name of the webpage file and obtains a suffix, performs a hit in the feature library, and acquires a corresponding engine mode.
  • the internal information of the webpage is obtained after the webpage is acquired by the browser.
  • the switching includes the browser automatically switching and/or prompting the user to perform the handover.
  • the present invention also discloses a browser with an engine mode switching function, comprising: a browser body, a switching module, a feature library, wherein the browser body is used to open in a current engine mode a webpage; the switching module, configured to collect at least one webpage internal information of the webpage, switch to the adapted engine mode in combination with the feature library, and notify the browser body to load; the feature library, save each type Correspondence between the internal information of the webpage and the adapted engine mode, wherein the internal information of the webpage is obtained by the browser after the webpage is acquired by the browser.
  • the feature library further stores a correspondence between each URL attribute and an adapted engine mode.
  • the switching module is further configured to collect at least one URL attribute of the webpage, switch to the adapted mode, and notify the browser body to load.
  • the feature library further includes a correspondence between an address format and an adapted engine mode; the switching module is further configured to collect an address of a server where the webpage is located, and switch to the adapted engine mode according to the feature library. Notifying the browser body to load.
  • the feature library further includes a duration threshold; the switching module is further configured to detect an opening duration of the webpage, and if the duration exceeds the duration threshold, switch to an adapted engine mode and notify the The browser body is loaded.
  • the switching module is further configured to set a priority for the engine mode, collect various webpage internal information and/or webpage attributes of the webpage, and/or an address and/or an opening duration of the server where the webpage is located, and Performing a hit in the feature library, identifying an internal engine information and/or a URL attribute of the hit and/or an engine mode of the engine mode corresponding to the address and/or the open duration of the server respectively, and notifying the browsing The body body loads the engine mode.
  • the switching module is further configured to set a priority on the internal information and/or the URL attribute of the various webpages and/or the address and/or the opening duration of the server, and collect the webpages one by one according to the priority order.
  • the internal information or the URL attribute of the web page and/or the address of the server and/or the length of the opening of the server are hit in the feature library. If the engine mode is hit and matched to the current engine mode, the collection is stopped and switched to the The engine mode notifies the browser body to load.
  • the switching module is further configured to set a weight on the internal information and/or the URL attribute of the various webpages and/or the address and/or the opening duration of the server, and collect various internal information of the webpage of the webpage and / or URL attribute and / or the address of the server and / or open time and hit in the feature library, identify the internal information and / or URL attributes of the hit pages and / or the address and / or open time of the server
  • Corresponding engine modes combined with the internal information and/or URL attributes of the hit pages and/or the address of the server and/or the weight of the open time, analyze the engine mode with the highest weight, and notify the browser to load the body.
  • the engine mode is further configured to set a weight on the internal information and/or the URL attribute of the various webpages and/or the address and/or the opening duration of the server, and collect various internal information of the webpage of the webpage and / or URL attribute and / or the address of the server and / or open time and hit in the feature library, identify the internal information and
  • the switching module detects a webpage script initiated by the webpage, hits the signature in the feature library according to the identifier of the control initiated by the webpage script, and acquires a corresponding Bow] ⁇ mode. Further, when the webpage internal information includes at least a webpage object, the switching module detects an object identifier that the webpage attempts to invoke, performs a hit in the feature library according to the object identifier, and acquires a corresponding engine mode.
  • the switching module detects a file related to the webpage, and acquires a web standard supported by the webpage related file according to the source code of the file, according to the webpage.
  • the standard hits in the feature library and obtains the corresponding engine mode.
  • the switching module detects a file related to the webpage, and acquires the webpage page structure according to the source code of the file, according to the webpage page structure.
  • the feature library performs a hit and acquires a corresponding engine mode.
  • the feature library further includes a quantity threshold; the switching module detects the number of the webpage elements and determines the number and quantity of the webpage elements in combination with the feature database. The relationship of the thresholds, according to the relationship, the corresponding engine mode is obtained.
  • the feature library further includes a size threshold; the switching module detects an element size of the webpage and determines the webpage element size and size according to the feature library. The relationship of the thresholds is obtained according to the relationship.
  • the switching module detects a web address of the webpage, obtains a protocol used by the webpage according to the webpage, hits the signature database, and obtains a corresponding Engine mode.
  • the switching module detects that the web port number is hit in the standard port number in the feature library, and obtains a corresponding engine mode.
  • the switching module detects a file name of the webpage file and obtains a suffix, performs a hit in the feature library, and acquires a corresponding engine mode. Further, the internal information of the webpage is obtained after the webpage is acquired by the switching module.
  • the browser also adapts according to the address of the server where the webpage is located and the webpage opening speed, which further ensures the accuracy of the switching.
  • Figure 1 is a flow chart of a first embodiment of the present invention
  • Figure 2 is a flow chart of a second embodiment of the present invention.
  • Figure 3 is a flow chart of a third embodiment of the present invention.
  • Figure 4 is a flow chart of a fourth embodiment of the present invention.
  • Figure 5 is a flow chart of a fifth embodiment of the present invention.
  • Figure 6 is a flow chart of a sixth embodiment of the present invention.
  • FIG. 7 is an application architecture diagram of the present invention.
  • the core idea of the present invention is to: establish a feature library, where the correspondence between the internal information of each webpage and the adapted engine mode is saved, and the internal information of the webpage is obtained by the browser after acquiring the webpage If the browser has opened a webpage in the current engine mode, the at least one webpage internal information of the webpage is collected, and the signature library is switched to the adapted engine mode, thereby ensuring The accuracy of engine mode switching, especially when there is a problem when the webpage is opened for browsing, even when the user does not find the problem, help the user to solve the problem intelligently, and ensure that the user can open the webpage correctly by using the browser, and this method can be solved.
  • the feature library also stores a correspondence between each URL attribute and the adapted engine mode.
  • the browser attempts to open a webpage in the current engine mode, the browser also collects at least one URL of the webpage.
  • the attribute is combined with the feature library to switch to the adapted engine mode. In this way, quick identification before the webpage is opened can not affect the user's use, and the user can not feel the existence of the switching mode while ensuring the accuracy of the adaptation engine mode.
  • the browser with the engine mode switching function of the present invention includes: a browser body, a switching module, and a feature library, wherein the browser body performs the webpage display operation in FIG. 7 for opening a webpage in the current engine mode, that is, Loading the parsing engine and downloading the webpage triggered by the user, and then opening the webpage to display; the switching module is respectively connected with the browser body and the feature library, and performs the collecting operation and the analyzing operation in FIG. 7, and the browser body is already in the current engine mode.
  • the switching module is configured to collect at least one webpage internal information of the webpage, switch to the adapted engine mode, and notify the browser body to load the signature library; Corresponding relationship between the internal information of each webpage and the adapted engine mode is saved, and the internal information of the webpage is obtained by the browser after the webpage is acquired by the browser.
  • the feature library further stores a correspondence between each URL attribute and an adapted engine mode; the switching module further collects the webpage when the browser body attempts to open a webpage in the current engine mode. At least one URL attribute, combined with the feature library, switches to the adapted engine mode and notifies the browser ontology to load.
  • the feature library further includes a correspondence between an address format and an adapted engine mode; the switching module, when the browser body has opened a webpage in the current engine mode or is opening a webpage The address of the server where the webpage is located is also collected, and the signature library is switched to the adapted engine mode and the browser body is notified to load.
  • the feature library further includes a duration threshold; the switching module detects when the browser body opens a webpage in the current engine mode, and if the duration exceeds the duration threshold, switches to Adapt the engine mode and notify the browser body to load, otherwise, keep in the current engine mode.
  • the present invention is based on webpage switching, in which case a plurality of webpages have been opened. If the current webpage identification requires engine mode switching, only the webpage is switched, and other webpages remain in the original engine mode.
  • first, second, and third embodiments illustrating how the browser (mainly the switching module in the browser combines the feature library) in the process of opening a webpage, how to perform engine mode switching through the URL attribute .
  • the present invention will be described below with reference to the first embodiment.
  • the browser is set to be a WebKit/IE dual-engine browser.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 1, do the following:
  • Step S11 establishing a feature library, where the corresponding relationship between each URL attribute and the adapted engine mode is saved;
  • the URL attribute includes at least: a protocol used by the webpage, a webpage port, and a suffix of the webpage file; Step S12, setting a priority of the engine mode;
  • the priority is ranked according to compatibility, and the most compatible engine mode is set to the highest priority.
  • the IE core is used as the engine with the highest priority, and the present invention is not limited thereto;
  • Step S13 the user attempts to open a webpage in the default engine mode by using the browser, and the webpage is not yet opened, and the browser collects at least one URL attribute of the webpage;
  • the default engine mode is set to the engine mode with poor compatibility but the best performance.
  • the WebKit kernel is used as the default engine.
  • the browser is based on at least one collected.
  • the URL attribute is combined with the feature library to perform a matching hit;
  • the browser collects the protocol used by the webpage, detects the protocol used by the webpage and hits the protocol in the signature database, and obtains the engine mode corresponding to the protocol according to the hit protocol; for example, through the webpage URL//. . . , can know that the protocol used by the webpage is the FTP protocol (file transfer protocol), then hits in the feature library according to the FTP protocol, hits the FTP protocol and obtains the IE kernel corresponding to the webpage, based on the IE kernel.
  • the page displayed by the browser is HTP-friendly;
  • the browser collects the port used by the webpage, detects the webpage port number and hits the standard port number in the feature library, and obtains a corresponding engine mode according to the hitting result; for example, the general webpage port uses the port 80 by default. Therefore, the standard port number is set to 80 in the signature database. If the webpage port is not 80, it is better to use the IE kernel; the port number of the detection webpage is hit in the signature database. If there is no hit, it indicates that the webpage port is not 80 at this time. Therefore, obtaining this web page corresponds to the IE kernel;
  • the suffix of the webpage file When the browser collects the suffix of the webpage file, the suffix of the webpage file is detected and hit in the feature library, and the corresponding engine mode is obtained according to the suffix of the hit; the webpage file may be downloaded to the local, or may be ⁇ ⁇ The file opened in the webpage;
  • the suffix MHT is set in the feature library, and the file of the suffix is only supported by the IE kernel.
  • the file name of the related file of the webpage is detected as the suffix of the mail.mht is MHT hits in the feature library, if hit , indicating that the web page file can only be displayed by the IE kernel, so the web page corresponding to the IE kernel is obtained;
  • Step S15 Identify an engine mode with the highest priority among the engine modes corresponding to each of the hit URL attributes
  • the webpage has three URL attributes corresponding to the IE kernel, and the IE kernel has higher priority because of better compatibility, so the browser recognizes the highest priority IE. Kernel
  • Step S16 the browser works in the engine mode;
  • the browser automatically switches from the default WebKit kernel to the IE kernel or prompts the user to manually switch from the default WebKit kernel to the IE kernel to display the current web page.
  • the browser can also keep working under the WebKit kernel, which is determined by the collected analysis results in steps S13-S15.
  • the present invention will be described below with reference to the second embodiment.
  • the browser is set to be a WebKit/IE dual-engine mode browser.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 2, do the following:
  • Step S21 Establish a feature library, where the corresponding relationship between each URL attribute and the adapted engine mode is saved;
  • the URL attribute includes at least: a protocol used by the webpage, a webpage port, and a suffix of the webpage file; and step S22, setting a priority for each webpage attribute;
  • Step S23 the user attempts to open a webpage in the default engine mode by using the browser, and the webpage is not yet opened, and the browser collects the priority according to the priority order.
  • a URL attribute of a web page
  • the default engine mode is set to the engine mode with poor compatibility but the best performance.
  • the WebKit kernel is used as the default engine.
  • the present invention is not limited thereto; Step S24, the browser is based on the collected one.
  • the URL attribute is combined with the feature library to perform a matching hit;
  • step S25 If the engine mode is different from the default engine mode, the engine mode is not considered to be switched according to the URL attribute, and the process returns to step S23; if it matches the engine mode different from the default engine mode, step S25 is performed;
  • the current default engine mode is based on the WebKit kernel, and the protocols, the web port, and the suffix of the webpage file used by the webpage are collected and matched one by one in priority order, and once matched to the engine mode different from the default engine mode, in this example In this engine mode is the IE kernel, then step S25; otherwise, remain in the default engine mode, return to step S23;
  • Step S25 the browser switches to the engine mode;
  • the browser automatically switches from the default WebKit kernel to the IE kernel or prompts the user to manually switch from the default WebKit kernel to the IE kernel to display the current web page.
  • the present invention will be described below with reference to the third embodiment.
  • the browser is set to be a browser of the WebKit/IE dual engine mode.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 3, do the following:
  • Step S31 establishing a feature library, where the correspondence relationship between each URL attribute and the adapted engine mode is saved;
  • the URL attribute includes at least: a protocol used by the webpage, a webpage port, and a suffix of the webpage file; step S32, setting weights for engine modes corresponding to the various URL attributes according to various URL attributes; for example, identifying the importance of the URL attribute according to experience,
  • the weight of the corresponding engine mode of the protocol used by the webpage may be set to 3, the weight of the corresponding engine mode of the webpage port is set to 1, and the weight of the corresponding engine mode of the suffix of the webpage file is set to 2, of course, the present invention is not limited thereto;
  • Step S33 the user attempts to open a webpage in the default engine mode by using the browser, and the webpage is not yet opened, and the browser collects at least one URL attribute of the webpage;
  • Step S34 the browser is based on at least A URL attribute is combined with the feature library to perform a matching hit;
  • step S14 For specific operations of matching hits, refer to step S14;
  • Step S35 Identify an engine mode corresponding to each URL attribute of the hit, and analyze an engine mode with the highest weight according to the weight of each URL attribute of the hit;
  • the web page has three URL attributes corresponding to the IE kernel, respectively, the protocol used by the web page, the web port, and the suffix of the web file; at this time, the weights are analyzed, and the weight of the IE kernel is analyzed. Highest
  • Step S36 the browser works in the engine mode
  • the browser automatically switches from the default WebKit kernel to the IE kernel or prompts the user to manually
  • the operation is switched to the IE kernel by the default WebKit kernel to display the current web page.
  • the browser can also remain working under the WebKit kernel, which is determined by the collection of analysis results in steps S33-S35.
  • the following describes the second part, including: fourth, fifth, and sixth embodiments, illustrating that after the webpage has been opened, the browser (mainly the switching module in the browser combines the feature library) how to perform engine mode switching through the internal information of the webpage
  • the browser mainly the switching module in the browser combines the feature library
  • the internal information of the webpage is obtained after the browser obtains the webpage.
  • the present invention will be described below with reference to the fourth embodiment.
  • the browser is set to be a WebKit/IE dual-engine mode browser.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 4, do the following:
  • Step S41 establishing a feature library, where the correspondence between the internal information of each webpage and the adapted engine mode is saved;
  • the internal information of the webpage includes at least: a webpage script, a webpage object (Object), a web standard, a webpage page structure, a number of webpage elements, and a webpage element size;
  • Step S42 setting a priority to the engine mode
  • the priority is ranked according to compatibility, and the most compatible engine mode is set to the highest priority.
  • the IE core is used as the engine with the highest priority, and the present invention is not limited thereto;
  • Step S43 the user opens a webpage in the default engine mode by using the browser, and the webpage is opened, and the browser collects at least one webpage internal information of the webpage;
  • the default engine mode is set to the engine mode with poor compatibility but the best performance.
  • the WebKit kernel is used as the default engine.
  • the present invention is not limited thereto; Step S44, the browser is based on at least one collected. The internal information of the webpage is combined with the feature library to perform a matching hit;
  • the browser collects a webpage currently opening a script file, the script file attempts to launch a control, detects that the identifier of the control hits in the feature library, and obtains a corresponding engine mode for running the control; for example, at the current Click on the page to download the file, and activate a JS foot.
  • This ie javascript script, object- and event-driven and relatively secure client-side script
  • this script file attempts to launch a download tool, this download tool is more suitable to run under the browser of the IE kernel, according to the download
  • the identifier of the tool is hit in the feature library, and the download tool corresponds to the IE kernel;
  • the browser collects a webpage object that the webpage currently attempts to invoke, detects that the identifier of the object hits in the feature library, and obtains a corresponding engine mode for running the object; for example, clicking on the current webpage to perform a video playback.
  • the control that plays the video is called in the ClassID of the registry of the system where the browser is located, and the control can only be run under the browser of the IE kernel, and then the identifier is performed in the feature library according to the identifier of the control. Hit, get call to this control needs to be based on the IE kernel;
  • the browser collects a web standard, detects a file related to the webpage, and obtains a web standard supported by the webpage according to a webpage header description (Head) in the source code of the file, according to the web standard. Hits in the feature library and obtains the corresponding engine mode; for example, obtaining the source file index.htm of the current webpage, and obtaining the webpage support CSS 3.0 from the header description (Head) of the source code of the file (Cascading Style Sheet) , cascading style sheet), hitting in the feature library according to the identifier of the version, and acquiring the webpage needs to be opened based on the WebKit kernel;
  • Head webpage header description
  • the browser detects a file related to the webpage, collects a webpage page structure according to the source code of the file, performs a hit in the feature library according to the webpage page structure, and acquires a corresponding engine mode; for example, detecting a file of the webpage, the file is written by using Dreamweaver 8.0, and the specified border width of a table in the webpage is obtained according to the source code, and the signature is hit in the feature library according to the specified border width, and the engine corresponding to the border width is obtained.
  • the mode is WebKit, and this page structure is more suitable for display in the WebKit kernel;
  • the browser detects the number of elements of the webpage in the default kernel, the feature library includes a quantity threshold, and obtains a relationship between the number of the webpage elements and the number threshold of the feature library, and acquires a corresponding engine mode according to the relationship; For example, the feature library includes a number of thresholds A. If the number of elements of the current webpage is greater than A, the number of elements of the current webpage is larger, and the corresponding kernel is obtained. In this embodiment, the number of elements is larger, corresponding to the WebKit kernel;
  • the browser detects an element size of the web page under a default kernel, the feature library including a size
  • the relationship acquires the corresponding engine mode; for example, the feature library includes a size threshold B, and the element size of the current webpage is greater than B, indicating that the element size of the current webpage is larger, and the corresponding kernel is obtained.
  • the webpage is obtained.
  • the size of the element corresponds to the WebKit kernel; the size of the web page element includes: a resolution size (Dimension) and/or a file size (Size);
  • Step S45 identifying an engine mode with the highest priority among the engine modes corresponding to the internal information of the hit pages;
  • the webpage has two webpage internal information corresponding to the IE kernel, and four webpage internal information corresponds to the WebKit kernel, and the IE kernel has priority because of better compatibility.
  • the level is higher, so the browser recognizes the highest priority IE kernel;
  • Step S46 the browser works in the engine mode
  • the browser automatically switches from the default WebKit kernel to the IE kernel or prompts the user to manually switch from the default WebKit kernel to the IE kernel to display the current web page.
  • the browser can also remain working under the WebKit kernel, which is determined by the results of the collection of steps S43-S45.
  • the present invention will be described below with reference to the fifth embodiment.
  • the browser is set to the browser of the WebKit/IE dual engine mode.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 5, do the following:
  • Step S51 establishing a feature library, where the correspondence between the internal information of each webpage and the adapted engine mode is saved;
  • the internal information of the webpage includes at least: a webpage script, a webpage object (Object), a web standard, a webpage page structure, a number of webpage elements, and a webpage element size;
  • Step S52 setting priorities for various internal information of the webpage
  • step S53 the user opens a webpage in the default engine mode by using the browser, and the webpage is already opened, and the browser collects the information according to the priority order.
  • a web page internal information Generally, the default engine mode is set to the engine mode with poor compatibility but the best performance. For example, in actual operation, the WebKit kernel is used as the default engine.
  • Step S54 the browser is based on the collected one.
  • the internal information of the webpage is combined with the feature library to perform a matching hit;
  • step S55 If it is not matched to the engine mode different from the default engine mode, the engine mode is not considered to be switched according to the internal information of the webpage, and the process returns to step S53; if it matches the engine mode different from the default engine mode, step S55 is performed;
  • the current default engine mode is based on the WebKit kernel, and the webpage script, the web object (Object), the web standard, the webpage page structure, the number of webpage elements, and the webpage element size are collected and matched one by one in order of priority.
  • the engine mode of the default engine mode in this example, the engine mode is the IE kernel, then step S55; otherwise, in the default engine mode, return to step S53;
  • Step S55 the browser switches to the engine mode
  • the browser automatically switches from the default WebKit kernel to the IE kernel or prompts the user to manually switch from the default WebKit kernel to the IE kernel to display the current web page.
  • the present invention will be described below with reference to the sixth embodiment.
  • the browser is set to be a WebKit/IE dual-engine mode browser.
  • the present invention is not limited thereto, and is also applicable to a multi-engine browser. As shown in Figure 6, do the following:
  • Step S61 establishing a feature library, where the correspondence between the internal information of each webpage and the adapted engine mode is saved;
  • the internal information of the webpage includes at least: a webpage script, a webpage object (Object), a web standard, a webpage page structure, a number of webpage elements, and a webpage element size;
  • Step S62 setting weights for engine modes corresponding to internal information of various webpages according to internal information of various webpages;
  • the weight of the corresponding engine mode of the webpage script may be set to 3, the weight of the corresponding engine mode of the webpage object is set to 3, and the weight of the corresponding engine mode of the web standard is set to 3,
  • the weight of the corresponding engine mode of the web page structure Set to 2 the weight of the engine mode corresponding to the number of webpage elements is set to 1, and the weight of the corresponding engine mode of the webpage element size is set to 1, of course, the invention is not limited thereto;
  • Step S63 The user opens a webpage in the default engine mode by using the browser, and the webpage is opened, and the browser collects at least one webpage internal information of the webpage;
  • the default engine mode is set to be poorly compatible, but the best performing engine mode, for example, in actual operation, the WebKit kernel is used as the default engine.
  • the present invention is not limited thereto; Step S64, the browser is based on at least A webpage internal information is combined with the feature library to perform a matching hit;
  • step S44 For specific operations of matching hits, refer to step S44;
  • Step S65 Identify an engine mode corresponding to the internal information of each of the hit pages, and analyze an engine mode with the highest weight according to the weight of the internal information of each page that is hit;
  • the engine mode corresponding to the internal information of each webpage that identifies the hit finds that the webpage has two internal information corresponding to the IE kernel, which are a webpage script and a webpage object respectively, and four webpage attributes correspond to the WebKit kernel, which are respectively a web standard and a webpage page structure. , the number of web page elements and the size of the web page element; at this time, the weight of the webKit kernel is the highest;
  • Step S66 the browser works in the engine mode
  • the browser remains in the default WebKit kernel and displays the current web page.
  • the browser can also be switched to the IE kernel by the WebKit kernel, which is determined by the collection analysis results in steps S63-S65.
  • first embodiment cooperates with the fourth embodiment, and steps S11-S16 are performed in a stage where the webpage is being opened, and after the webpage is opened, the webpage is browsed.
  • Steps S41-S46 are performed, and the adapted engine mode is finally confirmed and switched; or the second embodiment cooperates with the fifth embodiment to perform steps S21-S26 in a stage where the webpage is being opened, after the webpage is opened, browsing Steps S51-S56 are performed in the process of the webpage, and finally the adapted engine mode is confirmed and switched; or the third embodiment cooperates with the sixth embodiment to perform steps S31-S36 in the stage that the webpage is being opened, after the webpage is opened, Steps S61-S66 are performed during the process of browsing the webpage, and finally the adapted 1 engine mode is confirmed and switched.
  • the first embodiment may cooperate with the fifth or sixth embodiment. In the stage that the webpage is being opened, according to the attribute of the webpage, the priority of the engine mode is switched.
  • the webpage is browsed according to the webpage.
  • the internal information is switched according to the priority or weight of the internal information of the webpage.
  • the second embodiment may cooperate with the fourth or sixth embodiment.
  • the priority of the webpage attribute is used.
  • the engine mode is switched according to the priority or weight of the engine mode.
  • the browser (mainly the switching module in the browser combined with the feature library) performs engine mode switching by the address format. It may be executed in the same process as the solution of the first part and cooperate with the execution of the solution of the second part, or may be executed at the same time as the solution of the second part and cooperate with the execution of the solution of the first part, which may also be A part of the scheme is executed in the same process or at the same timing as the scheme of the second part.
  • the feature library also stores the correspondence between the address format of the server and the adapted engine mode.
  • the browser also collects the address of the server where the web page is located, and switches to the adapted engine mode in combination with the feature library to further ensure the accuracy of the handover.
  • the address format saved in the feature library includes a public address and a private address, and the web page of the general private address can be considered to be based on the IE kernel; the browser attempts to open a webpage in the default engine mode or has opened the webpage.
  • the IP address of the server where the webpage is located is 192.168.*.*, and the IP address is hit in the signature database according to the IP address, and the IP address belongs to the private address, and the corresponding engine mode is obtained as the IE kernel. .
  • the priority or weight of the address format or the priority based on the above engine mode can be set as described above, and cooperate with the above URL attribute and the internal information of the webpage to finally confirm the adapted engine mode and switch.
  • the browser mainly the switching module in the browser combined with the feature library
  • the implementation of the program is mainly the switching module in the browser combined with the feature library.
  • the feature library also stores a duration threshold; when the browser opens a webpage in the default engine mode, detecting the opening duration of the webpage in the default kernel, and determining, according to the signature database, that if the duration exceeds the duration threshold, Then switch to the adapted engine mode, otherwise, keep in the current engine mode; for example, the feature library includes a duration threshold of 20 seconds, the current webpage opening time is 30 seconds, the webpage has not been opened, and the duration threshold is exceeded, At this time, the current default kernel is not suitable for this webpage, then it switches to the adapted kernel; if the webpage is opened within 20 seconds, it remains in the current engine mode.
  • the invention can effectively detect which kernel the current webpage is, thereby switching the browser to the corresponding engine mode.
  • the accuracy of the engine mode switching is ensured, especially when there is a problem when the webpage is opened for browsing, even when the user does not find the problem, the user is helped to solve the problem intelligently, and the user is allowed to use the browser to open the webpage correctly;
  • Quick identification before the web page is opened can not affect the user's use, while ensuring the accuracy of the adaptation engine mode,
  • the user does not feel the existence of the switching mode; in addition, the browser adapts according to the address of the server where the webpage is located and the opening speed of the webpage, thereby further ensuring the accuracy of the switching.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Description

一种浏览器引擎模式的切换方法及浏览器
技术领域
本发明属于互联网领域, 具体地说, 涉及一种浏览器引擎模式的切换 方法及浏览器。
背景技术
浏览器的内核, 可以称之为内核或者排版引擎, 也可以称为页面渲染引 擎。 它负责取得网页的内容(HTML、 XML, 图像等等) 、 整理信息 (例如 加入 CSS等) 以及计算网页的显示方式, 然后会输出为用户能看到的网页。 不同的浏览器内核对网页编写语法的解释不同, 因此同一网页在不同内核的 浏览器里的渲染效果也可能不同, 这也是网页编写者需要在不同内核的浏览 器中测试网页显示效果的原因。
现在浏览器的内核, 主要包括: Trident内核, 即 IE内核, 供 IE浏览器 使用; Gecko 内核, 主要为 Firefox浏览器所使用; WebKit内核, 供 Safari 浏览器、 Google Chrome浏览器、 搜狗浏览器使用; Presto内核, 主要应用在 手机平台的 Opera mini浏览器。以下主要以 WebKit和 Trident为例进行说明。
WebKit是一个开源的浏览器的内核,其引擎高效稳定且源码结构清晰, 渲染速度快, 易于维护; 其最重要的优点就是速度极快; Trident是 IE的浏 览器的内核, 以下简称 IE 内核, 网站一般都基于此引擎搭载网页的内容, 在这方面它得到了最广泛的支持; 其最重要的优点就是兼容性最好。
由于 IE 内核的浏览器对于市场的巨大的占用率, 目前市场上大部分网 站所提供的网页在设计时都 ^^于 IE内核的, 这些网页的一些内容只有 IE 内核的浏览器才能够正常运行, 此时使用 WebKit内核运行的浏览器是无法 正常显示这些网页内容的。 例如: 运行在这些网页上的一些控件只有通过 IE 内核的浏览器才能够完成调用启动, 在基于 WebKit内核运行的浏览器上是 无法打开的; 用来搭建网页的页面结构的代码是通过一些特殊的程序语言编 写的,而这些代码通过 IE内核的浏览器才能够正常打开,而如果通过 WebKit 内核运行的浏览器打开则会出现页面结构的错乱或者显示文字的错乱。 但是, IE内核在访问复杂网页时, 容易出现速度慢、 不流畅、 崩溃的问 题, 而 WebKit则更能适应复杂的网页。 考虑到 IE内核在市场上仍然占有绝 对地位, 仍不能直接抛弃 IE 内核, 因此目前市场上有些网站则专门设计了 WebKit和 IE两个版本的网页, 一个版本的网页供基于 WebKit内核的浏览 器显示, 另一个版本的网页供基于 IE内核的浏览器显示, 但是由于 WebKit 内核的速度优势, 用户在使用 WebKit内核的浏览器时会带来更好的用户体 验, 因此这些网站一般会默认优先提供基于 WebKit内核的网页。
另外, 目前市场上有些网站所提供的内容对浏览器的速度有要求, 因此 特别适用于基于 WebKit内核的浏览器, 所以这些网站在设计网页时是专门 基于 WebKit内核的,网页的一些内容只有基于 WebKit内核的浏览器才能够 正常运行, 此时使用 Trident 内核运行的浏览器是无法正常显示这些网页内 容的。
针对上述情况, 市场上出现了具有 WebKit内核和 IE内核的双引擎模式 的浏览器,根据网页的兼容情况自动选择 "速度最快"的 WebKit内核或 "兼 容性最好" 的 IE 内核。 但是对于网页的兼容情况的获知, 这种双引擎模式 的浏览器主要是通过识别用户当前试图访问的网页的网址, 如 www.360.cn, 根据这个网址去列表中进行识别, 识别这个网址是适用 WebKit内核还是 IE 内核,然后启动这个网址适合的内核,如果列表中没有关于这个网页的记录, 则无法进行自动切换, 需要用户手动切换。
可是此时用户不一定了解这个网页原本的功能, 无从判断是否出现问 题, 例如: 这个网页在当前的引擎模式下被显示为错乱的页面结构, 可是用 户可能会认为网页本来的样子就是这样, 无法判断出是否出了问题, 更无法 判断出是浏览器的引擎模式不适配而导致出现了问题;
而且即使用户发现了问题也不知道如何解决, 例如: 这个网页上存在一 个视频控件, 在当前引擎模式下无法播放并显示错误, 但是用户并不知道是 由于引擎模式导致的, 用户很可能会认为是网页本身的问题, 并不了解可以 通过切换浏览器的引擎模式来解决问题, 或浏览器的引擎模式的切换入口不 明显而使用户不知道如何切换。
同时, 如果列表中没有关于这个网页的记录从而无法进行自动切换时, 这种双引擎浏览器需要将这个网址上传至服务器侧, 由官方人工验证网址是 否确实在当前引擎模式下存在问题, 如果确实存在问题再将这个网址根据适 用的引擎模式加入列表, 由服务器侧向各终端上的浏览器发布列表升级。
在浏览器打开网页之前, 通过用户输入的网址本身进行识别方式过于单 一, 而且可靠性较差, 因为网址本身不能穷尽, 每天都会新增很多的网页, 网页列表的更新永远是滞后于新网址的产生的, 而且列表需要通过人工维 护, 效率低下而且成本^ ί艮高。
发明内容
有鉴于此, 本发明所要解决的技术问题是提供了一种浏览器引擎模式的 切换方法及浏览器, 可以有效检测当前网页^^于哪种内核, 从而将浏览器 切换至相应的引擎模式。
为了解决上述技术问题, 本发明公开了一种浏览器引擎模式的切换方 法, 包括: 构建特征库, 包括每种网页内部信息与适配的引擎模式的对应关 系; 浏览器在当前引擎模式下已打开一网页, 收集所述网页的至少一种网页 内部信息, 结合所述特征库切换到适配的引擎模式。
进一步地, 还包括: 所述特征库还包括每种网址属性与适配的引擎模式 的对应关系; 所述浏览器在当前引擎模式下打开一网页时, 还收集所述网页 的至少一种网址属性, 结合所述特征库切换到适配的引擎模式。
进一步地, 还包括: 所述特征库还包括地址格式与适配的引擎模式的对 应关系; 所述浏览器还收集网页所在服务器的地址, 结合所述特征库切换到 适配的引擎模式。
进一步地, 所述特征库还包括时长门限; 浏览器在当前引擎模式下打开 一网页时, 所述浏览器检测所述网页的打开时长, 结合所述特征库判断, 如 所述时长超过所述时长门限, 则切换至适配的引擎模式, 否则, 保持在当前 引擎模式。
进一步地, 结合所述特征库切换到适配的引擎模式的步骤, 包括: 对所 述引擎模式设置优先级,收集所述网页的多种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长并在所述特征库中进行命中, 识别命中 的各网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长分别 对应的引擎模式中优先级最高的一引擎模式, 所述浏览器在所述引擎模式下 工作。
进一步地, 结合所述特征库切换到适配的引擎模式的步骤, 包括: 对所 述各种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长设 置优先级, 按优先级顺序逐一收集所述网页的网页内部信息或网址属性并和 /或所在服务器的地址和 /或打开时长在所述特征库中进行命中, 如果命中并 匹配到不同于当前引擎模式的引擎模式, 则停止收集并切换至所述引擎模 式。
进一步地, 结合所述特征库切换到适配的引擎模式的步骤, 包括: 对所 述各种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长设 置权重, 收集所述网页的多种网页内部信息和 /或网址属性和 /或所在服务器 的地址和 /或打开时长并在所述特征库中进行命中 ,识别命中的各网页内部信 息和 /或网址属性和 /或所在服务器的地址和 /或打开时长分别对应的引擎模 式, 并结合命中的各网页内部信息和 /或网址属性和 /或所在服务器的地址和 / 或打开时长的权重分析出权重最高的一引擎模式, 所述浏览器在所述引擎模 式下工作。
进一步地, 当所述网页内部信息至少包括网页脚本时, 所述浏览器检测 所述网页启动的网页脚本, 根据所述网页脚本启动的控件的标识在所述特征 库中进行命中并获取对应的 ^ ]擎模式。
进一步地, 当所述网页内部信息至少包括网页对象时, 所述浏览器检测 所述网页试图调用的对象标识, 根据所述对象标识在所述特征库中进行命中 并获取对应的引擎模式。
进一步地, 当所述网页内部信息至少包括 Web标准时,所述浏览器检测 持的 Web标准, 根据所述 Web标准在所述特征库中进行命中并获取对应的 引擎模式。
进一步地, 当所述网页内部信息至少包括网页页面结构时, 所述浏览器 检测与所述网页相关的文件, 根据所述文件的源代码获取所述网页页面结 构, 根据所述网页页面结构在所述特征库中进行命中并获取对应的引擎模 式。
进一步地, 当所述网页内部信息至少包括网页元素数量时, 所述特征库 包含数量门限, 所述浏览器检测所述网页元素数量并结合所述特征库判断所 述网页元素数量与数量门限的关系, 根据所述关系获取对应的引擎模式。
进一步地, 当所述网页内部信息至少包括网页元素尺寸时, 所述特征库 所述网页元素尺寸与尺寸门限的关系, 才艮据所述关系获取对应的引擎模式。
进一步地, 当所述网址属性至少包括网页使用的协议时, 所述浏览器检 测所述网页的网址, 根据所述网址获取所述网页使用的协议在所述特征库中 进行命中并获取对应的 ^ 1擎模式。
进一步地, 当所述网址属性至少包括网页端口时, 所述浏览器检测所述 网页端口号在所述特征库中的标准端口号进行命中并获取对应的引擎模式。
进一步地, 当所述网址属性至少包括网页文件的后缀时, 所述浏览器检 测所述网页文件的文件名并获取后缀, 在所述特征库中进行命中并获取对应 的引擎模式。
进一步地, 所述网页内部信息, 为所述浏览器获取所述网页后经过分析 得到的。
进一步地,所述切换,包括所述浏览器自动切换和 /或提示用户进行切换。 为了解决上述技术问题, 本发明还公开了一种具有引擎模式切换功能 的浏览器, 包括: 浏览器本体、 切换模块、 特征库, 其中, 所述浏览器 本体, 用于在当前引擎模式下打开一网页; 所述切换模块, 用于收集所述 网页的至少一种网页内部信息, 结合所述特征库切换至适配的引擎模式并通 知浏览器本体进行加载; 所述特征库, 保存每种网页内部信息与适配的引 擎模式的对应关系, 所述网页内部信息为所述浏览器获取所述网页后才能够 通过分析得到的。
进一步地, 所述特征库, 还保存每种网址属性与适配的引擎模式的对应 关系; 所述切换模块, 还用于收集所述网页的至少一种网址属性, 结合所 述特征库切换到适配的弓 ]擎模式并通知所述浏览器本体进行加载。
进一步地,所述特征库,还包括地址格式与适配的引擎模式的对应关系; 所述切换模块, 还用于收集网页所在服务器的地址, 结合所述特征库切换 到适配的引擎模式并通知所述浏览器本体进行加载。
进一步地, 所述特征库, 还包括时长门限; 所述切换模块, 还用于检 测所述网页的打开时长, 如所述时长超过所述时长门限, 则切换至适配的引 擎模式并通知所述浏览器本体进行加载。
进一步地, 所述切换模块, 还用于对所述引擎模式设置优先级, 收集 所述网页的多种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打 开时长并在所述特征库中进行命中,识别命中的各网页内部信息和 /或网址属 性和 /或所在服务器的地址和 /或打开时长分别对应的引擎模式中优先级最高 的一引擎模式, 并通知所述浏览器本体加载所述引擎模式。
进一步地, 所述切换模块, 还用于对所述各种网页内部信息和 /或网址 属性和 /或所在服务器的地址和 /或打开时长设置优先级, 按优先级顺序逐一 收集所述网页的网页内部信息或网址属性并和 /或所在服务器的地址和 /或打 开时长在所述特征库中进行命中, 如果命中并匹配到不同于当前引擎模式的 引擎模式, 则停止收集并切换至所述引擎模式, 通知所述浏览器本体进行 加载。
进一步地, 所述切换模块, 还用于对所述各种网页内部信息和 /或网址 属性和 /或所在服务器的地址和 /或打开时长设置权重, 收集所述网页的多种 网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长并在所述 特征库中进行命中, 识别命中的各网页内部信息和 /或网址属性和 /或所在服 务器的地址和 /或打开时长分别对应的引擎模式,并结合命中的各网页内部信 息和 /或网址属性和 /或所在服务器的地址和 /或打开时长的权重分析出权重最 高的一引擎模式, 并通知所述浏览器本体加载所述引擎模式。
进一步地, 当所述网页内部信息至少包括网页脚本时,所述切换模块检 测所述网页启动的网页脚本, 根据所述网页脚本启动的控件的标识在所述特 征库中进行命中并获取对应的弓 ]擎模式。 进一步地, 当所述网页内部信息至少包括网页对象时,所述切换模块检 测所述网页试图调用的对象标识, 根据所述对象标识在所述特征库中进行命 中并获取对应的引擎模式。
进一步地, 当所述网页内部信息至少包括 Web标准时, 所述切换模块 检测与所述网页相关的文件, 根据所述文件的源代码获取所述网页相关的文 件支持的 Web标准, 根据所述 Web标准在所述特征库中进行命中并获取对 应的引擎模式。
进一步地, 当所述网页内部信息至少包括网页页面结构时, 所述切换模 块检测与所述网页相关的文件, 根据所述文件的源代码获取所述网页页面结 构, 根据所述网页页面结构在所述特征库中进行命中并获取对应的引擎模 式。
进一步地, 当所述网页内部信息至少包括网页元素数量时, 所述特征库 还包含数量门限; 所述切换模块, 检测所述网页元素数量并结合所述特征 库判断所述网页元素数量与数量门限的关系, 根据所述关系获取对应的引擎 模式。
进一步地, 当所述网页内部信息至少包括网页元素尺寸时, 所述特征库 还包含尺寸门限;所述切换模块检测所述网页的元素尺寸并结合所述特征库 判断所述网页元素尺寸与尺寸门限的关系, 根据所述关系获取对应的弓 ]擎模 式。
进一步地, 当所述网址属性至少包括网页使用的协议时, 所述切换模块 检测所述网页的网址, 根据所述网址获取所述网页使用的协议在所述特征库 中进行命中并获取对应的引擎模式。
进一步地, 当所述网址属性至少包括网页端口时, 所述切换模块检测所 述网页端口号在所述特征库中的标准端口号进行命中并获取对应的引擎模 式。
进一步地, 当所述网址属性至少包括网页文件的后缀时, 所述切换模块 检测所述网页文件的文件名并获取后缀, 在所述特征库中进行命中并获取对 应的引擎模式。 进一步地, 所述网页内部信息,为所述切换模块获取所述网页后经过分 析得到的。
与现有的方案相比, 本发明所获得的技术效果:
1 )保证了引擎模式切换的准确性, 尤其在网页打开浏览时出现问题时, 甚至在用户没有发现问题时, 帮助用户智能化地解决问题, 最大限度保证用 户使用浏览器正确打开网页;
2 )在网页打开之前进行快速识别可以不影响用户的使用, 在保证适配 弓 ]擎模式的准确性的同时, 使用户感觉不到切换模式的存在;
3 ) 浏览器还依据网页所在服务器的地址和网页打开速度进行适配, 进 一步保证了切换的准确。
附图概述
图 1为本发明第一实施例的流程图;
图 2为本发明第二实施例的流程图;
图 3为本发明第三实施例的流程图;
图 4为本发明第四实施例的流程图;
图 5为本发明第五实施例的流程图;
图 6为本发明第六实施例的流程图;
图 7为本发明的应用架构图。
本发明的较佳实施方式
以下将配合图式及实施例来佯细说明本发明的实施方式, 藉此对本发明 如何应用技术手段来解决技术问题并达成技术功效的实现过程能充分理解 并据以实施。
本发明的核心构思在于: 建立特征库, 其中保存每种网页内部信息与适 配的引擎模式的对应关系, 所述网页内部信息为所述浏览器获取所述网页后 才能够通过分析得到的; 浏览器在当前引擎模式下已经打开一网页的情况 下, 收集所述网页的至少一种网页内部信息, 结合所述特征库切换到适配的 引擎模式, 这样可以保证引擎模式切换的准确性, 尤其在网页打开浏览时出 现问题时, 甚至在用户没有发现问题时, 帮助用户智能化地解决问题, 最大 限度保证用户使用浏览器正确打开网页, 利用此方式, 可以解决背景技术中 所提到的技术缺陷。
另外, 所述特征库中还保存每种网址属性与适配的引擎模式的对应关 系, 浏览器在当前引擎模式下试图打开一网页的过程中, 浏览器还收集所述 网页的至少一种网址属性, 结合所述特征库切换到适配的引擎模式。 这样在 网页打开之前进行快速识别可以不影响用户的使用, 在保证适配引擎模式的 准确性的同时, 使用户感觉不到切换模式的存在。
如图 7所示, 为本发明的应用架构图, 其中收集操作、 分析操作和特征 库部分为本发明方案涉及的范围。 本发明的具有引擎模式切换功能的浏览 器, 包括: 浏览器本体、 切换模块、 特征库, 所述浏览器本体执行图 7 中的网页显示操作, 用于在当前引擎模式下打开一网页, 即加载解析引擎 并下载用户触发的网页, 而后将网页打开显示; 所述切换模块分别与浏 览器本体、 特征库相连, 执行图 7中的收集操作和分析操作, 浏览器本体 在当前引擎模式下已经打开一网页的情况下, 所述切换模块用于收集所述 网页的至少一种网页内部信息, 结合所述特征库切换至适配的引擎模式并通 知浏览器本体进行加载; 所述特征库, 保存每种网页内部信息与适配的引 擎模式的对应关系 , 所述网页内部信息为所述浏览器获取所述网页后才能够 通过分析得到的。
另外 ,所述特征库,还保存每种网址属性与适配的引擎模式的对应关系; 所述切换模块, 当浏览器本体在当前引擎模式下试图打开一网页的过程中, 还收集所述网页的至少一种网址属性, 结合所述特征库切换到适配的引擎模 式并通知浏览器本体进行加载。
所述特征库, 还包括地址格式与适配的引擎模式的对应关系; 所述切换 模块, 当浏览器本体在当前引擎模式下已打开一网页或者正在打开一网页 时, 还收集网页所在服务器的地址, 结合所述特征库切换到适配的引擎模式 并通知浏览器本体进行加载。
所述特征库, 还包括时长门限; 所述切换模块, 当浏览器本体在当前 引擎模式下打开一网页时, 检测所述网页的打开时长, 如所述时长超过所述 时长门限, 则切换至适配的引擎模式并通知浏览器本体进行加载, 否则, 保持在当前引擎模式。
以上所述浏览器的结构功能与以下描述的实施例中的方法流程描述对 应, 不足之处参考下述实施例中的流程操作的叙述, 在此不——赘述。
本发明基于网页进行切换, 如此时已打开多个网页, 如果当前一网页识 别需要进行引擎模式切换, 则仅对所述网页进行切换, 其他网页仍保持原引 擎模式。
以下描述第一部分, 包括: 第一、 二、 三实施例, 说明本发明在打开网 页的过程中, 浏览器(主要是浏览器中的切换模块结合特征库) 如何通过 网址属性进行引擎模式切换的。
以下以第一实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 1所示, 执 行如下操作:
步骤 S11 , 建立特征库, 其中保存每种网址属性与适配的引擎模式的对 应关系;
网址属性, 至少包括: 网页使用的协议、 网页端口、 网页文件的后缀; 步骤 S12, 对所述引擎模式设置优先级;
一般会按兼容性进行优先级排列, 将兼容性最好的引擎模式设置为优先 级最高, 例如在实际操作中, 将 IE 内核作为优先级最高的引擎, 当然本发 明并不限于此;
步骤 S13 , 用户使用浏览器在默认引擎模式下试图打开一网页, 此时网 页尚未打开, 浏览器收集所述网页的至少一种网址属性; 一般默认引擎模式会设置为兼容性较差但是性能最好的引擎模式, 例如 在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S14, 浏览器根据收集的至少一种网址属性结合所述特征库进行匹 配命中;
浏览器收集到网页使用的协议, 检测所述网页使用的协议与所述特征库 中的协议进行命中, 并根据命中的协议获取该协议对应的引擎模式; 例如, 通过网页的网址 FTP//... , 可以获知所述网页使用的协议为 FTP协议(文件 传输协议) , 则根据 FTP协议在所述特征库中进行命中, 命中 FTP协议并 获取此网页对应的是 IE内核,基于 IE内核的浏览器显示出的 HTP协议的页 面较为友好;
浏览器收集到网页所使用的端口, 检测所述网页端口号与所述特征库中 的标准端口号进行命中, 并根据命中结果获取对应的引擎模式; 例如, 一般 的网页端口都默认使用 80端口, 因此在特征库中设置标准端口号为 80, 如 果网页端口不是 80, 则最好使用 IE内核; 检测网页的端口号在特征库中进 行命中, 如果没有命中, 说明此时网页端口不是 80, 因此获取此网页对应的 是 IE内核;
浏览器收集到网页文件的后缀时, 检测所述网页文件的后缀与所述特征 库中进行命中, 并根据命中的后缀获取对应的引擎模式; 这个网页文件可以 是下载到本地的, 也可能^^于网页打开的文件; 例如: 特征库中设置后缀 MHT , 此后缀的文件仅被 IE 内核支持, 检测网页的相关文件的文件名 mail.mht的后缀为 MHT在特征库中进行命中, 如果命中, 说明此时网页文 件只能被 IE内核显示, 因此获取此网页对应的是 IE内核;
步骤 S15 , 识别命中的各网址属性分别对应的引擎模式中优先级最高的 一引擎模式;
根据步骤 S14中命中的各网址属性对应的引擎模式发现, 该网页有三个 网址属性对应 IE内核, 而且 IE内核因为兼容性更好, 其优先级也高, 因此 浏览器识别出优先级最高的 IE内核;
步骤 S16, 所述浏览器在所述引擎模式下工作; 所述浏览器自动由默认的 WebKit内核切换至 IE内核或者提示用户手动 操作由默认的 WebKit内核切换至 IE内核, 对当前网页进行显示。 当然, 浏 览器也可以保持在 WebKit内核下工作, 其决定于步骤 S13-S15的收集分析 结果。
以下以第二实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 模式的浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 2所 示, 执行如下操作:
步骤 S21 , 建立特征库, 其中保存每种网址属性与适配的引擎模式的对 应关系;
网址属性, 至少包括: 网页使用的协议、 网页端口、 网页文件的后缀; 步骤 S22, 对各种网址属性设置优先级;
例如, 按照经验识别网址属性的重要程度, 对其进行优先级设置; 步骤 S23 , 用户使用浏览器在默认引擎模式下试图打开一网页, 此时网 页尚未打开, 浏览器按照优先级顺序收集所述网页的一种网址属性;
一般默认引擎模式会设置为兼容性较差但是性能最好的引擎模式, 例如 在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S24, 浏览器根据收集的一种网址属性结合所述特征库进行匹配命 中;
如果未匹配至不同于默认引擎模式的引擎模式, 则不考虑依据该网址属 性来切换引擎模式, 返回执行步骤 S23; 如果匹配到不同于默认引擎模式的 引擎模式, 则执行步骤 S25;
可参考步骤 S14, 当前默认引擎模式基于 WebKit内核, 则按优先级顺 序逐一收集并匹配网页使用的协议、 网页端口、 网页文件的后缀, 一旦匹配 到不同于默认引擎模式的引擎模式, 在本例中此引擎模式即为 IE 内核, 则 执行步骤 S25; 否则, 保持在默认引擎模式下, 返回执行步骤 S23;
步骤 S25, 所述浏览器切换至所述引擎模式; 所述浏览器自动由默认的 WebKit内核切换至 IE内核或者提示用户手动 操作由默认的 WebKit内核切换至 IE内核, 对当前网页进行显示。
以下以第三实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 模式的浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 3所 示, 执行如下操作:
步骤 S31 , 建立特征库, 其中保存每种网址属性与适配的引擎模式的对 应关系;
网址属性, 至少包括: 网页使用的协议、 网页端口、 网页文件的后缀; 步骤 S32,根据各种网址属性对各种网址属性对应的引擎模式设置权重; 例如, 按照经验识别网址属性的重要程度, 可将网页使用的协议相应的 引擎模式的权重设置为 3 , 网页端口相应的引擎模式的权重设置为 1 , 网页 文件的后缀相应的引擎模式的权重设置为 2, 当然本发明并不限于此;
步骤 S33 , 用户使用浏览器在默认引擎模式下试图打开一网页, 此时网 页尚未打开, 浏览器收集所述网页的至少一种网址属性;
一般默认引擎模式会设置为兼容性较差, 但是性能最好的引擎模式, 例 如在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S34, 浏览器根据收集的至少一种网址属性结合所述特征库进行匹 配命中;
匹配命中的具体操作可参考步骤 S14;
步骤 S35 , 识别命中的各网址属性分别对应的引擎模式, 并结合命中的 各网址属性的权重分析出权重最高的一引擎模式;
识别命中的各网址属性对应的弓 1擎模式发现, 该网页有三个网址属性对 应 IE 内核, 分别是网页使用的协议, 网页端口, 网页文件的后缀; 此时结 合权重, 分析获知 IE内核的权重最高;
步骤 S36, 所述浏览器在所述引擎模式下工作;
所述浏览器自动由默认的 WebKit内核切换至 IE内核或者提示用户手动 操作由默认的 WebKit内核切换至 IE内核, 对当前网页进行显示。 当然 , 浏 览器也可以保持在 WebKit内核下工作, 其决定于步骤 S33-S35的收集分析 结果。
以下描述第二部分, 包括: 第四、 五、 六实施例, 说明本发明在已经打 开网页后, 浏览器(主要是浏览器中的切换模块结合特征库) 如何通过网 页内部信息进行引擎模式切换的; 所述网页内部信息为所述浏览器获取所述 网页后经过分析得到的。
以下以第四实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 模式的浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 4所 示, 执行如下操作:
步骤 S41 , 建立特征库, 其中保存每种网页内部信息与适配的引擎模式 的对应关系;
网页内部信息, 至少包括: 网页脚本、 网页对象( Object ) 、 Web标准、 网页页面结构、 网页元素数量、 网页元素尺寸;
步骤 S42, 对所述引擎模式设置优先级;
一般会按兼容性进行优先级排列, 将兼容性最好的引擎模式设置为优先 级最高, 例如在实际操作中, 将 IE 内核作为优先级最高的引擎, 当然本发 明并不限于此;
步骤 S43 , 用户使用浏览器在默认引擎模式下打开一网页, 此时网页已 经打开, 浏览器收集所述网页的至少一种网页内部信息;
一般默认引擎模式会设置为兼容性较差但是性能最好的引擎模式, 例如 在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S44, 浏览器根据收集的至少一种网页内部信息结合所述特征库进 行匹配命中;
浏览器收集到网页当前打开一脚本文件, 所述脚本文件试图启动一控 件, 检测所述控件的标识在所述特征库中进行命中, 并获取运行该控件的对 应的引擎模式; 例如, 在当前网页下点击进行文件下载, 此时激活一 JS脚 本(即 javascript脚本, 基于对象和事件驱动并具有相对安全性的客户端脚 本) , 此脚本文件试图启动一下载工具, 此下载工具更适合运行在 IE 内核 的浏览器下, 则根据所述下载工具的标识在所述特征库中进行命中, 获取此 下载工具对应的是 IE内核;
浏览器收集到网页当前试图调用的一网页对象, 检测所述对象的标识在 所述特征库中进行命中, 并获取运行该对象的对应的引擎模式; 例如, 在当 前网页下点击进行一个视频播放,此时在浏览器所在系统的注册表的 ClassID 中调用所述播放此视频的控件, 此控件只能运行在 IE 内核的浏览器下, 则 根据所述控件的标识在所述特征库中进行命中, 获取调用此控件需基于 IE 内核;
浏览器收集到 Web标准,检测与所述网页相关的文件,根据所述文件的 源代码中的网页头部描述(Head )获取所述网页所支持的 Web标准, 根据 所述 Web标准在所述特征库中进行命中, 并获取对应的引擎模式; 例如, 获 取当前网页的源文件 index.htm, 从该文件的源代码的头部描述( Head )中获 取所述网页支持 CSS 3.0 ( Cascading Style Sheet, 层叠样式表) , 根据所述 版本的标识在所述特征库中进行命中, 获取所述网页需要基于 WebKit内核 打开;
浏览器检测与所述网页相关的文件, 根据所述文件的源代码收集其中的 网页页面结构, 根据所述网页页面结构在所述特征库中进行命中并获取对应 的引擎模式;例如 ,检测到所述网页的一个文件 ,所述文件使用 Dreamweaver 8.0 编写, 根据源代码获取这个网页中一个表格的指定边框宽度, 根据这个 指定的边框宽度在特征库中进行命中, 获取这种边框宽度对应的引擎模式为 WebKit, 这种页面结构更适于在 WebKit内核显示;
浏览器检测在默认内核下的所述网页的元素数量, 所述特征库包含数量 门限, 获取所述网页元素数量与所述特征库中数量门限的关系, 根据所述关 系获取对应的引擎模式; 例如, 所述特征库包含一个数量门限 A, 将当前网 页的元素数量大于 A说明当前的网页的元素数量较多, 则获取对应的内核, 在本实施例中, 元素数量较多时对应 WebKit内核;
浏览器检测在默认内核下的所述网页的元素尺寸, 所述特征库包含尺寸 关系获取对应的引擎模式; 例如, 所述特征库包含一个尺寸门限 B, 当前网 页的元素尺寸大于 B,说明当前的网页的元素尺寸较大,则获取对应的内核, 在本实施例中, 网页元素尺寸较大时对应 WebKit内核; 所述网页元素尺寸, 包括: 分辨率尺寸 (Dimension )和 /或文件大小尺寸 (Size ) ;
步骤 S45 , 识别命中的各网页内部信息分别对应的引擎模式中优先级最 高的一引擎模式;
根据步骤 S44中命中的各网页内部信息对应的引擎模式发现, 该网页有 两个网页内部信息对应 IE内核, 有四个网页内部信息对应 WebKit内核, 而 IE内核因为兼容性更好, 因此其优先级更高, 因此浏览器识别出优先级最高 的 IE内核;
步骤 S46, 所述浏览器在所述引擎模式下工作;
所述浏览器自动由默认的 WebKit内核切换至 IE内核或者提示用户手动 操作由默认的 WebKit内核切换至 IE内核, 对当前网页进行显示。 当然, 浏 览器也可以保持在 WebKit内核下工作, 其决定于步骤 S43-S45的收集分析 结果。
以下以第五实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 模式的浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 5所 示, 执行如下操作:
步骤 S51 , 建立特征库, 其中保存每种网页内部信息与适配的引擎模式 的对应关系;
网页内部信息, 至少包括: 网页脚本、 网页对象( Object ) 、 Web标准、 网页页面结构、 网页元素数量、 网页元素尺寸;
步骤 S52, 对各种网页内部信息设置优先级;
例如, 按照经验识别网页内部信息的重要程度, 对其进行优先级设置; 步骤 S53 , 用户使用浏览器在默认引擎模式下打开一网页, 此时网页已 经打开, 浏览器按照优先级顺序收集所述网页的一种网页内部信息; 一般默认引擎模式会设置为兼容性较差但是性能最好的引擎模式, 例如 在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S54, 浏览器根据收集的一种网页内部信息结合所述特征库进行匹 配命中;
如果未匹配至不同于默认引擎模式的引擎模式, 则不考虑依据该网页内 部信息来切换引擎模式, 返回执行步骤 S53; 如果匹配到不同于默认引擎模 式的引擎模式, 则执行步骤 S55;
可参考步骤 S44, 当前默认引擎模式基于 WebKit内核, 则按优先级顺 序逐一收集并匹配网页脚本、 网页对象(Object ) 、 Web标准、 网页页面结 构、 网页元素数量、 网页元素尺寸, 一旦匹配到不同于默认引擎模式的引擎 模式, 在本例中此引擎模式即为 IE内核, 则执行步骤 S55; 否则, 保持在默 认引擎模式下, 返回执行步骤 S53;
步骤 S55, 所述浏览器切换至所述引擎模式;
所述浏览器自动由默认的 WebKit内核切换至 IE内核或者提示用户手动 操作由默认的 WebKit内核切换至 IE内核, 对当前网页进行显示。
以下以第六实施例对本发明进行说明, 设定浏览器为 WebKit/IE双引擎 模式的浏览器, 当然本发明并不限于此, 也适用于多引擎浏览器。 如图 6所 示, 执行如下操作:
步骤 S61 , 建立特征库, 其中保存每种网页内部信息与适配的引擎模式 的对应关系;
网页内部信息, 至少包括: 网页脚本、 网页对象( Object ) 、 Web标准、 网页页面结构、 网页元素数量、 网页元素尺寸;
步骤 S62, 根据各种网页内部信息对各种网页内部信息对应的引擎模式 设置权重;
例如, 按照经验识别网页内部信息的重要程度, 可将网页脚本相应的引 擎模式的权重设置为 3 , 网页对象相应的引擎模式的权重设置为 3 , Web标 准相应的引擎模式的权重设置为 3 , 网页页面结构相应的引擎模式的权重设 置为 2, 网页元素数量相应的引擎模式的权重设置为 1 , 网页元素尺寸相应 的引擎模式的权重设置为 1 , 当然本发明并不限于此;
步骤 S63 , 用户使用浏览器在默认引擎模式下打开一网页, 此时网页已 经打开, 浏览器收集所述网页的至少一种网页内部信息;
一般默认引擎模式会设置为兼容性较差, 但是性能最好的引擎模式, 例 如在实际操作中, 将 WebKit内核作为默认引擎, 当然本发明并不限于此; 步骤 S64, 浏览器根据收集的至少一种网页内部信息结合所述特征库进 行匹配命中;
匹配命中的具体操作可参考步骤 S44;
步骤 S65 , 识别命中的各网页内部信息分别对应的引擎模式, 并结合命 中的各网页内部信息的权重分析出权重最高的一引擎模式;
识别命中的各网页内部信息对应的引擎模式发现, 该网页有两个网页内 部信息对应 IE 内核, 分别是网页脚本和网页对象, 有四个网址属性对应 WebKit内核, 分别是 Web标准、 网页页面结构、 网页元素数量和网页元素 尺寸; 此时结合权重, 分析获知 WebKit内核的权重最高;
步骤 S66, 所述浏览器在所述引擎模式下工作;
所述浏览器保持在默认的 WebKit内核, 对当前网页进行显示。 当然, 浏览器也可以由 WebKit内核切换至 IE内核, 其决定于步骤 S63-S65的收集 分析结果。
需要说明的是, 可以将上述第一部分和第二部分的方案配合使用, 例如 第一实施例与第四实施例配合, 在网页正在打开的阶段执行步骤 S11-S16, 在网页打开之后, 浏览网页的过程中执行步骤 S41-S46, 最终确认适配的引 擎模式并进行切换; 或者第二实施例与第五实施例配合, 在网页正在打开的 阶段执行步骤 S21-S26 , 在网页打开之后, 浏览网页的过程中执行步骤 S51-S56, 最终确认适配的引擎模式并进行切换; 或者第三实施例与第六实 施例配合, 在网页正在打开的阶段执行步骤 S31-S36, 在网页打开之后, 浏 览网页的过程中执行步骤 S61 -S66 , 最终确认适配的 1擎模式并进行切换。 当然也可以第一实施例与第五或者第六实施例配合, 在网页正在打开的 阶段, 根据网址属性, 按引擎模式的优先级进行切换, 在网页打开之后, 浏 览网页的过程中, 根据网页内部信息, 按网页内部信息的优先级或者权重进 行引擎模式切换; 也可以第二实施例与第四或者第六实施例配合, 在网页正 在打开的阶段, 根据网址属性, 按网址属性的优先级进行切换, 在网页打开 之后, 浏览网页的过程中, 根据网页内部信息, 按引擎模式的优先级或者权 重进行引擎模式切换; 也可以第三实施例与第四或者第五实施例配合, 在在 网页正在打开的阶段, 根据网址属性, 按权重进行切换, 在网页打开之后, 浏览网页的过程中, 根据网页内部信息, 按引擎模式的优先级或者权重进行 引擎模式切换。
以下说明第三部分的方案, 在打开网页的过程中或者在已经打开网页 后, 浏览器(主要是浏览器中的切换模块结合特征库) 如何通过地址格式 进行引擎模式切换的。 其可以与第一部分的方案在相同的过程中执行并配合 第二部分的方案的执行, 也可以与第二部分的方案在相同的时机执行并配合 第一部分的方案的执行, 其还可以与第一部分的方案在相同的过程中执行或 者与第二部分的方案在相同的时机执行。 所述特征库还保存服务器的地址格式与适配的引擎模式的对应关系; 浏 览器还收集网页所在服务器的地址, 结合所述特征库切换到适配的引擎模 式, 进一步保证了切换的准确。 例如, 特征库中保存的所述地址格式包括公 共地址和私有地址, 一般私有地址的网页可以认为都是基于 IE 内核的; 浏 览器在默认引擎模式下试图打开一网页的过程中或者已经打开网页时, 收集 所述网页所在服务器的 IP地址为 192.168.*.* , 根据所述 IP地址在所述特征 库中进行命中, 命中所述 IP地址属于私有地址, 则获取对应的引擎模式为 IE内核。
之后可以如上述方式对地址格式设置优先权或者权重或者基于上述引 擎模式的优先权, 并与上述网址属性、 网页内部信息配合, 最终确认适配的 引擎模式并进行切换。 以下说明第四部分的方案, 在打开网页的过程中, 浏览器(主要是浏览 器中的切换模块结合特征库)如何通过网页打开时长进行引擎模式切换的。 其可以与第一部分和 /或第三部分的方案在相同的过程中执行并配合第二部 分的方案的执行; 也可以与第一部分的方案在相同的时机执行并配合第二部 分和第三部分的方案的执行。
所述特征库还保存时长门限; 浏览器在默认引擎模式下打开一网页时, 检测在默认内核下所述网页的打开时长, 结合所述特征库判断, 如果所述时 长超过所述时长门限, 则切换至适配的引擎模式, 否则, 保持在当前引擎模 式; 例如, 所述特征库包含一个时长门限 20秒, 当前网页的打开时间为 30 秒, 网页尚未打开, 超过所述时长门限, 说明此时当前默认内核并不适于这 个网页, 则切换至适配的内核; 如果在 20秒之内所述网页打开, 则保持在 当前引擎模式。
也可以如上述方式对打开时长设置优先权或者权重或者基于上述引擎 模式的优先权, 并与上述网址属性、 网页内部信息、 地址格式配合, 最终确 认适配的引擎模式并进行切换。
上述说明示出并描述了本发明的若干优选实施例, 但如前所述, 应当理 解本发明并非局限于本文所披露的形式, 不应看作是对其他实施例的排除, 而可用于各种其他组合、 修改和环境, 并能够在本文所述发明构想范围内, 通过上述教导或相关领域的技术或知识进行改动。 而本领域人员所进行的改 动和变化不脱离本发明的精神和范围, 则都应在本发明所附权利要求的保护 范围内。
工业实用性
本发明可以有效检测当前网页^^于哪种内核, 从而将浏览器切换至相 应的引擎模式。 首先, 保证了引擎模式切换的准确性, 尤其在网页打开浏览 时出现问题时, 甚至在用户没有发现问题时, 帮助用户智能化地解决问题, 最大限度保证用户使用浏览器正确打开网页; 同时, 在网页打开之前进行快 速识别可以不影响用户的使用, 在保证适配引擎模式的准确性的同时, 使用 户感觉不到切换模式的存在; 另外, 浏览器还依据网页所在服务器的地址和 网页打开速度进行适配, 进一步保证了切换的准确。

Claims

权 利 要 求 书
1. 一种浏览器引擎模式的切换方法, 其特征在于, 包括:
构建特征库, 其中包括每种网页内部信息与适配的引擎模式的对应关 系;
浏览器在当前引擎模式下已打开一网页, 收集所述网页的至少一种网页 内部信息, 结合所述特征库切换到适配的引擎模式。
2. 如权利要求 1所述的切换方法, 其特征在于, 还包括:
所述特征库还包括每种网址属性与适配的引擎模式的对应关系; 所述浏览器在当前引擎模式下打开一网页时, 还收集所述网页的至少一 种网址属性, 结合所述特征库切换到适配的引擎模式。
3. 如权利要求 2所述的切换方法, 其特征在于, 还包括:
所述特征库还包括地址格式与适配的引擎模式的对应关系;
所述浏览器在当前引擎模式下已打开一网页或者正在打开一网页时, 还 收集网页所在服务器的地址, 结合所述特征库切换到适配的弓 ]擎模式。
4. 如权利要求 3所述的切换方法, 其特征在于, 还包括:
所述特征库还包括时长门限;
所述浏览器在当前引擎模式下打开一网页时, 检测所述网页的打开时 长, 如所述时长超过所述时长门限, 则切换至适配的引擎模式, 否则, 保持 在当前引擎模式。
5. 如权利要求 4所述的切换方法, 其特征在于, 结合所述特征库切换到 适配的引擎模式的步骤, 进一步包括:
对所述引擎模式设置优先级,收集所述网页的多种网页内部信息和 /或网 址属性和 /或所在服务器的地址和 /或打开时长并在所述特征库中进行命中, 识别命中的各网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开 时长分别对应的引擎模式中优先级最高的一引擎模式, 所述浏览器在所述引 擎模式下工作。
6. 如权利要求 4所述的切换方法, 其特征在于, 结合所述特征库切换到 适配的引擎模式的步骤, 进一步包括:
对所述各种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打 开时长设置优先级, 按优先级顺序逐一收集所述网页的网页内部信息或网址 属性并和 /或所在服务器的地址和 /或打开时长在所述特征库中进行命中, 如 果命中并匹配到不同于当前引擎模式的引擎模式, 则停止收集并且所述浏览 器切换至所述引擎模式。
7. 如权利要求 4所述的切换方法, 其特征在于, 结合所述特征库切换到 适配的引擎模式的步骤, 进一步包括:
对所述各种网页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打 开时长设置权重, 收集所述网页的多种网页内部信息和 /或网址属性和 /或所 页内部信息和 /或网址属性和 /或所在服务器的地址和 /或打开时长分别对应的 引擎模式, 并结合命中的各网页内部信息和 /或网址属性和 /或所在服务器的 地址和 /或打开时长的权重分析出权重最高的一引擎模式,所述浏览器在所述 引擎模式下工作。
8. 如权利要求 1所述的切换方法, 其特征在于,
当所述网页内部信息至少包括网页脚本时, 所述浏览器检测所述网页启 动的网页脚本, 根据所述网页脚本启动的控件的标识在所述特征库中进行命 中并获取对应的引擎模式。
9. 如权利要求 1所述的切换方法, 其特征在于,
当所述网页内部信息至少包括网页对象时, 所述浏览器检测所述网页试 图调用的对象标识, 根据所述对象标识在所述特征库中进行命中并获取对应 的引擎模式。
10. 如权利要求 1所述的切换方法, 其特征在于,
当所述网页内部信息至少包括 Web标准时,所述浏览器检测与所述网页 标准, 根据所述 Web标准在所述特征库中进行命中并获取对应的引擎模式。
11. 如权利要求 1所述的切换方法, 其特征在于, 当所述网页内部信息至少包括网页页面结构时, 所述浏览器检测与所述 网页相关的文件, 根据所述文件的源代码获取所述网页页面结构, 根据所述
12. 如权利要求 1所述的切换方法, 其特征在于,
当所述网页内部信息至少包括网页元素数量时, 所述特征库包含数量门 限, 所述浏览器检测所述网页元素数量并结合所述特征库判断所述网页元素 数量与数量门限的关系, 根据所述关系获取对应的引擎模式。
13. 如权利要求 1所述的切换方法, 其特征在于,
当所述网页内部信息至少包括网页元素尺寸时, 所述特征库包含尺寸门 素尺寸与尺寸门限的关系, 根据所述关系获取对应的引擎模式。
14. 如权利要求 2所述的切换方法, 其特征在于,
当所述网址属性至少包括网页使用的协议时, 所述浏览器检测所述网页 的网址, 根据所述网址获取所述网页使用的协议在所述特征库中进行命中并 获取对应的引擎模式。
15. 如权利要求 2所述的切换方法, 其特征在于,
当所述网址属性至少包括网页端口时, 所述浏览器检测所述网页端口号 在所述特征库中的标准端口号进行命中并获取对应的引擎模式。
16. 如权利要求 2所述的切换方法, 其特征在于,
当所述网址属性至少包括网页文件的后缀时, 所述浏览器检测所述网页 文件的文件名并获取后缀, 在所述特征库中进行命中并获取对应的引擎模 式。
17. 如权利要求 1所述的切换方法, 其特征在于,
所述网页内部信息 , 为所述浏览器获取所述网页后经过分析得到的。
18. 如以上任一权利要求所述的切换方法, 其特征在于,
所述切换, 包括所述浏览器自动切换和 /或提示用户进行切换。
19. 一种具有引擎模式切换功能的浏览器, 其特征在于, 包括: 浏览 器本体、 切换模块、 特征库, 其中,
所述浏览器本体, 用于在当前引擎模式下打开一网页;
所述切换模块, 用于收集所述网页的至少一种网页内部信息, 结合所 述特征库切换至适配的引擎模式并通知浏览器本体进行加载;
所述特征库, 保存每种网页内部信息与适配的引擎模式的对应关系。
20. 如权利要求 19所述的浏览器, 其特征在于,
所述特征库, 还保存每种网址属性与适配的引擎模式的对应关系; 所述切换模块, 还用于收集所述网页的至少一种网址属性, 结合所述 特征库切换到适配的引擎模式并通知所述浏览器本体进行加载。
21. 如权利要求 20所述的浏览器, 其特征在于,
所述特征库, 还包括地址格式与适配的引擎模式的对应关系; 所述切换模块, 还用于收集网页所在服务器的地址, 结合所述特征库 切换到适配的引擎模式并通知所述浏览器本体进行加载。
22. 如权利要求 21所述的浏览器, 其特征在于,
所述特征库, 还包括时长门限;
所述切换模块, 还用于检测所述网页的打开时长, 如所述时长超过所 述时长门限, 则切换至适配的引擎模式并通知所述浏览器本体进行加载。
PCT/CN2012/070842 2011-02-28 2012-02-02 一种浏览器引擎模式的切换方法及浏览器 Ceased WO2012116589A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/002,032 US20130339842A1 (en) 2011-02-28 2012-02-02 Browser-engine mode switching method and browser

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201110047803.9 2011-02-28
CN201110047803.9A CN102156709B (zh) 2011-02-28 2011-02-28 一种浏览器引擎模式的切换方法

Publications (1)

Publication Number Publication Date
WO2012116589A1 true WO2012116589A1 (zh) 2012-09-07

Family

ID=44438208

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/070842 Ceased WO2012116589A1 (zh) 2011-02-28 2012-02-02 一种浏览器引擎模式的切换方法及浏览器

Country Status (3)

Country Link
US (1) US20130339842A1 (zh)
CN (1) CN102156709B (zh)
WO (1) WO2012116589A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160283606A1 (en) * 2013-09-17 2016-09-29 Beijing Qihoo Technology Company Limited Method for performing webpage loading, device and browser thereof

Families Citing this family (35)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102156709B (zh) * 2011-02-28 2020-01-03 奇智软件(北京)有限公司 一种浏览器引擎模式的切换方法
CN103019832B (zh) * 2011-09-20 2016-08-31 百度在线网络技术(北京)有限公司 浏览器的切换控制方法及装置
CN102314516B (zh) * 2011-09-22 2014-07-09 惠州Tcl移动通信有限公司 网页处理方法及其移动终端、电子设备
CN102508710B (zh) * 2011-09-28 2014-01-01 奇智软件(北京)有限公司 一种ie6内核与新型ie内核的切换方法和系统
CN103067423B (zh) * 2011-10-20 2015-10-14 腾讯科技(深圳)有限公司 浏览器内核适配的方法和浏览器
CN103164423B (zh) * 2011-12-09 2017-11-03 百度在线网络技术(北京)有限公司 一种用于确定渲染网页的浏览器内核类型的方法与设备
CN105610870B (zh) * 2012-02-10 2019-08-20 北京奇虎科技有限公司 多账号登录方法及装置
CN102624891B (zh) * 2012-03-08 2014-03-26 腾讯科技(深圳)有限公司 网页浏览装置的切换内核方法及对应的网页浏览装置
CN103389912A (zh) * 2012-05-09 2013-11-13 阿里巴巴集团控股有限公司 一种浏览器内核切换方法、系统与装置
CN103514175A (zh) * 2012-06-18 2014-01-15 联想(北京)有限公司 一种浏览器访问网站的信息处理方法和电子设备
CN103678340B (zh) * 2012-09-07 2016-09-14 腾讯科技(深圳)有限公司 浏览器引擎的运行方法、装置、浏览器及终端
CN102968341B (zh) * 2012-10-25 2016-09-28 北京奇虎科技有限公司 基于多内核浏览器的不同版本ie内核切换的方法和装置
CN102968448B (zh) * 2012-10-25 2016-09-28 北京奇虎科技有限公司 一种浏览器
US9098228B2 (en) * 2013-01-02 2015-08-04 International Business Machines Corporation Determining content rendering capabilities for web browser optimization
CN103324735A (zh) * 2013-06-28 2013-09-25 贝壳网际(北京)安全技术有限公司 浏览器中异常页面的加载方法、装置和客户端
WO2015014189A1 (zh) * 2013-08-02 2015-02-05 优视科技有限公司 一种访问网站的方法及装置
CN103414770B (zh) * 2013-08-05 2016-12-28 贝壳网际(北京)安全技术有限公司 文件下载方法及装置、文件下载建议方法及装置
CN103500210A (zh) * 2013-09-27 2014-01-08 北京奇虎科技有限公司 一种进行网页加载的方法、装置和浏览器
US9639511B2 (en) * 2014-11-24 2017-05-02 Google Inc. Systems and methods for editing a file in a non-native application using an application engine
US9734136B1 (en) 2014-12-05 2017-08-15 Intuit Inc. Methods, systems, and articles of manufacture for rendering internet contents on different displays of mobile devices
CN104615670A (zh) * 2015-01-16 2015-05-13 百纳(武汉)信息技术有限公司 一种android浏览器中支持多渲染引擎的方法及浏览器
CN106354484A (zh) * 2015-07-16 2017-01-25 中兴通讯股份有限公司 一种浏览器兼容方法及浏览器
CN105224592B (zh) * 2015-08-24 2018-09-11 北京金山安全软件有限公司 提高浏览器兼容性的方法、装置和电子设备
CN107045501A (zh) * 2016-02-05 2017-08-15 腾讯科技(深圳)有限公司 一种网页访问方法和装置
CN107291916A (zh) * 2017-06-28 2017-10-24 上海尚工机器人技术有限公司 网络信息整合引擎
CN110020338B (zh) * 2017-08-17 2022-10-28 腾讯科技(深圳)有限公司 浏览器、网页打开方法及设备
US10693974B2 (en) * 2017-09-28 2020-06-23 Citrix Systems, Inc. Managing browser session navigation between one or more browsers
CN107894983A (zh) * 2017-11-08 2018-04-10 深圳市沃特沃德股份有限公司 引擎的切换方法与装置
CN109684584B (zh) * 2018-11-15 2020-02-11 北京海泰方圆科技股份有限公司 一种浏览器内核的智能切换方法、装置、终端及存储介质
US11442599B2 (en) 2019-06-07 2022-09-13 Microsoft Technology Licensing, Llc Systems and methods for hosting a browser within another browser
CN110719274B (zh) * 2019-09-29 2022-10-04 武汉极意网络科技有限公司 网络安全控制方法、装置、设备及存储介质
CN112988410B (zh) * 2019-12-17 2024-09-10 深圳市雅阅科技有限公司 浏览器扩展接口的调用方法、装置、终端及存储介质
CN111666249B (zh) * 2020-05-11 2024-02-09 上海连尚网络科技有限公司 一种在阅读应用中获取目标阅读模式的方法与设备
US11893199B2 (en) * 2020-06-10 2024-02-06 Microsoft Technology Licensing, Llc Systems and methods for viewing incompatible web pages via remote browser instances
CN115470426B (zh) * 2022-09-02 2023-07-21 北京海泰方圆科技股份有限公司 浏览器内核确定方法、装置、计算机设备和存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504650A (zh) * 2009-01-15 2009-08-12 北京傲游天下科技有限公司 一种智能网络解释引擎切换方法
CN101655863A (zh) * 2009-04-24 2010-02-24 北京搜狗科技发展有限公司 在浏览器中加载网页的方法及浏览器
CN102156709A (zh) * 2011-02-28 2011-08-17 奇智软件(北京)有限公司 一种浏览器引擎模式的切换方法

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6433794B1 (en) * 1998-07-31 2002-08-13 International Business Machines Corporation Method and apparatus for selecting a java virtual machine for use with a browser
US7254526B2 (en) * 2001-08-24 2007-08-07 International Business Machines Corporation Apparatus and method for determining compatibility of web sites with designated requirements based on functional characteristics of the web sites
US7496847B2 (en) * 2004-04-29 2009-02-24 International Business Machines Corporation Displaying a computer resource through a preferred browser
US20060161503A1 (en) * 2005-01-18 2006-07-20 Andrei Popescu Budget browsing method, system, apparatus, and software product
US7996778B2 (en) * 2006-05-18 2011-08-09 Dell Products L.P. Central internet browser control for multiple browsers enabled system
US20080189593A1 (en) * 2006-11-20 2008-08-07 Tim Baker System and method for enabling flash playback of MP3 files available on a web page
US8225227B2 (en) * 2007-01-19 2012-07-17 Microsoft Corporation Managing display of user interfaces
US7818681B2 (en) * 2007-06-28 2010-10-19 International Business Machines Corporation Method and system for internally identifying a specific web browser for displaying a specific web page
US8321798B2 (en) * 2007-06-28 2012-11-27 International Business Machines Corporation Containing and accessing multiple web browsers
US8266635B2 (en) * 2007-12-20 2012-09-11 Access Co., Ltd. Browser-based user interface and control architecture with priority attributes
US8887039B2 (en) * 2008-01-02 2014-11-11 Microsoft Corporation Web page based program versioning
US20090315894A1 (en) * 2008-06-18 2009-12-24 Microsoft Corporation Browser-independent animation engines
CN102823197B (zh) * 2010-03-05 2015-02-04 泰克莱克股份有限公司 用于增强的服务检测和策略规则确定的方法、系统和计算机可读介质

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504650A (zh) * 2009-01-15 2009-08-12 北京傲游天下科技有限公司 一种智能网络解释引擎切换方法
CN101655863A (zh) * 2009-04-24 2010-02-24 北京搜狗科技发展有限公司 在浏览器中加载网页的方法及浏览器
CN102156709A (zh) * 2011-02-28 2011-08-17 奇智软件(北京)有限公司 一种浏览器引擎模式的切换方法

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160283606A1 (en) * 2013-09-17 2016-09-29 Beijing Qihoo Technology Company Limited Method for performing webpage loading, device and browser thereof

Also Published As

Publication number Publication date
CN102156709A (zh) 2011-08-17
CN102156709B (zh) 2020-01-03
US20130339842A1 (en) 2013-12-19

Similar Documents

Publication Publication Date Title
CN102156709B (zh) 一种浏览器引擎模式的切换方法
US9235451B2 (en) Browser kernel switching method
CN106503134B (zh) 浏览器跳转至应用程序的数据同步方法及装置
CN102968341B (zh) 基于多内核浏览器的不同版本ie内核切换的方法和装置
US10241846B2 (en) Enabling a web application to call at least one native function of a mobile device
CN102855318B (zh) 网页预加载方法与系统
CN103176844B (zh) 一种ie6内核与新型ie内核的切换方法和系统
CN106294372B (zh) 应用程序页面快速访问方法及应用其的移动终端
CN103810176B (zh) 一种网页信息的预取访问方法和装置
CN106528659B (zh) 浏览器跳转至应用程序的控制方法及装置
WO2013044744A1 (zh) 一种下载资源提供方法及装置
WO2013097592A1 (zh) 脚本加载技术
WO2014032237A1 (zh) 网页应用程序的管理方法和装置
WO2014101486A1 (zh) 浏览器中插件的播放方法及装置
WO2012094965A1 (zh) 提示消息呈现方法、终端和服务器
CN102662837A (zh) 一种浏览器的测试方法和系统
CN102968448B (zh) 一种浏览器
WO2014169766A1 (zh) 通过网页调用客户端处理计算机故障的方法及装置
CN103810086B (zh) 使浏览器崩溃的网址的处理方法、装置及系统
US20180129804A1 (en) Threat detection method and apparatus, and network system
JP5112401B2 (ja) Web行動履歴取得システム、Web行動履歴取得方法、ゲートウェイ装置、及びプログラム
CN106649497A (zh) 一种网页展示方法及装置
CN102750285B (zh) 提供离线浏览的系统及其方法
CN114089997B (zh) 页面栈的处理方法和装置、存储介质及电子装置
US11115462B2 (en) Distributed system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12752716

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 14002032

Country of ref document: US

122 Ep: pct application non-entry in european phase

Ref document number: 12752716

Country of ref document: EP

Kind code of ref document: A1