Page display method, device and storage medium

By introducing a transformation layer in the page display, the virtual tree structure is converted into a view that is recognizable by the native layer, the problem of poor page display effect in the prior art is solved, and better page display effect and user experience are achieved.

CN107291465BActive Publication Date: 2024-12-27BEIJING XIAOMI MOBILE SOFTWARE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201710454463.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2017-06-14
Publication Date
2024-12-27
Estimated Expiration
2037-06-14

AI Technical Summary

Technical Problem

When the page is displayed, the virtual tree structure is converted into a tree structure recognized by the browser kernel. The page display effect is poor, and the real form of the page cannot be restored to the maximum extent, affecting the user experience.

Method used

Introduce a transformation layer to convert elements in the virtual tree structure into views recognized by the native layer through a pre-built rule database, and display pages through the native layer to realize the conversion of web pages to native pages.

Benefits of technology

Through statement conversion, the display form of the specified web page is converted from the web page to the native page, which improves the page display effect, provides a new page display method, and enhances the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN107291465B_ABST
    Figure CN107291465B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a page display method, device and storage medium, and belongs to the field of computer technology. The page display device includes a JavaScript execution layer, a conversion layer and a native layer, and the method includes: in the process of executing a JavaScript file, the JavaScript execution layer generates a virtual tree structure, and sends a first drawing message including the virtual tree structure to the conversion layer, and the virtual tree structure includes multiple elements described by JavaScript statements; the conversion layer converts the multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and sends the multiple first views to the native layer for page display. The present disclosure converts the multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from a web page to a native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

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

[0002] With the development of computer technology, various web applications have been developed for the convenience of users. When users browse web application pages, the display effect of the page directly affects the user's browsing experience. Therefore, in order to improve the user's browsing experience, how to display the page has become a problem that people in this field are more concerned about.

[0003] When displaying a page, the related technology mainly relies on a page display device, which includes a JavaScript execution layer and a browser kernel. The specific display process is: the JavaScript execution layer parses the specified web page requested to be displayed to obtain a JavaScript file; in the process of executing the JavaScript file, the JavaScript execution layer generates a virtual tree structure; the JavaScript execution layer converts the virtual tree structure into a tree structure recognizable by the browser kernel, and sends the tree structure to the browser kernel; the browser kernel displays the page according to the tree structure. Summary of the invention

[0004] The present disclosure provides a page display method, device and storage medium.

[0005] According to a first aspect of an embodiment of the present disclosure, a page display method is provided, the method being applied to a page display device, the page display device comprising a JavaScript execution layer, a conversion layer, and a native layer, the method comprising:

[0006] The JavaScript execution layer parses the specified web page requested for display to obtain a JavaScript file;

[0007] In the process of executing the JavaScript file, the JavaScript execution layer generates a virtual tree structure and sends a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, the virtual tree structure includes a plurality of elements, and each element is described by a JavaScript statement;

[0008] The conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and sends the multiple first views to the native layer, which performs page display.

[0009] In another embodiment of the present disclosure, sending the first drawing message to the conversion layer includes:

[0010] The JavaScript execution layer calls the communication interface between the JavaScript execution layer and the conversion layer to send a first drawing message to the conversion layer.

[0011] In another embodiment of the present disclosure, the conversion layer converts the multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, including:

[0012] Based on a pre-constructed rule database, the conversion layer converts multiple elements in the virtual tree structure into multiple views recognizable by the native layer, and the rule database stores the corresponding relationship between JavaScript statements and the first view.

[0013] In another embodiment of the present disclosure, the method further includes:

[0014] When the updated JavaScript statement and the updated view are obtained, the conversion layer updates the rule database according to the updated JavaScript statement and the updated view.

[0015] In another embodiment of the present disclosure, the method further includes:

[0016] When a trigger operation is detected on the designated web page, the native layer sends a notification message to the JavaScript execution layer, wherein the notification message includes a changed element identifier;

[0017] The JavaScript execution layer modifies the virtual tree structure according to the changed element identifier, and sends a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure;

[0018] The conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer, and sends the multiple second views to the native layer, which performs page display.

[0019] In another embodiment of the present disclosure, the native layer sends a notification message to the JavaScript execution layer, including:

