Web page display method, device, electronic device and storage medium

By generating and displaying the first web page first and switching after the second web page is loaded, the problem of slow web page display speed in the prior art is solved, and a faster web page loading speed is achieved.

CN112632436BActive Publication Date: 2024-12-10SHENZHEN YAYUE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN201910953463.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-10-09
Publication Date
2024-12-10
Estimated Expiration
2039-10-09

AI Technical Summary

Technical Problem

The loading process of existing web page display schemes is complicated and requires online downloading of resources, resulting in slow web page display.

Method used

By obtaining feature files and calling preset components, the first web page is generated and displayed first. After the second web page is loaded, the first web page is hidden and the second web page is displayed. The second web page is loaded using preset components to increase the speed of web page display.

Benefits of technology

The generated first web page is displayed while loading the second web page, reducing the waiting time and improving the web page display speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112632436B_ABST
    Figure CN112632436B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a web page display method, device, electronic device and storage medium. The embodiment of the present application can obtain a feature file and call a preset component; generate a first web page according to the feature file and display the first web page; load a second web page through the preset component; when the second web page is loaded, hide the first web page and display the second web page. This solution can display the generated first web page first when the second web page is loaded and the first web page is generated, and when the second web page is loaded, the first web page is switched to the second web page, thereby achieving the purpose of improving the web page display speed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a web page display method, device, electronic device and storage medium. Background Art

[0002] With the rapid development of network technology, web pages have shown many new features and changes, and web page display has received more and more attention.

[0003] In the prior art, the fifth major revision of the Hypertext Markup Language (H5) solution based on the web page (Web) is generally used to display web pages. In this web page display solution, all components related to the Web engine in the browser need to be started before the web page is displayed, and the resources required for the web page are downloaded from the electronic device through the Web engine, and then the resources are subsequently processed.

[0004] Since the loading process of the existing solution is relatively complicated and requires online download of resources, the web page displays slowly. Summary of the invention

[0005] The embodiments of the present application provide a web page display method, device, electronic device and storage medium, which can improve the web page display speed.

[0006] The present application provides a web page display method, including:

[0007] Get feature files and call preset components;

[0008] generating a first web page according to the feature file, and displaying the first web page;

[0009] Loading a second web page through the preset component;

[0010] When the second webpage is loaded, the first webpage is hidden and the second webpage is displayed.

[0011] In some implementations, after displaying the first webpage, the method further includes:

[0012] receiving input information based on the first webpage, and responding to the input information based on the first webpage;

[0013] When the second webpage is loaded, hiding the first webpage and displaying the second webpage comprises:

[0014] When the second webpage is loaded, mapping the input information to the second webpage;

[0015] Responding to the input information based on the second web page, obtaining a response web page;

[0016] The first web page is hidden, and the response web page is displayed.

[0017] In some implementations, when the second webpage is loaded, mapping the input information to the second webpage, the method includes:

[0018] When the second webpage is loaded, obtaining the first webpage tag corresponding to the input information;

[0019] According to a preset relationship between the first web page tag set and the second web page tag set, determining the second web page tag corresponding to the first web page tag;

[0020] The input information is added to the second web page tag.

[0021] In some implementations, the method of generating the first webpage according to the feature file includes:

[0022] Parsing the feature file to obtain element information and layout information;

[0023] A first webpage is generated according to the element information and the layout information.

[0024] In some implementations, the method of generating a first webpage according to the element information and the layout information includes:

[0025] Obtaining a preprocessed native component according to the element information and the layout information;

[0026] The pre-processed native component is rendered to generate a first webpage.

[0027] In some implementations, the method of obtaining a preprocessed native component according to the element information and the layout information includes:

[0028] Generate a native component corresponding to the element information according to the element information;

[0029] Obtaining a layout strategy according to the layout information;

[0030] The native components are arranged according to the layout strategy to obtain pre-processed native components.

[0031] In some implementations, when the second webpage is loaded, after hiding the first webpage and displaying the second webpage, the method further includes:

[0032] When it is detected that the second webpage is abnormal, the second webpage is hidden and the first webpage is displayed.

[0033] The embodiment of the present application also provides a web page display device, including:

[0034] An acquisition unit, used to acquire a feature file and call a preset component;

[0035] A first display unit, configured to generate a first web page according to the feature file and display the first web page;

[0036] A loading unit, used for loading a second web page through the preset component;

[0037] The second display unit is used to hide the first web page and display the second web page when the second web page is loaded.

[0038] In some embodiments, the web page display device may further include:

[0039] A first responding unit, configured to receive input information based on the first webpage, and respond to the input information based on the first webpage;

