CN107045546B - Webpage processing method and device and intelligent terminal - Google Patents

Webpage processing method and device and intelligent terminal Download PDF

Info

Publication number
CN107045546B
CN107045546B CN201710209838.5A CN201710209838A CN107045546B CN 107045546 B CN107045546 B CN 107045546B CN 201710209838 A CN201710209838 A CN 201710209838A CN 107045546 B CN107045546 B CN 107045546B
Authority
CN
China
Prior art keywords
page
display
loading
data
request
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.)
Active
Application number
CN201710209838.5A
Other languages
Chinese (zh)
Other versions
CN107045546A (en
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 Cheetah Mobile Technology Co Ltd
Original Assignee
Beijing Cheetah Mobile 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 Cheetah Mobile Technology Co Ltd filed Critical Beijing Cheetah Mobile Technology Co Ltd
Priority to CN201710209838.5A priority Critical patent/CN107045546B/en
Publication of CN107045546A publication Critical patent/CN107045546A/en
Application granted granted Critical
Publication of CN107045546B publication Critical patent/CN107045546B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The embodiment of the invention discloses a webpage processing method, a webpage processing device and an intelligent terminal, wherein the method comprises the following steps: when a page request is received, acquiring an object identifier of a target object in a page requested by the page request; acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request; loading the object data based on a preset first page template, and loading the page data based on a preset second page template; and displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data. By adopting the embodiment of the invention, the user can conveniently and quickly view the webpage to a certain extent.

Description

Webpage processing method and device and intelligent terminal
Technical Field
The invention relates to the technical field of computer application, in particular to a webpage processing method and device and an intelligent terminal.
Background
With the development of computer technology and network technology, users can basically view various web pages anytime and anywhere through an intelligent terminal in hand. The intelligent terminals can be terminals with network functions and display functions, such as smart phones, tablet computers, intelligent wearable devices and the like.
When viewing web pages, for example news pages, these intelligent terminals can load and view the web pages using WebView (which can be understood as a simple browser). Among other things, news source web pages typically have many elements including news, advertisements, various related links, etc. And the main purpose of the user is to see part of the object content, such as a news part, loading other object content (such as advertisements, etc.) wastes the loading time of the user, and the viewing efficiency of the user on the page content is reduced.
Disclosure of Invention
The embodiment of the invention provides a webpage processing method, a webpage processing device and an intelligent terminal, which can facilitate a user to check a webpage more quickly to a certain extent.
In a first aspect, an embodiment of the present invention provides a web page processing method, including:
when a page request is received, acquiring an object identifier of a target object in a page requested by the page request;
acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request;
loading the object data based on a preset first page template, and loading the page data based on a preset second page template;
and displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data.
Optionally, the displaying the target page includes: displaying a second display page as a target page; if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
Optionally, the method further includes: displaying a first switching button, and determining that a first switching display instruction is received when the triggering operation of the first switching button is detected.
Optionally, the method further includes: after the first display page is used as a target page for display processing, if a second switching display instruction is received, invisible processing is carried out on the displayed first display page; and performing display processing by taking the second display page as a target page.
Optionally, the displaying the target page includes: displaying a second display page as a target page; if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
Optionally, the method further includes: displaying a first progress bar, wherein the initial progress information for loading the page data is displayed on the first progress bar; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar; and displaying progress information used for representing the actual progress value on the second progress bar.
Optionally, when receiving a page request, obtaining an object identifier of a target object in a page requested by the page request further includes: when a page request is received, determining the type of a page requested by the page request; if the determined type is the specified page type, acquiring an object identifier of a target object in the page requested by the page request; and if the determined type is not the specified page type, directly acquiring the page data of the page requested by the page request.
Optionally, the method further includes: newly building a first display page for loading object data, and newly building a second display page for loading page data; and setting the first display page and the second display page to be in an invisible state.
Optionally, the method further includes: after the second display page is used as a target page for display processing, if the first display page is determined to have errors in loading the object data, displaying and displaying a second switching button, and performing invisible processing on the displayed first display page when the triggering operation of the second switching button is detected; and performing display processing by taking the second display page as a target page.
Optionally, the method further includes: when the callback request is checked, determining whether a page requested to be opened by the callback request is the same as a page requested by the page request; if not, further determining whether the page data and the object data are completely loaded; and if the loading is finished, responding to the callback request to perform callback processing.
In a second aspect, an embodiment of the present invention further provides a web page processing apparatus, including:
the identification acquisition module is used for acquiring the object identification of a target object in a page requested by a page request when the page request is received;
the data acquisition module is used for acquiring the object data of the object indicated by the object identifier and acquiring the page data of the page requested by the page request;
the data loading module is used for loading the object data based on a preset first page template and loading the page data based on a preset second page template;
and the display module is used for displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data.
Optionally, the display module is specifically configured to display a second display page as a target page; if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
Optionally, the display module is further configured to display a first switching button, and determine that a first switching display instruction is received when a trigger operation on the first switching button is detected.
Optionally, the display module is further configured to perform, after performing display processing on the first display page as a target page, perform invisible processing on the displayed first display page if a second display switching instruction is received; and performing display processing by taking the second display page as a target page.
Optionally, the display module is configured to display a second display page as a target page; if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
Optionally, the display module is further configured to display a first progress bar, where the first progress bar displays initial progress information for loading the page data; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar; and displaying progress information used for representing the actual progress value on the second progress bar.
Optionally, the apparatus may further include: the identification acquisition module is used for determining the type of a page requested by a page request when the page request is received; and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request.
Optionally, the apparatus may further include: the configuration module is used for newly building a first display page for loading object data and a second display page for loading page data; and setting the first display page and the second display page to be in an invisible state.
Optionally, the display module is further configured to, after performing display processing on the second display page as a target page, if it is determined that loading of the object data by the first display page is erroneous, display a second switch button, and perform invisible processing on the displayed first display page when detecting a trigger operation on the second switch button; and performing display processing by taking the second display page as a target page.
Optionally, the apparatus may further include: the processing module is used for determining whether a page requested to be opened by the callback request is the same as a page requested by the page request when the callback request is checked; if not, further determining whether the page data and the object data are completely loaded; and if the loading is finished, responding to the callback request to perform callback processing.
In a third aspect, an embodiment of the present invention further provides an intelligent terminal, including: a user interface and a processor;
the user interface is used for receiving a page request, and the page request is used for requesting to open a webpage;
the processor is used for acquiring the object identification of the target object in the page requested by the page request; acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request; loading the object data based on a preset first page template, and loading the page data based on a preset second page template; and displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data.
In a fourth aspect, an embodiment of the present invention provides a storage medium, where the storage medium is used to store an application program, and the application program is used to execute, when running, the web page processing method according to the first aspect of the embodiment of the present invention.
In a fifth aspect, an embodiment of the present invention provides an application program product, where the application program is configured to execute, when running, the web page processing method according to the first aspect of the embodiment of the present invention.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for processing a web page requested by a user according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a method for processing a web page according to an embodiment of the present invention;
FIG. 3 is a flowchart illustrating another method for processing a web page according to an embodiment of the invention;
FIG. 4 is a schematic structural diagram of a web page processing apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention.
Detailed Description
In the embodiment of the present invention, for some specified types of pages requested to be opened by a user, a background server may be configured to perform special processing on the requested specified types of pages, extract a part of content in the specified types of pages, load object data corresponding to the extracted content in a first display page, and load original webpage data of the specified types in a second display page. Only the first display page or only the second display page is displayed according to the needs of the user; or the first display page and the second display page are respectively displayed in a split screen mode and the like.
In general, the original webpage can be preferentially selected to be displayed to the user, but since the first display page which only displays part of the content is faster when the object data of the part of the content is loaded, the intelligent terminal can select the page to be displayed currently according to the loading progress of the second display page. If the progress of loading the original webpage data in the second display page within the preset time range exceeds a preset threshold value, for example, exceeds 90%, the second display page is selected to be displayed, and if the progress does not exceed the preset threshold value, the first display page is selected to be displayed.
The first display page can be preferentially selected to be displayed to the user, and the second display page is selected to be displayed in a switching mode if a switching instruction is received. On the contrary, the second display page can be preferentially selected to be displayed to the user, and when the switching instruction is received, the first display page is selected to be switched and displayed.
A switching button may be provided on a display page that is preferentially displayed (a first display page that is preferentially displayed or a second display page that is preferentially displayed), and it may be determined that a switching instruction is received when a user's trigger operation on the switching button is received. And switching buttons are arranged on the first display page and the second display page, so that the other display page opposite to the first display page can be switched and displayed after the switching button on the currently displayed display page is clicked.
In one embodiment, two WebViews can be created, and the server is requested to extract and send down the object data of the content object on the original webpage before loading the page data of the original webpage. And when the server returns the object data, filling a local page by using one WebView in the object data, but not displaying the local page. And simultaneously loading the page data of the original webpage by using another webpage and displaying the process. When the original webpage is displayed too slowly, the user can switch the local page, and the local page can be immediately displayed after being filled.
Fig. 1 is a schematic flow chart of a method for processing a web page requested by a user according to an embodiment of the present invention, where the method according to the embodiment of the present invention may be executed by various types of intelligent terminals, and the intelligent terminals have a network function, can initiate a page request and also request to open a web page, and have a touch screen and the like for displaying a page after data loading, and receive an operation of the user. The method comprises the following steps.
S101: and judging whether to carry out multi-page loading or not. The method specifically comprises the steps of judging whether a page requested by a user supports a multi-page loading mode or not and judging whether the terminal starts the multi-page loading mode or not. The multi-page load mode may be, for example, an instant show InstantView mode. When it is determined that the page requested by the user is the page of the specified type that supports the multi-page loading mode and the terminal opens the multi-page loading mode, S102 described below is performed. Otherwise, S111 described below is executed. The type of the requested webpage can be analyzed and identified by the webpage server according to the content and/or source of the webpage, and a type tag is generated and returned to the terminal, so that the terminal can determine whether the page requested by the user is the page of the specified type or not based on the type tag. Of course, the terminal may also perform analysis according to the data content and the source of the requested page to determine the type of the requested page.
S102: two WebViews are newly built, the newly built WebViews are set to be in an invisible state, and specifically, a parameter setViewality (GONE) in the WebView can be set.
S103: and obtaining the ID of the target object on the requested page, and sending a content request comprising the ID to the server. And simultaneously displaying a virtual progress bar, and setting an initial value of the progress bar, wherein at the moment, the terminal sends a content request to the server through the background and waits for a response. The server is configured to extract part of the object content from the original webpage and return the object content to the terminal for initiating the content request limit. For example, the server may extract only the content of the news body part from the news original webpage and send the content to the terminal. The ID of a target object (e.g. an original news object) in the requested page is issued by a server of the web page, the terminal stores the ID of one or more target objects such as the original news object, and after the terminal selects a certain target object such as the original news object, the terminal finds the ID of the target object selected by the user and initiates a request to the server for acquiring the object data of the target object.
S104: and loading a local javascript template by using one of the two newly-built WebViews to prepare for analyzing the object data to be returned. In the embodiment of the present invention, the WebView loaded with the object data may be referred to as InstantWebView (or referred to as a first display page).
S105: and when the server returns the object data within the preset time, the instantWebView analyzes and fills the data.
S106: for the page data of the original webpage acquired by responding to the user request, starting to automatically load the page data of the original webpage by using another WebView, wherein the WebView loading the page data of the original webpage can be called as a Source WebView (or called as a second display page). The above InstantWebView is still invisible. In one embodiment, after the page data of the original webpage is analyzed and filled, a button for switching InstantWebView is added on a SourceWebView interface.
S107: and displaying the progress bar in the process of loading the page data of the original webpage by the SourceWebView. And if the loading progress exceeds the initial value of the progress bar, the progress information displayed by the progress bar is not the virtual progress any more, and the progress information is updated along with the actual loading progress of the original webpage.
S108: in the process of loading the original webpage by the SourceWebView, when a user clicks a switching button, invisible processing can be carried out on the SourceWebView, and display processing can be carried out on the InstantWebView. The method specifically comprises the step of executing a fade-out animation corresponding to the SourceWebView, wherein the fade-out animation is gradually invisible, and the progress bar can be set to be completely transparent. And simultaneously, displaying the InstantWebView, executing a fade-in animation, and gradually displaying the InstantWebView loaded with the object data. When the SourceWebView is subjected to invisible processing, the progress bar is displayed, and if the work of filling data in the InstantWebView is finished, the progress bar does not need to be displayed when the InstantWebView is switched. Or updating the progress bar, and displaying the loading progress information of the instantWebView on the object data on the progress bar.
Further, in the embodiment of the present invention, if the switch button is clicked again, invisible processing may be performed on InstantWebView, a corresponding dissolve animation is performed on InstantWebView, the InstantWebView is gradually invisible, the progress bar is set to be completely opaque, and meanwhile, display processing is performed on SourceWebView, a dissolve animation is performed, and the SourceWebView loaded with page data of the original web page is gradually displayed. And executing invisible processing on the instantWebView, and if the page data of the original webpage are completely loaded by the SourceWebView at the moment, automatically setting the progress bar to be in an invisible state. Or if the page data of the original webpage are not loaded completely by the SourceWebView, displaying the loading progress information of the SourceWebView on the page data of the original webpage on the progress bar.
S109: when data is wrong, for example, when the page data of the original webpage requested by the user or the object data returned by the server side is wrong, if the user switches to InstantWebView, an error page is displayed, a retry button is placed on the error page, and the request is sent again to request the object data by clicking the retry button. Or the loading of the page data of the original webpage requested by the user is normal, a switching button is arranged on the error page, and the user clicks the switching button to switch and display the SourceWebView for loading the page data of the original webpage with errors.
S110: and when the user exits, destroying the two WebViews and the progress bar, and stopping the possible timeout check. The user exit means that the user closes the SourceWebView loaded with the page data currently displayed by the terminal or closes the InstantWebView loaded with the object data currently displayed by the terminal.
In the process of executing the above embodiment, the multi-page loading mode may be opened in a UI thread of the terminal, so as to perform loading object data and presentation operations in InstantWebView. In addition, if the problem that a flicker white block occurs when the WebView is opened exists, the background of the WebView can be set to be completely transparent, namely, the parameter setBackgroupcolor of the WebView is assigned to color.
When different webpages are multiplexed and loaded by WebView, if conflict is generated due to asynchronous callback completed by WebView loading, the loading of page data of the previous original webpage and corresponding object data can be completely stopped to avoid the conflict, whether the current requested and loaded page is the same as the page corresponding to the callback request or not can be checked, and if not, whether the current loaded page data and the object data are completely loaded or not is further determined; if the loading is finished, responding to the callback request to carry out callback processing so as to load the webpage corresponding to the callback request; and if the loading is not finished, completely stopping the loading of the page data and the object data which are requested to be loaded at present, and loading the webpage corresponding to the callback request. If the data are the same, continuing to load the page data and the object data which are currently requested to be loaded.
S111: and responding to the page request of the user, acquiring the data of the original webpage requested by the page request and automatically loading the page data of the original webpage.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
Referring to fig. 2 again, the method of the embodiment of the present invention is a flowchart of a web page processing method, and the method of the embodiment of the present invention may be executed by various types of intelligent terminals, which have a network function, can initiate a page request and also request to open a web page, have a touch screen and the like for displaying a page after data loading, and receive an operation of a user. The method comprises the following steps.
S201: when a page request is received, the object identification of a target object in a page requested by the page request is obtained. A user may input a URL (Uniform Resource Locator) address on WebView, and initiate a page request for a certain web page. Or clicking a certain link address to initiate a page request for the webpage corresponding to the link address.
Various object elements exist in the webpage, and different target objects can be determined according to the type of the requested webpage. These target objects refer primarily to the primary content of that type of web page. For example, in a news-type web page, the target object is the news body in the web page, and other objects such as advertisements and hyperlinks are not considered as target objects. For another example, in a web page of a product introduction type, a body of a product introduction is a target object, and objects such as other advertisements and hyperlinks connected to other product introductions are not targeted. In the requested web page, the page objects all have a unique ID, and based on the ID in combination with the URL address of the web page, the server can find specific content data of the target object, i.e., object data, which may be, for example, the above-mentioned news text, product introduction text, and the like.
S202: and acquiring the object data of the object indicated by the object identification, and acquiring the page data of the page requested by the page request. The object data of the target object can be found based on the above-mentioned ID of the target object and the URL of the requested web page. Based on the URL, all page data of the original web page requested by the page request can be found.
S203: and loading the object data based on a preset first page template, and loading the page data based on a preset second page template. In one embodiment, two webviews can be newly created when a page request is received, and the two webviews are set to be invisible. And loading the acquired object data based on the first page template through one of the two WebViews, and loading the acquired page data based on the second page template through the other WebView.
It can be understood that, based on the network and hardware performance of the intelligent terminal, there is a certain time for the object data and the page data acquired in S202, and the corresponding WebView loads the acquired corresponding data in real time in the process of acquiring the object data and the page data. According to the size of the total data volume of the object data and the page data, the loading time lengths are different.
S204: and displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data. The first display page is an interface for loading the WebView corresponding to the object data, and the second display page is an interface for loading the WebView corresponding to the page data.
Similarly, in the process of displaying the target page, the corresponding target page is also displayed according to the progress of the acquired and loaded object data or page data. Specifically, the corresponding first display page or second display page may be used as the target page only after the loading is completed, or the first display page or second display page including the loaded partial data may be displayed while loading.
The user can determine and display the target page in S204 as needed. For example, preferentially selecting a first display page as a target page; or preferentially selecting the second display page as a target page; or according to the selection of the user, the first display page is firstly used as the target page or the second display page is firstly used as the target page. Or, the second display page may be selected to be displayed if the progress of loading the original webpage data in the second display page within the preset time range exceeds a preset threshold, and the first display page may be selected to be displayed if the progress of loading the original webpage data in the second display page does not exceed the preset threshold.
The first display page and the second display page can be switched with each other, in one embodiment, a corresponding switching button can be set, and once a trigger operation such as clicking the switching button by a user is detected, the switching is performed. In one embodiment, the switching may also be performed automatically, and the second display page as the target page may be displayed first; if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
In addition, when the callback request is checked, whether the page requested to be opened by the callback request is the same as the page requested by the page request is determined; if not, further determining whether the page data and the object data are completely loaded; and if the loading is finished, responding to the callback request to perform callback processing. The page callback request refers to that in the process of loading object data and/or page data by the WebView, the WebView is called again to execute other operations, for example, a new user is opened in response to a new page request, and the callback request can be considered to be detected. When the callback request is detected, whether the page data and the object data before the callback request is initiated are loaded completely or not can be ensured through the mode, the callback request is responded to for callback processing after the page data and the object data are loaded completely, and otherwise, the corresponding callback processing cannot be carried out.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
Referring to fig. 3 again, the method of the embodiment of the present invention is a flowchart of another web page processing method, and the method of the embodiment of the present invention may be executed by various types of intelligent terminals, which have a network function, can initiate a page request and also request to open a web page, have a touch screen and the like for displaying a page after data loading, and receive an operation of a user. The method comprises the following steps.
S301: when a page request is received, determining the type of a page requested by the page request; in an embodiment, when a page request is received, a first display page for loading object data is newly created, and a second display page for loading page data is newly created; and setting the first display page and the second display page to be in an invisible state. In other embodiments, before or after receiving the page request, a first display page for loading the object data may be newly created, and a second display page for loading the page data may be newly created; and setting the first display page and the second display page to be in an invisible state. And the first display page and the second display page are set to be in invisible states because the corresponding object data and the corresponding page data are not acquired and loaded.
S302: and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request, and acquiring the object data corresponding to the object identification. The specified page type may be a news type page.
In one embodiment, if the determined type is not the specified page type, the page data of the page requested by the page request is directly obtained. That is, according to the existing response flow to the page request, the page request sent by the user is responded, and a certain webpage is opened for the user.
S303: and acquiring page data of the page requested by the page request.
S304: and loading the object data based on a preset first page template, and loading the page data based on a preset second page template. The first page template and the second page template can be a preset javascript template.
S305: displaying a second display page as a target page; when a second display page is displayed, a first progress bar can be displayed at the same time, and initial progress information for loading the page data is displayed on the first progress bar; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is greater than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar. And displaying progress information used for representing the actual progress value on the second progress bar. And if the initial progress information is smaller than the initial value indicated by the initial progress information, continuing to display the first progress bar. The second progress bar may be obtained by updating only progress information on the basis of the first progress bar. The second progress bar may also be a new progress bar redrawn according to the actual progress value.
S306: displaying a first switching button, and determining that a first switching display instruction is received when the triggering operation of the first switching button is detected. The first switching button may be disposed on the second display page, and a user may issue a trigger operation to the first switching button by clicking or the like, so as to execute S307 described below
S307: if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page. And if the first display page has completely loaded all the object data of the target object, the progress bar does not need to be displayed. Optionally, if the loading is not completed, a new progress bar can be set to display the loading progress of the first display page. In an embodiment, a progress bar may be obtained by updating according to the loading progress of the first display page on the basis of the first progress bar.
S308: if a second switching display instruction is received, performing invisible processing on the displayed first display page; and performing display processing by taking the second display page as a target page. Specifically, after the first display page is displayed in S307, a second switching button is displayed on the first display page, and when a trigger operation on the second switching button is detected, it is determined that the second switching display instruction is acquired.
In an embodiment, when the second display page is switched and displayed in S308, if the second display page still does not completely load the page data of the original webpage, a progress bar may be displayed again, the progress information of the currently loaded page data of the second display page after switching is displayed on the progress bar, and if the second display page is completely loaded, the second display page is directly displayed without displaying the progress bar again.
In another embodiment, after the second display page is used as a target page for display processing, if it is determined that the first display page has errors in loading the object data, displaying and displaying a second switching button, and performing invisible processing on the displayed first display page when the triggering operation of the second switching button is detected; and performing display processing by taking the second display page as a target page.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
In an embodiment of the present invention, a storage medium is further provided, where the storage medium is used to store an application program, and the application program is used to execute, when running, a processing method for a web page in an embodiment corresponding to fig. 1 to 3. The processor of the intelligent terminal may call the application program stored in the storage medium to implement the method corresponding to the embodiment in fig. 1 to 3.
In an embodiment of the present invention, an application program product is further provided, where the application program is configured to execute, at runtime, the processing method related to the web page in the embodiment corresponding to fig. 1 to 3. The application program product may be run by a processor of the smart terminal to implement the methods of the embodiments corresponding to fig. 1 to 3.
The following describes a web page processing apparatus and an intelligent terminal according to an embodiment of the present invention.
Fig. 4 is a schematic structural diagram of a web page processing apparatus according to an embodiment of the present invention, where the apparatus according to the embodiment of the present invention may be disposed in intelligent terminals, and the intelligent terminals have a network function, can initiate a page request and also request to open a web page, and have touch screens and the like for displaying a page after data loading, and receive an operation of a user. The device of the embodiment of the invention comprises the following modules.
An identifier obtaining module 401, configured to obtain, when a page request is received, an object identifier of a target object in a page requested by the page request; a data obtaining module 402, configured to obtain object data of an object indicated by the object identifier, and obtain page data of a page requested by the page request; a data loading module 403, configured to load the object data based on a preset first page template, and load the page data based on a preset second page template; a display module 404, configured to display a target page, where the target page is a first display page on which the object data is loaded or a second display page on which the page data is loaded.
In an embodiment, the display module 404 is specifically configured to display a second display page as a target page; if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
In one embodiment, the display module 404 is further configured to display a first switch button, and determine that a first switch display instruction is received when a trigger operation of the first switch button is detected.
In an embodiment, the display module 404 is further configured to perform invisible processing on the displayed first display page if a second display switching instruction is received after the first display page is used as a target page for display processing; and performing display processing by taking the second display page as a target page.
In one embodiment, the display module 404 is configured to display a second display page as a target page; if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
In an embodiment, the display module 404 is further configured to display a first progress bar, where the first progress bar displays initial progress information of loading the page data; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar; and displaying progress information used for representing the actual progress value on the second progress bar.
In an embodiment, the identifier obtaining module 401 is configured to, when a page request is received, determine a type of a page requested by the page request; and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request.
In one embodiment, the apparatus may further include: the configuration module 405 is configured to create a first display page for loading object data, and create a second display page for loading page data; and setting the first display page and the second display page to be in an invisible state.
In an embodiment, the display module 404 is further configured to, after performing display processing on the second display page as a target page, if it is determined that loading of the object data by the first display page is erroneous, display a second switch button, and perform invisible processing on the displayed first display page when a trigger operation on the second switch button is detected; and performing display processing by taking the second display page as a target page.
In one embodiment, the apparatus may further include: the processing module 406 is configured to determine whether a page requested to be opened by the callback request is the same as a page requested by the page request when the callback request is checked; if not, further determining whether the page data and the object data are completely loaded; and if the loading is finished, responding to the callback request to perform callback processing.
It should be noted that, for specific functional implementation of each module of the web page processing apparatus in the embodiment of the present invention, reference may be made to the description of relevant contents in each embodiment above.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
Please refer to fig. 5, which is a schematic structural diagram of an intelligent terminal according to an embodiment of the present invention, where the intelligent terminal according to the embodiment of the present invention may be a smart phone, a tablet computer, an intelligent wearable device, and the like. The intelligent terminal may include a power supply and various functional modules, and in the embodiment of the present invention, the intelligent terminal at least further includes: user interface 501, communication interface 502, processor 503, and memory 504, among others.
The user interface 501 may be a display screen, a touch screen, or a function key of a corresponding function, or a keyboard, or a voice or video input interface, and the like, and the communication interface 502 may be an interface capable of accessing a computer network, or an interface capable of accessing a mobile communication network.
The memory 504 may include a volatile memory (volatile memory), such as a random-access memory (RAM); the memory 504 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), a HDD (hard disk drive) or an SSD (solid-state drive); the memory 504 may also comprise a combination of the above-described types of memory.
The processor 503 may be a Central Processing Unit (CPU). The processor 503 may further include a hardware chip. The hardware chip may be an ASIC (application-specific integrated circuit), a PLD (programmable logic device), or a combination thereof. The PLD may be a CPLD (complex programmable logic device), an FPGA (field-programmable gate array), a GAL (generic array logic), or any combination thereof.
Optionally, the memory 504 stores program instructions for implementing corresponding functions and data such as an operating system of the intelligent terminal, which may specifically enable the intelligent terminal to implement functions such as network communication and user interaction, and the memory 504 also stores a web page processing application program. The processor 503 may call the instruction of the web page processing application to implement the web page processing method described above.
In the embodiment of the present invention, the user interface 501 is configured to receive a page request, where the page request is used to request to open a web page; the processor 503 calls the program instruction stored in the memory 504, and is configured to obtain an object identifier of a target object in the page requested by the page request; acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request; loading the object data based on a preset first page template, and loading the page data based on a preset second page template; and displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data.
In one embodiment, the processor 503 is further configured to display a second display page as a target page; if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
In one embodiment, the processor 503 is further configured to display a first switch button, and determine that a first switch display instruction is received when a trigger operation of the first switch button is detected.
In an embodiment, the processor 503 is configured to perform invisible processing on the displayed first display page if a second display switching instruction is received after performing display processing on the first display page as a target page; and performing display processing by taking the second display page as a target page.
In one embodiment, the processor 503, when configured to display the target page, is configured to display a second display page as the target page; if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
In one embodiment, the processor 503 is further configured to display a first progress bar, where the first progress bar displays initial progress information for loading the page data; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar; and displaying progress information used for representing the actual progress value on the second progress bar.
In an embodiment, the processor 503, when configured to obtain an object identifier of a target object in a page requested by a page request when the page request is received, is configured to determine a type of the page requested by the page request when the page request is received; and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request.
In an embodiment, the processor 503 is further configured to create a first display page for loading the object data, and create a second display page for loading the page data; and setting the first display page and the second display page to be in an invisible state.
In an embodiment, the processor 503 is further configured to, after performing display processing on the second display page as a target page, if it is determined that loading of the object data by the first display page is erroneous, display a second switch button, and perform invisible processing on the displayed first display page when a trigger operation on the second switch button is detected; and performing display processing by taking the second display page as a target page.
In one embodiment, the processor 503 is further configured to determine whether the page requested to be opened by the callback request is the same as the page requested by the page request when the callback request is checked; if not, further determining whether the page data and the object data are completely loaded; and if the loading is finished, responding to the callback request to perform callback processing.
It should be noted that, the specific functional implementation of the processor 503 may refer to the description related to the foregoing embodiments.
The embodiment of the invention can extract the object of the webpage requested by the user, acquire the object data corresponding to the extracted object, load the object data in the two display pages and display the object data according to the requirement. If the original page is loaded slowly, the user can select to load only the target objects of the required part, so that the efficiency of the user for viewing the page is improved to a certain extent, and the user can view the webpage more quickly. And if the user wants to view the original webpage, the content of the original webpage can be viewed through the corresponding display page, so that different requirements of the user are met automatically and intelligently.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (17)