[0020] The native layer calls the communication interface between the native layer and the JavaScript execution layer to send a notification message to the JavaScript execution layer.

[0021] According to a second aspect of an embodiment of the present disclosure, there is provided a page display device, the page display device comprising a JavaScript execution layer, a conversion layer and a native layer;

[0022] The JavaScript execution layer is used to parse the specified web page requested for display to obtain a JavaScript file;

[0023] The JavaScript execution layer is further used to generate a virtual tree structure during the execution of the JavaScript file, and send a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, and the virtual tree structure includes a plurality of elements, each of which is described by a JavaScript statement;

[0024] The conversion layer is used to convert multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and send the multiple first views to the native layer;

[0025] The native layer is used for page display.

[0026] In another embodiment of the present disclosure, the JavaScript execution layer is further configured to call a communication interface with the conversion layer to send a first drawing message to the conversion layer.

[0027] In another embodiment of the present disclosure, the conversion layer is used to convert multiple elements in the virtual tree structure into multiple first views recognizable by the native layer based on a pre-built rule database, and the rule database stores the correspondence between JavaScript statements and views.

[0028] In another embodiment of the present disclosure, the conversion layer is further used to update the rule database according to the updated JavaScript statement and the updated view when an updated JavaScript statement and an updated view are obtained.

[0029] In another embodiment of the present disclosure, the native layer is further used to send a notification message to the JavaScript execution layer when a trigger operation is detected on the specified web page, wherein the notification message includes a changed element identifier;

[0030] The JavaScript execution layer is further used to modify the virtual tree structure according to the changed element identifier, and send a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure;

[0031] The conversion layer is further used to convert multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer, and send the multiple second views to the native layer, so that the native layer performs page display.

[0032] In another embodiment of the present disclosure, the native layer is further used to call the communication interface between the native layer and the JavaScript execution layer to send a notification message to the JavaScript execution layer.

[0033] According to a third aspect of an embodiment of the present disclosure, there is provided a page display device, including:

[0034] processor;

[0035] a memory for storing instructions executable by a processor;

[0036] Wherein, the processor is configured to:

[0037] The JavaScript execution layer parses the specified web page requested for display and obtains a JavaScript file;

[0038] In the process of executing the JavaScript file, the JavaScript execution layer generates a virtual tree structure and sends a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, the virtual tree structure includes a plurality of elements, and each element is described by a JavaScript statement;

[0039] The conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and sends the multiple first views to the native layer, which performs page display.

[0040] According to a fourth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided, wherein at least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement the page display method described in the first aspect.

[0041] The technical solution provided by the embodiments of the present disclosure may have the following beneficial effects:

[0042] The present disclosure converts multiple elements in a virtual tree structure into multiple first views recognizable by a native layer through a conversion layer, and then the native layer displays the page according to the first views. This process converts the display form of a specified web page from a web page to a native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0045] Figure 1 The present invention is an implementation environment involved in a page display method according to an exemplary embodiment.

[0046] Figure 2 The figure is a flow chart of a page display method according to an exemplary embodiment.

[0047] Figure 3 The figure is a flow chart of a page display method according to an exemplary embodiment.

[0048] Figure 4 The diagram is a schematic diagram showing a page display process according to an exemplary embodiment.

[0049] Figure 5 The invention is a block diagram of a page display device according to an exemplary embodiment.

[0050] Figure 6 The invention is a block diagram of a page display device according to an exemplary embodiment. DETAILED DESCRIPTION

[0051] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0052] See also Figure 1 , which shows the implementation environment involved in the page display method provided by the embodiment of the present disclosure, and the implementation environment includes: terminal 101.

[0053] Among them, the terminal 101 can be a smart phone, a tablet computer, a laptop computer and other devices, and the embodiment of the present disclosure does not specifically limit the product form of the terminal 101. The terminal 101 can run and display the page corresponding to the web application. Specifically, the terminal can search for the web application in the global search box provided by the operating system, and then after detecting a click operation on the web application, run and display the page corresponding to the web application; the terminal 101 can also run and display the page corresponding to the web application after detecting a click operation on the shortcut icon of the web application. In order to improve the display effect, the terminal 101 includes a page display device, which includes a JavaScript execution layer, a conversion layer and a native layer.