[0040] The second display unit comprises:

[0041] A mapping module, used for mapping the input information to the second web page when the second web page is loaded;

[0042] A response module, used for responding to the input information based on the second web page to obtain a response web page;

[0043] The hiding module is used to hide the first web page and display the response web page.

[0044] In some embodiments, the mapping module is specifically used to: when the second web page is loaded, obtain the first web page tag corresponding to the input information; confirm the second web page tag corresponding to the first web page tag according to the preset relationship between the first web page tag set and the second web page tag set; and add the input information to the second web page tag.

[0045] In some embodiments, the first display unit includes:

[0046] A parsing module, used for parsing the feature file to obtain element information and layout information;

[0047] A generation module, used to generate a first web page according to the element information and layout information

[0048] In some embodiments, the generating module comprises:

[0049] A processing submodule, used for obtaining a pre-processed native component according to the element information and layout information;

[0050] The rendering submodule is used to render the pre-processed native component to generate a first web page.

[0051] In some embodiments, the processing submodule is specifically used for:

[0052] Generate a native component corresponding to the element information according to the element information; obtain a layout strategy according to the layout information; arrange the native components according to the layout strategy to obtain a pre-processed native component.

[0053] In some embodiments, the web page display device further includes:

[0054] The third display unit is used to hide the second web page and display the first web page when an abnormality is detected in the second web page.

[0055] In addition, an embodiment of the present application also provides an electronic device, including a memory and a processor; the memory stores an application, and the processor is used to run the application in the memory to perform operations in any web page display method provided in the embodiment of the present application.

[0056] In addition, an embodiment of the present application further provides a storage medium, which stores a plurality of instructions, and the instructions are suitable for a processor to load to execute the steps in any one of the web page display methods provided in the embodiment of the present application.

[0057] The embodiment of the present application can obtain a feature file and call a preset component, then generate a first web page according to the feature file, display the first web page, and load a second web page through the preset component. When the second web page is loaded, the first web page is hidden and the second web page is displayed. Since the scheme can display the generated first web page first when the second web page is loaded and the first web page is generated, and when the second web page is loaded, the first web page is switched to the second web page, the web page display speed is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0059] Figure 1 is a schematic diagram of a scene of a web page display device provided in an embodiment of the present application;

[0060] Figure 2 It is a flowchart of a web page display method provided in an embodiment of the present application;

[0061] Figure 3 is a schematic diagram of a virtual navigation page provided in an embodiment of the present application;

[0062] Figure 4 is a schematic diagram of a real navigation page provided by an embodiment of the present application;

[0063] Figure 5 is another flowchart of the web page display method provided in an embodiment of the present application;

[0064] Figure 6 It is a schematic diagram of XML syntax support tags provided in an embodiment of the present application;

[0065] Figure 7 It is a schematic diagram of the interaction between the XML element layouter and the browser native component manager in the process of generating a virtual navigation page provided by an embodiment of the present application;

[0066] Figure 8 It is a flowchart of the virtual navigation page and the real navigation page processing input information provided by the embodiment of the present application;

[0067] Fig. 9 is a structural schematic diagram of a web page display device provided in an embodiment of the present application;

[0068] Fig.10 is another structural schematic diagram of the web page display device provided in an embodiment of the present application;

[0069] Fig.11 is another structural schematic diagram of the web page display device provided in an embodiment of the present application;

[0070] Fig.12 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0071] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.

[0072] Embodiments of the present application provide a web page display method, device, electronic device, and storage medium.

[0073] See also Figure 1 , Figure 1A schematic diagram of a scene of a web page display device provided in an embodiment of the present application. The web page display device can be specifically integrated in an electronic device such as a tablet computer, a mobile phone, a personal computer (PC, Personal Computer) that has a storage unit and is equipped with a microprocessor and has computing power. The electronic device can obtain a feature file, call a preset component, and then generate a first web page according to the feature file, display the first web page, and load the second web page through the preset component. When the second web page is loaded, the electronic device hides the first web page and displays the second web page. In addition, optionally, when the electronic device generates the first web page according to the feature file and displays the first web page, it can receive input information based on the first web page and respond to the input information based on the first web page. Then when the second web page is loaded, the electronic device can map the input information to the second web page, respond to the input information based on the second web page, obtain a response web page, hide the first web page, and display the response web page. When calling the preset component to load the second web page, the electronic device can interact with the server to obtain data from the server and load the second web page based on the data. Optionally, after the web page is loaded, the electronic device may interact with the server to implement related functions (such as jump links) when the first web page or the second web page responds to input information.

