Page resource loading method and device, storage medium and electronic device

By adjusting the loading order according to the attributes of the page resources and user behavior, and adopting preload and lazy loading strategies, the inefficiency problem caused by the unreasonable loading order of the page resources is solved, and the page loading speed and user experience are improved.

CN118551128BActive Publication Date: 2024-11-19INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411031286.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-30
Publication Date
2024-11-19
Estimated Expiration
2044-07-30

AI Technical Summary

Technical Problem

In the prior art, the unreasonable loading order of page resources leads to low page access efficiency. Users must wait for the page to be loaded before using the interactive function. The slow loading speed of key resources leads to stuttering.

Method used

Generate the target resource loading order based on the resource attribute information and user attribute information of the page resource. Resources with high importance and high possibility of calling are preferred. Preloading and lazy loading strategies are used to adjust the resource loading order.

Benefits of technology

Improve page access efficiency, reduce user waiting time, improve user experience, and optimize page loading speed.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118551128B_ABST
    Figure CN118551128B_ABST
Patent Text Reader

Abstract

The present application discloses a method and device for loading page resources, a storage medium and an electronic device. The method for loading page resources includes: obtaining a target access request initiated by a target account; responding to the target access request, generating a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the loading order of the page resource with greater importance is higher in the target resource loading order, and the loading order of the page resource with greater call possibility is higher in the target resource loading order; and loading the page resources in the page resource set according to the target resource loading order. The above technical solution is adopted to solve the problem that the unreasonable loading order of page resources leads to low page access efficiency in the related technology, thereby achieving the technical effect of improving the page access efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the computer field, and specifically, to a method and device for loading page resources, a storage medium, and an electronic device. Background Art

[0002] With the development of Internet technology, performance optimization of Web applications has become the key to improving user experience and business competitiveness. For a page to be accessed, it depends on the smooth loading of the corresponding page resources. Different page resources are used to achieve different effects / functions of the page (such as image / video effects and user interaction functions).

[0003] Currently, when a page is accessed, the order in which each page resource is loaded is determined by the code written during the R&D phase. In the traditional way, the code stipulates that the resources corresponding to the page rendering effect should be loaded first, so as to load the page image / effect first. After the image / effect is loaded, the page resources used to implement specific interactive functions are loaded. In this case, on the one hand, the user must wait for the page / effect to load before using the specific interactive function during the page access process. This results in low efficiency in user access to the page. On the other hand, the more critical page resources are slow to load because they are sorted after the larger image / video resources, resulting in page jams.

[0004] In the related art, there is no effective solution to the problem that the unreasonable loading order of page resources leads to low page access efficiency. Summary of the invention

[0005] The embodiments of the present application provide a method and device for loading page resources, a storage medium, and an electronic device, so as to at least solve the problem in the related art that the unreasonable loading order of page resources leads to low page access efficiency.

[0006] According to an embodiment of the present application, a method for loading a page resource is provided, including: applying to a page access application, the method comprising:

[0007] Obtaining a target access request initiated by a target account, wherein the target access request is used to request access to a target page;

[0008] In response to the target access request, a target resource loading order is generated according to resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order;

[0009] The page resources in the page resource set are loaded according to the target resource loading order.

[0010] Optionally, generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page includes:

[0011] Determine a resource loading strategy corresponding to each of the page resources according to the resource attribute information and the user attribute information of each of the page resources in the page resource set;

[0012] A target resource loading sequence is generated for the page resource set according to the resource loading strategy of each of the page resources in the page resource set.

[0013] Optionally, determining the resource loading strategy corresponding to each of the page resources according to the resource attribute information and the user attribute information of each of the page resources in the page resource set includes:

[0014] Determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources;

[0015] Generate the resource loading strategy that matches the resource type.

[0016] Optionally, determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources includes:

[0017] In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance, and / or the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is greater than the target possibility, the page resource is determined to be a core resource type;

[0018] When the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance, and the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is less than the target possibility, the page resource is determined to be a non-core resource type.

[0019] Optionally, the generating the resource loading strategy matching the resource type includes:

[0020] In the case where the page resource is of the core resource type, determining the resource loading strategy corresponding to the page resource as a preloading strategy, wherein the preloading strategy is used to indicate that the loading of the corresponding page resource is started before a first time period after responding to the target access request;

[0021] In the case where the page resource is the non-core resource type, the resource loading strategy corresponding to the page resource is determined as a lazy loading strategy, wherein the lazy loading strategy is used to start loading the corresponding page resource after a second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0022] Optionally, when the page resource set includes N page resources, N is an integer greater than 1, generating a target resource loading order for the page resource set according to the resource loading strategy of each page resource in the page resource set includes:

[0023] Generate a candidate resource loading sequence, wherein the candidate resource loading sequence records the loading sequence of N page resources in the page resource set;

[0024] When the resource loading strategy of the i-th page resource among the N page resources is a preloading strategy, and the resource loading strategy of the j-th page resource is a lazy loading strategy, the i-th page resource in the alternative resource loading order is adjusted to before the j-th page resource to obtain the target resource loading order, wherein i is not equal to j, i and j are both integers greater than or equal to 1 and less than or equal to N, the preloading strategy is used to indicate that the loading of the corresponding page resource is started before the first time period after responding to the target access request, and the lazy loading strategy is used to start the loading of the corresponding page resource after the second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0025] Optionally, the step of adjusting the i-th page resource in the candidate resource loading sequence to be before the j-th page resource to obtain the target resource loading sequence includes:

[0026] Adjust the i-th page resource to be before the j-th page resource to obtain a reference resource loading order;

[0027] In the case where the ath page resource and the bth page resource among the N page resources are both preloaded according to the preload strategy, and the ath resource size of the ath page resource is smaller than the bth resource size of the bth page resource, the ath page resource in the reference resource loading sequence is adjusted to be before the bth page resource, to obtain a candidate resource loading sequence, wherein a is not equal to b, and a and b are both integers greater than or equal to 1 and less than or equal to N;

[0028] When the cth page resource and the dth page resource among the N page resources are both lazy loading strategies, and the cth resource size of the cth page resource is smaller than the dth resource size of the dth page resource, the cth page resource in the candidate resource loading order is adjusted to before the dth page resource to obtain the target resource loading order, wherein c is not equal to d, and c and d are both integers greater than or equal to 1 and less than or equal to N.

[0029] Optionally, generating the candidate resource loading sequence includes:

[0030] Detecting resource dependency relationships between N of the page resources;

[0031] In the case where the resource dependency relationship is used to indicate that the loading of the e-th page resource among the N page resources depends on the completion of the loading of the f-th page resource, the loading order of the e-th page resource is adjusted to be before the f-th page resource, to obtain an initial resource loading order;

[0032] In the initial resource loading order, the resource dependency is used to indicate that when the loading of the gth page resource among the N page resources is not dependent on the completion of the loading of the hth page resource, the gth page resource and the hth page resource are determined to be loaded simultaneously to obtain the alternative resource loading order.

[0033] Optionally, before generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page, the method further includes:

[0034] Acquire the resource dependency relationship between each of the page resources in the page resource set, and extract the resource attribute information of each of the page resources from the resource dependency relationship;

[0035] Obtain target interaction information of the target account for the target page, and generate the user attribute information of each of the page resources according to the target interaction information, wherein the target interaction information is used to indicate the number of executions of each of the multiple historical interaction operations performed by the target account on the target page.

[0036] Optionally, obtaining the resource dependency relationship between the page resources in the page resource set includes:

[0037] Parsing the page resource referenced by each of the page resources in the page resource set by a resource parser to obtain a reference page resource corresponding to each of the page resources;