1. A method for processing a web page, comprising:
when a page request is received, acquiring an object identifier of a target object in a page requested by the page request;
acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request;
loading the object data based on a preset first page template, and loading the page data based on a preset second page template, wherein the loading operation of the object data is performed before the page data is loaded;
displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data;
wherein the displaying the target page includes:
displaying a second display page as a target page;
if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; the first display page is used as a target page for display processing;
when different webpages are multiplexed and loaded by WebView, if conflict is generated due to asynchronous callback completed by WebView loading, stopping loading page data and corresponding object data of a previous original webpage, and checking whether a current requested and loaded page is the same as a page corresponding to a callback request or not; if the pages are different, determining whether the loading of the currently loaded page data and the object data is finished; if the loading is finished, responding to the callback request to carry out callback processing so as to load the webpage corresponding to the callback request; if the loading is not finished, stopping the loading of the page data and the object data which are requested to be loaded currently, and loading and calling back the webpage corresponding to the request; and if the pages are the same, continuing to load the page data and the object data which are currently requested to be loaded.
2. The method of claim 1, wherein the displaying the target page comprises:
displaying a second display page as a target page;
if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
3. The method of claim 2, further comprising:
displaying a first switching button, and determining that a first switching display instruction is received when the triggering operation of the first switching button is detected.
4. The method of claim 2, further comprising:
after the first display page is used as a target page for display processing, if a second switching display instruction is received, invisible processing is carried out on the displayed first display page; and performing display processing by taking the second display page as a target page.
5. The method of claim 1, further comprising:
displaying a first progress bar, wherein the initial progress information for loading the page data is displayed on the first progress bar;
in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar;
and displaying progress information used for representing the actual progress value on the second progress bar.
6. The method according to any one of claims 1 to 5, wherein said obtaining, when a page request is received, an object identifier of a target object in a page requested by the page request comprises:
when a page request is received, determining the type of a page requested by the page request;
and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request.
7. The method of any of claims 1 to 5, further comprising:
newly building a first display page for loading object data, and newly building a second display page for loading page data;
and setting the first display page and the second display page to be in an invisible state.
8. The method of claim 2, further comprising:
after the second display page is used as a target page for display processing, if the first display page is determined to have errors in loading the object data, displaying and displaying a second switching button, and performing invisible processing on the displayed first display page when the triggering operation of the second switching button is detected; and performing display processing by taking the second display page as a target page.
9. A web page processing apparatus, comprising:
the identification acquisition module is used for acquiring the object identification of a target object in a page requested by a page request when the page request is received;
the data acquisition module is used for acquiring the object data of the object indicated by the object identifier and acquiring the page data of the page requested by the page request;
the data loading module is used for loading the object data based on a preset first page template and loading the page data based on a preset second page template, wherein the loading operation of the object data is performed before the page data is loaded;
the display module is used for displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data;
the data loading module is also used for stopping loading the page data of the previous original webpage and the corresponding object data and checking whether the current requested and loaded page is the same as the page corresponding to the callback request or not if the conflict is generated due to the asynchronous callback completed by the WebView loading when the WebView multiplexing is carried out and different webpages are loaded; if the pages are different, determining whether the loading of the currently loaded page data and the object data is finished; if the loading is finished, responding to the callback request to carry out callback processing so as to load the webpage corresponding to the callback request; if the loading is not finished, stopping the loading of the page data and the object data which are requested to be loaded currently, and loading and calling back the webpage corresponding to the request; and if the pages are the same, continuing to load the page data and the object data which are currently requested to be loaded.
10. The apparatus of claim 9,
the display module is specifically used for displaying a second display page serving as a target page; if a first switching display instruction is received, performing invisible processing on the displayed second display page; and performing display processing by taking the first display page as a target page.
11. The apparatus of claim 10,
the display module is further configured to display a first switching button, and determine that a first switching display instruction is received when the triggering operation of the first switching button is detected.
12. The apparatus of claim 10,
the display module is further configured to perform invisible processing on the displayed first display page if a second switching display instruction is received after the first display page is used as a target page for display processing; and performing display processing by taking the second display page as a target page.
13. The apparatus of claim 9,
the display module is further configured to display a first progress bar, where initial progress information for loading the page data is displayed on the first progress bar; in the process of loading the page data based on a second page template, if the actual progress value of loading the page data is larger than the initial value indicated by the initial progress information, updating the first progress bar according to the actual progress value to obtain a second progress bar; and displaying progress information used for representing the actual progress value on the second progress bar.
14. The apparatus of any of claims 9 to 13, further comprising:
the identification acquisition module is used for determining the type of a page requested by a page request when the page request is received; and if the determined type is the specified page type, acquiring the object identification of the target object in the page requested by the page request.
15. The apparatus of any of claims 9 to 13, further comprising:
the configuration module is used for newly building a first display page for loading object data and a second display page for loading page data; and setting the first display page and the second display page to be in an invisible state.
16. The apparatus of claim 10,
the display module is further configured to, after performing display processing on the second display page as a target page, display and display a second switch button if it is determined that the object data is loaded on the first display page erroneously, and perform invisible processing on the displayed first display page when a trigger operation on the second switch button is detected; and performing display processing by taking the second display page as a target page.
17. An intelligent terminal, comprising: a user interface and a processor;
the user interface is used for receiving a page request, and the page request is used for requesting to open a webpage;
the processor is used for acquiring the object identification of the target object in the page requested by the page request; acquiring object data of an object indicated by the object identifier, and acquiring page data of a page requested by the page request; loading the object data based on a preset first page template, and loading the page data based on a preset second page template, wherein the loading operation of the object data is performed before the page data is loaded; displaying a target page, wherein the target page is a first display page for loading the object data or a second display page for loading the page data;
wherein the displaying the target page includes:
displaying a second display page as a target page;
if the loading progress value of the page data in the preset time range on the second display page is smaller than a preset progress threshold value, performing invisible processing on the displayed second display page; the first display page is used as a target page for display processing;
when different webpages are multiplexed and loaded by WebView, if conflict is generated due to asynchronous callback completed by WebView loading, stopping loading page data and corresponding object data of a previous original webpage, and checking whether a current requested and loaded page is the same as a page corresponding to a callback request or not; if the pages are different, determining whether the loading of the currently loaded page data and the object data is finished; if the loading is finished, responding to the callback request to carry out callback processing so as to load the webpage corresponding to the callback request; if the loading is not finished, stopping the loading of the page data and the object data which are requested to be loaded currently, and loading and calling back the webpage corresponding to the request; and if the pages are the same, continuing to load the page data and the object data which are currently requested to be loaded.
CN201710209838.5A 2017-03-31 2017-03-31 Webpage processing method and device and intelligent terminal Active CN107045546B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710209838.5A CN107045546B (en) 2017-03-31 2017-03-31 Webpage processing method and device and intelligent terminal

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710209838.5A CN107045546B (en) 2017-03-31 2017-03-31 Webpage processing method and device and intelligent terminal