[0074] It should be noted that Figure 1 The scene diagram of the web page display device shown is merely an example. The web page display device and scene described in the embodiment of the present application are intended to more clearly illustrate the technical solution of the embodiment of the present application, and do not constitute a limitation on the technical solution provided in the embodiment of the present application. A person of ordinary skill in the art can appreciate that with the evolution of web page display devices and the emergence of new business scenarios, the technical solution provided in the embodiment of the present application is equally applicable to similar technical problems.

[0075] The following are detailed descriptions of each.

[0076] In this embodiment, the description will be made from the perspective of a web page display device, which can be integrated into electronic devices such as tablet computers, mobile phones, and personal computers (PCs). Figure 2 As shown, the specific process of the web page display method can be as follows:

[0077] 101. Obtain feature files and call preset components.

[0078] The feature file may include various files related to web page generation. Each web page has its own specific feature file, and the feature files of different web pages may be different. For example, the feature file may be an extension file defined by the browser based on a certain syntax standard (for example, a syntax standard such as a syntax description based on the eXtensible Application Markup Language (XAML) or the HyperText Markup Language (HTML) syntax). The feature file may be automatically generated or manually generated.

[0079] The preset component may be used to load a specific component of a web page, and the preset component may be different according to different web page display modes.

[0080] Acquiring feature files and calling preset components are prerequisites for displaying web pages. After receiving a web page display request, the electronic device can perform the steps of acquiring feature files and calling preset components at the same time or at a preset time interval to achieve the purpose of displaying the first web page and the second web page faster. The preset time can be flexibly set according to the actual needs of the electronic device. For example, the preset time can be set to 1 millisecond. Among them, the method for acquiring the feature file can be to search for feature files pre-stored on the electronic device, or the electronic device can send a request for acquiring the feature file to the server and receive the feature file transmitted by the server based on the acquisition request, etc. The method for calling the preset component can be to call a component related to the web page from the electronic device, etc.

[0081] 102. Generate a first web page according to the feature file, and display the first web page.

[0082] Among them, the first webpage is a webpage generated according to the feature file and related components, and the first webpage has multiple page elements, for example, the multiple page elements may include a search box, a text box, or an image. The second webpage subsequently loaded by the preset component may have multiple page elements, for example, the multiple page elements may include a search box, a text box, or an image. In addition, the page layout of the first webpage may be constructed based on the page layout of the second webpage, such as an elastic layout or an adaptive layout. Therefore, the first webpage and the second webpage are two very similar webpages in appearance, so that the user can hardly feel the difference between the two.

[0083] Since the first web page is generated by parsing the feature file, its display speed is relatively fast. When the first web page and the second web page start to be displayed at the same time, the first web page can be generated quickly and displayed to the user first.

[0084] In some embodiments, the web page display device generates a first web page based on the feature file, and the step of displaying the first web page may include: parsing the feature file to obtain element information and layout information; generating native components corresponding to the element information based on the element information; obtaining a layout strategy based on the layout information; arranging the native components according to the layout strategy to obtain preprocessed native components; rendering the preprocessed native components to generate the first web page.

[0085] Among them, the element information may correspond to the page elements when the web page is displayed, and the layout information may correspond to the page layout when the web page is displayed. The element information and layout information belong to the abstract description of the characteristics of the page elements and the page layout. For example, the element information may include an abstract description of lines and text boxes, and the layout information may include the layout of a single element. Among them, the element information is displayed in the form of a tag, and the layout information is located in the attribute part of the tag. For example, the element information in a web page may include a picture and a search box, and the layout information of the web page may include: the picture and the search box are located in a grid layout, and the grid layout is centered on the web page.

[0086] Since the feature file stores element information and layout information, the feature file can be parsed by a parser to obtain the element information and layout information. For example, the feature file is loaded into the memory of the electronic device by the parser, and the feature file is parsed into another file that contains the element information and layout information.

[0087] At this time, a native component corresponding to the element information can be generated according to the element information, wherein the native component is an object obtained by mapping the element information in the tag form, that is, the native component is in the object form.

[0088] And, a layout strategy is obtained according to the layout information, wherein the layout information may include absolute layout information and relative layout information. A layout strategy can be directly obtained based on the absolute layout information, and another layout strategy based on the relative layout information needs to be obtained through calculation.

[0089] Then, the native components can be arranged according to the layout strategy to obtain pre-processed native components. After obtaining the pre-processed native components, the pre-processed native components are drawn by calling a renderer to obtain a first web page, and the first web page is displayed on the screen of the electronic device. Among them, the renderer that can be used may include a two-dimensional vector graphics processing function library (Skia) engine, or a Microsoft Foundation Classes (MFC) component, etc.

