Page loading method and device, electronic equipment and storage medium
By optimizing the loading of each component in the page according to the importance of the component and the dynamic determination of the rendered loading frame when the page is loaded, the problem of low page loading effectiveness in the existing technology is solved, and more efficient and complete page loading is achieved.
Patent Information
- Application Number
- CN202411580958.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-25
AI Technical Summary
In the prior art, page functions are omitted due to component merging and compression when page loading, and the loading effectiveness is low.
By determining the target importance of each component on the page, dynamically determine the rendering load frame, and load the target components according to the rendering importance, ensuring that components with high importance are loaded first.
Improve the effectiveness and efficiency of page loading, ensuring complete page functions and improved user experience.
Smart Images

Figure CN119513435A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a page loading method, device, electronic device and storage medium. Background Art
[0002] Data and methods can be encapsulated through components. In front-end page design, components can be used to decompose the page into multiple functionally independent parts. In more complex page loading, there may be nested relationships between components, making the page load slowly.
[0003] In the prior art, multiple files in a component can be merged into one file and the code therein can be compressed to reduce the number of requests made by the browser to the server and the file size, thereby increasing the page loading speed. However, by merging and compressing the components, some functions of the page are omitted, making the page loading less effective. Summary of the invention
[0004] The present application provides a page loading method, device, electronic device and storage medium to solve the technical problem of low effectiveness of page loading.
[0005] In a first aspect, the present application provides a method for loading a page, comprising:
[0006] Determine the multiple components corresponding to the current page and the target importance of each component;
[0007] Determine a plurality of rendering loading frames corresponding to the plurality of components;
[0008] According to the target importance of each component, determining at least one target component corresponding to each rendering loading frame among the multiple components, and determining the rendering importance of each rendering loading frame;
[0009] According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame is loaded to obtain the current page.
[0010] In the embodiment of the present application, it is possible to load components with higher importance and then continue to load components with lower importance, thereby improving the effectiveness of page loading.
[0011] Optionally, the method described above, determining multiple components corresponding to the current page and the target importance of each component includes:
[0012] Analyze and process the current page to determine multiple components corresponding to the current page;
[0013] Determine the component type of each component and the loading position of each component on the current page;
[0014] The target importance of each component is determined according to the component type and loading position of each component.
[0015] In the embodiment of the present application, the accuracy of the determined component importance can be improved based on the influence of the component type and loading position of the component on the target importance of the component, thereby improving the effectiveness of page loading.
[0016] Optionally, the method described above, for any component, determines the target importance of the component according to the component type and loading position of the component, including:
[0017] Obtaining a first importance corresponding to the component type;
[0018] determining a second importance of the loading position;
[0019] The target importance is determined based on the first importance and the second importance.
[0020] In the embodiment of the present application, the target importance of the component can be determined based on the first importance and the second importance, which can improve the accuracy of the component importance.
[0021] Optionally, according to the method described above, determining a plurality of rendering loading frames corresponding to the plurality of components includes:
[0022] determining a number of components of the plurality of components;
[0023] Obtain multiple preset number intervals and the number of rendering loads corresponding to each preset data interval;
[0024] Determine a target interval corresponding to the number of components in the plurality of preset data intervals;
[0025] The plurality of rendering loading frames are determined according to the number of rendering loading times corresponding to the target interval.
[0026] In an embodiment of the present application, the number of rendering loads is dynamically determined based on the number of components of multiple components, and then a suitable number of rendering load frames is determined, which can improve the efficiency of page loading.
[0027] Optionally, the method as described above, according to the target importance of each component, determines at least one target component corresponding to each rendering loading frame among the multiple components, and determines the rendering importance of each rendering loading frame, including:
[0028] Obtaining the importance interval corresponding to each rendering loading frame;
[0029] For any one rendering loading frame, determining a component whose target importance is within the importance interval corresponding to the rendering loading frame as at least one target component corresponding to the rendering loading frame;
[0030] The rendering importance of each rendering loading frame is determined according to the importance interval corresponding to each rendering loading frame.
[0031] In an embodiment of the present application, at least one target component corresponding to each rendering loading frame and the rendering importance of each rendering loading frame can be determined based on the importance interval corresponding to each rendering loading frame. At least one target component corresponding to each rendering loading frame can be loaded based on the rendering importance, which can improve the effectiveness of page loading.
[0032] Optionally, the method as described above, according to the rendering importance of each rendering loading frame, performs loading processing on at least one target component corresponding to each rendering loading frame to obtain the current page, including:
[0033] According to the rendering importance of each rendering loading frame, the multiple rendering loading frames are sorted to obtain a rendering frame queue;
[0034] According to the rendering frame queue, rendering processing is performed on at least one target component corresponding to each rendering loading frame to obtain the current page.
[0035] In an embodiment of the present application, at least one target component corresponding to each rendering loading frame can be loaded in sequence according to the rendering frame queue, which can improve the reliability of page loading.
[0036] Optionally, the method as described above further comprises:
[0037] Performing monitoring processing on at least one target component of each rendering loading frame;
[0038] For any target component, if the target component is successfully rendered in the corresponding rendering loading frame, the instance of the target component is deleted and the monitoring of the target component is canceled.
[0039] In the embodiment of the present application, timely canceling the monitoring of the target component can reduce the computing and performance overhead, improve the performance of the web page, and improve the efficiency of page loading.
[0040] In a second aspect, an embodiment of the present application provides a page loading device, including a first determination module, a second determination module, a third determination module and a loading processing module:
[0041] The first determination module is used to determine multiple components corresponding to the current page and the target importance of each component;
[0042] The second determination module is used to determine a plurality of rendering loading frames corresponding to the plurality of components;
[0043] The third determination module is used to determine at least one target component corresponding to each rendering loading frame among the multiple components, and determine the rendering importance of each rendering loading frame according to the target importance of each component;
[0044] The loading processing module is used to perform loading processing on at least one target component corresponding to each rendering loading frame according to the rendering importance of each rendering loading frame to obtain the current page.
[0045] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a memory, and a processor communicatively connected to the memory,
[0046] The memory stores computer-executable instructions;
[0047] The processor executes the computer-executable instructions stored in the memory, so that the processor executes the page loading method described in any one of the first aspects.
[0048] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the page loading method described in any one of the first aspects.
[0049] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the page loading method described in any one of the first aspects.
[0050] The page loading method, device, electronic device and storage medium provided in the present application can determine the target importance of each component in the current page, determine multiple rendering loading frames, and at least one target component corresponding to each rendering loading frame. According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame can be loaded and processed. After loading components with high importance, components with low importance can continue to be loaded, which can improve the effectiveness of page loading. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0052] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present application;
[0053] Figure 2 A schematic diagram of a flow chart of a page loading method provided in an embodiment of the present application;
[0054] Figure 3 A flowchart of another method for loading a page provided in an embodiment of the present application;
[0055] Figure 4 A schematic diagram of hierarchical rendering of multiple components provided in an embodiment of the present application;
[0056] Figure 5 A schematic diagram of the architecture of a page loading method provided in an embodiment of the present application;
[0057] Figure 6 A schematic diagram of the structure of a page loading device provided in an embodiment of the present application;
[0058] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.
[0059] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION
[0060] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0061] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of the present application. Figure 1 , may include a terminal device 101 and a server 102.
[0062] The terminal device 101 may be a mobile phone, tablet, laptop, desktop computer, smart wearable device, etc. An application may be installed on the terminal device 101. When browsing a page through the application, the page needs to be loaded and displayed on the display interface of the terminal device 101 for the user to browse.
[0063] The server 102 can determine multiple components corresponding to the current page and the target importance of each component, and determine multiple rendering loading frames corresponding to the multiple components; according to the target importance of each component, determine at least one target component corresponding to each rendering loading frame among the multiple components, and determine the rendering importance of each rendering loading frame; according to the rendering importance of each rendering loading frame, load the at least one target component corresponding to each rendering loading frame to obtain the current page. The current page can be displayed on the display interface of the terminal device 101.
[0064] In the prior art, multiple files in a component can be merged into one file and the code therein can be compressed to reduce the number of requests made by the browser to the server and the file size, thereby increasing the page loading speed. However, by merging and compressing the components, some functions of the page are omitted, making the page loading less effective.
[0065] The page loading method provided in the present application can determine the target importance of each component in the current page, determine multiple rendering loading frames, and at least one target component corresponding to each rendering loading frame. According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame can be loaded. After loading components with high importance, components with low importance can continue to be loaded, thereby improving the effectiveness of page loading.
[0066] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.
[0067] Figure 2 A schematic diagram of a method for loading a page provided in an embodiment of the present application. Figure 2 , the method may include:
[0068] S201, determining multiple components corresponding to the current page and the target importance of each component.
[0069] The execution subject of the embodiment of the present application may be a server, or a page loading device set in the server. The page loading device may be implemented by software, or by a combination of software and hardware.
[0070] When a user browses in a browser or application through a terminal device, the current page to be browsed needs to be loaded.
[0071] The current page can be decomposed into multiple components with independent functions. If the functions of the current page are complex, there will be more corresponding components.
[0072] The target importance of each component can be determined by the loading position of each component in the current page and the component type.
[0073] For example, when a user browses the current page, components that are positioned at the front will be seen by the user first and can be loaded first; components with more important functions in the current page can be loaded first.
[0074] S202: Determine multiple rendering loading frames corresponding to multiple components.
[0075] In some possible embodiments, the number of rendering loading frames can be preconfigured to determine multiple rendering loading frames.
[0076] In some possible embodiments, multiple rendering loading frames can be determined according to the number of components of the multiple components, and the more components there are, the more rendering loading frames there are.
[0077] Furthermore, the number of components of multiple components can be determined; multiple preset number intervals and the number of rendering loads corresponding to each preset data interval can be obtained; in the multiple preset data intervals, the target interval corresponding to the number of components can be determined; and based on the number of rendering loads corresponding to the target interval, multiple rendering loading frames can be determined.
[0078] It is possible to dynamically determine the number of rendering loads, and then determine a suitable number of multiple rendering load frames to avoid excessive loading times, thereby improving the efficiency of page loading.
[0079] For example, assuming that there are 3 preset data intervals, namely preset data intervals 1-3, the corresponding rendering load times for each preset data interval can be shown in Table 1. Assuming that the number of components is 10, it can be determined that the number of components is within the preset number interval 2, and the target interval can be determined as the preset number interval 2. The rendering load times 3 corresponding to the preset number interval 2 can be determined as the number of rendering load frames, and 3 rendering load frames are obtained, namely rendering load frame 1, rendering load frame 2 and rendering load frame 3.
[0080] Table 1
[0081]
[0082] S203. According to the target importance of each component, determine at least one target component corresponding to each rendering loading frame among multiple components, and determine the rendering importance of each rendering loading frame.
[0083] In some possible embodiments, multiple components can be sorted according to the target importance of each component to obtain multiple component sets, wherein the target importance of the components in each component set is in the same importance interval, and the rendering loading frame corresponding to each component set can be determined, and the rendering importance of the rendering loading frame can be determined according to the importance interval corresponding to each component set.
[0084] In some possible embodiments, the importance interval corresponding to each rendering loading frame can be obtained; for any rendering loading frame, the component whose target importance is within the importance interval corresponding to the rendering loading frame is determined as at least one target component corresponding to the rendering loading frame; based on the importance interval corresponding to each rendering loading frame, the rendering importance of each rendering loading frame is determined.
[0085] At least one target component corresponding to each rendering loading frame may be loaded according to the rendering importance, which may improve the effectiveness of page loading.
[0086] For example, assuming that there are 10 components, namely components 1-10, and components 1-10 are sorted according to importance as follows: component 1>component 2>component 3>...>component 10. Assuming that there are 3 rendering loading frames, namely rendering loading frames 1-3, and assuming that the target component corresponding to each rendering loading frame can be determined according to the target importance of each component, as shown in Table 2, the rendering importance of rendering loading frame 1 is greater than the rendering importance of rendering loading frame 2, and the rendering importance of rendering loading frame 2 is greater than the rendering importance of rendering loading frame 3.
[0087] Table 2
[0088]
[0089] S204: According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame is loaded to obtain the current page.
[0090] By loading at least one target component corresponding to each rendering loading frame, the current page can be obtained, and the page function and the number of components can be guaranteed to be not missing.
[0091] Before all rendering loading frames are completed, rendering is performed step by step according to the rendering importance of each rendering loading frame. Some important functions, elements or components that users need to see first are rendered first. This can improve the efficiency of displaying pages on the terminal device interface and improve the user experience.
[0092] The page loading method provided by the embodiment of the present application can determine the target importance of each component in the current page, determine multiple rendering loading frames, and at least one target component corresponding to each rendering loading frame, and can load at least one target component corresponding to each rendering loading frame according to the rendering importance of each rendering loading frame, so that after loading components with high importance, components with low importance can continue to be loaded, which can improve the effectiveness of page loading. At the same time, it can improve the efficiency of displaying pages on the terminal device interface and improve the user experience.
[0093] Figure 3 A flowchart of another method for loading a page provided in an embodiment of the present application. Figure 3 , the method may include:
[0094] S301: Analyze and process the current page to determine multiple components corresponding to the current page.
[0095] The current page may be a view (Vue) page, and a recursive function may be used to traverse the component tree of the Vue instance in the Vue page, and then count the number of component instances.
[0096] S302: Determine the component type of each component and the loading position of each component on the current page.
[0097] Components can be divided into multiple component types, the importance corresponding to each component type can be determined, and whether the component needs to be loaded first can be determined based on the component type of the component.
[0098] You can configure multiple component types and the importance of each component type.
[0099] For example, component types may include base components (Base Components), single file components (SFCs), global components (Global Components), local components (Local Components), asynchronous components (Async Components), etc.
[0100] When a user browses the current page through the display screen of a terminal device, the user first sees the front part of the current page, and can determine the loading position of the component on the current page, and determine the importance of the component based on the loading position.
[0101] S303: Determine the target importance of each component according to the component type and loading position of each component.
[0102] For any component, the target importance can be determined in the following way: the first importance corresponding to the component type can be obtained, the second importance of the loading position can be determined, and the target importance of the component can be determined based on the first importance and the second importance, which can improve the accuracy of the component importance.
[0103] The current page may be divided into a plurality of loading areas, each loading area having its corresponding importance, and the importance of the loading area where the loading position of the component is located may be determined as the first importance of the component.
[0104] In some possible embodiments, the product of the first importance and the second importance may be determined as the target importance of the component.
[0105] It is worth noting that after determining the target importance of each component, the target importance of each component can be normalized.
[0106] S304: Determine multiple rendering loading frames corresponding to the multiple components.
[0107] The execution process of S304 can refer to the execution process of S202, which will not be repeated here.
[0108] S305: Obtain the importance interval corresponding to each rendering loading frame.
[0109] The importance interval corresponding to each rendering loading frame may be determined according to the number of rendering loading frames.
[0110] For example, suppose there are three rendering loading frames, namely rendering loading frame 1, rendering loading frame 2 and rendering loading frame 3. Suppose the importance interval of rendering loading frame 1 is (0.8, 1], that of rendering loading frame 2 is (0.5, 0.8], and that of rendering loading frame 3 is (0, 0.5].
[0111] S306: For any rendering loading frame, determine a component whose target importance is within the importance interval corresponding to the rendering loading frame as at least one target component corresponding to the rendering loading frame.
[0112] For example, assuming that there are 10 components, namely components 1-10, assuming that the importance of each component can be as shown in Table 1, assuming that there are 3 rendering loading frames, namely rendering loading frame 1, rendering loading frame 2 and rendering loading frame 3, assuming that the importance interval of rendering loading frame 1 is (0.8, 1], rendering loading frame 2 is (0.5, 0.8], and rendering loading frame 3 is (0, 0.5], then it can be determined that rendering loading frame 1 corresponds to component 1, component 2 and component 3, rendering loading frame 2 corresponds to component 4, component 5 and component 6, and rendering loading frame 3 corresponds to component 7, component 8, component 9 and component 10, as shown in Table 2.
[0113] Table 3
[0114] Components Importance Components Importance Component 1 1 Component 6 0.6 Component 2 0.9 Component 7 0.5 Component 3 0.9 Component 8 0.5 Component 4 0.8 Component 9 0.4 Component 5 0.6 Component 10 0.3
[0115] S307 . Determine the rendering importance of each rendering loading frame according to the importance interval corresponding to each rendering loading frame.
[0116] The rendering importance of the rendering loading frame can be assigned according to the importance interval corresponding to the rendering loading frame. If the importance interval corresponding to the rendering loading frame is larger, the rendering importance of the rendering loading frame is higher.
[0117] In some embodiments, the middle value of the importance interval may be determined as the rendering importance of rendering the loading frame.
[0118] For example, assuming that there are 3 rendering loading frames, namely rendering loading frame 1, rendering loading frame 2 and rendering loading frame 3, and assuming that the importance interval of rendering loading frame 1 is (0.8, 1], that of rendering loading frame 2 is (0.5, 0.8], and that of rendering loading frame 3 is (0, 0.5], then it can be determined that the rendering importance of rendering loading frame 1 is 0.9, the rendering importance of rendering loading frame 2 is 0.75, and the rendering importance of rendering loading frame 3 is 0.3.
[0119] S308 , sorting the multiple rendering loading frames according to the rendering importance of each rendering loading frame to obtain a rendering frame queue.
[0120] The rendering frame queue may include at least one component corresponding to each rendering loading frame.
[0121] S309: Render at least one target component corresponding to each rendering loading frame according to the rendering frame queue to obtain the current page.
[0122] For any rendering loading frame, at least one target component corresponding to the rendering loading frame can be rendered by controlling the rendering timing through the deferRender() function to obtain the rendering loading frame.
[0123] The deferRender() function can load at least one target component corresponding to each rendering loading frame in sequence according to the rendering frame queue.
[0124] In some possible embodiments, at least one target component of each rendering loading frame is monitored; for any target component, if the target component is successfully rendered in the corresponding rendering loading frame, the instance of the target component is deleted and the monitoring of the target component is canceled.
[0125] Being able to cancel monitoring of the target component in a timely manner can reduce computing and performance overhead, improve web page performance, and increase page loading efficiency.
[0126] The requestAnimationFrame interface can be used to control the execution of the deferRender() function to load the next rendering loading frame when the rendering loading frame is ready.
[0127] Figure 4 A schematic diagram of hierarchical rendering of multiple components provided in an embodiment of the present application. Figure 4 There are 10 components, namely components 1-10. The order of sorting components 1-10 according to importance is: component 1, component 2, component 3, ..., component 10. Assume that 3 rendering loading frames are determined, namely rendering loading frames 1-3, where rendering loading frame 1 corresponds to components 1, 2 and 3, rendering loading frame 2 corresponds to components 4, 5 and 6, and rendering loading frame 3 corresponds to components 7, 8, 9 and 10. The deferRender() function can load the rendering loading frames in sequence until the current page is obtained.
[0128] The page loading method provided in the embodiment of the present application can determine the target importance of each component in the current page, determine multiple rendering loading frames, and at least one target component corresponding to each rendering loading frame. According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame can be loaded. After loading components with high importance, components with low importance can continue to be loaded, thereby improving the effectiveness of page loading.
[0129] Figure 5 This is a schematic diagram of the architecture of a page loading method provided in an embodiment of the present application. Figure 5 , multiple components can be determined in the current page, the component type of each component and the loading position of each component in the current page can be determined, and the target importance of each component can be determined according to the component type and loading position of each component. According to the target importance of each component, at least one component corresponding to each rendering loading frame and the rendering importance of each rendering loading frame can be determined. According to the rendering importance of each rendering loading frame, a rendering frame queue can be determined, and according to the rendering frame queue, at least one target component corresponding to each rendering loading frame is rendered to obtain the current page.
[0130] Figure 6 This is a schematic diagram of the structure of a page loading device provided in an embodiment of the present application. Figure 6 The page loading device may include a first determining module 11, a second determining module 12, a third determining module 13 and a loading processing module 14:
[0131] The first determination module 11 is used to determine multiple components corresponding to the current page and the target importance of each component;
[0132] The second determination module 12 is used to determine multiple rendering loading frames corresponding to multiple components;
[0133] The third determination module 13 is used to determine at least one target component corresponding to each rendering loading frame from among the multiple components, and to determine the rendering importance of each rendering loading frame according to the target importance of each component;
[0134] The loading processing module 14 is used to perform loading processing on at least one target component corresponding to each rendering loading frame according to the rendering importance of each rendering loading frame to obtain the current page.
[0135] The page loading device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0136] Optionally, in the above method, the first determining module 11 is specifically used for:
[0137] Analyze and process the current page to determine multiple components corresponding to the current page;
[0138] Determine the component type of each component and the loading position of each component on the current page;
[0139] Determine the target importance of each component based on its component type and loading location.
[0140] Optionally, the above method is for any component; the first determining module 11 is specifically used to:
[0141] Get the first importance corresponding to the component type;
[0142] Determine the second importance of the loading location;
[0143] The target importance is determined based on the first importance and the second importance.
[0144] Optionally, in the above method, the second determining module 12 is specifically configured to:
[0145] Determine the number of components for multiple components;
[0146] Obtain multiple preset number intervals and the number of rendering loads corresponding to each preset data interval;
[0147] Determine a target interval corresponding to the number of components in a plurality of preset data intervals;
[0148] According to the number of rendering loads corresponding to the target interval, a plurality of rendering load frames are determined.
[0149] Optionally, in the above method, the third determining module 13 is specifically used for:
[0150] Get the importance interval corresponding to each rendering loading frame;
[0151] For any rendering loading frame, determining a component whose target importance is within the importance interval corresponding to the rendering loading frame as at least one target component corresponding to the rendering loading frame;
[0152] The rendering importance of each rendering loading frame is determined according to the importance interval corresponding to each rendering loading frame.
[0153] Optionally, in the above method, the loading processing module 14 is specifically used for:
[0154] According to the rendering importance of each rendering loading frame, multiple rendering loading frames are sorted to obtain a rendering frame queue;
[0155] According to the rendering frame queue, at least one target component corresponding to each rendering loading frame is rendered to obtain the current page.
[0156] Optionally, in the above method, the device further comprises:
[0157] Perform monitoring processing on at least one target component of each rendering loading frame;
[0158] For any target component, if the target component is rendered successfully in the corresponding rendering loading frame, the instance of the target component is deleted and the monitoring of the target component is canceled.
[0159] The page loading device provided in the embodiment of the present application can execute the technical solution shown in the above method embodiment, and its implementation principle and beneficial effects are similar, which will not be repeated here.
[0160] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 The electronic device 20 may include a processor 21 and a memory 22 that is communicatively connected to the processor 21. Exemplarily, the processor 21 and the memory 22 are interconnected via a bus 23.
[0161] The memory 22 stores computer executable instructions;
[0162] The processor 21 executes the computer execution instructions stored in the memory 22, so that the processor 21 executes the page loading method shown in the above method embodiment.
[0163] Accordingly, an embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the page loading method of the above method embodiment.
[0164] Accordingly, an embodiment of the present application may also provide a computer program product, including a computer program, which, when executed by a processor, can implement the page loading method shown in the above method embodiment.
[0165] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0166] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.
[0167] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
[0168] It should be understood that the above-mentioned device embodiments are only illustrative, and the device of the present application can also be implemented in other ways. For example, the division of units / modules in the above-mentioned embodiments is only a logical function division, and there may be other division methods in actual implementation. For example, multiple units, modules or components can be combined, or can be integrated into another system, or some features can be ignored or not executed.
[0169] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.
[0170] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. If not specifically stated, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. If not specifically stated, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc.
[0171] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or all or part of the technical solution, can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.
[0172] In the above embodiments, the description of each embodiment has its own emphasis. For parts not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0173] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.
[0174] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for loading a page, characterized in that: include: Determine the multiple components corresponding to the current page and the target importance of each component; Determine a plurality of rendering loading frames corresponding to the plurality of components; According to the target importance of each component, determining at least one target component corresponding to each rendering loading frame among the multiple components, and determining the rendering importance of each rendering loading frame; According to the rendering importance of each rendering loading frame, at least one target component corresponding to each rendering loading frame is loaded to obtain the current page.
2. The method according to claim 1, characterized in that Determine the multiple components corresponding to the current page and the target importance of each component, including: Analyze and process the current page to determine multiple components corresponding to the current page; Determine the component type of each component and the loading position of each component on the current page; The target importance of each component is determined according to the component type and loading position of each component.
3. The method according to claim 2, characterized in that For any component, according to the component type and loading position of the component, determine the target importance of the component, including: Obtaining a first importance corresponding to the component type; determining a second importance of the loading position; The target importance is determined based on the first importance and the second importance.
4. The method according to any one of claims 1 to 3, characterized in that: Determining a plurality of rendering loading frames corresponding to the plurality of components includes: determining a number of components of the plurality of components; Obtain multiple preset number intervals and the number of rendering loads corresponding to each preset data interval; Determine a target interval corresponding to the number of components in the plurality of preset data intervals; The plurality of rendering loading frames are determined according to the number of rendering loading times corresponding to the target interval.
5. The method according to any one of claims 1 to 4, characterized in that: According to the target importance of each component, determining at least one target component corresponding to each rendering loading frame among the multiple components, and determining the rendering importance of each rendering loading frame, including: Obtaining the importance interval corresponding to each rendering loading frame; For any one rendering loading frame, determining a component whose target importance is within the importance interval corresponding to the rendering loading frame as at least one target component corresponding to the rendering loading frame; The rendering importance of each rendering loading frame is determined according to the importance interval corresponding to each rendering loading frame.
6. The method according to any one of claims 1 to 5, characterized in that: According to the rendering importance of each rendering loading frame, loading processing is performed on at least one target component corresponding to each rendering loading frame to obtain the current page, including: According to the rendering importance of each rendering loading frame, the multiple rendering loading frames are sorted to obtain a rendering frame queue; According to the rendering frame queue, rendering processing is performed on at least one target component corresponding to each rendering loading frame to obtain the current page.
7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Performing monitoring processing on at least one target component of each rendering loading frame; For any target component, if the target component is successfully rendered in the corresponding rendering loading frame, the instance of the target component is deleted and the monitoring of the target component is canceled.
8. A page loading device, characterized in that: It includes a first determination module, a second determination module, a third determination module and a loading processing module: The first determination module is used to determine multiple components corresponding to the current page and the target importance of each component; The second determination module is used to determine a plurality of rendering loading frames corresponding to the plurality of components; The third determination module is used to determine at least one target component corresponding to each rendering loading frame among the multiple components, and determine the rendering importance of each rendering loading frame according to the target importance of each component; The loading processing module is used to perform loading processing on at least one target component corresponding to each rendering loading frame according to the rendering importance of each rendering loading frame to obtain the current page.
9. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 7 when executed by a processor.