[0038] It is determined that there exists the resource dependency relationship between each of the page resources and the corresponding reference page resource, wherein the resource dependency relationship is used to indicate that loading of the page resource depends on completion of loading of the corresponding reference page resource.

[0039] Optionally, the page resource referenced by each of the page resources in the page resource set is parsed by a resource parser to obtain a reference page resource corresponding to each of the page resources, including:

[0040] Identify the file type of each of the page resources by the resource parser;

[0041] The resource parser uses a parsing operation matching the file type to parse the page resources referenced by the corresponding page resources to obtain reference page resources corresponding to each of the page resources.

[0042] Optionally, the page resource referenced by the corresponding page resource is parsed by the resource parser using a parsing operation matching the file type to obtain a referenced page resource corresponding to each page resource, including:

[0043] In the case where the file type of the page resource is a web page file type, the resource tag of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the web page file type indicates the referenced reference page resource through the resource tag;

[0044] In the case where the file type of the page resource is a style file type or an interactive file type, the reference function of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the style file type is used to set the layout and appearance style of the target page, and the page resource of the interactive file type is used to add interactive functions to the target page, and the page resource of the style file type or the interactive file type references the corresponding reference page resource through the reference function.

[0045] Optionally, extracting the resource attribute information of each of the page resources from the resource dependency relationship includes:

[0046] Constructing a resource dependency graph for the page resource set according to the resource dependency;

[0047] The resource attribute information of each of the page resources is extracted from the resource dependency graph.

[0048] Optionally, when the page resource set includes N page resources, N is an integer greater than 1, constructing a resource dependency graph for the page resource set according to the resource dependency includes:

[0049] Inputting resource dependency relationships between the respective page resources in the page resource set into a graphical tool;

[0050] Receive the resource dependency graph output by the graphical tool, wherein the resource dependency graph includes N graphic nodes connected by directed arrows, wherein each of the N graphic nodes represents one of the page resources in the page resource set, and the two graphic nodes connected by the directed arrow are used to indicate that the resource dependency relationship exists between the corresponding two page resources, and the directed arrow includes a starting end and an arrow end, and the graphic node connected to the arrow end is used to represent the dependent page resource.

[0051] Optionally, extracting the resource attribute information of each of the page resources from the resource dependency graph includes:

[0052] Extracting a target graphic node from the resource dependency graph, wherein the target graphic node is the graphic node in the resource dependency graph connected by the arrow ends of the directed arrows greater than a preset number, and / or the graphic node connected by the starting end of the directed arrow that does not exist;

[0053] Determining the resource attribute information of the page resource represented by the target graphic node to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance;

[0054] The resource attribute information of the page resource represented by the non-target graph node in the resource dependency graph is determined to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance.

[0055] Optionally, generating the user attribute information of each of the page resources according to the target interaction information includes:

[0056] In a case where the target interaction information is used to indicate that the target account has executed a target history interaction operation on the target page for a number of times greater than a preset number, the user attribute information corresponding to the target page resource is determined to be used to indicate that the call probability of the target page resource being called when the target page is accessed by the target account is greater than the target probability, wherein the target page resource is the page resource required to execute the target history interaction operation;

[0057] When the target interaction information is used to indicate that the number of times the target account has performed a target historical interaction operation on the target page is less than or equal to the preset number of times, the user attribute information corresponding to the target page resource is determined to indicate that the possibility of calling the target page resource when the target page is accessed by the target account is less than or equal to the target possibility.

[0058] Optionally, after the page resources in the page resource set are loaded according to the target resource loading order to obtain the target page, the method further includes:

[0059] During the access process of the target page, collecting the target loading time of the target page;

[0060] Determine a loading speed parameter of the target page in the target resource loading sequence according to the target loading time, wherein the loading speed parameter is used to indicate the speed at which the target page is loaded;

[0061] When the loading speed parameter is used to indicate that the target page is loaded at a speed lower than a preset speed, the target resource loading order is adjusted to obtain an updated target resource loading order, and when the target page is accessed again, the page resources in the page resource collection are loaded using the updated target resource loading order.

[0062] Optionally, collecting the target loading time of the target page includes:

[0063] During the access process of the target page, the event loading start time and event loading completion time of the target event and the resource loading start time and resource loading completion time of each of the page resources in the page resource set are collected, wherein the target event is the event that the access operation of the target page depends on;

[0064] The event loading start time, the event loading completion time, the resource loading start time and the resource loading completion time are determined as the target loading time.

[0065] According to another embodiment of the embodiment of the present application, a device for loading page resources is also provided, which is applied to a page access application, and the device includes:

[0066] A first acquisition module is used to acquire a target access request initiated by a target account, wherein the target access request is used to request access to a target page;

[0067] A response module, used to respond to the target access request, and generate a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order;

[0068] A loading module is used to load the page resources in the page resource set according to the target resource loading order.

[0069] According to another embodiment of the present application, a computer program product is provided, including a computer program, wherein the computer program is executed by a processor to perform the steps in any of the above method embodiments.

[0070] According to another embodiment of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0071] According to another embodiment of the present application, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0072] In an embodiment of the present application, a method for loading page resources is proposed, which is applied to a page access application. The page access application first obtains a target access request initiated by a target account for requesting access to a target page; then responds to the target access request, and generates a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page. Since the resource attribute information can indicate the importance of the corresponding page resource for realizing the access operation of the target page, the user attribute information can indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with greater importance is higher in the target resource loading order, and the loading order of the page resource with greater calling possibility is higher in the target resource loading order; therefore, the page resources in the page resource set are loaded according to the target resource loading order, which can ensure that the page resources with greater importance and the page resources with greater calling possibility are loaded first in the process of the target page being accessed. The above technical solution solves the problems in the related technology that the unreasonable loading order of page resources leads to low page access efficiency, and achieves the technical effect of improving the page access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] Figure 1 It is a hardware structure block diagram of a computer device of a method for loading page resources in an embodiment of the present application;

[0074] Figure 2 is a flow chart of a method for loading page resources according to an embodiment of the present application;

[0075] Figure 3 is a schematic diagram of an intelligent preloading algorithm model according to an embodiment of the present application;

[0076] Figure 4 is a schematic diagram of constructing a resource dependency graph according to an embodiment of the present application;

[0077] Figure 5 is a schematic diagram of a page resource loading process according to an embodiment of the present application;

[0078] Figure 6 is a schematic diagram of a first acquisition code according to an embodiment of the present application;

[0079] Figure 7 is a schematic diagram of a second acquisition code according to an embodiment of the present application;

[0080] Figure 8 is a schematic diagram of a third acquisition code according to an embodiment of the present application;

[0081] Fig. 9 is a structural block diagram of a device for loading page resources according to an embodiment of the present application;

[0082] Fig.10 is a schematic diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0083] The embodiments of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0084] It should be noted that the terms "first", "second", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0085] The method embodiments provided in the embodiments of the present application can be executed in a server device or a similar computing device. Taking running on a server device as an example, Figure 1 1 is a hardware structure block diagram of a computer device for a method of loading page resources in an embodiment of the present application. Figure 1 As shown, the server device may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the above-mentioned server device may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above server device. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0086] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for loading page resources in the embodiment of the present application. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the server device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0087] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of the server device. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0088] In this embodiment, a method for loading page resources is provided, which is applied to page access applications. Figure 2 is a flow chart of a method for loading page resources according to an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:

[0089] Step S12, obtaining a target access request initiated by a target account, wherein the target access request is used to request access to a target page;

[0090] Step S14, in response to the target access request, generating a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order;

[0091] Step S16: loading the page resources in the page resource set according to the target resource loading order.

[0092] Optionally, in this embodiment, the target page may be, but is not limited to, a page that needs to load page resources during the access process.