Publications (2)

Publication Number Publication Date
CN107045546A CN107045546A (en) 2017-08-15
CN107045546B true CN107045546B (en) 2021-01-05

Family

ID=59544254

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710209838.5A Active CN107045546B (en) 2017-03-31 2017-03-31 Webpage processing method and device and intelligent terminal

Country Status (1)

Country Link
CN (1) CN107045546B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108881493A (en) * 2018-08-08 2018-11-23 郑州云海信息技术有限公司 A kind of Task Progress information-pushing method, device and equipment
CN111353110A (en) * 2018-12-21 2020-06-30 西安中兴新软件有限责任公司 Information input method and device
CN111818109B (en) * 2019-04-10 2022-09-23 腾讯科技(深圳)有限公司 Progress display method and device, computer readable storage medium and computer equipment
CN112163173B (en) * 2020-09-22 2024-05-03 Oppo(重庆)智能科技有限公司 Webpage loading method, webpage loading device, electronic equipment and computer readable storage medium
CN114491372B (en) * 2022-02-08 2023-09-08 北京有竹居网络技术有限公司 Page processing method and device, electronic equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011011398A2 (en) * 2009-07-21 2011-01-27 Saambaa Llc Systems and methods for utilizing and searching social network information
CN104267968A (en) * 2014-10-16 2015-01-07 福建星网视易信息系统有限公司 Interface switching method and device

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104035753B (en) * 2013-03-04 2018-11-02 优视科技有限公司 A kind of method and system of double WebView displayings customized web pages
US20140280590A1 (en) * 2013-03-15 2014-09-18 Nevada Funding Group Inc. Systems, methods and apparatus for creating, managing and presenting a social contacts list
CN103425794B (en) * 2013-08-29 2016-12-28 优视科技有限公司 Web preview method and apparatus based on double WebView
CN105335052B (en) * 2015-11-30 2019-01-04 腾讯科技(深圳)有限公司 Information processing method and terminal device
CN106250434B (en) * 2016-07-26 2019-09-13 东软集团股份有限公司 Load the method and device of webpage

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2011011398A2 (en) * 2009-07-21 2011-01-27 Saambaa Llc Systems and methods for utilizing and searching social network information
CN104267968A (en) * 2014-10-16 2015-01-07 福建星网视易信息系统有限公司 Interface switching method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Kepler WebView: A Lightweight, Portable Framework for Constructing Real-time Web Interfaces of Scientific Workflows;DanielCrawl 等;《Procedia Computer Science》;20160601;第80卷;673-679 *
基于iPhone移动平台的网上导购客户端软件技术研究;谢杰阳 等;《福建电脑》;20130225(第2期);141-143 *