[0090] In some embodiments, after the web page display device generates the first web page according to the feature file, after the step of displaying the first web page, the method may further include: receiving input information based on the first web page, and responding to the input information based on the first web page.

[0091] For example, the search box of the first web page receives input information "how to grow taller", and the first web page responds to the input information by displaying search term associations based on this information, such as "how to grow taller methods", "how to grow taller scientific methods", etc.

[0092] 103. Load the second web page through the preset component.

[0093] Among them, the second web page is very similar to the first web page. The unique elements of the second web page (for example, weather, feedback, time and date, etc.) are usually located in a non-central position of the web page, and the functions they implement do not belong to the core functions of the second web page. The display scheme of the second web page causes the display speed of the second web page to be significantly lower than that of the first web page.

[0094] Among them, different preset components are selected according to the selected web page display mode. This process usually requires sending a request to the server, receiving data sent by the server and performing preset processing steps on the data, and finally displaying a complete second web page.

[0095] 104. When the second webpage is completely loaded, the first webpage is hidden and the second webpage is displayed.

[0096] When the second webpage is loaded, the first webpage can be hidden, and the first webpage is in an invisible state, and the second webpage is displayed, so that the second webpage is in a visible state.

[0097] In some embodiments, after the web page display method generates the first web page according to the feature file, after the step of displaying the first web page, it may also include: receiving input information based on the first web page, and responding to the input information based on the first web page. When the second web page is loaded, the web page display method hides the first web page and displays the second web page, which may include: when the second web page is loaded, mapping the input information to the second web page; based on the second web page responding to the input information, obtaining a response web page; hiding the first web page, and displaying the response web page.

[0098] The input information may refer to operations performed by the user on certain input-capable page elements of the first webpage, such as clicking a link or entering a search term, etc. The response to the input information is to process the input information, such as redirecting a link or displaying associated words of the search term, etc.

[0099] In the process of mapping the input information to the second webpage, the input information can be injected into the second webpage through the first webpage, or the input information obtained from the first webpage can be obtained and modified through the second webpage. In some embodiments, when the second webpage is loaded, mapping the input information to the second webpage may include: when the second webpage is loaded, obtaining the first webpage tag corresponding to the input information; confirming the second webpage tag corresponding to the first webpage tag according to the preset relationship between the first webpage tag set and the second webpage tag set; and adding the input information to the second webpage tag.

[0100] For example, a preset relationship between the first web page tag set and the second web page tag set can be pre-established, and the preset relationship may include: the corresponding relationship between the first web page tag A and the second web page tag a, the corresponding relationship between the first web page tag B and the second web page tag b, etc. The preset relationship can be determined automatically or manually. When the second web page is loaded, the first web page tag corresponding to the input information can be obtained, and the second web page tag corresponding to the first web page tag can be confirmed according to the preset relationship; at this time, the input information can be added to the second web page tag. For example, the input information "how to grow taller" received by the first web page tag A is added to the second web page tag a.

[0101] The embodiment of the present application can obtain a feature file and call a preset component, then generate a first web page according to the feature file, display the first web page, and load a second web page through the preset component. When the second web page is loaded, the first web page is hidden and the second web page is displayed. Since the scheme can display the generated first web page first when the second web page is loaded and the first web page is generated, and when the second web page is loaded, the first web page is switched to the second web page, the web page display speed is improved.

[0102] The method described in the above embodiment is further described in detail below with examples.

[0103] Take the browser navigation page as an example. Figure 3 and Figure 4 The virtual navigation page (i.e., the first web page) and the real navigation page (i.e., the second web page) are displayed respectively. Figure 3 and Figure 4It can be seen that the elements shared by the virtual navigation page and the real navigation page may include core page elements such as a search box and a website index (for example, website A or website B, etc.), and the real navigation page may be provided with non-core page elements such as weather, feedback, time and date, etc. In addition, the non-core page elements may be located at the edge of the navigation page. Since most users pay less attention to the non-core page elements at the edge, in the display process of the virtual navigation page and the real navigation page in this embodiment, based on the setting of the page elements of the two navigation pages, the user can hardly perceive the difference between the virtual navigation page and the real navigation page, thereby improving the display effect.

[0104] See also Figure 5 , Figure 5 Another flowchart of the web page display method provided in an embodiment of the present application.

[0105] The specific process of this method may include:

[0106] 201. The electronic device obtains a feature file and calls a preset component.