[0054] The JavaScript execution layer is a logic layer provided by the terminal operating system that can execute JavaScript statements. The JavaScript execution layer can parse the web page to obtain the JavaScript file and generate a virtual tree structure according to the JavaScript file; the JavaScript execution layer can also modify the virtual tree structure so that the modified virtual tree structure meets the user's current display requirements.

[0055] The conversion layer is a business layer provided by the terminal operating system that can perform statement conversion. The conversion layer can be an independent business layer in the operating system or a sublayer in the native layer responsible for statement conversion. The embodiments of this disclosure do not specifically limit the conversion layer. The conversion layer stores the correspondence between JavaScript statements and views, and can convert the virtual tree structure sent by the JavaScript execution layer into a view recognizable by the native layer, thereby realizing the conversion of web pages to native pages.

[0056] The native layer is a business layer provided by the terminal operating system that can render pages. The native layer can call the communication interface provided by the operating system to trigger the operating system to render pages; the native layer can also send a notification message to the JavaScript execution layer after detecting a trigger operation on the currently displayed page, so that the JavaScript execution layer can modify the virtual tree structure and re-execute the page rendering logic.

[0057] The above implementation environment may further include a server 102. The server 102 is a background server corresponding to the web application, and the server 102 is used to provide HTML5 (HyperText Markup Language) data and JavaScript files to the terminal 101.

[0058] In the embodiment of the present disclosure, the terminal 101 and the server 102 may communicate via a wired network or a wireless network, thereby ensuring that the terminal 101 can obtain data required for displaying a web application from the server 102 .

[0059] Figure 2 is a flow chart of a page display method according to an exemplary embodiment. Figure 2 As shown, the page display method is used in a terminal, the terminal includes a page display device, the page display device includes a JavaScript execution layer, a conversion layer and a native layer, and the method includes the following steps.

[0060] In step S201, the JavaScript execution layer parses the specified web page requested for display to obtain a JavaScript file.

[0061] In step S202, during the execution of the JavaScript file, the JavaScript execution layer generates a virtual tree structure and sends a first drawing message to the conversion layer.

[0062] In step S203 , the conversion layer converts the multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and sends the multiple first views to the native layer, which performs page display.

[0063] The method provided by the embodiment of the present disclosure converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from the web page to the native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0064] In another embodiment of the present disclosure, sending a first drawing message to the conversion layer includes:

[0065] The JavaScript execution layer calls the communication interface between the JavaScript execution layer and the conversion layer to send a first drawing message to the conversion layer.

[0066] In another embodiment of the present disclosure, the conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, including:

[0067] Based on a pre-built rule database, the conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and the rule database stores the correspondence between JavaScript statements and views.

[0068] In another embodiment of the present disclosure, the method further comprises:

[0069] When the updated JavaScript statement and the updated view are obtained, the conversion layer updates the rule database according to the updated JavaScript statement and the updated view.

[0070] In another embodiment of the present disclosure, the method further comprises:

[0071] When a trigger operation is detected on a specified web page, the native layer sends a notification message to the JavaScript execution layer, and the notification message includes the changed element identifier;

[0072] The JavaScript execution layer modifies the virtual tree structure according to the changed element identifier, and sends a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure;

[0073] The conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer, and sends the multiple second views to the native layer, which performs page display.

[0074] In another embodiment of the present disclosure, the native layer sends a notification message to the JavaScript execution layer, including:

[0075] The native layer calls the communication interface between the JavaScript execution layer and sends a notification message to the JavaScript execution layer.

[0076] All the above optional technical solutions can be arbitrarily combined to form optional embodiments of the present disclosure, and will not be described in detail here.

[0077] Figure 3 is a flow chart of a page display method according to an exemplary embodiment. Figure 3 As shown, the page display method is used in a terminal, the terminal includes a page display device, the page display device includes a JavaScript execution layer, a conversion layer and a native layer, and the method includes the following steps.

[0078] In step S301, the JavaScript execution layer parses the specified web page requested for display to obtain a JavaScript file.

