[0047] In order to make the above objects, features and advantages of the present invention more clearly understood, the present invention will be described in further detail below with reference to the accompanying drawings and specific embodiments.
[0048] see figure 1 , the method for loading a webpage provided by the embodiment of the present invention includes the following steps:
[0049] S101: Receive the input information input by the user in the address bar;
[0050]The input information refers to any information input by the user, such as English, numbers, Chinese, and the like. The input information can be a web address that can fully express a web page, but this embodiment is mainly aimed at most cases where the input is in the address bar, that is, when the input information cannot fully express its actual web address, even if the user does not remember a web page. If you can only remember the relevant information of some webpages, a follow-up inference mechanism is used to obtain a website that the user is most likely to visit according to the existing input, and the webpage corresponding to the website is loaded in advance.
[0051] S102: Before the user determines to enter a certain webpage, infer the website that best matches the user's current input according to the input information currently input by the user in the address bar; and use the background browsing mode to load the webpage corresponding to the website that best matches the user's current input . The so-called background browsing mode loading means that the loaded web page content is invisible to the foreground user, and is completely background operation.
[0052] Step S101 provides a basis for real-time dynamic analysis of the input information, monitors changes in the input information, and especially determines whether the input information includes more valid information, and provides it to the subsequent step S102. For example, when the user only inputs an "s", it is determined that the website that the user wants to visit may be www.sina.com.cn, or it may be www.sohu.com. Next, judge whether the input content includes more valid information. For example, the user input "o" again. After receiving the input information such as "so", the www.sina.com.cn that was originally considered valid can be removed. such a URL. The valid information referred to here is actually the second letter "o" entered here.
[0053] The legitimacy of the input information can be analyzed first, and then the web address that the user is most likely to input based on the current input can be analyzed, and the web address can be loaded in advance. However, since it cannot be completely determined whether the obtained most matching URL is the same as the URL finally input by the user, the present invention adopts the background browsing mode for loading, that is, this form of browsing does not include a user interface and the user cannot intervene.
[0054] Since the URL that best matches the user's current input is inferred based on the user's current input, as the information input by the user changes (such as the addition or modification of input characters, etc.), the inferred current best-matching URL may be changes will occur, so in a preferred embodiment of the present invention, inferring the website that best matches the current input of the user according to the input information currently input by the user in the address bar includes the following steps:
[0055] If the change in the input information input by the user in the address bar causes the inferred web address that best matches the user's current input to change from the first web address to the second web address, then the web address that best matches the user's current input is the second web address;
[0056] The loading the web page corresponding to the web address that most matches the user's current input by using the background browsing mode includes: stopping using the background browsing mode to load the web page corresponding to the first web address, and using the background browsing mode to load the web page corresponding to the second web address. .
[0057] For example, the user currently enters the input information "so" in the address bar, and according to the current input, it is inferred that the most matching URL for the user is "www.sohu.com" (ie, the first URL), so the background mode is used to load the URL. The corresponding web page; however, the next character input by the user is "g", then the most matching URL is inferred to become "www.sogou.com" (ie, the second URL) according to the "sog" currently input by the user. , the embodiment of the present invention will stop using the background browsing mode to load the webpage corresponding to "www.sohu.com", and at the same time, start using the background browsing mode to load the webpage corresponding to "www.sogou.com".
[0058] Of course, if the inferred best-matching URL does not change with the change of the user's input information, then naturally the above-mentioned situation that different webpages need to be loaded when the background browsing mode is used will not occur.
[0059] The browsing in the background mode is performed when the website information input by the user is not complete, or when the website information is complete but the user has not yet determined to enter the webpage. When the user determines to enter a certain webpage by clicking the OK button (or hitting the "Enter" key or directly selecting a URL from the drop-down list of the address bar), etc., it can be determined that the last URL actually input by the user matches the inferred current best match Whether the URL is the same, if it is the same, change the background browsing mode to the foreground browsing mode, keep the process that has been completed in the background mode (that is, keep the relevant content of the webpage that has been downloaded during the background browsing mode), and use the foreground browsing mode to continue. Browse the page for that best matching URL. The web address actually input by the user in the address bar includes the web address input by the user character by character, and the web address selected by the user from the drop-down list of the address bar during the input process of the address bar. Of course, in a preferred embodiment of the present invention, if the website actually input by the user does not exactly match the website browsed in the background, the webpage corresponding to the website actually input by the user can be loaded in the foreground browsing mode. Optionally, In order to save unnecessary system resources, background browsing can also be stopped in time, and the allocated resources can be destroyed. It can be seen that the entire process of preloading in the embodiment of the present invention does not reduce the browsing content for the user compared with the common browsing with a user interface commonly used by the user. The background browsing mode is preloaded, so if the preloaded web page is the same as the web page that the user has determined to enter, the speed of opening the web page experienced by the user is greatly improved.
[0060] It can be seen that in this embodiment of the present invention, when the user starts to input information in the address bar, according to the input information input by the user, it is inferred that the user is most likely to input the website address based on the input information currently input in the address bar, that is, the URL that is most likely to be input by the user based on the input information currently input in the address bar The most matching URL, and then load the web page corresponding to the most matching URL in advance, so that the user can browse to the desired web page faster after entering the address bar, thus saving the time from the user determining to enter a certain web page to being able to provide the user with The time required to actually display the web page (that is, to enable the user to browse to the web page) accelerates the speed of opening the web page from the user experience.
[0061] In addition, when a client requests to browse a web page, the requested content can be obtained from the following places: the server, the browser cache or the cache server, depending on the web page information output by the server. There are three cache states for web files:
[0062] Up-to-date: Choose not to cache the web page and fetch the latest content from the server each time it is requested.
[0063] Unexpired: cached within a given time, if the user refreshes or the page expires, it will go to the server to request, otherwise, the local cache will be read, which can improve the browsing speed.
[0064] Expired: That is, stale web pages that must be re-fetched when the web page is requested.
[0065] Therefore, in this embodiment of the present invention, after obtaining the web address that best matches the input information currently input by the user in the address bar, the background starts to browse the web page corresponding to the web address, including sending a request to the server (that is, downloading the web page as described above). Relevant content), request non-expired web page elements from the local hard disk cache (that is, query the local cache as mentioned above) and source file parsing, but because the user interface is not included in the background browsing mode, it is not necessary to render related web page elements temporarily. step. When the user determines to enter a certain webpage, if the actual URL entered by the user in the address bar (that is, the URL corresponding to the webpage that the user determines to enter) is the same as the inferred current best matching URL, then the foreground browsing mode is used instead to load the webpage. Then perform the step of rendering the relevant web page elements.
[0066] In the general process of browsing web pages, the order of downloading is from top to bottom, the order of rendering is also from top to bottom, and the downloading and rendering are performed at the same time. When rendering to a certain part of a web page, all parts above it need to be downloaded. During the download process, if a tag is encountered, it is an embedded file, and the file is semantically interpretable (for example: JS script, CSS style), then the browser's download process will enable a separate connection for download. And in the process of parsing after downloading, during the parsing process (if there is redefinition in JS and CSS, the post-defined function will overwrite the pre-defined function), the download of all the downward elements of the web page is stopped. The style sheet file is special. After it is downloaded, it will be parsed together with all previously downloaded style sheets. After the parsing is completed, all previous elements (including those that have been rendered before) will be re-rendered in style. And continue to render in this way until the rendering of the relevant elements of the entire webpage is completed.
[0067] In the present invention, the rendering of web page related elements can be started only after switching to the foreground browsing mode. Since part of the downloading and parsing process has been completed in the background mode, the downloading and parsing process and the rendering process are separated in time. It greatly reduces the intersection of the two processes in time, thus avoiding the conflict between the two processes, and greatly reducing the possibility of repeated rendering. It can be seen that the present invention starts from the perspective of time allocation, optimizes the efficiency of computer hardware. Of course, it is also possible to perform the step of rendering relevant webpage elements while loading the webpage in the background browsing mode, but the rendered webpage may not be displayed to the user for the time being.
[0068] In practical applications, the step of obtaining the URL that best matches the user input can be implemented in various ways. For example, searching in a network search engine server or a local browsing history database, or a combination of the two can be used. Search, etc., are described in detail below.
[0069] After receiving the input information entered by the user in the address bar, it can analyze whether the input information is legal and what type of input information (including but not limited to English URL, Chinese URL, and webpage title), and can be based on different types of input information. Choose to request a web search engine server or a local browsing history database for the URL that best matches the user's current input. The result returned by the network search engine server or the local browsing history database is a list of possible matching URLs, and a most likely URL is selected from the list to initiate a hidden background browsing command for the URL. At the same time, a list of URLs arranged in priority order can also be displayed for the user to select, so as to save the time for the user to input letter by letter.
[0070] Of course, it is also possible to initiate a request to the network search engine server and the local browsing history database at the same time. The network search engine server and the local browsing history database can obtain a list of matching URLs according to their own judgment logic according to the matching degree of the input information, and can be based on all users. For the click habits of the same keywords, the matching degree of the URL to the input information is obtained, and the matching degree is marked. Then according to the matching degree and the coincidence degree of the two returned results, deduplication and prioritization are performed, and a most Possibly the URL that the user actually entered.
[0071] Among them, the input information that the web search engine server can receive is not limited by type, as long as the input information is legal, it can be searched on the web search engine server, and according to the existing user browsing behavior in the database, the best matching URL list is obtained and returned. the list.
[0072] The local browsing history database stores a collection of URLs that users have visited. The input received and the output returned are the same as the web search engine server, but the search scope is limited to the web pages that the browser has browsed. Compared with the massive amount of Internet data and information, since only the relevant information of the webpages that the machine has browsed is recorded, the effective amount of information is small. However, the advantage of this kind of search is that it is not limited by bottlenecks such as abnormal network and low artificial intelligence in machine search, and can be based on the browsing behavior of the user in the local browsing history database (frequency of browsing a certain webpage, time of browsing a certain webpage recently, etc. ) to determine the matching degree of each URL. Since the user's own historical browsing behavior has higher reliability for the judgment of the matching degree, the matching accuracy is higher and faster.
[0073] Corresponding to the method for loading a web page described in the present invention, an embodiment of the present invention also provides a device for loading a web page, see figure 2, the device includes:
[0074] Input information receiving unit U201, for receiving input information input by the user in the address bar;
[0075] The URL matching unit U202 is used to infer the URL that best matches the current input of the user according to the input information currently input by the user in the address bar before the user determines to enter a certain webpage;
[0076] The webpage loading unit U203 is configured to use a background browsing mode to load the webpage corresponding to the current most matching website before the user determines to enter a certain webpage.
[0077] The input information receiving unit U201 receives the input information input by the user in the address bar, including but not limited to English, Chinese, numbers, etc., whenever the input input information changes, especially after receiving more valid information in the input information, The content of the input information in the address bar is passed to the URL matching unit U202, and the URL matching unit U202 infers according to the input information currently input by the user in the address bar before the user determines to enter a certain webpage, and obtains the current input information of the user. The most matching URL is sent to the web page loading unit U203, and a hidden background browsing mode browsing command is sent to the webpage loading unit U203. Since the browsing in the background browsing mode does not include a user interface, the loading process may only include the steps of downloading the relevant content of the webpage, querying the local cache, and analyzing the source file, but not rendering the relevant webpage elements for the time being. Of course, it is also possible to perform the step of rendering relevant webpage elements while loading the webpage in the background browsing mode, but the rendered webpage may not be displayed to the user for the time being.
[0078] As the information entered by the user changes, the inferred current best matching URL may change, so if the input information entered by the user in the address bar changes, whether the inferred best matching URL with the user's current input is determined by the first When a website becomes a second website, the second website is the website that best matches the current input of the user; therefore, the webpage loading unit U303 is specifically configured to stop using the background browsing mode to load the website before the user determines to enter a certain webpage. For the web page corresponding to the first web address, the web page corresponding to the second web address is loaded in a background browsing mode.
[0079] see image 3 , in practical applications, the device may also include a control unit U304, after the user inputs the complete web address information, the control unit U304 determines whether the web address actually input by the user is the same as the most matching web address; if the same, triggers the web page loading unit U303 turns to use the foreground browsing mode to continue loading the webpage corresponding to the current best-matched URL, and the completed process in the background browsing mode continues to be retained.
[0080] In the embodiment of the present invention, if the URL actually input by the user is different from the current best matching URL, the control unit U304 triggers the web page loading unit U303 to start loading the web page corresponding to the URL actually input by the user in the foreground browsing mode. Optionally, in order to avoid unnecessary waste of system resources, in the above case, the control unit U304 may also trigger the web page loading unit U303 to stop loading the web page corresponding to the currently most matching URL, and destroy the allocated resources.
[0081] It can be seen that the entire process of preloading in the embodiment of the present invention does not reduce the browsing content for the user compared with the common browsing with a user interface commonly used by the user. The background browsing mode is preloaded, so if the preloaded web page is the same as the web page that the user has determined to enter, the speed of opening the web page experienced by the user is greatly improved.
[0082] The URL matching unit U302 can obtain the URL that best matches the user's current input in various ways, for example, see Figure 4 , the URL matching unit U402 may include the following two subunits:
[0083] The search subunit U4021 is used to search the valid information in the current input information as a keyword;
[0084] The selection subunit U4022 is configured to obtain the web address that best matches the user's current input according to the search result.
[0085] In practical applications, the search subunit U4021 may send a search request to the network search engine server and the local browsing history database respectively; the network search engine server and the local browsing history database search for matching URLs, which are respectively each URL Mark the matching degree, and return the URL list matching the current input information to the search subunit U4021; the selection subunit U4022 analyzes the degree of coincidence of the two matching URL lists, and according to the matching degree of each URL in the two lists to get the URL that best matches the user's current input.
[0086] Wherein, the network search engine server can receive any input information. In practical applications, the search subunit U4021 can also only send a search request to the search engine server; A list of URLs that match the information to get the URL that best matches the user's current input. For example, the highest matching URL in the list can be selected as the URL that best matches the user's current input.
[0087] Although the objects that can be queried in the local browsing history database are limited to historical records, it has the advantages of not being restricted by bottlenecks such as network anomalies, low machine search artificial intelligence, and higher matching accuracy and faster. When the currently input input information is content such as an English website address or a webpage title, the search subunit U4021 may also only send a search request to the local browsing history database, and the analysis subunit U4022 returns according to the local browsing history database and the current input information A list of matching URLs to get the URL that best matches the user's current input.
[0088] The above-mentioned apparatus for loading a webpage may be implemented in a browser, that is, an existing browser may be enabled to implement the function of webpage preloading.
[0089] The method and device for loading web pages provided by the present invention are described above in detail. The principles and implementations of the present invention are described in this paper by using specific examples. The descriptions of the above embodiments are only used to help understand the present invention. At the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In conclusion, the contents of this specification should not be construed as limiting the present invention.