[0107] The feature file can be generated based on a grammar, and the grammar can match the grammar supported by the component of the browser that processes the feature file (referred to as the processing component). For example, the feature file and the processing component can be based on the XML description grammar of XAML, based on the HTML grammar, and so on. Specifically, the feature file can be a file containing element information and layout information (for example, the layout information is located in the attributes of the element information tag), or it can be a file containing element information and a file containing layout information. For example, an XML file contains layout information, and a Cascading Style Sheets (CSS) file contains element information, and so on.

[0108] For example, the electronic device may obtain the XML description file by searching locally or sending a request to a server, or the electronic device may call a preset component locally after receiving a web page display request.

[0109] 202. The electronic device parses the feature file to obtain element information and layout information, generates a native component corresponding to the element information according to the element information, and obtains a layout strategy according to the layout information.

[0110] 203. The electronic device arranges the native components according to the layout strategy to obtain pre-processed native components.

[0111] 204. The electronic device renders the pre-processed native component to generate a virtual navigation page.

[0112] For example, the feature file is an XML description file generated based on XML description syntax, which contains element information and layout information, and the layout information is contained in the attributes of the element information. Then the display of the virtual navigation page requires the XML element layouter and the browser native component manager inside the browser to be implemented.

[0113] The description syntax of the XML element layout uses a subset of Microsoft's XAML syntax, implements some of Microsoft's public XAML definitions, and supports editing or previewing in the XAML editor of the development toolkit. Figure 6 As shown in the figure, the XML element layout mainly supports the following native component tags: text (TextBlock / Label), image (Image), line (Line), nested XML page (Frame), search box (SearchBox), etc. The supported layout tags are: grid layout (Grid) and stack layout (StackPanel).

[0114] The browser native component manager is built on the browser basic framework. The bottom layer of the browser native component manager is drawn using a rendering engine. The upper layer of the browser native component manager encapsulates components corresponding to tags supported by the XML element layout (such as text, images, lines, nested XML pages, or search boxes, etc.), and interacts with users by responding to window messages. For example, the nested XML page component can recursively display the XML page by calling the XML element layout; the search box component uses the browser search bar component, which supports hot search word list recommendations, user-entered search word associations, custom search engines, billing codes, and other functions.

[0115] like Figure 7 As shown in the figure, in the process of generating a virtual navigation page, the data transmission and interaction process between the XML element layouter and the browser native component manager. Among them, the XML element layouter mainly implements: obtaining the XML description file, then parsing the XML description file to obtain element information and layout information; calculating the layout information to obtain the layout strategy; arranging the native components according to the layout strategy to obtain the pre-processed native components, and sending the element information and the pre-processed native components to the browser native component manager. In the web page generation stage, the browser native component manager mainly implements: generating the native components corresponding to the element information according to the element information, and sending the native components to the XML element layouter so that the XML element layouter arranges the native components according to the layout strategy; rendering the pre-processed native components to generate a virtual navigation page. Finally, the browser native component manager renders the pre-processed native components to generate a virtual navigation page.

[0116] For example, get Figure 3The XML description file corresponding to the virtual navigation page is parsed by the XML element layout to obtain element information including search box tags, text tags, etc. The search box tags or text tags contain their corresponding layout information. For layout information that cannot be used directly, the XML element layout is calculated by the XML element layout to obtain its corresponding layout strategy. The browser native page manager is called by the XML element layout, and the browser native page manager generates native components according to the element tags. The electronic device can arrange the native components according to the layout strategy through the XML element layout to obtain the pre-processed native components. Finally, the electronic device can render the pre-processed native components through the browser native page manager to generate a virtual navigation page.

[0117] 205. The electronic device receives input information based on the virtual navigation page, and responds to the input information based on the virtual navigation page.

[0118] The input information may be text input or clicking on a page element. The object pointed to by the input information is a virtual navigation page. For example, the input information that the electronic device may receive through the virtual navigation page may include clicking on a link or inputting a search word, and the corresponding response input information may include jumping to a link or displaying an associated word.

[0119] 206. The electronic device loads the real navigation page through the preset component.

[0120] Among them, the web page display mode can be selected according to actual needs, and different preset components can be determined according to the selected web page display mode. In the process of the electronic device loading the real navigation page through the preset component, the electronic device can send a request to the server and receive the data returned by the server based on the request, so that the electronic device processes the data, obtains the real navigation page, and finally displays a complete real navigation page. For example, the real navigation page adopts the H5 web page display mode, and the real navigation page requires browser support. First, the components related to the web engine in the browser kernel are started, and a request is sent to the server through these components to download the resources required for the real navigation page from the server, and then the resources are parsed, calculated, and rendered, etc., to obtain a real navigation page.

[0121] 207. When the real navigation page is loaded, the electronic device maps the input information to the real navigation page; responds to the input information based on the real navigation page to obtain a response web page; hides the virtual navigation page and displays the response web page.

[0122] Among them, mapping the input information to the real navigation page may include: when the real navigation page is loaded, obtaining the virtual navigation page tag corresponding to the input information; confirming the real navigation page tag corresponding to the virtual navigation page tag based on the preset relationship between the virtual navigation page tag set and the second web page tag set; adding the input information to the real navigation page tag.

[0123] The process of mapping input information to the real navigation page can be dominated by the real navigation page. For example, when the real navigation page is loaded, the real navigation page can call the extension interface customized by the browser kernel to obtain the input information and modify the corresponding page elements on the real navigation page. It can also be dominated by the virtual navigation page. For example, in the browser native component manager, the input information is transferred to the real web page by using the element tag mapping method. Since it runs in the browser, the script can be injected into the web page through the browser kernel to directly modify the elements in the web page, so as to simulate the input information received on the virtual navigation page to the real navigation page.

[0124] The processing and switching process of input information between the virtual navigation page and the real navigation page can be as follows: Figure 8 As shown: the browser native component manager and the browser kernel in the electronic device load the web page at the same time when the browser is started, first display the virtual navigation page loaded by the browser native component manager, and receive input information through the browser native component manager, and record and respond to the input information, and then output the result of responding to the input information. When the real navigation page loaded by the browser kernel is loaded, the browser kernel sends a prompt that the real navigation page has been loaded to the browser native component manager, and then transmits the input information to the browser kernel, and the browser kernel synchronizes and responds to the input information, and outputs the real navigation page after responding to the input information.

[0125] 208. When the electronic device detects that an abnormality occurs on the real navigation page, the real navigation page is hidden and the virtual navigation page is displayed.

[0126] The electronic device detects whether there is an abnormality in the real navigation page. Possible abnormalities may include: the real navigation page cannot be opened, etc. When the electronic device detects that there is an abnormality in the real navigation page, the real navigation page is hidden and the virtual navigation page is displayed.

[0127] In the embodiment of the present application, the electronic device can obtain the feature file, call the preset component, analyze the feature file, obtain the element information and layout information, generate the virtual navigation page according to the element information and layout information, and then receive the input information based on the virtual navigation page, and respond to the input information based on the virtual navigation page. At this time, the real navigation page can be loaded through the preset component. When the real navigation page is loaded, the electronic device maps the input information to the real navigation page and responds to the input information based on the real navigation page, obtains the response web page, hides the virtual navigation page, and displays the response web page; when the electronic device detects that the real navigation page is abnormal, the real navigation page is hidden and the virtual navigation page is displayed. Because the scheme can first display the virtual navigation page generated quickly when the real navigation page is loaded and the virtual navigation page is generated, so that the virtual navigation page can be displayed quickly, when the real navigation page is loaded, the virtual navigation page is switched to the real navigation page, and when the real navigation page is abnormal, the real navigation page can be switched to the virtual navigation page so that the navigation page can be used normally, thereby improving the display speed of the web page (i.e., the navigation page) and improving the stability of the web page display.

[0128] In order to better implement the media file acquisition method provided in the embodiment of the present application, the embodiment of the present application also provides a device for displaying a web page. The meanings of the terms are the same as those in the above-mentioned media file acquisition method, and the specific implementation details can refer to the description in the method embodiment.

[0129] See also Fig. 9 , Fig. 9 This is a schematic diagram of the structure of a web page display device provided in an embodiment of the present application, wherein the web page display device may include a request acquisition unit 301, a first display unit 302, a loading unit 303, and a second display acquisition unit 304, etc. Among them:

[0130] The acquisition unit 301 is used to acquire a feature file and call a preset component.

[0131] The first display unit 302 is used to generate a first web page according to the feature file and display the first web page.

[0132] The loading unit 303 is used to load the second web page through a preset component.

[0133] The second display unit 304 is used to hide the first web page and display the second web page when the second web page is loaded.

[0134] In some embodiments, Fig.10 As shown, the web page display device may further include:

[0135] The first responding unit 305 is configured to receive input information based on the first web page, and respond to the input information based on the first web page.

[0136] The second display unit 304 may include a mapping module 3041, a response module 3042, a hiding module 3043, etc., which may be specifically as follows:

[0137] A mapping module 3041, used for mapping the input information to the second web page when the second web page is loaded;

[0138] A response module 3042, configured to obtain a response web page based on the second web page response input information;

[0139] The hiding module 3043 is used to hide the first web page and display the response web page.

