Web page generation method, device, electronic device and readable storage medium

By cached parsed node data objects before opening the target web page and reused during rendering, the problem of limited improvement in web page opening speed in the prior art is solved, and the loading speed of web pages is significantly improved.

CN113626742BActive Publication Date: 2025-06-06VIVO MOBILE COMM CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110880720.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-08-02
Publication Date
2025-06-06
Estimated Expiration
2041-08-02

AI Technical Summary

Technical Problem

In the prior art, only optimization is carried out for network delay, resulting in limited improvement in web page opening speed.

Method used

By cached the parsed and renderable node data objects before opening the destination web page, query the cached data during rendering, and reuse it directly if it exists, eliminating the re-parsing process.

Benefits of technology

It greatly reduces the browser's parsing time and improves the opening speed of web pages.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113626742B_ABST
    Figure CN113626742B_ABST
Patent Text Reader

Abstract

The present application discloses a webpage generation method, device, electronic device and readable storage medium, which belongs to the field of Internet technology. The webpage generation method includes: obtaining a node to be rendered of a target webpage; generating rendering data of the node to be rendered according to the target node data object when there is a target node data object corresponding to the target identifier of the node to be rendered in the cache data; wherein the cache data includes at least one identifier and a node data object corresponding to each of the identifiers, the node data object is obtained by parsing a node in a first webpage, the first webpage being a webpage generated before the target webpage; and displaying the target webpage according to the rendering data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of Internet technology, and specifically relates to a web page generation method, device, electronic device and readable storage medium. Background Art

[0002] With the rapid development of wireless mobile technology, the storage performance and processing performance of mobile devices have been improved, and more and more businesses are using HyperText Markup Language 5 (H5) to implement. The process of opening an H5 can be divided into the following steps: 1. The Uniform Resource Locator (URL) initiates a request; 2. The Domain Name System (DNS) query; 3. The server responds to the request and returns the index.html file; 4. The client receives the index.html file and reads the file; 5. The client parses the index.html file and renders it. After rendering, it accesses the server to obtain interface data in the page, and generates new html data after parsing the interface data; 6. Parses the new html data; 7. Complete the page display. However, the above steps 1-3 need to rely on network transmission. If the network signal is not good, the H5 loading will fail. The current static resource caching solution is to send the H5 static resources to the client in the form of resource packages, and directly load the local H5 resources when the client needs to load H5. This method can bypass the network loading time and improve the local loading speed and loading success rate.

[0003] However, the above solutions only consider network delay, and the improvement in the speed of opening web pages is limited. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a web page generation method, device, electronic device and readable storage medium, which can solve the problem that the prior art only optimizes network delay and has limited improvement in web page opening speed.

[0005] In a first aspect, an embodiment of the present application provides a method for generating a webpage, the method comprising:

[0006] Get the node to be rendered of the target web page;

[0007] In the case where there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data, generating rendering data of the node to be rendered according to the target node data object; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, and the node data object is obtained by parsing a node in a first webpage, and the first webpage is a webpage generated before the target webpage;

[0008] The target webpage is displayed according to the rendering data.

[0009] In a second aspect, an embodiment of the present application provides a webpage generation device, the device comprising:

[0010] An acquisition module is used to acquire the nodes to be rendered of the target web page;

[0011] A generating module, configured to generate rendering data of the node to be rendered according to the target node data object when there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, the node data object being obtained by parsing a node in a first web page, the first web page being a web page generated before the target web page;

[0012] A display module is used to display the target web page according to the rendering data.

[0013] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.

[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.

[0015] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.

[0016] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the target web page, and a query is performed in the cached data when the target web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the speed of opening the web page. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1 A schematic diagram of a flow chart of a web page generation method provided in an embodiment of the present application;

[0018] Figure 2 A schematic diagram of the structure of a web page generating device provided in an embodiment of the present application;

[0019] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0020] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.

[0022] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.

[0023] The webpage generation method, device, electronic device, and readable storage medium provided in the embodiments of the present application are described in detail below with reference to the accompanying drawings through specific embodiments and their application scenarios.

[0024] Please refer to Figure 1 , is a flow chart of a webpage generation method provided in an embodiment of the present application. Figure 1As shown, an embodiment of the present application provides a method for generating a web page, the method comprising the following steps:

[0025] Step 101: Obtain the nodes to be rendered of the target web page.

[0026] In the embodiment of the present application, the target webpage usually has a plurality of nodes to be rendered. When rendering is required, the nodes to be rendered are loaded one by one for rendering.

[0027] Step 102: When there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data, generating rendering data of the node to be rendered according to the target node data object; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, and the node data object is obtained by parsing the nodes in a first web page, and the first web page is a web page generated before the target web page.

[0028] In an embodiment of the present application, when a first web page before a target web page is generated, the node data objects and corresponding identifiers obtained after parsing the nodes in the first web page are saved one by one in the form of cached data. When the target web page is opened, it is possible to query in the cached data whether there is a target node data object corresponding to the target identifier of the node to be rendered of the target web page. If so, the target node data object in the cached data can be reused to generate rendering data of the node to be rendered, thereby eliminating the process of parsing the corresponding node to be rendered and improving the speed of opening the web page.

[0029] Among them, the so-called node data object is a parsed and renderable node object obtained by parsing the node, which can be saved in the form of object data. The identifier is determined according to the content of the node and is used to mark the type of the node, etc. The identifier corresponds to the node data object one by one.

[0030] Step 103: Display the target webpage according to the rendering data.

[0031] In an embodiment of the present application, if a target node data object corresponding to a target identifier of a node to be rendered exists in the cache data, the rendering data of the node to be rendered can be directly obtained according to the cache data, thereby eliminating the process of parsing the corresponding node to be rendered. Afterwards, the target web page can be generated and displayed according to the obtained rendering data.

[0032] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the target web page, and a query is performed in the cached data when the target web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the speed of opening the web page.

[0033] In some embodiments of the present application, after querying in the cache data whether there is a target node data object corresponding to the target identifier of the node to be rendered, the method further includes:

[0034] If the target node data object does not exist in the cache data, downloading the node data corresponding to the node to be rendered;

[0035] Parsing the node data to obtain the target node data object;

[0036] The target node data object and the target identifier are associated and stored in the cache data, and rendering data of the node to be rendered is generated according to the target node data object.

[0037] That is to say, if the target node data object corresponding to the target identifier cannot be found in the cache data, it means that this type of node has not been parsed before the target web page. Therefore, it is necessary to download the node data corresponding to the node to be rendered from the server. The node data is only a partial fragment in the target web page, that is, the web page content file corresponding to the node to be rendered; then, the node data is parsed to obtain a parsed and renderable target node data object; then, the target node data object and the target identifier are associated and saved in the cache data to update the cache data, so that when the web page is opened subsequently, if it is necessary to render this type of node, the target node data object can be directly reused; and after obtaining the target node data object, the target node data object can be used to generate the rendering data of the node to be rendered, thereby realizing the rendering of the node to be rendered.

[0038] It can be known that when the target webpage is the first webpage opened by the browser, that is, when no first webpage has been generated before the target webpage, there is no cache data. At this time, all nodes to be rendered in the target webpage need to be parsed to make them parsed and renderable node data objects. Generally, the more node data objects in the cache data, the more node data objects can be reused when opening the target webpage, the fewer nodes to be rendered that need to be parsed, the less time it takes to parse, and the faster the target webpage is usually opened.

[0039] In some other embodiments of the present application, obtaining the to-be-rendered node of the target webpage includes:

[0040] Receive at least one to-be-rendered node of a target webpage and a target identifier corresponding to each to-be-rendered node sent by a server;

[0041] The at least one node to be rendered is obtained by the server splitting the target webpage, and the target identifier corresponding to the node to be rendered is generated by the server according to the content of the node to be rendered.

[0042] That is, the to-be-rendered node is obtained by splitting the target web page for the server, and the server sends the web page to the electronic device after completing the splitting.

[0043] Exemplarily, in the embodiment of the present application, the server has the ability to split web page files. Usually, a web page file includes a series of tags, through which the document format on the network can be unified, so that the scattered network resources are connected into a logical whole. A simple web page file content is as follows:

[0044]

[0045] A node is a section of content in a web page file. In order to parse and cache many nodes in a web page file, the server can split the web page file into several nodes. For example, the web page file can be split into the following parts / nodes:

[0046] Part 1: Main frame,

[0047]

[0048] Part 2: Head,

[0049]

[0050]

[0051] Part 3: Content body,

[0052]

[0053] The content theme can be divided into:

[0054] Paragraph 1;

[0055] Paragraph 2;

[0056] Paragraph 3.

[0057] It can be seen that after the server splits, each part is a node and corresponds to a unique identifier, which is generated by the server according to the content of the corresponding node. Optionally, if the split node contains other nodes (such as a content node), it can be identified by a content placeholder, which can be a symbol used to identify that there is content here, or an identifier (i.e., the identifier of another node), so that the split node is reusable.

[0058] Optionally, the server can issue the nodes (or fragmented content) of the target webpage in advance or in real time, and in the process of issuing, the key-value format can be used, that is, the nodes and identifiers are matched one by one. Optionally, the server can also identify the type of the node during the issuing process.

[0059] In some embodiments of the present application, the cache data is obtained when generating a first web page, wherein the first web page is a web page received before the target web page, that is, similarly, the server splits the first web page into several nodes and sends them to the electronic device, and the electronic device parses each node of the first web page to make it a parsed and renderable node data object, and then stores it in a one-to-one correspondence with the identifier to obtain the cache data.

[0060] In the embodiment of the present application, since the electronic device receives several nodes obtained by the server after splitting the web page, for the nodes that need to be parsed that are not stored in the cache data, a multi-threaded concurrent parsing technology can be used to improve the parsing speed. That is, the electronic device can use a multi-threaded approach to parse multiple nodes at the same time, thereby improving the node parsing speed and saving the time required for parsing.

[0061] In the embodiment of the present application, the node data object obtained after parsing the node may include the following parts of data: 1. View frame; 2. Variable part content. Take a node in the above text as an example:

[0062]

[0063] Content placeholder 3

[0064] Content Placeholder 4

[0065] Content placeholder 5

[0066] .

[0067] The body part defines a view frame. After parsing it as an independent node, its corresponding node data object is: 1. View part (body frame); 2. Variable content (three). At this time, the reusable body only stipulates that there are three variable components inside, and there is no specific regulation as to what they are. When rendering, what needs to be put inside can be determined by other nodes (such as the content corresponding to the content placeholder). Therefore, this body component is reusable, so we can cache this node data object and use it directly when we need to use similar components later.

[0068] In some embodiments of the present application, generating rendering data of the node to be rendered according to the target node data object includes:

[0069] The target node data object in the cache data is used to render the node to be rendered, and rendering data of the node to be rendered is generated.

[0070] As can be seen from the above content, if the target node data object corresponding to the target identifier can be queried in the cache data, since the target node data object can be directly rendered, the target node data can be directly used to render the node to be rendered, thereby obtaining the rendering data of the node to be rendered. Optionally, the rendering in the embodiment of the present application can adopt DOM rendering and other methods.

[0071] In some other embodiments of the present application, the cached data also includes pre-rendered data, the pre-rendered data is obtained by pre-rendering a first node data object, and the first node data is a node data object in the cached data whose reuse rate is higher than a preset threshold;

[0072] The step of obtaining rendering data of the node to be rendered according to the target node data object includes:

[0073] Determining target pre-rendering data corresponding to the target node data object from the pre-rendering data;

[0074] The target pre-rendering data is determined as rendering data of the node to be rendered.

[0075] Exemplarily, the electronic device in the embodiment of the present application has pre-rendering capability. The so-called pre-rendering is an off-screen rendering capability. Under normal circumstances, rendering occurs when the view is about to be displayed. In the embodiment of the present application, the timing of rendering can be advanced. When the user does not open the browser, the node component with a higher reuse rate (i.e., the node data object) is rendered to obtain pre-rendered data. The rendering here can be understood as a solution for converting all renderable data into data that can be directly used for display on a computer display unit. Therefore, when generating a target web page, there is no need to perform secondary data conversion when displaying. Instead, the data is directly transmitted to the computer display unit to display the corresponding image at the fastest speed, thereby saving a lot of time-consuming calculations and data conversion.

[0076] That is to say, in the embodiment of the present application, by pre-rendering the node data object whose reuse rate is higher than the preset threshold, it is directly rendered into display data that can be directly used by the computer display unit, that is, pre-rendered data, and cached. When searching, the target node data object corresponding to the identifier is directly found to obtain the target pre-rendered data, and the target pre-rendered data is determined as the rendering data of the node to be rendered, so that the rendering data can be directly used to generate and display the target web page.

[0077] In summary, in an embodiment of the present application, when generating a target web page, each node to be rendered of the target web page is obtained one by one, and a search is performed in the cache data to determine whether a target node data object exists. If so, and the target node data object has pre-rendered target pre-rendering data, the target pre-rendering data is directly used to generate and display the corresponding part of the target web page. If the target node data object does not have pre-rendered target pre-rendering data, the target node data object is used to render the node to be rendered to obtain the rendering data of the node to be rendered. If the target node data object does not exist, the node data corresponding to the node to be rendered in the target web page is downloaded and parsed to obtain the target node data object, and then the target node data object is saved in the cache data to update the cache data. At the same time, the target node data object is used to render the node to be rendered to obtain the rendering data of the node to be rendered. Finally, the target web page is generated and displayed.

[0078] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the web page, and a query is performed in the cached data when the web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the opening speed of the web page.

[0079] It should be noted that the webpage generation method provided in the embodiment of the present application can be executed by a webpage generation device or a control module in the webpage generation device for executing the webpage generation method. In the embodiment of the present application, the webpage generation device executing the webpage generation method is taken as an example to illustrate the webpage generation device provided in the embodiment of the present application.

[0080] Please refer to Figure 2 , is a schematic diagram of the structure of a webpage generation device provided in an embodiment of the present application. Figure 2 As shown, another embodiment of the present application further provides a webpage generation device, the device 20 comprising:

[0081] An acquisition module 21 is used to acquire a node to be rendered of a target web page;

[0082] A generating module 22 is used to generate rendering data of the node to be rendered according to the target node data object when there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, and the node data object is obtained by parsing the nodes in the first web page, and the first web page is a web page generated before the target web page;

[0083] The display module 23 is used to display the target web page according to the rendering data.

[0084] Optionally, the device 20 further includes:

[0085] A download module, used for downloading the node data corresponding to the node to be rendered when the target node data object does not exist in the cache data;

[0086] A parsing module, used for parsing the node data to obtain the target node data object;

[0087] The saving module is used to associate the target node data object with the target identifier and save it in the cache data, and generate rendering data of the node to be rendered according to the target node data object.

[0088] Optionally, the acquisition module includes:

[0089] A receiving unit, configured to receive at least one to-be-rendered node of a target webpage and a target identifier corresponding to each to-be-rendered node sent by a server;

[0090] The at least one node to be rendered is obtained by the server splitting the target webpage, and the target identifier corresponding to the node to be rendered is generated by the server according to the content of the node to be rendered.

[0091] Optionally, the cached data further includes pre-rendering data, the pre-rendering data is obtained by pre-rendering a first node data object, and the first node data is a node data object in the cached data whose reuse rate is higher than a preset threshold;

[0092] The generation module comprises:

[0093] A first determining unit, configured to determine target pre-rendering data corresponding to the target node data object from the pre-rendering data;

[0094] The second determining unit is configured to determine the target pre-rendering data as the rendering data of the node to be rendered.

[0095] Optionally, the generating module includes:

[0096] The rendering unit is used to render the node to be rendered by using the target node data object in the cache data to generate rendering data of the node to be rendered.

[0097] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the target web page, and a query is performed in the cached data when the target web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the speed of opening the web page.

[0098] The webpage generating device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA), etc. The non-mobile electronic device can be a personal computer (PC), a television (TV), a teller machine, or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.

[0099] The webpage generating device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.

[0100] The webpage generation device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented by the method embodiment are not described here.

[0101] Alternatively, if Figure 3 As shown, the embodiment of the present application also provides an electronic device 300, including a processor 301, a memory 302, and a program or instruction stored in the memory 302 and executable on the processor 301. When the program or instruction is executed by the processor 301, each process of the above-mentioned web page generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0102] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.

[0103] Figure 4 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.

[0104] The electronic device 400 includes but is not limited to: a radio frequency unit 401, a network module 402, an audio output unit 403, an input unit 404, a sensor 405, a display unit 406, a user input unit 407, an interface unit 408, a memory 409, and a processor 4010 and other components.

[0105] Those skilled in the art will appreciate that the electronic device 400 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 4010 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.

[0106] Wherein, the network module 402 is used to obtain the node to be rendered of the target web page;

[0107] Processor 4010 is configured to generate rendering data of the node to be rendered according to the target node data object when there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, the node data object being obtained by parsing a node in a first webpage, the first webpage being a webpage generated before the target webpage;

[0108] Display unit 406, used to display the target web page according to the rendering data

[0109] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the web page, and a query is performed in the cached data when the web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the opening speed of the web page.

[0110] Optionally, the network module 402 is further configured to download node data corresponding to the node to be rendered if the target node data object does not exist in the cache data;

[0111] Optionally, the processor 4010 is further configured to parse the node data to obtain the target node data object;

[0112] The processor 4010 is further configured to generate rendering data of the node to be rendered according to the target node data object;

[0113] The memory 409 is used to store the target node data object and the target identifier in association with each other in the cache data.

[0114] Optionally, the network module 402 is further configured to receive at least one to-be-rendered node of a target webpage and a target identifier corresponding to each to-be-rendered node sent by a server;

[0115] The at least one node to be rendered is obtained by the server splitting the target webpage, and the target identifier corresponding to the node to be rendered is generated by the server according to the content of the node to be rendered.

[0116] Optionally, the cached data further includes pre-rendering data, the pre-rendering data is obtained by pre-rendering a first node data object, and the first node data is a node data object in the cached data whose reuse rate is higher than a preset threshold;

[0117] The step of obtaining rendering data of the node to be rendered according to the target node data object includes:

[0118] Determining target pre-rendering data corresponding to the target node data object from the pre-rendering data;

[0119] The target pre-rendering data is determined as rendering data of the node to be rendered.

[0120] Optionally, generating rendering data of the node to be rendered according to the target node data object includes:

[0121] The target node data object in the cache data is used to render the node to be rendered, and rendering data of the node to be rendered is generated.

[0122] In an embodiment of the present application, the parsed and renderable node data objects are cached before opening the target web page, and a query is performed in the cached data when the target web page is opened for rendering. If there is a corresponding node data object, it is directly reused, thereby eliminating the process of re-parsing the corresponding node, greatly reducing the browser's parsing time, and improving the speed of opening the web page.

[0123] It should be understood that in the embodiment of the present application, the input unit 404 may include a graphics processor (Graphics Processing Unit, GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of the static picture or video obtained by the image capture device (such as a camera) in the video capture mode or the image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 409 can be used to store software programs and various data, including but not limited to applications and operating systems. The processor 4010 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the modem processor may not be integrated into the processor 4010.

[0124] The embodiment of the present application further provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned web page generation method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.

[0125] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0126] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned web page generation method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0127] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0128] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.

[0129] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0130] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

Claims

1. A web page generation method, It is characterized in that include: Get the node to be rendered of the target web page; The target webpage has multiple nodes to be rendered; In the case where there is a target node data object corresponding to the target identifier of the node to be rendered in the cache data, the rendering data of the node to be rendered is generated according to the target node data object; wherein the cache data includes at least one identifier and a node data object corresponding to each identifier, the node data object is obtained by parsing the nodes in the first web page, the first web page has a plurality of nodes, each identifier corresponds to a node, and the first web page is a web page generated before the target web page; the identifier is generated by the server according to the content of the corresponding node; if other nodes are included in the split nodes, the other nodes are identified by content placeholders, and the content placeholders are symbols used to identify that there is content here or identifiers of the other nodes; The target webpage is displayed according to the rendering data.

2. The method according to claim 1, It is characterized in that After obtaining the to-be-rendered node of the target webpage, the method further includes: If the target node data object does not exist in the cache data, downloading the node data corresponding to the node to be rendered; Parsing the node data to obtain the target node data object; The target node data object and the target identifier are associated and stored in the cache data, and rendering data of the node to be rendered is generated according to the target node data object.

3. The method according to claim 1, It is characterized in that The step of obtaining the to-be-rendered node of the target webpage includes: Receive at least one to-be-rendered node of a target webpage and a target identifier corresponding to each to-be-rendered node sent by a server; The at least one node to be rendered is obtained by the server splitting the target webpage, and the target identifier corresponding to the node to be rendered is generated by the server according to the content of the node to be rendered.

4. The method according to claim 1, It is characterized in that The cached data also includes pre-rendering data, where the pre-rendering data is obtained by pre-rendering a first node data object, and the first node data is a node data object in the cached data whose reuse rate is higher than a preset threshold; The step of obtaining rendering data of the node to be rendered according to the target node data object includes: Determining target pre-rendering data corresponding to the target node data object from the pre-rendering data; The target pre-rendering data is determined as rendering data of the node to be rendered.

5. The method according to claim 1, It is characterized in that The step of generating rendering data of the node to be rendered according to the target node data object comprises: The target node data object in the cache data is used to render the node to be rendered, and rendering data of the node to be rendered is generated.

6. A web page generating device, It is characterized in that include: An acquisition module is used to acquire the nodes to be rendered of the target web page; The target webpage has multiple nodes to be rendered; A generation module, configured to generate rendering data of the node to be rendered according to the target node data object when there is a target node data object corresponding to the target identifier of the node to be rendered in the cached data; wherein the cached data includes at least one identifier and a node data object corresponding to each of the identifiers, the node data object is obtained by parsing the nodes in a first web page, the first web page has a plurality of nodes, each identifier corresponds to a node, and the first web page is a web page generated before the target web page; the identifier is generated by the server according to the content of the corresponding node; if other nodes are included in the split nodes, the other nodes are identified by content placeholders, the content placeholders are symbols used to identify that there is content here or identifiers of the other nodes; A display module is used to display the target web page according to the rendering data.

7. The device according to claim 6, It is characterized in that Also includes: A download module, used for downloading the node data corresponding to the node to be rendered when the target node data object does not exist in the cache data; A parsing module, used for parsing the node data to obtain the target node data object; The saving module is used to associate the target node data object with the target identifier and save it in the cache data, and generate rendering data of the node to be rendered according to the target node data object.

8. The device according to claim 6, It is characterized in that The acquisition module comprises: A receiving unit, configured to receive at least one to-be-rendered node of a target webpage and a target identifier corresponding to each to-be-rendered node sent by a server; The at least one node to be rendered is obtained by the server splitting the target webpage, and the target identifier corresponding to the node to be rendered is generated by the server according to the content of the node to be rendered.

9. The device according to claim 6, It is characterized in that The cached data also includes pre-rendering data, where the pre-rendering data is obtained by pre-rendering a first node data object, and the first node data is a node data object in the cached data whose reuse rate is higher than a preset threshold; The generation module comprises: A first determining unit, configured to determine target pre-rendering data corresponding to the target node data object from the pre-rendering data; The second determining unit is configured to determine the target pre-rendering data as the rendering data of the node to be rendered.

10. The device according to claim 6, It is characterized in that The generation module comprises: The rendering unit is used to render the node to be rendered by using the target node data object in the cache data to generate rendering data of the node to be rendered.

11. An electronic device, It is characterized in that The method comprises a processor, a memory and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the webpage generation method according to any one of claims 1 to 5.

12. A readable storage medium, It is characterized in that The readable storage medium stores a program or instruction, and when the program or instruction is executed by a processor, the steps of the webpage generation method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Method and device for rendering webpage of mobile explorer

    CN106776761A

  • Page display method, device and equipment and storage medium

    CN109634598A