[0093] Optionally, in this embodiment, the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page. For example, if page resource A is referenced / dependent on most page resources in the page resource set, most page resources that reference / depend on page resource A cannot be loaded before page resource A is loaded. Therefore, the resource attribute information is used to indicate that the importance of page resource A for implementing the access operation of the target page is greater than the target importance.

[0094] Optionally, in this embodiment, the user attribute information is used to indicate the possibility of calling the corresponding page resource when the target page is accessed by the target account. For example, the target account has a high probability of executing a certain interactive operation of a feature each time it visits the target page. Then, the user attribute information is used to indicate that when the target page is accessed by the target account, the possibility of calling the page resource that implements the interactive operation is greater than the target possibility.

[0095] As an optional solution, generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page includes:

[0096] S21, determining a resource loading strategy corresponding to each of the page resources according to the resource attribute information and the user attribute information of each of the page resources in the page resource set;

[0097] S22: Generate a target resource loading sequence for the page resource set according to the resource loading strategy of each of the page resources in the page resource set.

[0098] Optionally, in this embodiment, the resource loading strategy in this application may include, but is not limited to: sequential strategy, parallel strategy, preloading strategy and lazy loading strategy. The sequential strategy may refer to loading two page resources in sequence. The parallel strategy may refer to loading two page resources in parallel, the preloading strategy may refer to preloading a specific page resource, and the lazy loading strategy may refer to delaying loading of a specific page resource.

[0099] Optionally, in this embodiment, due to the differences in resource attribute information and user attribute information, the corresponding resource loading strategy of each of the page resources may also be different. At the same time, since the resource attribute information can indicate the importance of the corresponding page resource for implementing the access operation of the target page, the user attribute information can indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account. Therefore, generating a target resource loading order for the page resource set according to the resource loading strategy of each of the page resources in the page resource set can ensure that page resources with greater importance and greater calling possibilities are loaded first when the target page is accessed.

[0100] As an optional solution, determining the resource loading strategy corresponding to each page resource according to the resource attribute information and the user attribute information of each page resource in the page resource set includes:

[0101] S31, determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources;

[0102] S32: Generate the resource loading strategy that matches the resource type.

[0103] Optionally, in this embodiment, the resource loading strategy of each of the page resources matches the resource type. The resource type is determined based on the resource attribute information and the user attribute information of each of the page resources. Since the resource attribute information can indicate the importance of the corresponding page resource for implementing the access operation of the target page, the user attribute information can indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account. Therefore, the determined resource loading strategy matches the importance of the corresponding page resource for implementing the access operation of the target page, and the possibility of the corresponding page resource being called when the target page is accessed by the target account.

[0104] As an optional solution, determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources includes:

[0105] S41, determining that the page resource is a core resource type when the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance, and / or the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is greater than the target possibility;

[0106] S42, when the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance, and the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is less than the target possibility, determine that the page resource is a non-core resource type.

[0107] As mentioned above, the resource loading strategy of each page resource matches the resource type. Optionally, in this embodiment, the page resource can be, but is not limited to, a core resource type / non-core resource type. Further, more types can be divided as needed.

[0108] As an optional solution, generating the resource loading strategy matching the resource type includes:

[0109] S51, when the page resource is of the core resource type, determining the resource loading strategy corresponding to the page resource as a preloading strategy, wherein the preloading strategy is used to indicate that the loading of the corresponding page resource is started before a first time period after responding to the target access request;

[0110] S52, when the page resource is the non-core resource type, the resource loading strategy corresponding to the page resource is determined as a lazy loading strategy, wherein the lazy loading strategy is used to start loading the corresponding page resource after a second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0111] Optionally, in this embodiment, different resource types mentioned above generate different resource loading strategies. For page resources of core resource types, a preloading strategy can be adopted, which can refer to preloading of specific page resources, and for page resources of non-core resource types, a lazy loading strategy can be adopted, which can refer to delayed loading of specific page resources.

[0112] As an optional solution, when the page resource set includes N page resources, N is an integer greater than 1, generating a target resource loading order for the page resource set according to the resource loading strategy of each page resource in the page resource set includes:

[0113] S61, generating a candidate resource loading sequence, wherein the candidate resource loading sequence records the loading sequence of N page resources in the page resource set;

[0114] S62, when the resource loading strategy of the i-th page resource among the N page resources is the preloading strategy, and the resource loading strategy of the j-th page resource is the lazy loading strategy, adjust the i-th page resource in the alternative resource loading order to before the j-th page resource, and obtain the target resource loading order, wherein i is not equal to j, i and j are both integers greater than or equal to 1 and less than or equal to N, the preloading strategy is used to indicate that the loading of the corresponding page resource is started before the first time period after responding to the target access request, and the lazy loading strategy is used to start the loading of the corresponding page resource after the second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0115] Optionally, in this embodiment, the preloading strategy may refer to preloading of a specific page resource, and the lazy loading strategy may refer to delayed loading of a specific page resource. When the resource loading strategy of the i-th page resource among the N page resources is a preloading strategy, and the resource loading strategy of the j-th page resource is a lazy loading strategy, the i-th page resource in the alternative resource loading sequence is adjusted to be before the j-th page resource, and the target resource loading sequence is obtained, in which the page resources of the preloading strategy are arranged before the page resources of the lazy loading strategy.

[0116] As an optional solution, the step of adjusting the i-th page resource in the candidate resource loading sequence to be before the j-th page resource to obtain the target resource loading sequence includes:

[0117] S71, adjusting the i-th page resource to be before the j-th page resource to obtain a reference resource loading order;

[0118] S72, when the ath page resource and the bth page resource among the N page resources are both the preloading strategies, and the ath resource size of the ath page resource is smaller than the bth resource size of the bth page resource, adjust the ath page resource in the reference resource loading sequence to before the bth page resource, to obtain a candidate resource loading sequence, wherein a is not equal to b, and a and b are both integers greater than or equal to 1 and less than or equal to N;

[0119] S73, when the cth page resource and the dth page resource among the N page resources are both lazy loading strategies, and the cth resource size of the cth page resource is smaller than the dth resource size of the dth page resource, the cth page resource in the candidate resource loading order is adjusted to before the dth page resource to obtain the target resource loading order, wherein c is not equal to d, and c and d are both integers greater than or equal to 1 and less than or equal to N.

[0120] Optionally, in this embodiment, the i-th page resource in the alternative resource loading order is adjusted to before the j-th page resource, and the target resource loading order can be obtained, but is not limited to, by an intelligent preloading algorithm model. The intelligent preloading algorithm model determines which page resources must be requested at the first load and which page resources are required based on user behavior or specific conditions. The page resources are divided into different groups according to their dependencies. Secondly, the intelligent preloading algorithm model can design the target resource loading order according to the resource dependencies and loading time. In this application, the page resources are sorted by size: the page resources are sorted by size, and smaller page resources are loaded first to reduce the loading time of a single page resource. And sorting by loading time: according to the loading time estimation of the page resources, page resources with shorter loading time are loaded first to shorten the overall loading time. Resource dependencies can also be considered: for page resources with dependencies, the dependent page resources are loaded first to reduce the waiting time of subsequent page resources.

[0121] As an optional solution, generating the candidate resource loading sequence includes:

[0122] S81, when the resource dependency relationship indicates that the loading of the e-th page resource among the N page resources depends on the completion of the loading of the f-th page resource, adjusting the loading order of the e-th page resource to be before the f-th page resource, to obtain an initial resource loading order;

[0123] S82, in the initial resource loading order, the resource dependency is used to indicate that when the loading of the g-th page resource among the N page resources is not dependent on the completion of the loading of the h-th page resource, the g-th page resource and the h-th page resource are determined to be loaded simultaneously to obtain the alternative resource loading order.