[0140] In some embodiments, the mapping module 3041 is specifically used to: when the second web page is loaded, obtain the first web page tag corresponding to the input information; confirm the second web page tag corresponding to the first web page tag according to the preset relationship between the first web page tag set and the second web page tag set; and add the input information to the second web page tag.

[0141] In some embodiments, Fig.11 As shown, the first display unit 302 may include a parsing module 3021 and a generating module 3022, etc., wherein:

[0142] The parsing module 3021 is used to parse the feature file to obtain element information and layout information;

[0143] Generating module 3022, used to generate a first web page according to element information and layout information

[0144] In some embodiments, the generation module 3022 may include a processing submodule and a rendering submodule, etc., which may be specifically as follows:

[0145] The processing submodule is used to obtain the pre-processed native component according to the element information and layout information;

[0146] The rendering submodule is used to render the pre-processed native component to generate a first web page.

[0147] In some embodiments, the processing submodule is specifically used to:

[0148] Generate native components corresponding to the element information according to the element information; obtain a layout strategy according to the layout information; arrange the native components according to the layout strategy to obtain pre-processed native components.

[0149] In some embodiments, the web page display device may further include:

[0150] The third display unit is used to hide the second web page and display the first web page when an abnormality is detected on the second web page.

[0151] In the embodiment of the present application, the electronic device can obtain the feature file through the acquisition unit 301 and call the preset component, then the first display unit 302 can generate the first web page according to the feature file and display the first web page, and the loading unit 303 can load the second web page through the preset component, and finally the second display unit 304 can hide the first web page and display the second web page when the second web page is loaded. Because this solution can display the generated first web page first when the second web page is loaded and the first web page is generated, and when the second web page is loaded, the first web page is switched to the second web page, thereby improving the web page display speed.

[0152] The present application also provides an electronic device, such as Fig.12 As shown, it shows a schematic diagram of the structure of the electronic device involved in the embodiment of the present application, specifically:

[0153] The electronic device may include components such as a processor 401 with one or more processing cores, a memory 402 with one or more computer-readable storage media, a power supply 403, and an input unit 404. Those skilled in the art will appreciate that Fig.12 The electronic device structure shown in the figure does not constitute a limitation on the electronic device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0154] The processor 401 is the control center of the electronic device, and uses various interfaces and lines to connect various parts of the entire electronic device. By running or executing software programs and / or modules stored in the memory 402, and calling data stored in the memory 402, the processor 401 performs various functions of the electronic device and processes data, thereby monitoring the electronic device as a whole. Optionally, the processor 401 may include one or more processing cores; preferably, the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 401.

[0155] The memory 402 can be used to store software programs and modules. The processor 401 executes various functional applications and data processing by running the software programs and modules stored in the memory 402. The memory 402 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the electronic device, etc. In addition, the memory 402 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 402 may also include a memory controller to provide the processor 401 with access to the memory 402.

[0156] The electronic device also includes a power supply 403 for supplying power to each component. Preferably, the power supply 403 can be logically connected to the processor 401 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 403 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0157] The electronic device may further include an input unit 404, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0158] Although not shown, the electronic device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 401 in the electronic device will load the executable files corresponding to the processes of one or more application programs into the memory 402 according to the following instructions, and the processor 401 will run the application programs stored in the memory 402, thereby realizing various functions, as follows:

[0159] Acquire a feature file and call a preset component; generate a first web page according to the feature file and display the first web page; load a second web page through the preset component; when the second web page is loaded, hide the first web page and display the second web page.

[0160] In some implementations, after displaying the first web page, the processor 401 further executes:

[0161] Receiving input information based on a first web page, and responding to the input information based on the first web page; when the second web page is loaded, hiding the first web page and displaying the second web page includes: when the second web page is loaded, mapping the input information to the second web page; obtaining a response web page based on the second web page responding to the input information; hiding the first web page and displaying the response web page.

[0162] In some implementations, when mapping the input information to the second webpage, the processor 401 further executes:

[0163] When the second web page is loaded, the first web page tag corresponding to the input information is obtained; according to the preset relationship between the first web page tag set and the second web page tag set, the second web page tag corresponding to the first web page tag is confirmed; and the input information is added to the second web page tag.

[0164] In some implementations, when generating the first webpage according to the feature file, the processor 401 further executes:

[0165] The feature file is parsed to obtain element information and layout information; and a first web page is generated according to the element information and layout information.

[0166] In some implementations, when generating the first webpage according to the element information and the layout information, the processor 401 further executes:

[0167] A preprocessed native component is obtained according to the element information and the layout information; the preprocessed native component is rendered to generate a first web page.

[0168] In some implementations, when obtaining the pre-processed native component according to the element information and the layout information, the processor 401 further executes:

[0169] Generate native components corresponding to the element information according to the element information; obtain a layout strategy according to the layout information; arrange the native components according to the layout strategy to obtain pre-processed native components.

[0170] In some implementations, when the second webpage is loaded, the first webpage is hidden, and after the second webpage is displayed, the processor 401 further executes:

[0171] When it is detected that the second webpage is abnormal, the second webpage is hidden and the first webpage is displayed.

[0172] After acquiring the feature file and calling the preset component, the electronic device of the embodiment of the present application can generate a first web page according to the feature file, display the first web page, and load the second web page through the preset component. When the second web page is loaded, the first web page is hidden and the second web page is displayed. Since the scheme can display the generated first web page first when loading the second web page and generating the first web page, and switch the first web page to the second web page when the second web page is loaded, the web page display speed is improved.

[0173] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0174] To this end, an embodiment of the present application provides a storage medium in which a plurality of instructions are stored, and the instructions can be loaded by a processor to execute the steps in any virtual resource transfer method provided in the embodiment of the present application. For example, the instructions can execute the following steps:

[0175] Acquire a feature file and call a preset component; generate a first web page according to the feature file and display the first web page; load a second web page through the preset component; when the second web page is loaded, hide the first web page and display the second web page.

[0176] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0177] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0178] Since the instructions stored in the storage medium can execute the steps in any web page display method provided in the embodiments of the present application, the beneficial effects that can be achieved by any web page display method provided in the embodiments of the present application can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0179] The web page display method, device, electronic device and storage medium provided in the embodiments of the present application are introduced in detail above. The principles and implementation methods of the present application are explained in this article using specific examples. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A web page display method, characterized in that: include: Get feature files and call preset components; generating a first web page according to the feature file, and displaying the first web page; Loading a second webpage through the preset component; the first webpage is used to implement the core function of the webpage, and the second webpage is used to implement the core function of the webpage and the non-core function of the webpage; When the loading of the second webpage is not completed, receiving input information based on the first webpage and responding to the input information; When the second webpage is loaded, mapping the input information to the second webpage, and responding to the input information based on the second webpage to obtain a response webpage; The first web page is hidden, and the response web page is displayed.

2. The web page display method according to claim 1, characterized in that: Mapping the input information to the second webpage includes: When the second webpage is loaded, obtaining the first webpage tag corresponding to the input information; According to a preset relationship between the first web page tag set and the second web page tag set, determining the second web page tag corresponding to the first web page tag; The input information is added to the second web page tag.

3. The web page display method according to claim 1, characterized in that: The step of generating a first webpage according to the feature file includes: Parsing the feature file to obtain element information and layout information; A first webpage is generated according to the element information and the layout information.

4. The web page display method according to claim 3, characterized in that: Generating a first webpage according to the element information and the layout information includes: Obtaining a preprocessed native component according to the element information and the layout information; The pre-processed native component is rendered to generate a first webpage.

5. The web page display method according to claim 4, characterized in that: The obtaining of the preprocessed native component according to the element information and the layout information includes: Generate a native component corresponding to the element information according to the element information; Obtaining a layout strategy according to the layout information; The native components are arranged according to the layout strategy to obtain pre-processed native components.

6. The webpage display method according to any one of claims 1 to 5, characterized in that: The method further comprises: When the second webpage is loaded, displaying the second webpage; When it is detected that the second webpage is abnormal, the second webpage is hidden and the first webpage is displayed.

7. A web page display device, characterized in that: include: An acquisition unit, used to acquire a feature file and call a preset component; A first display unit is used to generate a first web page according to the feature file and display the first web page; a loading unit is used to load a second web page through the preset component; the first web page is used to implement the core function of the web page, and the second web page is used to implement the core function of the web page and the non-core function of the web page; A first responding unit, configured to receive input information based on the first webpage and respond to the input information when the loading of the second webpage is not completed; The second display unit is used to map the input information to the second web page when the second web page is loaded, and respond to the input information based on the second web page to obtain a response web page; hide the first web page, and display the response web page.

8. An electronic device, characterized in that: It comprises a memory and a processor; the memory stores an application program, and the processor is used to run the application program in the memory to execute the operations in the web page display method according to any one of claims 1 to 6.

9. A storage medium, characterized in that: The storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor to execute the steps of the web page display method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • System and method for optimum webpage loading of browser embedded in terminal

    CN106095460A

  • Method and device for generating web preloading page

    CN110309451A