[0079] The designated webpage is a webpage in the webpage application, and the designated webpage can be a first-level webpage in the webpage application, or a second-level or higher webpage in the webpage application. When the designated webpage is a first-level webpage, the designated webpage source code can be obtained in the following two ways:

[0080] The first method is that during the browser startup process, the user can use a mouse or other device to enter the name of the web application in the global search box of the browser or operating system according to their own reading needs. When the user clicks the web application link displayed on the browser or global search box of the terminal, the terminal generates a display request for the specified web page. Under the triggering of the display request for the specified web page, the terminal can obtain the specified web page source code from the server. Among them, the display request for the specified web page carries at least the attribute information of the specified web page, including the web page identifier, web page type, web page size, etc. The specified web page source code includes JavaScript code and HTML5 data.

[0081] The second method is that if the designated web page link is stored in the local memory of the terminal, for example, a shortcut icon corresponding to the designated web page is displayed on the desktop, then the terminal can generate a display request for the designated web page when detecting a user click on the shortcut icon. When the display request for the designated web page is triggered, the terminal can obtain the source code of the designated web page from the server.

[0082] When the designated web page is a second-level or higher web page, the following method can be used to obtain the source code of the designated web page: when a click operation on any item on a first-level web page in the web application (the item is a title, icon, etc. with the nature of a web page link) is detected, the terminal generates a display request for the designated web page. When the display request for the designated web page is triggered, the terminal can obtain the source code of the designated web page from the server.

[0083] When a request to display a designated web page is triggered, the JavaScript execution layer in the terminal performs JavaScript parsing on the designated web page requested to be displayed, and obtains a JavaScript file, which includes the logic code of the entire page display process.

[0084] In step S302, during the execution of the JavaScript file, the JavaScript execution layer generates a virtual tree structure.

[0085] In the process of executing the JavaScript file, the JavaScript execution layer can perform HTML parsing on the HTML5 data to obtain a virtual tree structure. The virtual tree structure includes multiple elements. Among them, the element is data used to describe web page attribute information, web page content, etc. in a specified web page, and each element is described using a JavaScript statement. In the embodiment of the present disclosure, the virtual tree structure can be a VDOM (Virtual Document Object Model) tree.

[0086] In step S303, the JavaScript execution layer calls the communication interface between the JavaScript execution layer and the conversion layer to send a first drawing message to the conversion layer.

[0087] Since each element in the virtual tree structure is described by JavaScript statements, and JavaScript statements cannot be recognized by the native layer, after obtaining the virtual tree structure, the related technology can only convert the virtual tree structure into a tree structure that can be recognized by the browser kernel, and then the browser kernel renders it into a web page for display. Since the page displayed in this process is a web page, the page display effect is not good.

[0088] In order to improve the page display effect, restore the real form of the page to the maximum extent, and provide users with a real experience of installing the web application, the method provided by the embodiment of the present disclosure, after generating the virtual tree structure, the JavaScript execution layer will also generate a first drawing message, and then send the first drawing message to the conversion layer. The first drawing message includes a virtual tree structure, etc., which is used to trigger the conversion layer to perform statement conversion, so as to display the native page corresponding to the specified web page. Furthermore, the embodiment of the present disclosure also provides a communication interface, which can realize the communication between the JavaScript execution layer and the conversion layer. Based on this communication interface, when the JavaScript execution layer sends the first drawing message to the conversion layer, it can call the communication interface between the JavaScript execution layer and the conversion layer to send it.

[0089] In step S304 , the conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer.

[0090] For many applications, developers usually develop two types of applications: one is a web application that does not need to be installed, and the other is an application that needs to be installed. In this way, for the same application, there are HTML5 data and JavaScript code that can be recognized by the browser kernel, and views that can be recognized by the terminal native layer. In actual use, it is difficult for developers to know which type of application the user is using. Therefore, developers usually separate HTML5 data, JavaScript files, and views. Figure 1 The JavaScript execution layer can be packaged in the developed application. In this way, when the user browses the web page corresponding to the web application, the conversion layer in the terminal can obtain JavaScript statements and views from the data parsed by the JavaScript execution layer. Based on the obtained JavaScript statements and views, the conversion layer can establish a rule database. The rule database stores the correspondence between JavaScript statements and views. In order to facilitate subsequent applications, the conversion layer will also store the established rule database.

[0091] Based on the pre-built rule database, when the conversion layer converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, it can obtain the view corresponding to the JavaScript statement used to describe each element in the virtual tree structure from the rule database, and use the obtained view as the first view.

[0092] Since JavaScript statements are not fixed, in order to ensure the real-time validity of the rule database, after obtaining updated JavaScript statements and updated views, the conversion layer will also update the rule database according to the updated JavaScript statements and updated views.

[0093] In step S305 , the conversion layer sends the multiple first views to the native layer, and the native layer displays the page.

[0094] The disclosed embodiment provides a communication interface, which can realize the communication between the conversion layer and the native layer. Based on the communication interface, the conversion layer can send multiple first views converted from multiple elements in the virtual tree structure to the native layer, and then the native layer displays the page. Specifically, when the native layer displays the page, the following method can be adopted: the native layer renders the specified web page by calling the API (Application Programming Interface) of the operating system Native GUI (Graphical User Interface), obtains the native page corresponding to the specified web page, and then displays the native page.

[0095] In step S306, when a trigger operation is detected on the designated web page, the native layer calls the communication interface between the native layer and the JavaScript execution layer to send a notification message to the JavaScript execution layer.

[0096] The triggering operation includes but is not limited to sliding operation and clicking operation. During the display process of the native page corresponding to the specified web page, when a sliding operation on the native page is detected, or a clicking operation on any web link on the native page is detected, the content displayed on the native page will change. At this time, the native layer will send a notification message to the JavaScript execution layer. The notification message is used to re-trigger the above page display logic so that the displayed page meets the user's current browsing needs. The notification message includes the changed element identifier and the operation type, and the operation type includes adding operation, deleting operation, etc.

[0097] When sending a notification message to the JavaScript execution layer, the native layer may call a communication interface with the JavaScript execution layer to send a notification message to the JavaScript execution layer.

[0098] In step S307, the JavaScript execution layer modifies the virtual tree structure according to the changed element identifier, and sends a second drawing message to the conversion layer.

[0099] After receiving the notification message, the JavaScript execution layer modifies the virtual tree structure according to the operation type of the element corresponding to the changed element identifier. For example, if the operation type is a delete operation, the JavaScript execution layer will delete the element corresponding to the element identifier in the virtual tree structure; if the operation type is an add operation, the JavaScript execution layer will add the element corresponding to the element identifier in the virtual tree structure.

[0100] Based on the modified virtual tree structure, the JavaScript execution layer generates a second drawing message including the modified virtual tree structure, etc., and then sends the second drawing message to the conversion layer by calling the communication interface with the conversion layer.

[0101] In step S308 , the conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer, and sends the multiple second views to the native layer, which performs page display.

[0102] After receiving the second drawing message, the conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer based on the pre-built rule database.

[0103] It should be noted here that the first view and the second view are only for illustrating that when the page display content changes, the views corresponding to different elements will change. In fact, before and after the triggering operation, the first view and the second view corresponding to the same element on the page are the same.

[0104] After acquiring the multiple second views, the conversion layer sends the multiple second views to the native layer by calling the communication interface between the conversion layer and the native layer, and then the native layer displays the page according to the second views.

[0105] For the above process, in order to facilitate understanding, the following will be Figure 4 Take this as an example to illustrate.

[0106] See also Figure 4When the web page requested for display is obtained, the JavaScript execution layer parses the web page requested for display to obtain a JavaScript file. During the execution of the JavaScript file, the JavaScript execution layer generates a virtual tree structure, and then sends a first drawing message including the virtual tree structure to the conversion layer by calling the communication interface between the conversion layer. After receiving the first drawing message, the elements in the virtual tree structure are converted into a first view recognizable by the native layer, and then the first view is sent to the native layer by calling the communication interface between the native layer, and the native layer displays the page. When a click operation or a sliding operation on the displayed page is detected, the native layer sends a communication message to the JavaScript execution layer to trigger the JavaScript execution layer to modify the virtual tree structure, and then sends a second drawing message including the modified virtual tree structure to the conversion layer by calling the communication interface between the conversion layer. When the second drawing message is received, the conversion layer converts the elements in the virtual tree structure into a second view recognizable by the native layer, and sends the second view to the native layer by calling the communication interface between the native layer, and the native layer displays the page.

[0107] The method provided by the embodiment of the present disclosure converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from the web page to the native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0108] Figure 5 FIG. 1 is a schematic diagram of a page display device according to an exemplary embodiment. Figure 5 The page display device includes: a JavaScript execution layer 501, a conversion layer 502 and a native layer 503.

[0109] The JavaScript execution layer 501 is configured to parse the specified web page requested for display and obtain a JavaScript file;

[0110] The JavaScript execution layer 501 is configured to generate a virtual tree structure during the execution of the JavaScript file, and send a first drawing message to the conversion layer, where the first drawing message includes the virtual tree structure, the virtual tree structure includes a plurality of elements, and each element is described by a JavaScript statement;

[0111] The conversion layer 502 is configured to convert the multiple elements in the virtual tree structure into multiple first views recognizable by the native layer, and send the multiple first views to the native layer;

[0112] The native layer 503 is configured to perform page display.

[0113] In another embodiment of the present disclosure, the JavaScript execution layer 501 is configured to call the communication interface between the JavaScript execution layer 501 and the conversion layer 502 to send a first drawing message to the conversion layer 502 .

[0114] In another embodiment of the present disclosure, the conversion layer 502 is configured to convert multiple elements in the virtual tree structure into multiple first views recognizable by the native layer based on a pre-built rule database, and the rule database stores the correspondence between JavaScript statements and views.

[0115] In another embodiment of the present disclosure, the conversion layer 502 is configured to update the rule database according to the updated JavaScript statement and the updated view when the updated JavaScript statement and the updated view are obtained.

[0116] In another embodiment of the present disclosure, the native layer 503 is configured to send a notification message to the JavaScript execution layer when a trigger operation is detected on a specified web page, the notification message including the changed element identifier;

[0117] The JavaScript execution layer 501 is configured to modify the virtual tree structure according to the changed element identifier, and send a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure;

[0118] The conversion layer 502 is configured to convert the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer 503 , and send the multiple second views to the native layer 503 , so that the native layer 503 performs page display.

[0119] In another embodiment of the present disclosure, the native layer 503 is configured to call the communication interface between the native layer 503 and the JavaScript execution layer 501 to send a notification message to the JavaScript execution layer 501 .

[0120] The device provided by the embodiment of the present disclosure converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from the web page to the native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0121] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0122] Figure 6 6 is a block diagram of an apparatus 600 for page display according to an exemplary embodiment. For example, the apparatus 600 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0123] Reference Figure 6 , the device 600 may include one or more of the following components: a processing component 602 , a memory 604 , a power component 606 , a multimedia component 608 , an audio component 610 , an input / output (I / O) interface 612 , a sensor component 614 , and a communication component 616 .

[0124] The processing component 602 generally controls the overall operation of the device 600, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 602 may include one or more processors 620 to execute instructions to complete all or part of the steps of the above-mentioned method. In addition, the processing component 602 may include one or more modules to facilitate the interaction between the processing component 602 and other components. For example, the processing component 602 may include a multimedia module to facilitate the interaction between the multimedia component 608 and the processing component 602.

[0125] The memory 604 is configured to store various types of data to support operations on the device 600. Examples of such data include instructions for any application or method operating on the device 600, contact data, phone book data, messages, pictures, videos, etc. The memory 604 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0126] The power supply component 606 provides power to the various components of the device 600. The power supply component 606 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the device 600.

[0127] The multimedia component 608 includes a screen that provides an output interface between the device 600 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 608 includes a front camera and / or a rear camera. When the device 600 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0128] The audio component 610 is configured to output and / or input audio signals. For example, the audio component 610 includes a microphone (MIC), and when the device 600 is in an operating mode, such as a call mode, a recording mode, and a speech recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 604 or sent via the communication component 616. In some embodiments, the audio component 610 also includes a speaker for outputting audio signals.

[0129] I / O interface 612 provides an interface between processing component 602 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: a home button, a volume button, a start button, and a lock button.

[0130] The sensor assembly 614 includes one or more sensors for providing various aspects of status assessment for the device 600. For example, the sensor assembly 614 can detect the open / closed state of the device 600, the relative positioning of components, such as the display and keypad of the device 600, and the sensor assembly 614 can also detect the position change of the device 600 or a component of the device 600, the presence or absence of user contact with the device 600, the orientation or acceleration / deceleration of the device 600, and the temperature change of the device 600. The sensor assembly 614 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 614 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 614 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0131] The communication component 616 is configured to facilitate wired or wireless communication between the device 600 and other devices. The device 600 can access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 616 receives a broadcast signal or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 616 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0132] In an exemplary embodiment, the apparatus 600 may be implemented by one or more application specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors or other electronic components to perform the above method.

[0133] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 604 including instructions, and the instructions can be executed by a processor 620 of the device 600 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0134] The device provided by the embodiment of the present disclosure converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from the web page to the native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0135] The present disclosure provides a computer-readable storage medium storing at least one instruction, wherein the at least one instruction is loaded and executed by a processor to implement Figure 2 or Figure 3 The page display method described.

[0136] The computer-readable storage medium provided by the embodiment of the present disclosure converts multiple elements in the virtual tree structure into multiple first views recognizable by the native layer through the conversion layer, and then the native layer displays the page according to the first view. This process converts the display form of the specified web page from the web page to the native page by performing statement conversion, which not only provides a new page display method, but also has a better page display effect.

[0137] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0138] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A page display method, characterized in that: The method is applied to a page display device, which includes a JavaScript execution layer, a conversion layer and a native layer. The conversion layer is a business layer provided by a terminal operating system and capable of performing statement conversion. The conversion layer can convert a virtual tree structure sent by the JavaScript execution layer into a view recognizable by the native layer. The method includes: The JavaScript execution layer parses the specified web page requested for display to obtain a JavaScript file, wherein the specified web page is a web page in a web application, and the web application is not installed on the terminal, wherein hypertext markup language data, the JavaScript file and the view are packaged together in the web application, so that when a user browses a web page corresponding to the web application, the conversion layer obtains JavaScript statements and views from the data parsed by the JavaScript execution layer, establishes a rule database based on the obtained JavaScript statements and views, and stores the established rule database, wherein the rule database stores the corresponding relationship between JavaScript statements and views; In the process of executing the JavaScript file, the JavaScript execution layer generates a virtual tree structure, and calls the communication interface between the JavaScript execution layer and the conversion layer to send a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, and the virtual tree structure includes a plurality of elements, each of which is described by a JavaScript statement; Based on the pre-built rule database, the conversion layer obtains the view corresponding to the JavaScript statement used to describe each element in the virtual tree structure from the rule database, and uses the obtained view as the first view, which can be recognized by the native layer; The conversion layer sends the plurality of first views converted from the plurality of elements in the virtual tree structure to the native layer; The native layer renders the specified web page by calling the application programming interface of the native graphical user interface of the terminal operating system to obtain a native page corresponding to the specified web page; The native layer displays the native page; When a trigger operation is detected on the designated web page, the native layer calls the communication interface between the native layer and the JavaScript execution layer to send a notification message to the JavaScript execution layer, wherein the notification message includes a changed element identifier; The JavaScript execution layer modifies the virtual tree structure according to the operation type of the element corresponding to the changed element identifier, and sends a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure; After receiving the second drawing message, the conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer based on the rule database, and sends the multiple second views to the native layer, so that the native layer performs page display; The method further comprises: When the updated JavaScript statement and the updated view are obtained, the conversion layer updates the rule database according to the updated JavaScript statement and the updated view.

2. A page display device, characterized in that: The page display device includes a JavaScript execution layer, a conversion layer and a native layer. The conversion layer is a business layer provided by the terminal operating system and capable of performing statement conversion. The conversion layer stores the correspondence between JavaScript statements and views and can convert the virtual tree structure sent by the JavaScript execution layer into a view recognizable by the native layer. The JavaScript execution layer is used to parse the specified web page requested for display to obtain a JavaScript file, wherein the specified web page is a web page in a web application, and the web application is not installed on the terminal, wherein hypertext markup language data, the JavaScript file and the view are packaged together in the web application, so that when a user browses a web page corresponding to the web application, the conversion layer obtains JavaScript statements and views from the data parsed by the JavaScript execution layer, establishes a rule database based on the obtained JavaScript statements and views, and stores the established rule database, wherein the rule database stores the corresponding relationship between JavaScript statements and views; The JavaScript execution layer is further used to generate a virtual tree structure during the execution of the JavaScript file, and call the communication interface with the conversion layer to send a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, and the virtual tree structure includes a plurality of elements, each of which is described by a JavaScript statement; The conversion layer is used to obtain, based on the pre-built rule database, a view corresponding to a JavaScript statement used to describe each element in the virtual tree structure from the rule database, and use the obtained view as a first view, where the first view can be recognized by the native layer; The conversion layer is further used to send a plurality of first views converted from a plurality of elements in the virtual tree structure to the native layer; The native layer is used to render the specified web page by calling the application programming interface of the native graphical user interface of the terminal operating system to obtain a native page corresponding to the specified web page; The native layer is also used to display the native page; The native layer is further configured to, when a trigger operation is detected on the specified web page, call a communication interface with the JavaScript execution layer to send a notification message to the JavaScript execution layer, wherein the notification message includes a changed element identifier; The JavaScript execution layer is further used to modify the virtual tree structure according to the operation type of the element corresponding to the changed element identifier, and send a second drawing message to the conversion layer, where the second drawing message includes the modified virtual tree structure; The conversion layer is further configured to, after receiving the second drawing message, convert the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer based on the rule database, and send the multiple second views to the native layer, so that the native layer performs page display; The conversion layer is further used to update the rule database according to the updated JavaScript statements and the updated views when the updated JavaScript statements and the updated views are obtained.

3. A page display device, characterized in that: include: processor; a memory for storing instructions executable by a processor; Wherein, the processor is configured to: The specified web page requested for display is parsed through the JavaScript execution layer to obtain a JavaScript file, wherein the specified web page is a web page in a web application, and the web application is not installed on the terminal, wherein hypertext markup language data, the JavaScript file and the view are packaged together in the web application, so that when a user browses the web page corresponding to the web application, the JavaScript statement and the view are obtained from the data parsed by the JavaScript execution layer through the conversion layer, and a rule database is established based on the obtained JavaScript statement and view, and the established rule database is stored, wherein the rule database stores the corresponding relationship between the JavaScript statement and the view; the conversion layer is a business layer provided by the terminal operating system and capable of performing statement conversion, and the conversion layer can convert the virtual tree structure sent by the JavaScript execution layer into a view recognizable by the native layer; In the process of executing the JavaScript file, a virtual tree structure is generated by the JavaScript execution layer, and a communication interface with the conversion layer is called to send a first drawing message to the conversion layer, wherein the first drawing message includes the virtual tree structure, and the virtual tree structure includes a plurality of elements, each of which is described by a JavaScript statement; Based on the pre-built rule database, the view corresponding to the JavaScript statement used to describe each element in the virtual tree structure is obtained from the rule database through the conversion layer, and the obtained view is used as the first view, which can be recognized by the native layer; Sending a plurality of first views converted from a plurality of elements in the virtual tree structure to the native layer through the conversion layer; The designated web page is rendered by calling the application programming interface of the native graphical user interface of the terminal operating system through the native layer to obtain a native page corresponding to the designated web page; Displaying the native page through the native layer; When a trigger operation is detected on the designated web page, a notification message is sent to the JavaScript execution layer through the native layer calling the communication interface between the native layer and the JavaScript execution layer, wherein the notification message includes a changed element identifier; Modifying the virtual tree structure by the JavaScript execution layer according to the operation type of the element corresponding to the changed element identifier, and sending a second drawing message to the conversion layer, wherein the second drawing message includes the modified virtual tree structure; After receiving the second drawing message, the conversion layer converts the multiple elements in the modified virtual tree structure into multiple second views recognizable by the native layer based on the rule database, and sends the multiple second views to the native layer, so that the native layer performs page display; When the updated JavaScript statement and the updated view are obtained, the rule database is updated according to the updated JavaScript statement and the updated view through the conversion layer.

4. A computer-readable storage medium, characterized in that: The storage medium stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the page display method according to claim 1.