Also Published As

Publication number Publication date
CN107045546A (en) 2017-08-15

Similar Documents

Publication Publication Date Title
CN107045546B (en) Webpage processing method and device and intelligent terminal
TWI690812B (en) Method, device and client for dynamic layout of page elements
CN106156066B (en) Page switching method, device and client
CN106547417B (en) Method and device for displaying background task message
CN104834637B (en) Webpage picture display method and device
US20140222947A1 (en) Method and apparatus for browsings webpages, and storage medium
US10810698B2 (en) Information processing method and client
CN107463563B (en) Information service processing method and device of browser
CN112130729B (en) Page processing method and device, computer equipment and storage medium
CN110941779B (en) Page loading method and device, storage medium and electronic equipment
CN114065080B (en) Page rendering method, device, equipment and computer readable storage medium
CN106775208B (en) Operation method and device for application individuation and terminal
CN109361948B (en) Interface management method, intelligent terminal and readable storage medium
CN105808307B (en) Page display method and device
CN115309470B (en) Method, device, equipment and storage medium for loading widget
US20170169122A1 (en) Webpage display method, mobile terminal, intelligent terminal, program and storage medium
CN108933947B (en) Bullet screen display method and device
CN104537049A (en) Picture browsing method and device
CN115017428A (en) Information display method, device, system and storage medium
CN106970848B (en) Input control method and device and electronic equipment
CN113419649A (en) Method for operating electronic device and device thereof
CN108345683A (en) Webpage display process, device, terminal and storage medium
CN112163432A (en) Translation method, translation device and electronic equipment
CN109446451B (en) Webpage display method, device, medium and computing equipment
CN112966201B (en) Object processing method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant