Webpage loading method and apparatus, and electronic device
By prioritizing the loading and rendering of the content of the anchor page, the problem of time-consuming loading of anchor pages is solved and the user's web browsing experience is improved.
Patent Information
- Application Number
- PCT/CN2024/123584
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-31
- Filing Date
- 2024-10-09
- Publication Date
- 2025-08-07
AI Technical Summary
During the browsing of web pages with anchor points, the loading and rendering of anchor points pages in the prior art takes a long time, resulting in poor user experience.
By changing the order in which web pages are loaded and rendered, the content of the anchor page is loaded and rendered first, and the anchor page is displayed first in the display window, and then the content of other areas is gradually loaded and rendered.
It speeds up the display rate of anchor pages, improves user experience, and allows users to see the target page faster.
Smart Images

Figure CN2024123584_07082025_PF_FP_ABST
Abstract
Description
Method, device and electronic device for loading web pages
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on January 31, 2024, with application number 202410145748.4 and application name “Method, device and electronic device for loading web pages”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] Embodiments of the present application relate to the field of web page loading, and more specifically, to a method, apparatus, and electronic device for loading a web page. Background Art
[0003] Currently, when browsing long web pages with anchors, the processes of web page loading, web page rendering, and web page display are carried out in the order of web page content. Only after the web page is fully loaded and rendered will it jump to the anchor page for users to browse. This makes it time-consuming to display the anchor page, which makes it easy for users to perceive that the web page is loading slowly during the web page access process, thus affecting the user experience.
[0004] Summary of the Invention
[0005] This application provides a method, device, and electronic device for loading web pages. This method, device, and electronic device can change the order in which various parts of a web page containing an anchor are loaded and rendered, prioritizing loading and rendering of the content corresponding to the anchor web page. This speeds up the display rate of the anchor web page, allowing users to view the target page more quickly, thereby improving the user experience.
[0006] In a first aspect, a method for loading a web page is provided, the method comprising: receiving a first request message, the first request message being used to request loading a first web page, the first web page containing an anchor corresponding to the first request message; loading content corresponding to a tree in a first area and content corresponding to a parent node tree in the first web page, wherein the parent node tree is a parent node tree of a tree in the first area, and the anchor is located in the first area; rendering content corresponding to the tree in the first area and content corresponding to the parent node tree; and displaying content corresponding to the tree in the first area and content corresponding to the parent node tree in a first display window.
[0007] In some embodiments, the first request message includes the URL of the first webpage, and when the URL of the first webpage contains a "#" identifier, it is determined that the first webpage contains an anchor.
[0008] Among them, the tree of the first area in the first web page refers to the tree structure corresponding to the first area web page in the first web page, the first area web page in the first web page is an anchor page, and the content corresponding to the tree of the first area in the first web page can be understood as the content of the anchor page, and the content of the first web page includes the content of the anchor page. For example, the tree of the first area can be understood as an anchor area tree. Corresponding to the source code or tree structure of a web page, it may include a parent node tree, an anchor area tree, and a sibling tree of the anchor area tree. It should be understood that from the perspective of the displayed web page, the contents displayed by the three split trees are different. In some examples, the parent node tree does not include the data of the anchor area tree and its sibling trees.
[0009] The first display window refers to a display window that displays the loaded first web page.
[0010] It can be understood that the above-mentioned first area can also be described as an anchor area. After loading the content corresponding to the tree of the first area in the first web page and the content corresponding to the parent node tree, the content corresponding to the trees of other areas in the first web page except the first area is further loaded, or the content corresponding to the trees of other areas in the first web page except the first area may not be loaded.
[0011] In an embodiment of the present application, the order in which the content of each part of the web page is loaded and rendered can be changed to prioritize loading and rendering the content corresponding to the anchor web page, thereby speeding up the display rate of the anchor web page, allowing users to see the target page more quickly, thereby improving the user experience.
[0012] In combination with the first aspect, in a possible implementation, the method further includes: loading content corresponding to the tree in the second area of the first web page, where the second area is an area located after the first area in the first web page; and rendering content corresponding to the tree in the second area.
[0013] The tree in the second area of the first webpage refers to a tree structure corresponding to the webpage in the second area of the first webpage, and the webpage in the second area of the first webpage refers to a page located after the anchor page in the first webpage.
[0014] In an embodiment of the present application, after loading and rendering the content of the anchor page so that the anchor page is displayed to the user first, the page after the anchor page in the first web page can be further loaded and rendered, so that the user can quickly view the content after the anchor page by browsing downward after viewing the content of the anchor page, thereby improving the user's web page access experience.
[0015] In combination with the first aspect, in a possible implementation, the method further includes: loading content corresponding to the tree in the third area of the first web page, where the third area is an area in the first web page located before the first area; and rendering content corresponding to the tree in the third area.
[0016] The tree in the third area of the first webpage refers to a tree structure corresponding to the webpage in the third area of the first webpage, and the webpage in the third area of the first webpage refers to a page located before the anchor page in the first webpage.
[0017] It can be understood that the third region webpage in the first webpage, the first region webpage in the first webpage, and the second region webpage in the first webpage constitute the first webpage.
[0018] In an embodiment of the present application, after loading and rendering the content of the anchor page so that the anchor page is displayed to the user first, the page before the anchor page in the first web page can be further loaded and rendered so that the entire first web page can be displayed normally, thereby improving the user's web page access experience.
[0019] In combination with the first aspect, in a possible implementation, the method further includes: in the process of rendering the content corresponding to the tree of the first area and the content corresponding to the parent node tree, adding lazy loading tags to at least some of the nodes constituting the parent node tree.
[0020] In some embodiments, at least some of the above-mentioned nodes may be high-load nodes in the parent node tree, for example, they may be nodes whose load ratio is in the top a% among all nodes in the parent node tree, where the value of a may be any number between 1 and 90, for example.
[0021] In an embodiment of the present application, while rendering the web page content corresponding to the parent node tree and the anchor area tree, the load of rendering the web page content corresponding to the parent node tree is reduced, so that there is more sufficient load for rendering the web page content corresponding to the anchor area tree, which can further improve the display rate of the anchor page.
[0022] In combination with the first aspect, in a possible implementation manner, the height of the first area is greater than or equal to the height of the first display window, and the anchor point is located at the top of the first area.
[0023] In an embodiment of the present application, the height of the anchor page that is preferentially loaded and rendered is greater than or equal to the height of the window displaying the web page, so that the content of the anchor page covers the entire display window, and the user can see as much web page content as possible within the display capability of the device.
[0024] In a second aspect, an electronic device is provided, which includes: a receiving module for receiving a first request message, the first request message being used to request loading the first web page, the first web page containing an anchor point corresponding to the first request message; a loading module for loading the content corresponding to the tree of the first area and the content corresponding to the parent node tree in the first web page, wherein the parent node tree is the parent node tree of the tree of the first area, and the anchor point is located in the first area; a rendering module for rendering the content corresponding to the tree of the first area and the content corresponding to the parent node tree; and a display module for displaying the content corresponding to the tree of the first area and the content corresponding to the parent node tree in a first display window.
[0025] In some embodiments, the first request message includes the URL of the first webpage, and when the URL of the first webpage contains a "#" identifier, it is determined that the first webpage contains an anchor.
[0026] Among them, the tree in the first area of the first web page refers to the tree structure corresponding to the first area web page in the first web page. The first area web page in the first web page is the anchor page. The content corresponding to the tree in the first area of the first web page can be understood as the content of the anchor page. The content of the first web page includes the content of the anchor page.
[0027] The first display window refers to a display window that displays the loaded first web page.
[0028] In an embodiment of the present application, the order in which the content of each part of the web page is loaded and rendered can be changed to prioritize loading and rendering the content corresponding to the anchor web page, thereby speeding up the display rate of the anchor web page, allowing users to see the target page more quickly, thereby improving the user experience.
[0029] In combination with the second aspect, in a possible implementation method, the loading module is also used to: load the content corresponding to the tree in the second area in the first web page, where the second area is the area in the first web page located after the first area; the rendering module is also used to: render the content corresponding to the tree in the second area.
[0030] The tree in the second area of the first webpage refers to a tree structure corresponding to the webpage in the second area of the first webpage, and the webpage in the second area of the first webpage refers to a page located after the anchor page in the first webpage.
[0031] In an embodiment of the present application, after loading and rendering the content of the anchor page so that the anchor page is displayed to the user first, the page after the anchor page in the first web page can be further loaded and rendered, so that the user can quickly view the content after the anchor page by browsing downward after viewing the content of the anchor page, thereby improving the user's web page access experience.
[0032] In combination with the second aspect, in one possible implementation, the loading module is also used to: load the content corresponding to the tree in the third area in the first web page, where the third area is the area in the first web page located before the first area; the rendering module is also used to: render the content corresponding to the tree in the third area.
[0033] The tree in the third area of the first webpage refers to a tree structure corresponding to the webpage in the third area of the first webpage, and the webpage in the third area of the first webpage refers to a page located before the anchor page in the first webpage.
[0034] It can be understood that the third region webpage in the first webpage, the first region webpage in the first webpage, and the second region webpage in the first webpage constitute the first webpage.
[0035] In an embodiment of the present application, after loading and rendering the content of the anchor page so that the anchor page is displayed to the user first, the page before the anchor page in the first web page can be further loaded and rendered so that the entire first web page can be displayed normally, thereby improving the user's web page access experience.
[0036] In combination with the second aspect, in a possible implementation method, the loading module is specifically used to: load the content corresponding to the tree of the first area and the content corresponding to the parent node tree into a shared memory, which is a shared memory of the loading module and the rendering module; the rendering module is also used to: obtain the content corresponding to the tree of the first area and the content corresponding to the parent node tree from the shared memory.
[0037] In an embodiment of the present application, the web page loading process and the web page rendering process interact through shared memory. By preferentially loading the content of the anchor page into the shared memory, the content of the anchor page is further preferentially rendered and displayed.
[0038] In combination with the second aspect, in a possible implementation method, the loading module is also used to: when the content corresponding to the tree of the first area and the content corresponding to the parent node tree are loaded into the shared memory, notify the rendering module to obtain the content corresponding to the tree of the first area and the content corresponding to the parent node tree from the shared memory.
[0039] In an embodiment of the present application, after the content of the anchor page is preferentially loaded into the shared memory, the rendering process is notified to obtain the content of the anchor page from the shared memory and render it, so that the content of the anchor page is preferentially rendered and displayed.
[0040] In combination with the second aspect, in a possible implementation method, the loading module is specifically used to: load the content corresponding to the tree in the second area into a shared memory, which is a shared memory of the loading module and the rendering module; the rendering module is also used to: obtain the content corresponding to the tree in the second area from the shared memory.
[0041] In an embodiment of the present application, the web page loading process and the web page rendering process interact through shared memory. After the anchor page is rendered, the page content after the anchor page is loaded into the shared memory, so that the page content after the anchor page is further rendered and displayed, so that the user can further browse the remaining web page content after browsing the anchor page.
[0042] In combination with the second aspect, in a possible implementation, the loading module is further used to: when the content corresponding to the tree in the second area is loaded into the shared memory, notify the rendering module to obtain the content corresponding to the tree in the second area from the shared memory.
[0043] In combination with the second aspect, in one possible implementation, the loading module is specifically used to: load the content corresponding to the tree in the third area into a shared memory, which is a shared memory of the loading module and the rendering module; the rendering module is also used to: obtain the content corresponding to the tree in the third area from the shared memory.
[0044] In an embodiment of the present application, the web page loading process and the web page rendering process interact through shared memory. After rendering the anchor page and the page after the anchor page, the page content before the anchor page is loaded into the shared memory, and the page content before the anchor page is further rendered and displayed, so that all the web pages visited by the user can be displayed normally.
[0045] In combination with the second aspect, in a possible implementation, the loading module is further used to: when the content corresponding to the tree in the third area is loaded into the shared memory, notify the rendering module to obtain the content corresponding to the tree in the third area from the shared memory.
[0046] In combination with the second aspect, in a possible implementation, the device also includes: a marking module for adding lazy loading tags to at least some of the nodes constituting the parent node tree during the process of rendering the content corresponding to the tree of the first area and the content corresponding to the parent node tree.
[0047] In some embodiments, at least some of the above-mentioned nodes may be high-load nodes in the parent node tree, for example, they may be nodes whose load ratio is in the top a% among all nodes in the parent node tree, where the value of a may be any number between 1 and 90, for example.
[0048] In an embodiment of the present application, while rendering the web page content corresponding to the parent node tree and the anchor area tree, the load of rendering the web page content corresponding to the parent node tree is reduced, so that there is more sufficient load for rendering the web page content corresponding to the anchor area tree, which can further improve the display rate of the anchor page.
[0049] In combination with the second aspect, in a possible implementation manner, the height of the first area is greater than or equal to the height of the first display window, and the anchor point is located at the top of the first area.
[0050] In an embodiment of the present application, the height of the anchor page that is preferentially loaded and rendered is greater than or equal to the height of the window displaying the web page, so that the content of the anchor page covers the entire display window, and the user can see as much web page content as possible within the display capability of the device.
[0051] In a third aspect, an electronic device is provided, comprising a memory and a processor, wherein the memory is used to store computer program code, and the processor is used to execute the computer program code stored in the memory to implement the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0052] In a fourth aspect, a computer-readable storage medium is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is implemented.
[0053] In a fifth aspect, a chip is provided, in which instructions are stored. When the chip is run on a device, the chip executes the method in the above-mentioned first aspect or any possible implementation of the first aspect.
[0054] In a sixth aspect, a computer program product is provided, in which a computer program or instruction is stored. When the computer program or instruction is executed, the method in the above-mentioned first aspect or any possible implementation of the first aspect is implemented. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] FIG1 is a schematic structural diagram of an electronic device provided in an embodiment of the present application;
[0056] FIG2 is a software structure block diagram of an electronic device provided in an embodiment of the present application;
[0057] FIG3 is a schematic diagram of a web page for explaining anchor points provided in an embodiment of the present application;
[0058] FIG4 is a schematic flow chart of a method for loading a web page;
[0059] FIG5 is a general tree structure diagram corresponding to a web page with an anchor point;
[0060] FIG6 is a schematic flow chart of a method for loading a web page provided in an embodiment of the present application;
[0061] FIG7 is a schematic interactive diagram of a method for loading a web page provided in an embodiment of the present application;
[0062] FIG8 is a schematic interactive diagram of another method for loading a web page provided in an embodiment of the present application;
[0063] FIG9 is a schematic diagram of functional modules of a device for loading a web page provided in an embodiment of the present application. DETAILED DESCRIPTION
[0064] The technical solutions of this application will be described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only part of the embodiments of this application, rather than all the embodiments.
[0065] The technical solutions in the embodiments of the present application will be described below in conjunction with the accompanying drawings in the embodiments of the present application. In the description of the embodiments of the present application, unless otherwise specified, " / " means or, for example, A / B can mean A or B; "and / or" in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of the present application, "plurality" or "multiple" refers to two or more than two.
[0066] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the number of the technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this embodiment, unless otherwise specified, "plurality" means two or more.
[0067] The terms used in the following embodiments are only for the purpose of describing specific embodiments and are not intended to limit the present application. As used in the specification of this application and the appended claims, the singular expressions "a", "an", "said", "above", "the" and "this" are intended to also include expressions such as "one or more", unless there is a clear contrary indication in the context. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" refer to one, two or more. The term "and / or" is used to describe the association relationship of associated objects, indicating that three relationships can exist; for example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship.
[0068] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "one embodiment," "some embodiments," "another embodiment," and "other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically stated. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically stated.
[0069] The method provided in the embodiments of the present application can be applied to electronic devices with a time display function or a time recognition function, for example, mobile phones, tablet computers, wearable devices, vehicle-mounted devices, augmented reality (AR) / virtual reality (VR) devices, laptop computers, ultra-mobile personal computers (UMPCs), netbooks, personal digital assistants (PDAs), smart home devices, and other electronic devices. The embodiments of the present application do not impose any restrictions on the specific types of electronic devices.
[0070] 1 shows a schematic structural diagram of an electronic device 100. The electronic device 100 may include a processor 110, an external memory interface 120, an internal memory 121, a universal serial bus (USB) interface 130, a charging management module 140, a power management module 141, a battery 142, an antenna 1, an antenna 2, a mobile communication module 150, a wireless communication module 160, an audio module 170, a speaker 170A, a receiver 170B, a microphone 170C, an earphone interface 170D, a sensor module 180, a button 190, a motor 191, an indicator 192, a camera 193, a display 194, and a subscriber identification module (SIM) card interface 195. The sensor module 180 may include a pressure sensor 180A, a gyroscope sensor 180B, an air pressure sensor 180C, a magnetic sensor 180D, an acceleration sensor 180E, a distance sensor 180F, a proximity light sensor 180G, a fingerprint sensor 180H, a temperature sensor 180J, a touch sensor 180K, an ambient light sensor 180L, a bone conduction sensor 180M, etc.
[0071] It should be understood that the structures illustrated in the embodiments of the present application do not constitute a specific limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may include more or fewer components than shown, or may combine or separate certain components, or arrange the components differently. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
[0072] The processor 110 may include one or more processing units. For example, the processor 110 may include an application processor (AP), a modem processor, a graphics processing unit (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU). The different processing units may be independent devices or integrated into one or more processors.
[0073] The controller may be the nerve center and command center of the electronic device 100. The controller may generate an operation control signal according to the instruction operation code and the timing signal to complete the control of fetching and executing instructions.
[0074] Processor 110 may also include a memory for storing instructions and data. In some embodiments, the memory in processor 110 is a cache memory. This memory can store instructions or data that have just been used or are being recycled by processor 110. If processor 110 needs to use the same instruction or data again, it can directly access the memory. This avoids duplicate accesses, reduces processor 110 latency, and thus improves system efficiency.
[0075] In some embodiments, the processor 110 may include one or more interfaces. The interfaces may include an inter-integrated circuit (I2C) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, and / or a universal serial bus (USB) interface.
[0076] The USB interface 130 is an interface that complies with USB standards and may be a Mini USB interface, a Micro USB interface, a USB Type-C interface, or the like. The USB interface 130 can be used to connect a charger to charge the electronic device 100, or to transfer data between the electronic device 100 and peripheral devices. It can also be used to connect headphones to play audio. This interface can also be used to connect other electronic devices, such as augmented reality devices.
[0077] It is understood that the interface connection relationship between the modules illustrated in the embodiments of the present application is merely an illustrative illustration and does not constitute a structural limitation on the electronic device 100. In other embodiments of the present application, the electronic device 100 may also adopt different interface connection methods from the above embodiments, or a combination of multiple interface connection methods.
[0078] The charging management module 140 is configured to receive charging input from a charger. The charger can be either a wireless charger or a wired charger. In some wired charging embodiments, the charging management module 140 can receive charging input from the wired charger via the USB interface 130. In some wireless charging embodiments, the charging management module 140 can receive wireless charging input via the wireless charging coil of the electronic device 100. While charging the battery 142, the charging management module 140 can also provide power to the electronic device via the power management module 141.
[0079] The power management module 141 is used to connect the battery 142, the charging management module 140 and the processor 110. The power management module 141 receives input from the battery 142 and / or the charging management module 140, and provides power to the processor 110, the internal memory 121, the external memory, the display 194, the camera 193, and the wireless communication module 160. The power management module 141 can also be used to monitor parameters such as battery capacity, battery cycle count, and battery health status (leakage, impedance). In some other embodiments, the power management module 141 can also be set in the processor 110. In other embodiments, the power management module 141 and the charging management module 140 can also be set in the same device.
[0080] The wireless communication function of the electronic device 100 can be implemented through the antenna 1, the antenna 2, the mobile communication module 150, the wireless communication module 160, the modem processor and the baseband processor.
[0081] Antenna 1 and Antenna 2 are used to transmit and receive electromagnetic wave signals. Each antenna in electronic device 100 can be used to cover a single or multiple communication frequency bands. Different antennas can also be reused to improve antenna utilization. For example, antenna 1 can be reused as a diversity antenna for a wireless local area network. In other embodiments, the antennas can be used in conjunction with a tuning switch.
[0082] The mobile communication module 150 can provide solutions for wireless communications including 2G / 3G / 4G / 5G applied to the electronic device 100. The mobile communication module 150 may include at least one filter, a switch, a power amplifier, a low noise amplifier (LNA), etc. The mobile communication module 150 can receive electromagnetic waves from the antenna 1, and filter, amplify, and process the received electromagnetic waves, and transmit them to the modulation and demodulation processor for demodulation. The mobile communication module 150 can also amplify the signal modulated by the modulation and demodulation processor, and convert it into electromagnetic waves for radiation through the antenna 1. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the processor 110. In some embodiments, at least some of the functional modules of the mobile communication module 150 can be set in the same device as at least some of the modules of the processor 110.
[0083] The modem processor may include a modulator and a demodulator. The modulator is used to modulate the low-frequency baseband signal to be transmitted into a medium-high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low-frequency baseband signal. The demodulator then transmits the demodulated low-frequency baseband signal to the baseband processor for processing. After being processed by the baseband processor, the low-frequency baseband signal is passed to the application processor. The application processor outputs a sound signal through an audio device (not limited to the speaker 170A, the receiver 170B, etc.) or displays an image or video through the display screen 194. In some embodiments, the modem processor may be an independent device. In other embodiments, the modem processor may be independent of the processor 110 and be set in the same device as the mobile communication module 150 or other functional modules.
[0084] The wireless communication module 160 can provide wireless communication solutions including wireless local area networks (WLAN) (such as wireless fidelity (Wi-Fi) networks), Bluetooth (BT), global navigation satellite system (GNSS), frequency modulation (FM), near field communication (NFC), infrared (IR), etc., which are applied to the electronic device 100. The wireless communication module 160 can be one or more devices that integrate at least one communication processing module. The wireless communication module 160 receives electromagnetic waves via the antenna 2, frequency modulates and filters the electromagnetic wave signals, and sends the processed signals to the processor 110. The wireless communication module 160 can also receive the signal to be sent from the processor 110, frequency modulate it, amplify it, and convert it into electromagnetic waves for radiation through the antenna 2.
[0085] In some embodiments, the antenna 1 of the electronic device 100 is coupled to the mobile communication module 150, and the antenna 2 is coupled to the wireless communication module 160, so that the electronic device 100 can communicate with a network and other devices through wireless communication technologies. The wireless communication technologies may include global system for mobile communications (GSM), general packet radio service (GPRS), code division multiple access (CDMA), wideband code division multiple access (WCDMA), time-division code division multiple access (TD-SCDMA), long term evolution (LTE), BT, GNSS, WLAN, NFC, FM, and / or IR technology. The GNSS may include a global positioning system (GPS), a global navigation satellite system (GLONASS), a Beidou navigation satellite system (BDS), a quasi-zenith satellite system (QZSS) and / or a satellite based augmentation system (SBAS).
[0086] Electronic device 100 implements display functionality through a GPU, display screen 194, and an application processor. A GPU is a microprocessor for image processing that connects display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. Processor 110 may include one or more GPUs that execute program instructions to generate or modify display information.
[0087] Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), a MiniLED, a MicroLED, a Micro-oLed, or a quantum dot light-emitting diode (QLED). In some embodiments, electronic device 100 may include one or N display screens 194, where N is a positive integer greater than one.
[0088] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device 100. The external memory card communicates with the processor 110 via the external memory interface 120 to implement data storage functions. For example, files such as music and videos can be stored on the external memory card.
[0089] The internal memory 121 can be used to store computer executable program codes, which include instructions. The processor 110 executes various functional applications and data processing of the electronic device 100 by running the instructions stored in the internal memory 121. The internal memory 121 may include a program storage area and a data storage area. Among them, the program storage area can store an operating system, an App required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area can store data created during the use of the electronic device 100 (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc.
[0090] The buttons 190 include a power button, a volume button, and the like. The buttons 190 may be mechanical buttons or touch buttons. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100.
[0091] The indicator 192 may be an indicator light, which may be used to indicate the charging status, power level changes, messages, missed calls, notifications, etc.
[0092] The software system of the electronic device 100 can adopt a layered architecture, an event-driven architecture, a micro-kernel architecture, a micro-service architecture, or a cloud architecture. In the embodiment of the present application, the Android system with a layered architecture is used as an example to illustrate the software structure of the electronic device 100.
[0093] Figure 2 is a software structure diagram of the electronic device 100 according to an embodiment of the present application. The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, namely, the application layer, the application framework layer, the Android runtime (Android runtime) and the system library, and the kernel layer, from top to bottom. The application layer can include a series of application packages.
[0094] As shown in FIG2 , the application package may include applications such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
[0095] The application framework layer provides an application programming interface (API) and programming framework for applications in the application layer. The application framework layer includes some predefined functions.
[0096] As shown in FIG2 , the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
[0097] The window manager is used to manage window programs. The window manager can obtain the display size, determine whether there is a status bar, lock the screen, take screenshots, etc.
[0098] Content providers are used to store and retrieve data and make it accessible to applications. The data may include videos, images, audio, calls made and received, browsing history and bookmarks, phone books, etc.
[0099] The view system includes visual controls, such as those for displaying text and images. The view system is used to build applications. A display interface can consist of one or more views. For example, a display interface containing a text notification icon might include a view for displaying text and a view for displaying images.
[0100] The phone manager is used to provide communication functions of the electronic device 100, such as management of call status (including answering, hanging up, etc.).
[0101] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, and so on.
[0102] The Notification Manager allows applications to display notifications in the status bar. These messages can be displayed briefly and then disappear automatically without user interaction. For example, the Notification Manager is used to notify users of completed downloads and message reminders. The Notification Manager can also display notifications in the top status bar of the system as icons or scrolling text, such as notifications from background applications, or as dialog windows on the screen. Examples include text messages in the status bar, beeps, vibrations on electronic devices, and flashing indicator lights.
[0103] Android Runtime includes core libraries and a virtual machine. Android runtime is responsible for scheduling and management of the Android system.
[0104] The core library consists of two parts: one is the function that needs to be called by the Java language, and the other is the Android core library.
[0105] The application layer and application framework layer run in a virtual machine. The virtual machine executes Java files in the application layer and application framework layer as binary files. The virtual machine manages object lifecycles, stack management, thread management, security and exception management, and garbage collection.
[0106] The system library can include multiple functional modules, such as a surface manager, media libraries, a 3D graphics processing library (such as OpenGL ES), and a 2D graphics engine (such as SGL).
[0107] The surface manager is used to manage the display subsystem and provide fusion of 2D and 3D layers for multiple applications.
[0108] The media library supports playback and recording of a variety of common audio and video formats, as well as static image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
[0109] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
[0110] A 2D graphics engine is a drawing engine for 2D drawings.
[0111] The kernel layer is the layer between hardware and software. The kernel layer includes at least display driver, camera driver, audio driver, and sensor driver.
[0112] It should be understood that the technical solutions in the embodiments of the present application can be used in Android, IOS, Hongmeng and other systems.
[0113] The technical solution of the embodiment of the present application can be applied to web browsing scenarios. For example, it can be applied to scenarios such as browsing a web page with an anchor by inputting a URL.
[0114] Among them, the electronic device can be a television, a desktop computer, a laptop computer, or a portable electronic device such as a mobile phone, a folding screen, a tablet computer, a camera, a video camera, a video recorder, or a smart home device such as a refrigerator, a washing machine, a sweeper, or any other electronic device with a web page loading function, or an electronic device in a 5G network or an electronic device in a future evolved public land mobile network (PLMN), etc.
[0115] Below, some terms involved in the embodiments of this application are first introduced in detail.
[0116] 1. Anchor
[0117] An anchor, also known as a named anchor, is a type of hyperlink used in web page design. It can be used as a hyperlink within a page. You can set an anchor at a specific location in a document and create a hyperlink to that anchor. On long web pages, hyperlinks can be used to quickly access the anchor location within the page.
[0118] For example, with reference to FIG3 , the anchor points described in the embodiments of the present application are schematically illustrated.
[0119] As shown in Figure 3, enter the URL "×××××××××#Title 6" in the browser. In this URL, "Title 6" with "#" as the identifier is the anchor. When the user accesses a web page based on this URL, the web page displayed on the target page is the anchor web page, that is, the web page corresponding to "Title 6". The anchor web page includes a directory structure, that is, the directory structure displayed on the left side of the web page shown in Figure 3. This directory structure can be used as the parent node tree of the anchor area tree. Among them, the content of the first height (the first height is greater than or equal to the height of the browser window) starting from the anchor point "Title 6" can be used as the anchor area tree. The tree before the anchor area is the anchor area front tree, and the tree after the anchor area is the anchor area back tree.
[0120] It should be understood that in the embodiments of the present application, the anchor point uses "#" as an identifier, but this is only an example and does not constitute any limitation on the identifier of the anchor point. In this scenario or other scenarios, the identifier of the anchor point can also be other symbols, such as "*".
[0121] For example, Figure 4 shows a schematic flow chart of a method 400 for loading a web page. As shown in Figure 4, the method 400 includes:
[0122] S401: Loading a first webpage based on a first URL corresponding to the first webpage.
[0123] Specifically, firstly, data related to the first webpage is downloaded based on the first URL, wherein the data related to the first webpage may include data such as webpage structure and webpage style; and then, the first webpage is loaded based on the data related to the first webpage.
[0124] S402: Rendering a first webpage and displaying the first webpage.
[0125] Specifically, after the first webpage is loaded, the first webpage is rendered, and the rendered first webpage enters a ready-to-display state.
[0126] S403: Determine whether the first webpage contains an anchor point.
[0127] When the first webpage includes an anchor point, execute S404 ; when the first webpage does not include an anchor point, execute S406 .
[0128] In one embodiment, when the first URL includes a “#” identifier, it is determined that the first webpage includes an anchor point, and the content identified by the “#” identifier is the anchor point information.
[0129] Similarly, when the first URL does not include the "#" identifier, it is determined that the first webpage does not include an anchor.
[0130] S404: Acquire anchor point information from the first URL, determine the anchor point position according to the anchor point information, and further execute S405.
[0131] Specifically, after the first web page is displayed, the anchor point information is obtained from the first URL through the "#" identifier, and the anchor point position is found by comparing the directory (category identifier) in the first web page.
[0132] S405: Jump the currently displayed page to the page corresponding to the anchor point position.
[0133] Specifically, after the anchor point position is determined, the page is jumped to the page corresponding to the anchor point position by scrolling the page.
[0134] S406: Display the page corresponding to the initial position.
[0135] That is, when the first webpage does not include an anchor point, the page content displayed based on the first URL is the top content of the first webpage.
[0136] In this method, the process of loading web page elements, rendering the web page, and displaying the web page is carried out in the order of the web page content. However, during the web page rendering process, the web page content before the anchor point is not the content that the user wants to view after entering the URL. On the contrary, because this part of the content is involved in the loading, rendering, and display process, the user needs to wait for the web page content before the anchor point to load, render, and display before they can see the web page content corresponding to the anchor point. Specifically, this can be reflected in the slow loading of the anchor page, which affects the user experience.
[0137] Exemplarily, FIG5 shows a general tree structure diagram corresponding to a web page with anchor points.
[0138] As shown in Figure 5, in the general tree structure diagram corresponding to the web page with anchor points, the root node includes a directory tree node and a web page header node, where the directory tree can be understood as the directory corresponding to all the content in the web page, and the web page header can include information such as the window name corresponding to the web page; the directory tree node includes an anchor area tree, one or more anchor area front trees, and one or more anchor area back trees.
[0139] In some embodiments, the front tree of the anchor area and the back tree of the anchor area can be collectively referred to as brother trees of the anchor area tree. Specifically, the front tree of the anchor area can be understood as the brother tree of the anchor area tree, and the back tree of the anchor area can be understood as the brother tree of the anchor area tree.
[0140] It can be understood that all tree nodes in the anchor area tree are not necessarily located at the same level, and can be distributed in multiple levels under the directory tree node. The anchor area tree includes trees of all levels within the width of the anchor area under the directory tree node. In other words, the anchor area tree includes multiple target nodes and the child nodes of these target nodes, and the child nodes of these child nodes, and so on..., the multiple target nodes include the anchor node, and the multiple target nodes are at the same level; similarly, the front tree of the anchor area includes trees of all levels under the directory tree node and located before the anchor area. In other words, the front tree of the anchor area includes the brother nodes of the target node and the child nodes of these brother nodes, and the child nodes of these child nodes, and so on...; the back tree of the anchor area includes trees of all levels under the directory tree node and located after the anchor area. In other words, the back tree of the anchor area includes the brother nodes of the target node and the child nodes of these brother nodes, and the child nodes of these child nodes, and so on...
[0141] It should be understood that the anchor node is located below the directory tree node. In the embodiment shown in FIG5 , the anchor node is located at the third level in the tree structure of the web page, but this is merely an example. When the directory tree node has multiple levels of parent nodes, the level at which the anchor node is located in the tree structure of the web page will adapt to the changes. For example, when the directory tree node has two levels of parent nodes, the directory tree node is located at the third level, and the corresponding anchor node is located at the fourth level. In some examples, the anchor node may be located at the third level in the tree structure of the web page.
[0142] Taking the web page shown in Figure 3 as an example, in this web page, the directory in the left area is a directory tree, which is also the parent node tree of the anchor area tree. It can also be the parent node tree of the front tree of the anchor area, and it can also be the parent node tree of the back tree of the anchor area.
[0143] In some examples, the web page content displayed on the page shown in Figure 3 is the web page content corresponding to the anchor area tree, that is, the part starting from "Title 6" and ending at the third line in "Title 7"; the web page content before "Title 6" is the web page content corresponding to the front tree of the anchor area, and the web page content after the third line in "Title 7" is the web page content corresponding to the back tree of the anchor area, and the access box displaying the URL "×××××××××#Title 6" belongs to the web page header of the web page.
[0144] In some other examples, the web page content displayed on the page shown in FIG. 3 may be only a portion of the web page content corresponding to the anchor region tree.
[0145] From this, we can see that the general tree structure corresponding to web pages with anchors has the characteristics of a shallow total hierarchy and many sibling trees of the anchor tree.
[0146] In summary, during the current web page display process, users need to wait for the web page content before the anchor point to load, render, and display completely before they can see the web page content corresponding to the anchor point. This can easily make users feel that the anchor point web page is loading slowly, thus affecting the user experience.
[0147] In view of this, embodiments of the present application provide a method, apparatus, and electronic device for loading web pages. This method can prioritize the loading and rendering of anchor pages within a web page by changing the order in which web page elements are loaded and rendered, thereby accelerating the display of anchor pages to the user, allowing the user to view the target page more quickly and thus improving the user experience.
[0148] For example, FIG6 shows a schematic flowchart of two methods for loading a web page provided in embodiments of the present application.
[0149] As shown in (a) of FIG6 , a method for loading a web page includes:
[0150] S601: Download the relevant data of the first web page based on the first URL corresponding to the first web page. The first web page contains an anchor point.
[0151] Among them, the data related to the first web page may include data such as web page content, web page structure, and web page style.
[0152] Taking the web page shown in Figure 3 as an example, when the user enters the first URL "×××××××××#Title 6" in the web page access page of the browser and performs the operation of confirming access, the download of the data related to the first web page corresponding to this first URL starts.
[0153] S602: Divide the tree structure corresponding to the first web page into three groups, namely the anchor point area tree, the tree before the anchor point area, and the tree after the anchor point area.
[0154] Among them, the anchor point area tree refers to the tree corresponding to the area where the cumulative height of the web page content from the anchor point position往后 is the first window height (the first window height is greater than or equal to the browser window height, or described as the first window height is greater than or equal to the visible height of the current page); the tree before the anchor point area refers to the tree in the tree structure corresponding to the first web page that is before the anchor point, and the tree after the anchor point area refers to the tree in the tree structure corresponding to the first web page that is after the anchor point area.
[0155] It can also be described as: Divide the content of the first web page into three groups, namely the web page content corresponding to the anchor point area tree, the web page content corresponding to the tree before the anchor point area, and the web page content corresponding to the tree after the anchor point area. Among them, the web page content corresponding to the anchor point area tree is the web page content that can be displayed by the first window height (the first window height is greater than or equal to the height of the current window), the web page content corresponding to the tree before the anchor point area is the web page content before the web page content corresponding to the anchor point area tree in the first web page, and the web page content corresponding to the tree after the anchor point area is the web page content after the web page content corresponding to the anchor point area tree in the first web page.
[0156] It can be understood that the distribution range of the anchor point area tree (or described as the web page content corresponding to the anchor point area tree) can be determined by the height of the current window. Among them, the height direction of the current window is parallel to the scrolling direction of the page displayed in this current window.
[0157] That is to say, for a window with vertical scrolling of the page, the distribution range of the anchor point area tree can be determined by the vertical height of the current window; for a window with horizontal scrolling of the page, the distribution range of the anchor point area tree can be determined by the horizontal width of the current window.
[0158] Taking the webpage shown in Figure 3 as an example, the anchor region tree may refer to the tree structure corresponding to the area starting from "Heading 6" and ending at the third line of "Heading 7." In this case, the "anchor region front tree" refers to the tree structure corresponding to the area before "Heading 6," and the "anchor region post tree" refers to the tree structure corresponding to the area after the third line of "Heading 7."
[0159] This example can also be described as follows: the webpage content corresponding to the anchor region tree can be the display content corresponding to the area starting from "Heading 6" and ending at the third line of "Heading 7". In this case, the webpage content corresponding to the tree before the anchor region is the display content corresponding to the area before "Heading 6", and the webpage content corresponding to the tree after the anchor region is the display content corresponding to the area after the third line of "Heading 7".
[0160] S603: Loading webpage content corresponding to the parent node tree and the anchor region tree.
[0161] The parent node tree can be understood as the parent node tree of the anchor area tree.
[0162] Among them, the parent node tree of the anchor area tree includes: the parent nodes of one or more target nodes in the anchor area tree in the tree structure corresponding to the web page, the multiple target nodes include the anchor node, the multiple target nodes have the same hierarchy, and can also include the brother nodes of the parent nodes of these one or more target nodes, and can also include the younger nodes of the parent nodes of these one or more target nodes. The specific included range can be determined by the display height of the current display window.
[0163] In some embodiments, if the height of the current display window is sufficient to fully display the contents of all nodes at the level of the parent node tree of the anchor area tree (i.e., the contents corresponding to all directory tree nodes), then the parent node tree of the anchor area tree can also be understood as the parent node tree of the sibling tree of the anchor area tree.
[0164] In some embodiments, the web page content corresponding to the parent node tree and the anchor region tree is loaded into a shared memory with the rendering process through a loading process, so that the rendering process can obtain the web page content corresponding to the parent node tree and the anchor region tree.
[0165] S604: Render and display the webpage content corresponding to the parent node tree and the anchor area tree.
[0166] In some embodiments, while rendering the web page content corresponding to the parent node tree and the anchor region tree, the load of rendering the web page content corresponding to the parent node tree is reduced, so that there is more sufficient load for rendering the web page content corresponding to the anchor region tree.
[0167] In one implementation, lazy loading tags are added to high-load nodes in the nodes constituting the parent node tree, thereby reducing the load of rendering the web page content corresponding to the parent node tree.
[0168] Taking the web page shown in FIG3 as an example, the parent node tree refers to the directory displayed on the left side of the page.
[0169] S605: Loading webpage contents corresponding to the back tree of the anchor region and the front tree of the anchor region.
[0170] In some embodiments, the webpage content corresponding to the tree behind the anchor point region may be loaded first, and then the webpage content corresponding to the tree before the anchor point region may be loaded.
[0171] S606: Render and display the webpage content corresponding to the tree behind the anchor point area and the webpage content corresponding to the tree before the anchor point area in sequence.
[0172] In some embodiments, after the rendering and display of the web page content corresponding to the anchor area tree are completed, the rendering and display of the web page content corresponding to the anchor area post-tree and the anchor area pre-tree are started.
[0173] In some embodiments, the webpage content corresponding to the tree behind the anchor area is rendered first, and then the webpage content corresponding to the tree before the anchor area is rendered. In this way, the webpage content corresponding to the tree behind the anchor area is displayed first, then the webpage content corresponding to the tree behind the anchor area is displayed, and finally the webpage content corresponding to the tree behind the anchor area is displayed, so that the user can see the anchor webpage in a shorter time and it conforms to the user's browsing habit (browsing downwards).
[0174] Taking the web page shown in Figure 3 as an example, when loading the web page corresponding to the URL "×××××××××#Title 6", you can first load and render the web page content corresponding to the area starting from "Title 6" and ending at the third line in "Title 7", and then load and render the web page content corresponding to the area after the third line in "Title 7", and load the web page content corresponding to the area before "Title 6".
[0175] As shown in FIG6(b), compared with the method for loading a web page shown in FIG6(a), the method for loading a web page shown in FIG6(b) adds S607 between S601 and S602. S607 specifically includes:
[0176] S607: Determine whether the first webpage contains an anchor point.
[0177] When the first webpage includes an anchor point, S602 is executed; when the first webpage does not include an anchor point, S608 is executed.
[0178] In one embodiment, when the first URL includes a “#” identifier, it is determined that the first webpage includes an anchor point, and the content identified by the “#” identifier is the anchor point information.
[0179] Similarly, when the first URL does not include the "#" identifier, it is determined that the first webpage does not include an anchor.
[0180] Taking the web page shown in FIG3 as an example, the first URL “×××××××××#Title 6” includes the “#” identifier, which means that the first web page contains an anchor point, and the corresponding anchor point content is “Title 6”.
[0181] S608: sequentially loading and rendering the first web page, and displaying a page corresponding to the initial position of the first web page.
[0182] That is, when the first URL does not contain an anchor, the user does not need to jump to the anchor page. In this case, the first web page can be loaded, rendered, and displayed in sequence. In this way, the target page obtained by accessing the web page based on the first URL displays the page corresponding to the initial position of the first web page.
[0183] Taking the web page shown in FIG3 as an example, when the URL does not include “#Title6”, the target page obtained by accessing the web page based on the URL may display the page corresponding to “Title1”.
[0184] In an embodiment of the present application, for some web pages with anchors, their tree structure has few levels, generally only 3 to 5 levels from directory nodes to leaf nodes. The anchor node is located below the directory node and can be located at the third level. The tree structure of the web page is split, specifically, the anchor area tree and its sibling trees are split. By modifying the loading order of each part of the split tree structure during the web page loading process, the split anchor area tree and its sibling trees are rendered in sections, with the anchor area tree being rendered first. That is, by changing the loading order, the rendering order of the tree structure corresponding to the web page with anchors is changed, and the anchor area tree is rendered and displayed first. After the anchor area tree is rendered, its sibling trees are loaded and rendered. In this way, the web page content before the anchor point that the user does not need to access can be rendered later, avoiding the complex process of loading all web page content and then scrolling to the specified position in the normal loading process. This not only speeds up the display rate of the anchor web page, but also enables the normal display of all web pages, improving the user experience.
[0185] For example, FIG7 shows a schematic interactive diagram of a method 700 for loading a web page provided in an embodiment of the present application. As shown in FIG7 , the method 700 includes:
[0186] S701: A web page loading process receives a web page request message, where the web page request message is used to request loading of a first web page.
[0187] In some examples, the loading process of the web page may be, for example, a browser process of a web kernel-based application.
[0188] In some embodiments, requesting to load the first webpage may refer to requesting to access the first webpage.
[0189] In some embodiments, the operation of triggering the sending of a web page request message to the loading process may be an operation in which a user enters a first URL in a web page access page of a browser for access, wherein the web page corresponding to the first URL is the first web page.
[0190] In some other embodiments, the operation that triggers sending a web page request message to the loading process may be, for example, an operation in which a user accesses map information corresponding to a first address on a map-related web page, wherein the web page corresponding to the first address is the first web page.
[0191] S702: After receiving the webpage request message, the loading process downloads relevant data of the first webpage.
[0192] Among them, the relevant data of the first web page may include the hypertext markup language (HTML) of the first web page, that is, the basic content corresponding to the first web page, and may also include the cascading style sheets (CSS) of the first web page, that is, the font, color, margin, height, width, background image, advanced positioning and other elements corresponding to the first web page. In addition, the relevant data of the first web page may also include other data corresponding to the first web page, such as the first URL corresponding to the first web page, which is not limited in this application.
[0193] The first webpage is synthesized according to the relevant data of the first webpage.
[0194] S703: Based on the data related to the first webpage, the loading process determines whether the first webpage includes an anchor point.
[0195] When it is determined that the first webpage includes an anchor point, S704 is further executed.
[0196] In some embodiments, when the first web page corresponds to the first URL, the method for determining whether the first web page contains an anchor point can be: when the first URL includes the identifier "#", it is determined that the first web page includes an anchor point, and the content marked by the identifier "#" is the anchor point content.
[0197] In some embodiments, step S703 is an optional step.
[0198] S704: When it is determined that the first webpage includes an anchor point, the loading process divides the tree structure corresponding to the first webpage into three groups, the three groups of tree structures being a parent node tree and an anchor area tree, an anchor area back tree, and an anchor area front tree.
[0199] It can be understood that this step divides the webpage content of the first webpage into three groups, namely the webpage content corresponding to the parent node tree and the anchor area tree, the webpage content corresponding to the anchor area back tree and the webpage content corresponding to the anchor area front tree.
[0200] The explanations of the parent node tree, the anchor region tree, the anchor region back tree, and the anchor region front tree are explained in detail in the embodiment shown in FIG6 , and will not be repeated here for the sake of brevity.
[0201] The grouping may be performed based on, for example, the ID of the anchor point (ie, the position of the anchor point in the first web page) and the height of the web page display window.
[0202] S705: The loading process loads the webpage content corresponding to the parent node tree and the anchor region tree to the rendering process of the webpage.
[0203] In some embodiments, the loading process loads the webpage content corresponding to the parent node tree and the anchor region tree to the rendering process through a shared memory, wherein the shared memory is a shared memory of the loading process and the rendering process.
[0204] S706: The rendering process renders the webpage content corresponding to the parent node tree and the anchor region tree.
[0205] In some embodiments, after rendering the web page content corresponding to the parent node tree and the anchor region tree, the rendering process sends it to the display module, and the display module displays the web page content corresponding to the parent node tree and the anchor region tree to the user.
[0206] S707: The loading process loads the webpage content corresponding to the back tree of the anchor area into the rendering process.
[0207] In some embodiments, the loading process loads the webpage content corresponding to the back tree of the anchor region to the rendering process through a shared memory, wherein the shared memory is a shared memory between the loading process and the rendering process.
[0208] S708: The rendering process renders the webpage content corresponding to the tree behind the anchor point area.
[0209] In some embodiments, after rendering the webpage content corresponding to the tree behind the anchor point area, the rendering process sends it to the display module, and the display module displays the webpage content corresponding to the tree behind the anchor point area to the user.
[0210] S709: The loading process loads the webpage content corresponding to the front tree of the anchor area to the rendering process.
[0211] In some embodiments, the loading process loads the webpage content corresponding to the front tree of the anchor region to the rendering process through a shared memory, wherein the shared memory is a shared memory between the loading process and the rendering process.
[0212] S710: The rendering process renders the webpage content corresponding to the front tree of the anchor area.
[0213] In some embodiments, after rendering the webpage content corresponding to the tree before the anchor point area, the rendering process sends it to the display module, and the display module displays the webpage content corresponding to the tree before the anchor point area to the user.
[0214] In some other embodiments, after the rendering process renders the web page content corresponding to the front tree of the anchor area, the rendered back tree of the anchor area and the rendered front tree of the anchor area are sent to the display module, and the display module displays the web page content corresponding to the back tree of the anchor area and the web page content corresponding to the front tree of the anchor area to the user.
[0215] In an embodiment of the present application, by changing the original loading order of the tree structure corresponding to the first web page, the anchor web page content in the first web page is loaded and rendered first, so that the display rate of the anchor web page can be accelerated; and after the anchor web page content is rendered, other web page content in the first web page continues to be loaded and rendered, so that all web pages are displayed normally.
[0216] That is to say, in the method provided in the embodiment of the present application, the web page content before the anchor point that the user has no access needs can be delayed for rendering, avoiding the complicated process of loading all the web page content and then scrolling to the anchor point position. It not only speeds up the display rate of the anchor point web page, but also enables all web pages to be displayed normally, thereby improving the user experience.
[0217] For example, FIG8 shows a schematic interactive diagram of another method 800 for loading a web page provided in an embodiment of the present application. The method 800 can be applied to an electronic device, which includes a loading module, a shared memory, a rendering module, and a display module. As shown in FIG8 , the method 800 includes:
[0218] S801: The loading module receives a webpage request message, where the webpage request message is used to request loading of a first webpage.
[0219] The explanation of this step is the same as that of S701 in the embodiment shown in FIG. 7 , and will not be repeated here for the sake of brevity.
[0220] The loading module may be understood as a loading process of a web page, for example, a browser process of an application based on a web kernel.
[0221] S802: After receiving the webpage request message, the loading module downloads relevant data of the first webpage.
[0222] The explanation of this step is the same as that of S702 in the embodiment shown in FIG. 7 , and will not be repeated here for the sake of brevity.
[0223] S803: Based on the data related to the first webpage, the loading module determines whether the first webpage contains an anchor point.
[0224] When it is determined that the first webpage includes an anchor point, S704 is further executed.
[0225] The explanation of this step is the same as that of S703 in the embodiment shown in FIG. 7 , and will not be repeated here for the sake of brevity.
[0226] S804: When it is determined that the first webpage includes an anchor point, the loading module divides the tree structure corresponding to the first webpage into three groups, the three groups of tree structures being a parent node tree and an anchor area tree, an anchor area back tree, and an anchor area front tree.
[0227] The explanation of this step is the same as that of S704 in the embodiment shown in FIG. 7 , and will not be repeated here for the sake of brevity.
[0228] S805: The loading module loads the webpage content corresponding to the parent node tree and the anchor area tree into a shared memory, which is a shared memory between the loading module and the rendering module.
[0229] The rendering module can be understood as a rendering process of a web page, for example, a render process of an application based on a web kernel.
[0230] S806: The loading module sends a first notification to the rendering module, where the first notification is used to notify the rendering module to obtain webpage content corresponding to the parent node tree and the anchor region tree from the shared memory.
[0231] In some embodiments, the loading module sends a first notification to the rendering module while loading the webpage content corresponding to the parent node tree and the anchor region tree into the shared memory.
[0232] In some further embodiments, after loading the webpage content corresponding to the parent node tree and the anchor region tree into the shared memory, the loading module sends a first notification to the rendering module.
[0233] In some embodiments, the loading module sends the first notification to the rendering module through an inter-process communication-data receiving function (inter process communication-DataReceived).
[0234] S807: In response to receiving the first notification sent by the loading module, the rendering module obtains the webpage content corresponding to the parent node tree and the anchor region tree from the shared memory.
[0235] S808: After acquiring the webpage content corresponding to the parent node tree and the anchor region tree in the shared memory, the rendering module renders the webpage content corresponding to the parent node tree and the anchor region tree.
[0236] In some embodiments, the rendering module renders the webpage content corresponding to the parent node tree and the anchor region tree through DomTree, where DomTree is a tree structure used for rendering in the rendering process.
[0237] S809: The rendering module sends the rendered webpage content corresponding to the parent node tree and the anchor area tree to the display module.
[0238] S810: The display module displays the webpage content corresponding to the parent node tree and the anchor region tree to the user, that is, displays the anchor page.
[0239] S811: The loading module loads the webpage content corresponding to the back tree of the anchor area into the shared memory.
[0240] In some embodiments, after the rendering module obtains the webpage content corresponding to the parent node tree and the anchor region tree from the shared memory, the loading module loads the webpage content corresponding to the anchor region tree into the shared memory.
[0241] It should be understood that S811 is executed after S805 so that the webpage content corresponding to the anchor region tree is loaded and rendered first, and the execution order of S811 and S806-S810 is not limited.
[0242] In one implementation, S811 is executed after S808, and the execution order of S811 and S809-S810 is not limited.
[0243] S812: The loading module sends a second notification to the rendering module, where the second notification is used to notify the rendering module to obtain webpage content corresponding to the back tree of the anchor area from the shared memory.
[0244] In some embodiments, the loading module sends a second notification to the rendering module while loading the webpage content corresponding to the back tree of the anchor region into the shared memory.
[0245] In some further embodiments, after loading the webpage content corresponding to the back tree of the anchor region into the shared memory, the loading module sends a second notification to the rendering module.
[0246] In some embodiments, the loading module sends the second notification to the rendering module through an inter-process communication-data receiving function.
[0247] S813: In response to receiving the second notification sent by the loading module, the rendering module obtains the webpage content corresponding to the tree behind the anchor area from the shared memory.
[0248] S814: After acquiring the webpage content corresponding to the tree behind the anchor point area in the shared memory, the rendering module renders the webpage content corresponding to the tree behind the anchor point area.
[0249] In some embodiments, the rendering module renders the webpage content corresponding to the tree behind the anchor area through DomTree.
[0250] S815: The loading module loads the webpage content corresponding to the front tree of the anchor area into the shared memory.
[0251] In some embodiments, after the rendering module obtains the webpage content corresponding to the tree behind the anchor region from the shared memory, the loading module loads the webpage content corresponding to the tree before the anchor region into the shared memory.
[0252] S816: The loading module sends a third notification to the rendering module, where the third notification is used to notify the rendering module to obtain the webpage content corresponding to the front tree of the anchor area from the shared memory.
[0253] In some embodiments, the loading module sends a third notification to the rendering module while loading the webpage content corresponding to the front tree of the anchor region into the shared memory.
[0254] In some further embodiments, after loading the webpage content corresponding to the front tree of the anchor region into the shared memory, the loading module sends a third notification to the rendering module.
[0255] In some embodiments, the loading module sends a third notification to the rendering module through an inter-process communication-data receiving function.
[0256] S817: In response to receiving the third notification sent by the loading module, the rendering module obtains the webpage content corresponding to the front tree of the anchor area from the shared memory.
[0257] S818: After acquiring the webpage content corresponding to the tree before the anchor point region in the shared memory, the rendering module renders the webpage content corresponding to the tree before the anchor point region.
[0258] In some embodiments, the rendering module renders the webpage content corresponding to the front tree of the anchor area through DomTree.
[0259] S819: The rendering module sends the rendered web page content corresponding to the tree behind the anchor point area and the rendered web page content corresponding to the tree before the anchor point area to the display module.
[0260] S820: The display module displays the webpage content corresponding to the tree behind the anchor area and the webpage content corresponding to the tree before the anchor area to the user, that is, displays the non-anchor page.
[0261] In some embodiments, after rendering the web page content corresponding to the back tree of the anchor area, the rendering module will place the rendered web page content corresponding to the back tree of the anchor area after the anchor area tree. After rendering the web page content corresponding to the front tree of the anchor area, the rendering module will place the rendered web page content corresponding to the back tree of the anchor area before the anchor area tree, so that the display content order of the first web page displayed at the user level is correct.
[0262] In the embodiment of the present application, by changing the original loading order of the tree structure corresponding to the web page, the loading module first places the web page content corresponding to the parent node tree and the anchor region tree into the shared memory of the loading module and the rendering module, and then notifies the rendering module to obtain the web page content corresponding to the parent node tree and the anchor region tree from the shared memory, and further render and display it. This can speed up the display rate of the anchor page; and after the web page content corresponding to the anchor region tree is rendered, the web page content corresponding to the tree after the anchor region and the web page content corresponding to the tree before the anchor region continue to be loaded, rendered, and displayed, so that all web pages can be displayed normally.
[0263] For example, FIG9 shows a functional module diagram of a device 900 for loading a web page provided in an embodiment of the present application. As shown in FIG9 , the device 900 includes:
[0264] The loading module 910 is configured to download relevant data of the first web page after receiving a web page request message, where the web page request message is used to request loading of the first web page.
[0265] In some embodiments, the apparatus 900 further includes a receiving module configured to receive a web page request message.
[0266] In some embodiments, the operation of triggering the sending of a webpage request message to the receiving module may be an operation of a user entering a first URL in a webpage access page of a browser to access a webpage, wherein the webpage corresponding to the first URL is the first webpage.
[0267] In some other embodiments, the operation of triggering the sending of a web page request message to the receiving module may be an operation of a user accessing map information corresponding to a first address on a map-related web page access page, wherein the web page corresponding to the first address is the first web page.
[0268] Among them, the relevant data of the first web page may include the hypertext markup language of the first web page, that is, the basic content corresponding to the first web page, and may also include the cascading style sheet of the first web page, that is, the font, color, margin, height, width, background image, advanced positioning and other elements corresponding to the first web page. In addition, the relevant data of the first web page may also include other data corresponding to the first web page, such as the first URL corresponding to the first web page, which is not limited in this application.
[0269] The determination module 920 is configured to determine whether the first webpage includes an anchor point based on data related to the first webpage.
[0270] In some embodiments, when the first web page corresponds to the first URL, the method for determining whether the first web page contains an anchor point can be: when the first URL includes the identifier "#", the judgment module 920 determines that the first web page includes an anchor point, and the content marked by the identifier "#" is the anchor point content.
[0271] The loading module 910 is further configured to divide the tree structure corresponding to the first webpage into three groups when determining that the first webpage includes an anchor point. The three groups of tree structures are a parent node tree and an anchor area tree, an anchor area back tree, and an anchor area front tree.
[0272] It can be understood that the loading module 910 actually divides the webpage content of the first webpage into three groups, namely the webpage content corresponding to the parent node tree and the anchor area tree, the webpage content corresponding to the anchor area back tree and the webpage content corresponding to the anchor area front tree.
[0273] The explanations of the parent node tree, the anchor region tree, the anchor region back tree, and the anchor region front tree are explained in detail in the embodiment shown in FIG6 , and will not be repeated here for the sake of brevity.
[0274] The loading module 910 is further configured to load the webpage content corresponding to the parent node tree and the anchor region tree into the shared memory 940 . The shared memory is a shared memory between the loading module 910 and the rendering module 930 .
[0275] The loading module 910 is further configured to send a first notification to the rendering module 930 , where the first notification is configured to notify the rendering module 930 to obtain the parent node tree and the anchor region tree from the shared memory 940 .
[0276] In some embodiments, the loading module 910 sends a first notification to the rendering module 930 while loading the webpage content corresponding to the parent node tree and the anchor region tree into the shared memory 940 .
[0277] In some further embodiments, after loading the webpage content corresponding to the parent node tree and the anchor region tree into the shared memory 940 , the loading module 910 sends a first notification to the rendering module 930 .
[0278] In some embodiments, the loading module 910 sends a first notification to the rendering module 930 through an inter-process communication-data receiving function.
[0279] The rendering module 930 is configured to obtain webpage content corresponding to the parent node tree and the anchor region tree from the shared memory 940 in response to receiving the first notification sent by the loading module 910 .
[0280] The rendering module 930 is further configured to render the webpage content corresponding to the parent node tree and the anchor region tree after acquiring the webpage content corresponding to the parent node tree and the anchor region tree in the shared memory 940 .
[0281] In some embodiments, the rendering module 930 renders the web page content corresponding to the parent node tree and the anchor region tree through DomTree.
[0282] The rendering module 930 is further configured to send the rendered webpage content corresponding to the parent node tree and the anchor region tree to the display module 950 .
[0283] The display module 950 is used to display the webpage content corresponding to the parent node tree and the anchor region tree to the user, that is, to display the anchor page.
[0284] The loading module 910 is further configured to load the webpage content corresponding to the back tree of the anchor area into the shared memory 940 .
[0285] In some embodiments, after the rendering module 930 obtains the webpage content corresponding to the parent node tree and the anchor region tree from the shared memory 940 , the loading module 910 loads the webpage content corresponding to the anchor region tree into the shared memory.
[0286] The loading module 910 is further configured to send a second notification to the rendering module 930 , where the second notification is configured to notify the rendering module 930 to obtain webpage content corresponding to the tree after the anchor area from the shared memory 940 .
[0287] In some embodiments, the loading module 910 sends a second notification to the rendering module 930 while loading the webpage content corresponding to the back tree of the anchor region into the shared memory 940 .
[0288] In some further embodiments, after loading the webpage content corresponding to the back tree of the anchor region into the shared memory 940 , the loading module 910 sends a second notification to the rendering module 930 .
[0289] In some embodiments, the loading module 910 sends the second notification to the rendering module 930 through an inter-process communication-data receiving function.
[0290] The rendering module 930 is further configured to obtain the webpage content corresponding to the tree behind the anchor area from the shared memory 940 in response to receiving the second notification sent by the loading module 910 .
[0291] The rendering module 930 is further configured to render the webpage content corresponding to the tree behind the anchor point area after acquiring the webpage content corresponding to the tree behind the anchor point area in the shared memory 940 .
[0292] In some embodiments, the rendering module 930 renders the webpage content corresponding to the tree behind the anchor area through DomTree.
[0293] The loading module 910 is further configured to load the webpage content corresponding to the front tree of the anchor area into the shared memory 940 .
[0294] In some embodiments, after the rendering module 930 obtains the webpage content corresponding to the tree behind the anchor region from the shared memory 940 , the loading module 910 loads the webpage content corresponding to the tree before the anchor region into the shared memory 940 .
[0295] The loading module 910 is further configured to send a third notification to the rendering module 930 , where the third notification is configured to notify the rendering module 930 to obtain webpage content corresponding to the front tree of the anchor region from the shared memory 940 .
[0296] In some embodiments, the loading module 910 sends a third notification to the rendering module 930 while loading the webpage content corresponding to the front tree of the anchor region into the shared memory 940 .
[0297] In some further embodiments, after loading the webpage content corresponding to the front tree of the anchor region into the shared memory 940 , the loading module 910 sends a third notification to the rendering module 930 .
[0298] In some embodiments, the loading module 910 sends a third notification to the rendering module 930 through an inter-process communication-data receiving function.
[0299] The rendering module 930 is further configured to obtain the webpage content corresponding to the front tree of the anchor area from the shared memory 940 in response to receiving the third notification sent by the loading module 910 .
[0300] After acquiring the webpage content corresponding to the tree before the anchor point region in the shared memory 940 , the rendering module 930 renders the webpage content corresponding to the tree before the anchor point region.
[0301] In some embodiments, the rendering module 930 renders the webpage content corresponding to the front tree of the anchor area through DomTree.
[0302] The rendering module 930 is further configured to send the rendered webpage content corresponding to the tree behind the anchor point area and the webpage content corresponding to the tree before the anchor point area to the display module 950 .
[0303] The display module 950 is used to display the webpage content corresponding to the tree behind the anchor area and the webpage content corresponding to the tree before the anchor area to the user, that is, to display the non-anchor page.
[0304] In an embodiment of the present application, by changing the original loading order of the tree structure corresponding to the web pages, the anchor web page content in the first web page is loaded and rendered first, so that the display rate of the anchor web page can be accelerated; and after the anchor web page content is rendered, other web page content in the first web page continues to be loaded and rendered, so that all web pages are displayed normally.
[0305] That is to say, in the method provided in the embodiment of the present application, the web page content before the anchor point that the user has no access needs can be delayed for rendering, avoiding the complicated process of loading all the web page content and then scrolling to the anchor point position. It not only speeds up the display rate of the anchor point web page, but also enables all web pages to be displayed normally, thereby improving the user experience.
[0306] It should be understood that the application scenarios of the embodiments provided in this application can be applied not only to browser scenarios, but also to map browsing scenarios, quick application scenarios such as mini-programs with anchors, and other scenarios containing anchors. This application does not limit this.
[0307] One or more of the modules or units described herein can be implemented in software, hardware, or a combination of the two. When any of the above modules or units is implemented in software, the software exists in the form of computer program instructions and is stored in a memory, and a processor can be used to execute the program instructions and implement the above method flow. The processor may include, but is not limited to, at least one of the following: a central processing unit (CPU), a microprocessor, a digital signal processor (DSP), a microcontroller unit (MCU), or an artificial intelligence processor, etc., a computing device that runs software, each computing device may include one or more cores for executing software instructions to perform operations or processing. The processor may be built into an SoC (system on chip) or an application specific integrated circuit (ASIC), or it may be an independent semiconductor chip. In addition to the core for executing software instructions to perform operations or processing within the processor, it may further include necessary hardware accelerators, such as a field programmable gate array (FPGA), a PLD (programmable logic device), or a logic circuit that implements dedicated logic operations.
[0308] When the modules or units described in this document are implemented in hardware, the hardware can be any one or any combination of a CPU, a microprocessor, a DSP, an MCU, an artificial intelligence processor, an ASIC, a SoC, an FPGA, a PLD, a dedicated digital circuit, a hardware accelerator, or a non-integrated discrete device, which can run the necessary software or not rely on the software to execute the above method flow.
[0309] When the modules or units described herein are implemented using software, they can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website, computer, server, or data center to another website, computer, server, or data center via a wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrations. The available medium can be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive (SSD)).
[0310] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0311] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0312] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0313] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0314] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0315] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0316] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
Claims
1. A method for loading a web page, characterized in that: The method comprises: receiving a first request message, where the first request message is used to request loading of a first webpage, where the first webpage includes an anchor corresponding to the first request message; Loading content corresponding to a tree in a first area of the first webpage and content corresponding to a parent node tree, wherein the parent node tree is the parent node tree of the tree in the first area, and the anchor point is located in the first area; Rendering the content corresponding to the tree in the first area and the content corresponding to the parent node tree; The content corresponding to the tree in the first area and the content corresponding to the parent node tree are displayed in the first display window.
2. The method according to claim 1, characterized in that The method further comprises: Loading content corresponding to the tree in a second area of the first webpage, where the second area is an area after the first area of the first webpage; Render the content corresponding to the tree in the second area.
3. The method according to claim 1 or 2, characterized in that The method further comprises: Loading content corresponding to the tree in a third area of the first webpage, where the third area is an area before the first area of the first webpage; Render the content corresponding to the tree in the third area.
4. The method according to any one of claims 1 to 3, characterized in that The method further comprises: In the process of rendering the content corresponding to the tree in the first area and the content corresponding to the parent node tree, lazy loading tags are added to at least part of the nodes constituting the parent node tree.
5. The method according to any one of claims 1 to 4, characterized in that The height of the first area is greater than or equal to the height of the first display window, and the anchor point is located at the top of the first area.
6. An electronic device, characterized in that: The electronic device comprises: A receiving module, configured to receive a first request message, where the first request message is used to request loading of a first webpage, where the first webpage includes an anchor corresponding to the first request message; a loading module, configured to load content corresponding to a tree in a first region and content corresponding to a parent node tree in the first webpage, wherein the parent node tree is a parent node tree of the tree in the first region, and the anchor point is located in the first region; A rendering module, configured to render content corresponding to the tree in the first area and content corresponding to the parent node tree; The display module is configured to display the content corresponding to the tree in the first area and the content corresponding to the parent node tree in a first display window.
7. The electronic device according to claim 6, wherein: The loading module is further used for: Loading content corresponding to the tree in a second area of the first webpage, where the second area is an area after the first area of the first webpage; The rendering module is further configured to: Render the content corresponding to the tree in the second area.
8. The electronic device according to claim 6 or 7, characterized in that: The loading module is further used for: Loading content corresponding to the tree in a third area of the first webpage, where the third area is an area before the first area of the first webpage; The rendering module is further configured to: Render the content corresponding to the tree in the third area.
9. The electronic device according to any one of claims 6 to 8, characterized in that: The loading module is specifically used for: Loading the content corresponding to the tree in the first area and the content corresponding to the parent node tree into a shared memory, where the shared memory is a shared memory between the loading module and the rendering module; The rendering module is further configured to obtain, from the shared memory, content corresponding to the tree in the first area and content corresponding to the parent node tree.
10. The electronic device according to claim 9, characterized in that The loading module is further used for: When the content corresponding to the tree in the first area and the content corresponding to the parent node tree are loaded into the shared memory, the rendering module is notified to obtain the content corresponding to the tree in the first area and the content corresponding to the parent node tree from the shared memory.
11. The electronic device according to claim 7, wherein: The loading module is specifically used for: Loading the content corresponding to the tree in the second area into a shared memory, where the shared memory is a shared memory between the loading module and the rendering module; The rendering module is further configured to obtain content corresponding to the tree in the second area from the shared memory.
12. The electronic device according to claim 11, wherein: The loading module is further used for: When the content corresponding to the tree in the second area is loaded into the shared memory, the rendering module is notified to obtain the content corresponding to the tree in the second area from the shared memory.
13. The electronic device according to claim 8, wherein: The loading module is specifically used for: Loading the content corresponding to the tree in the third area into a shared memory, where the shared memory is a shared memory between the loading module and the rendering module; The rendering module is further configured to obtain content corresponding to the tree in the third area from the shared memory.
14. The electronic device according to claim 13, wherein: The loading module is further used for: When the content corresponding to the tree in the third area is loaded into the shared memory, the rendering module is notified to obtain the content corresponding to the tree in the third area from the shared memory.
15. The electronic device according to any one of claims 6 to 14, characterized in that: The device further comprises: The marking module is used to add lazy loading tags to at least part of the nodes constituting the parent node tree during the process of rendering the content corresponding to the tree in the first area and the content corresponding to the parent node tree.
16. The electronic device according to any one of claims 6 to 15, characterized in that: The height of the first area is greater than or equal to the height of the first display window, and the anchor point is located at the top of the first area.
17. An electronic device, characterized in that: include: one or more processors; one or more memories; and one or more computer programs, wherein the one or more computer programs are stored in the one or more memories, and the one or more computer programs include instructions that, when executed by the one or more processors, cause the electronic device to perform the method as described in any one of claims 1 to 5.
18. A computer-readable storage medium, characterized in that The storage medium stores a program or instruction, and when the program or instruction is executed, the method according to any one of claims 1 to 5 is implemented.
19. A computer program product, characterized in that The computer program product stores a program or an instruction, and when the program or the instruction is executed, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Information presentation method and device
CN106951495A
Page lazy loading method and device, storage medium and processor
CN111259284A
Page data preloading method based on user behavior analysis, terminal and storage medium
CN114357338A
Systems and methods for direct navigation to specific portion of target document
CN1902627A
Identifying Information Using Referenced Text
US20180232344A1