[0124] Optionally, in this embodiment, Figure 3 is a schematic diagram of an intelligent preloading algorithm model according to an embodiment of the present application, such as Figure 3As shown, the intelligent preloading algorithm model can also obtain the dependency relationship between page resources, and further propose parallel loading strategy and sequential loading strategy. Parallel loading strategy: For resources without dependencies, they can be loaded in parallel to reduce the waiting time for resource loading. Sequential loading strategy: For resources with dependencies, they are loaded one by one according to the dependencies to avoid resource loading errors or disordered order. At the same time, the intelligent preloading algorithm model also has a preloading strategy: preloading key resources that may be required by subsequent resources.

[0125] As an optional solution, before generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page, the method further includes:

[0126] S91, obtaining resource dependency relationships between the page resources in the page resource set, and extracting the resource attribute information of each page resource from the resource dependency relationships;

[0127] S92, obtaining the target interaction information of the target account for the target page, and generating the user attribute information of each of the page resources according to the target interaction information, wherein the target interaction information is used to indicate the number of executions of each of the multiple historical interaction operations performed by the target account on the target page.

[0128] Optionally, in this embodiment, in the process of obtaining resource dependencies, it is first necessary to collect data according to the Performance API. Through the method provided by the Performance API, key information such as the loading time, resource size, priority, etc. of each page resource can be obtained. Integrate the obtained information: Integrate and store the information into a data structure to facilitate subsequent analysis and processing. Arrays, objects or other data structures can be used to store detailed information for each page resource. Then process and analyze the data structure: Analyze the collected page resource data to calculate indicators such as average loading time, maximum / minimum loading time, average page resource size, etc., so as to further optimize the page loading performance. Finally, visualize: With the help of data visualization tools or chart libraries, visualize the page resource data. Extract the resource attribute information of each of the page resources from the visual display of the page resource data.

[0129] As an optional solution, obtaining the resource dependency relationship between the page resources in the page resource set includes:

[0130] S101, parsing the page resources referenced by each of the page resources in the page resource set by a resource parser to obtain reference page resources corresponding to each of the page resources;

[0131] S102: Determine whether the resource dependency relationship exists between each of the page resources and the corresponding reference page resource, wherein the resource dependency relationship is used to indicate that loading of the page resource depends on completion of loading of the corresponding reference page resource.

[0132] Optionally, in this embodiment, the resource dependency relationship between page resources is obtained by using a resource parser to parse the page resources referenced by each page resource.

[0133] As an optional solution, the page resource referenced by each of the page resources in the page resource set is parsed by a resource parser to obtain a reference page resource corresponding to each of the page resources, including:

[0134] S111, identifying the file type of each of the page resources by the resource parser;

[0135] S112: The resource parser parses the page resources referenced by the corresponding page resources by adopting a parsing operation matching the file type to obtain a referenced page resource corresponding to each of the page resources.

[0136] Optionally, in this embodiment, the resource parser may parse the page resources referenced by the corresponding page resources by taking a parsing operation matching the file type according to the file type of each page resource to obtain a referenced page resource corresponding to each page resource.

[0137] As an optional solution, the resource parser uses a parsing operation matching the file type to parse the page resource referenced by the corresponding page resource to obtain a reference page resource corresponding to each page resource, including:

[0138] S121, when the file type of the page resource is a web page file type, parsing the resource tag of the page resource by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the web page file type indicates the referenced page resource referenced by the resource tag;

[0139] S122, when the file type of the page resource is a style file type or an interactive file type, the reference function of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the style file type is used to set the layout and appearance style of the target page, and the page resource of the interactive file type is used to add interactive functions to the target page, and the page resource of the style file type or the interactive file type references the corresponding reference page resource through the reference function.

[0140] Optionally, in this embodiment, the dependency relationship between page resources is identified based on the order in which page resources are loaded and the page structure. For different files, a resource parser is used to parse the file content; for example, for HTML files (web page file type), the tags therein can be parsed to identify the referenced CSS (style file type) and JavaScript files (interactive file type); for CSS files, the @import rules and url() functions (reference functions) therein can be parsed; for JavaScript files, the import statements and require statements (reference functions) therein can be parsed.

[0141] As an optional solution, extracting the resource attribute information of each of the page resources from the resource dependency relationship includes:

[0142] S131, constructing a resource dependency graph for the page resource set according to the resource dependency;

[0143] S132: extract the resource attribute information of each of the page resources from the resource dependency graph.

[0144] Optionally, in this embodiment, after obtaining the reference page resource corresponding to each of the page resources, Figure 4 is a schematic diagram of constructing a resource dependency graph according to an embodiment of the present application, such as Figure 4 As shown, you can organize the page resource list: First, sort out all the page resources required for page loading, including HTML files, CSS files, JavaScript files, pictures, etc. List these page resources in a list or table to facilitate analysis and establish dependencies.

[0145] Then analyze the page resource loading relationship: analyze the loading relationship between each page resource and determine which page resources depend on other page resources. Generally speaking, the HTML file is the entry point for page loading, which contains references to page resources such as CSS and JavaScript, while the CSS file may reference other CSS files, and the JavaScript file may reference other JavaScript files, etc.

[0146] Then draw a dependency diagram: Based on the dependencies between page resources, you can use graphical tools or software (such as MindMeister, Lucidchart, etc.) to draw a dependency diagram between page resources.

[0147] Finally, mark the page resource priority: In the dependency graph, you can mark the priority of each page resource to distinguish which page resources are necessary for the first load and which are page resources that may be needed later. This helps to more clearly understand the key page resources in the page loading process. There are three ways to identify high-priority page resources. The first is the first page resource loaded, the second is the page resource that takes the longest to load, and the third is through user behavior analysis: determine high-priority page resources based on user behavior and needs. For example, the first action a user takes to access a page is to click a button, then the page resources associated with the button are high-priority page resources.

[0148] As an optional solution, when the page resource set includes N page resources, N is an integer greater than 1, constructing a resource dependency graph for the page resource set according to the resource dependency includes:

[0149] S141, inputting the resource dependency relationship between each of the page resources in the page resource set into a graphical tool;

[0150] S142, receiving the resource dependency graph output by the graphical tool, wherein the resource dependency graph includes N graphic nodes connected by directed arrows, wherein each of the N graphic nodes represents one of the page resources in the page resource set, and the two graphic nodes connected by the directed arrow are used to indicate that the resource dependency relationship exists between the corresponding two page resources, and the directed arrow includes a starting end and an arrow end, and the graphic node connected to the arrow end is used to represent the dependent page resource.

[0151] Optionally, in this embodiment, the above mentioned graphical tools or software (such as MindMeister, Lucidchart, etc.) can be used to draw a resource dependency diagram between page resources. In the resource dependency diagram, different symbols or colors represent different types of page resources, and arrows are used to represent dependencies, and the direction of the arrows represents the direction of the dependency.

[0152] As an optional solution, extracting the resource attribute information of each of the page resources from the resource dependency graph includes:

[0153] S151, extracting a target graphic node from the resource dependency graph, wherein the target graphic node is the graphic node connected by the arrow ends of the directed arrows greater than a preset number in the resource dependency graph, and / or the graphic node connected by the starting end of the directed arrow that does not exist;

[0154] S152, determining the resource attribute information of the page resource represented by the target graphic node to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance;

[0155] S153: Determine the resource attribute information of the page resource represented by the non-target graph node in the resource dependency graph as indicating that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance.

[0156] Optionally, in this embodiment, the dependency relationship between each page resource is deeply analyzed based on the resource dependency relationship graph between the page resources that has been established. Determine which page resources must be requested when first loaded and which page resources are required based on user behavior or under specific conditions. Divide the page resources into different groups based on their dependency relationships. Then extract the resource attribute information of each of the page resources from the resource dependency relationship graph.

[0157] As an optional solution, generating the user attribute information of each of the page resources according to the target interaction information includes:

[0158] S161, when the target interaction information is used to indicate that the number of times the target account has executed the target history interaction operation on the target page is greater than a preset number, determining the user attribute information corresponding to the target page resource to indicate that the call probability of the target page resource being called when the target page is accessed by the target account is greater than the target probability, wherein the target page resource is the page resource required to execute the target history interaction operation;

[0159] S162, when the target interaction information is used to indicate that the number of times the target account has performed a target historical interaction operation on the target page is less than or equal to the preset number, the user attribute information corresponding to the target page resource is determined to be used to indicate that the possibility of calling the target page resource when the target page is accessed by the target account is less than or equal to the target possibility.

[0160] Optionally, in this embodiment, by analyzing the data collected by the Performance API, page resources that may be requested by the user are loaded in advance to reduce the user's waiting time and improve the page loading speed.

[0161] As an optional solution, after the page resources in the page resource set are loaded according to the target resource loading order to obtain the target page, the method further includes:

[0162] S171, during the access process of the target page, collecting the target loading time of the target page;

[0163] S172, determining a loading speed parameter of the target page in the target resource loading sequence according to the target loading time, wherein the loading speed parameter is used to indicate a speed at which the target page is loaded;

[0164] S173, when the loading speed parameter is used to indicate that the target page is loaded at a speed lower than a preset speed, the target resource loading sequence is adjusted to obtain an updated target resource loading sequence, and when the target page is accessed again, the page resources in the page resource collection are loaded using the updated target resource loading sequence.

[0165] Optionally, in this embodiment, Figure 5 is a schematic diagram of a page resource loading process according to an embodiment of the present application, such as Figure 5 As shown, the page resource loading process includes four core steps.

[0166] Step 1: Page resource dependency analysis: Collect data based on the Performance API.

[0167] Step 2: Create a dependency graph between page resources.

[0168] Step 3: Intelligent preloading algorithm model: Based on the dependency and loading time of page resources, obtain the intelligent preloading algorithm model. Intelligent preloading algorithm model Identify high-priority page resources: Determine the high-priority page resources that are loaded first, and load these page resources first to ensure that the basic functions of the page are available. Identify potential page resources: Identify page resources that may be required for subsequent requests, and determine them by analyzing user historical loading behavior, page structure and other information. Formulate a preloading strategy: Formulate a preloading strategy to load potential page resources in advance, but not to the extent that it affects the loading time of core page resources.

[0169] Step 4: Model optimization: Through actual performance testing, compare the page loading speed and performance of the intelligent page resource preloading algorithm and the traditional solution to evaluate the effect of the intelligent preloading algorithm model. Through this intelligent page resource preloading algorithm, page resources that may be used can be loaded in advance before the user requests, improving the page loading speed and user experience. Among them, the above S171-S173 is the fourth step: model optimization.

[0170] As an optional solution, the collecting the target loading time of the target page includes:

[0171] S181, during the access process of the target page, collecting the event loading start time and event loading completion time of the target event and the resource loading start time and resource loading completion time of each of the page resources in the page resource set, wherein the target event is the event on which the access operation of the target page depends;

[0172] S182: Determine the event loading start time, the event loading completion time, the resource loading start time, and the resource loading completion time as the target loading time.

[0173] Optionally, in this embodiment, during the above-mentioned fourth step: model optimization, page loading data is collected through performance monitoring tools or testing tools, the effect of the intelligent preloading algorithm model is evaluated, and adjustments and optimizations are made according to actual conditions.

[0174] The target loading time may be, but is not limited to, a part of the page loading data. The page loading data may include, but is not limited to, the following data:

[0175] 1. Page loading data includes: loading start time (event loading start time), DOMContentLoaded time, page full loading time, etc. (event loading completion time). window.performance.getEntriesByType('resource'): Gets the loading information of each page resource (such as images, scripts, style sheets, etc.) in the page, including loading start time (resource loading start time), loading end time (resource loading completion time), etc.

[0176] Figure 6 is a schematic diagram of a first acquisition code according to an embodiment of the present application, such as Figure 6 As shown, the Performance API (first acquisition code) is called through JavaScript to obtain page performance indicator data, for example: window.performance.timing: provides time information about each key event of page loading, such as: loading start time (event start loading time), DOMContentLoaded time, page full loading time, etc. (event loading completion time). window.performance.getEntriesByType('resource'): Gets the loading information of each page resource (such as images, scripts, style sheets, etc.) in the page, including loading start time (resource start loading time), loading end time (resource loading completion time), etc.

[0177] 2. Page loading data includes: the name of the page resource, loading type, size and other information.

[0178] Figure 7 is a schematic diagram of a second acquisition code according to an embodiment of the present application, such as Figure 7 As shown, the name of the page resource, loading type, size and other information are obtained through the second acquisition code as page loading data.

[0179] 3. Page loading data includes: the loading order of existing page resources.

[0180] Figure 8 is a schematic diagram of a third acquisition code according to an embodiment of the present application, such as Figure 8 As shown, the loading order, name, start loading time, end loading time and loading time of each page resource are output as page loading data through the third acquisition code.

[0181] In the fourth step of model optimization, we collect page loading data through performance monitoring tools or testing tools, evaluate the effect of the preloading algorithm, and identify user behavior through reinforcement learning according to the actual user usage. We update our sixth step strategy model based on the behavior data, based on user behavior: According to the behavior paths and preferences of different users, the page resource loading order is personalized so that each user can get the best experience during the page loading process. Further, it can be based on device characteristics: According to the performance of the access device, select the appropriate page resource loading strategy in a targeted manner to maximize the page loading speed. For example, when using the browser interceptor to send network status information to the web client, including: the number of different types of page resource requests, the client can adjust the loading order of page resources corresponding to the different types of page resource requests. For example, suppose the interceptor obtains statistics of the current ten network data requests, eight of which are requests for page resources from the Sina server, and the other two are requests for page resources from the Taobao server. In other words, the current burden of the communication link with the Sina server is relatively heavy. Then, after obtaining this information, the web client can first load the page resources of the Taobao server, because the communication link with the Taobao server is less burdened at this time, and the loading speed will be faster. Secondly, when the client loads the web page, in order to achieve a smoother web page loading effect and give users a better user experience, the client can load the web page according to a certain web page resource loading strategy. For example, some clients load in a pre-set page resource loading order, or determine how to load according to the network type (such as 2G / 3G / Wifi) obtained. In 2G / 3G networks, page resources with smaller data volumes are loaded first. In Wifi networks, page resources with larger data volumes are loaded first.

[0182] The page resource loading method proposed in this application has the following advantages:

[0183] 1. Intelligent optimization, real-time performance data analysis: Based on Performance API data, real-time analysis of performance indicators during page loading, such as page resource loading time, dependencies, rendering priority, etc. Intelligent decision-making: Make intelligent decisions based on real-time performance data and dynamically adjust the order of page resource loading.

[0184] 2. Personalized customization capability, based on user behavior: customize the page resource loading order according to the behavior paths and preferences of different users. Based on device characteristics: select the appropriate page resource loading strategy according to the performance of the access device.

[0185] 3. Dynamic adjustment and optimization, iterative optimization: Continuously iterate and optimize the page resource loading sequence according to the characteristics of different pages and different environments. Real-time feedback optimization: By real-time monitoring of user feedback and behavior data, timely adjust and optimize the page resource loading sequence.

[0186] This intelligent page resource loading order optimization algorithm can more accurately optimize page loading performance, reduce user waiting time, and improve user experience. The specific technical effects include the following:

[0187] 1. Improve user experience: Through the intelligent page resource loading order method, the company can optimize the web page loading speed and ensure that the page content is quickly displayed to users, thereby improving user experience, reducing user waiting time, and increasing user retention rate.

[0188] 2. Improve website performance: By analyzing and modeling the dependencies of page resources, companies can more effectively manage the order in which page resources are loaded, reduce page loading time, reduce server load, and improve overall website performance.

[0189] 3. Save bandwidth and server costs: Optimizing the order of page resource loading can reduce unnecessary page resource requests and transmissions, reduce server pressure, and reduce bandwidth usage, thereby saving bandwidth and server costs.

[0190] 4. Increase page visits: Improving page loading speed and performance can attract more visitors, increase page visits and user activity.

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

[0192] In this embodiment, a device for loading page resources is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0193] Fig. 9 is a structural block diagram of a device for loading page resources according to an embodiment of the present application; Fig. 9 As shown, the page resource loading device is applied to the page access application, and the device includes:

[0194] A first acquisition module 902 is used to acquire a target access request initiated by a target account, wherein the target access request is used to request access to a target page;

[0195] A response module 904 is used to respond to the target access request and generate a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order;

[0196] The loading module 906 is used to load the page resources in the page resource set according to the target resource loading order.

[0197] In an exemplary embodiment, the response module includes:

[0198] A first determining unit, configured to determine a resource loading strategy corresponding to each of the page resources in the page resource set according to the resource attribute information and the user attribute information of each of the page resources in the page resource set;

[0199] A generating unit is used to generate a target resource loading sequence for the page resource set according to the resource loading strategy of each of the page resources in the page resource set.

[0200] In an exemplary embodiment, the first determining unit includes:

[0201] Determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources;

[0202] Generate the resource loading strategy that matches the resource type.

[0203] In an exemplary embodiment, the first determining unit is further configured to:

[0204] In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance, and / or the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is greater than the target possibility, the page resource is determined to be a core resource type;

[0205] When the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance, and the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is less than the target possibility, the page resource is determined to be a non-core resource type.

[0206] In an exemplary embodiment, the first determining unit is further configured to:

[0207] In the case where the page resource is of the core resource type, determining the resource loading strategy corresponding to the page resource as a preloading strategy, wherein the preloading strategy is used to indicate that the loading of the corresponding page resource is started before a first time period after responding to the target access request;

[0208] In the case where the page resource is the non-core resource type, the resource loading strategy corresponding to the page resource is determined as a lazy loading strategy, wherein the lazy loading strategy is used to start loading the corresponding page resource after a second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0209] In an exemplary embodiment, when the page resource set includes N page resources, where N is an integer greater than 1, the generating unit includes:

[0210] Generate a candidate resource loading sequence, wherein the candidate resource loading sequence records the loading sequence of N page resources in the page resource set;

[0211] When the resource loading strategy of the i-th page resource among the N page resources is a preloading strategy, and the resource loading strategy of the j-th page resource is a lazy loading strategy, the i-th page resource in the alternative resource loading order is adjusted to before the j-th page resource to obtain the target resource loading order, wherein i is not equal to j, i and j are both integers greater than or equal to 1 and less than or equal to N, the preloading strategy is used to indicate that the loading of the corresponding page resource is started before the first time period after responding to the target access request, and the lazy loading strategy is used to start the loading of the corresponding page resource after the second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

[0212] In an exemplary embodiment, the generating unit is further configured to:

[0213] Adjust the i-th page resource to be before the j-th page resource to obtain a reference resource loading order;

[0214] In the case where the ath page resource and the bth page resource among the N page resources are both preloaded according to the preload strategy, and the ath resource size of the ath page resource is smaller than the bth resource size of the bth page resource, the ath page resource in the reference resource loading sequence is adjusted to be before the bth page resource, to obtain a candidate resource loading sequence, wherein a is not equal to b, and a and b are both integers greater than or equal to 1 and less than or equal to N;

[0215] When the cth page resource and the dth page resource among the N page resources are both lazy loading strategies, and the cth resource size of the cth page resource is smaller than the dth resource size of the dth page resource, the cth page resource in the candidate resource loading order is adjusted to before the dth page resource to obtain the target resource loading order, wherein c is not equal to d, and c and d are both integers greater than or equal to 1 and less than or equal to N.

[0216] In an exemplary embodiment, the generating unit comprises:

[0217] Detecting resource dependency relationships between N of the page resources;

[0218] In the case where the resource dependency relationship is used to indicate that the loading of the e-th page resource among the N page resources depends on the completion of the loading of the f-th page resource, the loading order of the e-th page resource is adjusted to be before the f-th page resource, to obtain an initial resource loading order;

[0219] In the initial resource loading order, the resource dependency is used to indicate that when the loading of the gth page resource among the N page resources is not dependent on the completion of the loading of the hth page resource, the gth page resource and the hth page resource are determined to be loaded simultaneously to obtain the alternative resource loading order.

[0220] In an exemplary embodiment, the apparatus further comprises:

[0221] A second acquisition module is used to acquire resource dependency relationships between the page resources in the page resource set corresponding to the target page, and extract the resource attribute information of each page resource from the resource dependency relationships before generating the target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page;

[0222] The third acquisition module is used to obtain the target interaction information of the target account for the target page, and generate the user attribute information of each of the page resources according to the target interaction information, wherein the target interaction information is used to indicate the execution count of each of the multiple historical interaction operations performed by the target account on the target page.

[0223] In an exemplary embodiment, the second acquisition module includes:

[0224] A parsing unit, configured to parse the page resources referenced by each of the page resources in the page resource set through a resource parser to obtain a reference page resource corresponding to each of the page resources;

[0225] The second determining unit is used to determine whether the resource dependency relationship exists between each of the page resources and the corresponding reference page resource, wherein the resource dependency relationship is used to indicate that loading of the page resource depends on completion of loading of the corresponding reference page resource.

[0226] In an exemplary embodiment, the parsing unit comprises:

[0227] Identify the file type of each of the page resources by the resource parser;

[0228] The resource parser uses a parsing operation matching the file type to parse the page resources referenced by the corresponding page resources to obtain reference page resources corresponding to each of the page resources.

[0229] In an exemplary embodiment, the parsing unit is further configured to:

[0230] In the case where the file type of the page resource is a web page file type, the resource tag of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the web page file type indicates the referenced reference page resource through the resource tag;

[0231] In the case where the file type of the page resource is a style file type or an interactive file type, the reference function of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the style file type is used to set the layout and appearance style of the target page, and the page resource of the interactive file type is used to add interactive functions to the target page, and the page resource of the style file type or the interactive file type references the corresponding reference page resource through the reference function.

[0232] In an exemplary embodiment, the second acquisition module includes:

[0233] A construction unit, configured to construct a resource dependency graph for the page resource set according to the resource dependency;

[0234] An extraction unit is used to extract the resource attribute information of each of the page resources from the resource dependency graph.

[0235] In an exemplary embodiment, when the page resource set includes N page resources, where N is an integer greater than 1, the construction unit includes:

[0236] Inputting resource dependency relationships between the respective page resources in the page resource set into a graphical tool;

[0237] Receive the resource dependency graph output by the graphical tool, wherein the resource dependency graph includes N graphic nodes connected by directed arrows, wherein each of the N graphic nodes represents one of the page resources in the page resource set, and the two graphic nodes connected by the directed arrow are used to indicate that the resource dependency relationship exists between the corresponding two page resources, and the directed arrow includes a starting end and an arrow end, and the graphic node connected to the arrow end is used to represent the dependent page resource.

[0238] In an exemplary embodiment, the extraction unit comprises:

[0239] Extracting a target graphic node from the resource dependency graph, wherein the target graphic node is the graphic node in the resource dependency graph connected by the arrow ends of the directed arrows greater than a preset number, and / or the graphic node connected by the starting end of the directed arrow that does not exist;

[0240] Determining the resource attribute information of the page resource represented by the target graphic node to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance;

[0241] The resource attribute information of the page resource represented by the non-target graph node in the resource dependency graph is determined to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance.

[0242] In an exemplary embodiment, the third acquisition module includes:

[0243] A third determining unit is used to determine the user attribute information corresponding to the target page resource as indicating that the call probability of the target page resource being called is greater than the target probability when the target page is accessed by the target account, when the target interaction information is used to indicate that the number of executions of the target history interaction operation performed by the target account on the target page is greater than a preset number, wherein the target page resource is the page resource required to perform the target history interaction operation;

[0244] A fourth determination unit is used to determine the user attribute information corresponding to the target page resource as indicating that the possibility of calling the target page resource when the target page is accessed by the target account is less than or equal to the target possibility, when the target interaction information is used to indicate that the number of times the target account has performed the target historical interaction operation on the target page is less than or equal to the preset number of times.

[0245] In an exemplary embodiment, the apparatus further comprises:

[0246] A collection module, configured to collect a target loading time of the target page during access to the target page after the page resources in the page resource set are loaded in the target resource loading order to obtain the target page;

[0247] A determination module, configured to determine a loading speed parameter of the target page in the target resource loading sequence according to the target loading time, wherein the loading speed parameter is used to indicate a speed at which the target page is loaded;

[0248] An adjustment module is used to adjust the target resource loading sequence when the loading speed parameter indicates that the target page is loaded at a speed lower than a preset speed, obtain an updated target resource loading sequence, and use the updated target resource loading sequence to load the page resources in the page resource collection when the target page is accessed again.

[0249] In an exemplary embodiment, the acquisition module includes:

[0250] A collection unit, used for collecting the event loading start time and event loading completion time of the target event and the resource loading start time and resource loading completion time of each of the page resources in the page resource set during the access process of the target page, wherein the target event is the event on which the access operation of the target page depends;

[0251] A fifth determining unit is used to determine the event loading start time, the event loading completion time, the resource loading start time and the resource loading completion time as the target loading time.

[0252] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.

[0253] An embodiment of the present application also provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the method described in each embodiment of the present application; the computer program product also includes a non-volatile computer-readable storage medium, which stores the computer program, and when executed by a processor, implements the steps of the method described in each embodiment of the present application.

[0254] An embodiment of the present application further provides a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when run.

[0255] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk.

[0256] An embodiment of the present application further provides an electronic device, Fig.10 is a schematic diagram of an electronic device according to an embodiment of the present application, such as Fig.10 As shown, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.

[0257] In an exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.

[0258] For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary implementation modes, and this embodiment will not be described in detail herein.

[0259] Obviously, those skilled in the art should understand that the above modules or steps of the present application can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order from that herein, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.

[0260] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principles of the present application shall be included in the protection scope of the present application.

Claims

1. A method for loading page resources, characterized in that: Applied to a page access application, the method comprises: Obtaining a target access request initiated by a target account, wherein the target access request is used to request access to a target page; In response to the target access request, a target resource loading order is generated according to resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order; Load the page resources in the page resource set according to the target resource loading order; The step of generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page includes: Determine a resource loading strategy corresponding to each of the page resources according to the resource attribute information and the user attribute information of each of the page resources in the page resource set; Generating a target resource loading order for the page resource set according to the resource loading strategy of each of the page resources in the page resource set; Wherein, determining the resource loading strategy corresponding to each of the page resources according to the resource attribute information and the user attribute information of each of the page resources in the page resource set includes: Determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources; Generating the resource loading strategy matching the resource type; Wherein, determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources includes: In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance, and / or the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is greater than the target possibility, the page resource is determined to be a core resource type; In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance, and the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is less than the target possibility, determining that the page resource is a non-core resource type; Wherein, generating the resource loading strategy matching the resource type includes: In the case where the page resource is of the core resource type, determining the resource loading strategy corresponding to the page resource as a preloading strategy, wherein the preloading strategy is used to indicate that the loading of the corresponding page resource is started before a first time period after responding to the target access request; In the case where the page resource is the non-core resource type, determining the resource loading strategy corresponding to the page resource as a lazy loading strategy, wherein the lazy loading strategy is used to start loading the corresponding page resource after a second time period after responding to the target access request, and the second time period is greater than or equal to the first time period; Wherein, in the case where the page resource set includes N page resources, N is an integer greater than 1, generating a target resource loading sequence for the page resource set according to the resource loading strategy of each page resource in the page resource set includes: Generate a candidate resource loading sequence, wherein the candidate resource loading sequence records the loading sequence of N page resources in the page resource set; When the resource loading strategy of the i-th page resource among the N page resources is a preloading strategy, and the resource loading strategy of the j-th page resource is a lazy loading strategy, the i-th page resource in the alternative resource loading order is adjusted to before the j-th page resource to obtain the target resource loading order, wherein i is not equal to j, i and j are both integers greater than or equal to 1 and less than or equal to N, the preloading strategy is used to indicate that the loading of the corresponding page resource is started before the first time period after responding to the target access request, and the lazy loading strategy is used to start the loading of the corresponding page resource after the second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

2. The method according to claim 1, characterized in that The step of adjusting the i-th page resource in the candidate resource loading sequence to be before the j-th page resource to obtain the target resource loading sequence includes: Adjust the i-th page resource to be before the j-th page resource to obtain a reference resource loading order; In the case where the ath page resource and the bth page resource among the N page resources are both preloaded according to the preload strategy, and the ath resource size of the ath page resource is smaller than the bth resource size of the bth page resource, the ath page resource in the reference resource loading sequence is adjusted to be before the bth page resource, to obtain a candidate resource loading sequence, wherein a is not equal to b, and a and b are both integers greater than or equal to 1 and less than or equal to N; When the cth page resource and the dth page resource among the N page resources are both lazy loading strategies, and the cth resource size of the cth page resource is smaller than the dth resource size of the dth page resource, the cth page resource in the candidate resource loading order is adjusted to before the dth page resource to obtain the target resource loading order, wherein c is not equal to d, and c and d are both integers greater than or equal to 1 and less than or equal to N.

3. The method according to claim 1, characterized in that The generating of the candidate resource loading sequence comprises: Detecting resource dependency relationships between N of the page resources; In the case where the resource dependency relationship is used to indicate that the loading of the e-th page resource among the N page resources depends on the completion of the loading of the f-th page resource, the loading order of the e-th page resource is adjusted to be before the f-th page resource, to obtain an initial resource loading order; In the initial resource loading order, the resource dependency is used to indicate that when the loading of the gth page resource among the N page resources is not dependent on the completion of the loading of the hth page resource, the gth page resource and the hth page resource are determined to be loaded simultaneously to obtain the alternative resource loading order.

4. The method according to claim 1, characterized in that: Before generating the target resource loading sequence according to the resource attribute information and user attribute information of each of the page resources in the page resource set corresponding to the target page, the method further includes: Acquire the resource dependency relationship between each of the page resources in the page resource set, and extract the resource attribute information of each of the page resources from the resource dependency relationship; Obtain target interaction information of the target account for the target page, and generate the user attribute information of each of the page resources according to the target interaction information, wherein the target interaction information is used to indicate the number of executions of each of the multiple historical interaction operations performed by the target account on the target page.

5. The method according to claim 4, characterized in that The obtaining of resource dependency relationships between the page resources in the page resource set includes: Parsing the page resource referenced by each of the page resources in the page resource set by a resource parser to obtain a reference page resource corresponding to each of the page resources; It is determined that there exists the resource dependency relationship between each of the page resources and the corresponding reference page resource, wherein the resource dependency relationship is used to indicate that loading of the page resource depends on completion of loading of the corresponding reference page resource.

6. The method according to claim 5, characterized in that The page resource referenced by each of the page resources in the page resource set is parsed by a resource parser to obtain a reference page resource corresponding to each of the page resources, including: Identify the file type of each of the page resources by the resource parser; The resource parser uses a parsing operation matching the file type to parse the page resources referenced by the corresponding page resources to obtain reference page resources corresponding to each of the page resources.

7. The method according to claim 6, characterized in that The resource parser uses a parsing operation matching the file type to parse the page resource referenced by the corresponding page resource to obtain a reference page resource corresponding to each page resource, including: In the case where the file type of the page resource is a web page file type, the resource tag of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the web page file type indicates the referenced reference page resource through the resource tag; In the case where the file type of the page resource is a style file type or an interactive file type, the reference function of the page resource is parsed by the resource parser to obtain the reference page resource corresponding to the page resource, wherein the page resource of the style file type is used to set the layout and appearance style of the target page, and the page resource of the interactive file type is used to add interactive functions to the target page, and the page resource of the style file type or the interactive file type references the corresponding reference page resource through the reference function.

8. The method according to claim 4, characterized in that The step of extracting the resource attribute information of each of the page resources from the resource dependency relationship includes: Constructing a resource dependency graph for the page resource set according to the resource dependency; The resource attribute information of each of the page resources is extracted from the resource dependency graph.

9. The method according to claim 8, characterized in that In the case where the page resource set includes N page resources, where N is an integer greater than 1, constructing a resource dependency graph for the page resource set according to the resource dependency includes: Inputting resource dependency relationships between the respective page resources in the page resource set into a graphical tool; Receive the resource dependency graph output by the graphical tool, wherein the resource dependency graph includes N graphic nodes connected by directed arrows, wherein each of the N graphic nodes represents one of the page resources in the page resource set, and the two graphic nodes connected by the directed arrow are used to indicate that the resource dependency relationship exists between the corresponding two page resources, and the directed arrow includes a starting end and an arrow end, and the graphic node connected to the arrow end is used to represent the dependent page resource.

10. The method according to claim 9, characterized in that The step of extracting the resource attribute information of each of the page resources from the resource dependency graph includes: Extracting a target graphic node from the resource dependency graph, wherein the target graphic node is the graphic node in the resource dependency graph connected by the arrow ends of the directed arrows greater than a preset number, and / or the graphic node connected by the starting end of the directed arrow that does not exist; Determining the resource attribute information of the page resource represented by the target graphic node to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance; The resource attribute information of the page resource represented by the non-target graph node in the resource dependency graph is determined to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance.

11. The method according to claim 4, characterized in that The generating the user attribute information of each of the page resources according to the target interaction information includes: In a case where the target interaction information is used to indicate that the target account has executed a target history interaction operation on the target page for a number of times greater than a preset number, the user attribute information corresponding to the target page resource is determined to be used to indicate that the call probability of the target page resource being called when the target page is accessed by the target account is greater than the target probability, wherein the target page resource is the page resource required to execute the target history interaction operation; When the target interaction information is used to indicate that the number of times the target account has performed a target historical interaction operation on the target page is less than or equal to the preset number of times, the user attribute information corresponding to the target page resource is determined to indicate that the possibility of calling the target page resource when the target page is accessed by the target account is less than or equal to the target possibility.

12. The method according to claim 1, characterized in that After the page resources in the page resource set are loaded according to the target resource loading sequence to obtain the target page, the method further includes: During the access process of the target page, collecting the target loading time of the target page; Determine a loading speed parameter of the target page in the target resource loading sequence according to the target loading time, wherein the loading speed parameter is used to indicate the speed at which the target page is loaded; When the loading speed parameter is used to indicate that the target page is loaded at a speed lower than a preset speed, the target resource loading order is adjusted to obtain an updated target resource loading order, and when the target page is accessed again, the page resources in the page resource collection are loaded using the updated target resource loading order.

13. The method according to claim 12, characterized in that The collecting the target loading time of the target page includes: During the access process of the target page, the event loading start time and event loading completion time of the target event and the resource loading start time and resource loading completion time of each of the page resources in the page resource set are collected, wherein the target event is the event that the access operation of the target page depends on; The event loading start time, the event loading completion time, the resource loading start time and the resource loading completion time are determined as the target loading time.

14. A device for loading page resources, characterized in that: Applied to page access application, the device comprises: A first acquisition module is used to acquire a target access request initiated by a target account, wherein the target access request is used to request access to a target page; A response module, used to respond to the target access request, and generate a target resource loading order according to the resource attribute information and user attribute information of each page resource in the page resource set corresponding to the target page, wherein the resource attribute information is used to indicate the importance of the corresponding page resource for implementing the access operation of the target page, and the user attribute information is used to indicate the possibility of the corresponding page resource being called when the target page is accessed by the target account, and the loading order of the page resource with a greater importance is higher in the target resource loading order, and the loading order of the page resource with a greater calling possibility is higher in the target resource loading order; A loading module, used to load the page resources in the page resource set according to the target resource loading order; Wherein, the response module includes: A first determining unit, configured to determine a resource loading strategy corresponding to each of the page resources in the page resource set according to the resource attribute information and the user attribute information of each of the page resources in the page resource set; A generating unit, configured to generate a target resource loading sequence for the page resource set according to the resource loading strategy of each of the page resources in the page resource set; Wherein, the first determining unit includes: Determining the resource type of each of the page resources according to the resource attribute information and the user attribute information of each of the page resources; Generating the resource loading strategy matching the resource type; Wherein, the first determining unit is further used for: In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is greater than the target importance, and / or the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is greater than the target possibility, the page resource is determined to be a core resource type; In the case where the resource attribute information is used to indicate that the importance of the corresponding page resource for implementing the access operation of the target page is less than or equal to the target importance, and the user attribute information is used to indicate that the possibility of calling the corresponding page resource when the target page is accessed by the target account is less than the target possibility, determining that the page resource is a non-core resource type; Wherein, the first determining unit is further used for: In the case where the page resource is of the core resource type, determining the resource loading strategy corresponding to the page resource as a preloading strategy, wherein the preloading strategy is used to indicate that the loading of the corresponding page resource is started before a first time period after responding to the target access request; In the case where the page resource is the non-core resource type, determining the resource loading strategy corresponding to the page resource as a lazy loading strategy, wherein the lazy loading strategy is used to start loading the corresponding page resource after a second time period after responding to the target access request, and the second time period is greater than or equal to the first time period; Wherein, in the case where the page resource set includes N page resources, N is an integer greater than 1, the generating unit includes: Generate a candidate resource loading sequence, wherein the candidate resource loading sequence records the loading sequence of N page resources in the page resource set; When the resource loading strategy of the i-th page resource among the N page resources is a preloading strategy, and the resource loading strategy of the j-th page resource is a lazy loading strategy, the i-th page resource in the alternative resource loading order is adjusted to before the j-th page resource to obtain the target resource loading order, wherein i is not equal to j, i and j are both integers greater than or equal to 1 and less than or equal to N, the preloading strategy is used to indicate that the loading of the corresponding page resource is started before the first time period after responding to the target access request, and the lazy loading strategy is used to start the loading of the corresponding page resource after the second time period after responding to the target access request, and the second time period is greater than or equal to the first time period.

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method described in any one of claims 1 to 13 are implemented.

16. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program implements the steps of the method described in any one of claims 1 to 13 when executed by a processor.

17. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method described in any one of claims 1 to 13 are implemented.