Method and device for dynamically loading website resources and medium
By dynamically adjusting the resource loading order, prioritizing the loading of important resources based on network conditions and priorities, the problem of low website loading efficiency caused by changes in network conditions in traditional loading methods is solved, thus improving the user experience.
Patent Information
- Application Number
- CN202511145998.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-11-14
AI Technical Summary
Traditional front-end resource loading methods cannot dynamically adjust the resource loading order according to network conditions, resulting in low website loading efficiency and affecting user experience.
By acquiring network information from devices in real time, the resource loading order is dynamically adjusted based on network conditions and resource priorities, prioritizing the loading of high-priority resources or delaying the loading of low-priority resources.
It effectively improves webpage loading speed and enhances user experience.
Smart Images

Figure CN120956802A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of website resource loading technology, and more specifically, to a method, apparatus, and medium for dynamically loading website resources. Background Technology
[0002] Traditional front-end resource loading methods typically follow the order of the HTML document, but this doesn't always ensure that important resources are loaded first. Furthermore, changes in network conditions can affect resource loading efficiency, and traditional loading methods cannot adapt to these changes. This results in technical problems such as low website loading efficiency. Summary of the Invention
[0003] To address the shortcomings of existing technologies, this invention provides a method, apparatus, and medium for dynamically loading website resources.
[0004] According to one aspect of the present invention, a method for dynamically loading website resources is provided, comprising: The network information of the device is obtained in real time through a pre-built network status detection interface; Based on the network information and preset network status standards, determine the current network status; Website resources are loaded based on the network conditions and preset website resource priorities.
[0005] Optionally, the network information includes download speed, upload speed, and whether it is cellular data.
[0006] Optionally, the current network status is determined based on the network information and preset network status standards, including: If the network information is lower than the network condition standard, the current network condition is determined to be poor; otherwise, it is determined to be excellent.
[0007] Optionally, it also includes: dynamically adjusting the loading order of website resources based on the current network conditions.
[0008] According to another aspect of the present invention, an apparatus for dynamically loading website resources is provided, comprising: The acquisition module is used to acquire network information of the device in real time through a pre-built network condition detection interface; The judgment module is used to determine the current network status based on the network information and preset network status standards; The loading module is used to load website resources based on the network conditions and preset website resource priorities.
[0009] According to another aspect of the present invention, a computer-readable storage medium is provided, the storage medium storing a computer program for performing the methods described in any of the above aspects of the present invention.
[0010] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the instructions to implement the method described in any of the preceding aspects of the present invention.
[0011] Therefore, by dynamically adjusting the resource loading order, this invention can effectively improve webpage loading speed, thereby enhancing the user experience. Attached Figure Description
[0012] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1 This is a flowchart illustrating a method for dynamically loading website resources provided in an exemplary embodiment of the present invention; Figure 2 This is a schematic diagram of the structure of an apparatus for dynamically loading website resources provided in an exemplary embodiment of the present invention; Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. Detailed Implementation
[0013] Hereinafter, exemplary embodiments according to the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are merely some embodiments of the present invention, and not all embodiments of the present invention. It should be understood that the present invention is not limited to the exemplary embodiments described herein.
[0014] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values of the components and steps described in these embodiments do not limit the scope of the invention.
[0015] Those skilled in the art will understand that the terms "first," "second," etc., in the embodiments of the present invention are only used to distinguish different steps, devices, or modules, and do not represent any specific technical meaning, nor do they indicate a necessary logical order between them.
[0016] It should also be understood that in the embodiments of the present invention, "multiple" can refer to two or more, and "at least one" can refer to one, two or more.
[0017] It should also be understood that any component, data or structure mentioned in the embodiments of the present invention can generally be understood as one or more unless explicitly defined or given contrary instructions in the context.
[0018] Furthermore, the term "and / or" in this invention is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this invention generally indicates that the preceding and following related objects have an "or" relationship.
[0019] It should also be understood that the description of the various embodiments in this invention emphasizes the differences between the various embodiments, and the similarities or similarities can be referred to each other. For the sake of brevity, they will not be described in detail.
[0020] At the same time, it should be understood that, for ease of description, the dimensions of the various parts shown in the accompanying drawings are not drawn according to actual scale.
[0021] The following description of at least one exemplary embodiment is merely illustrative and is in no way intended to limit the invention or its application or use.
[0022] Techniques, methods, and equipment known to those skilled in the art may not be discussed in detail, but where appropriate, they should be considered part of the specification.
[0023] It should be noted that similar labels and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be discussed further in subsequent figures.
[0024] The embodiments of this invention can be applied to electronic devices such as terminal devices, computer systems, and servers, and can operate together with a wide range of other general-purpose or special-purpose computing system environments or configurations. Well-known examples of terminal devices, computing systems, environments, and / or configurations suitable for use with electronic devices such as terminal devices, computer systems, and servers include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, handheld or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputer systems, mainframe computer systems, and distributed cloud computing environments including any of the above systems, etc.
[0025] Electronic devices such as terminal devices, computer systems, and servers can be described in the general context of computer system executable instructions (such as program modules) executed by a computer system. Typically, program modules can include routines, programs, object programs, components, logic, data structures, etc., which perform specific tasks or implement specific abstract data types. Computer systems / servers can be implemented in distributed cloud computing environments, where tasks are executed by remote processing devices linked through communication networks. In distributed cloud computing environments, program modules can reside on local or remote computing system storage media, including storage devices.
[0026] Exemplary methods Figure 1 This is a flowchart illustrating a method for dynamically loading website resources according to an exemplary embodiment of the present invention. This embodiment can be applied to electronic devices, such as... Figure 1 As shown, the method 100 for dynamically loading website resources includes the following steps: Step 101: Obtain the device's network information in real time through a pre-built network status detection interface; Step 102: Determine the current network status based on the network information and preset network status standards; Step 103: Load website resources according to the network conditions and preset website resource priorities.
[0027] Specifically, this invention dynamically adjusts the loading order of resources by dynamically detecting network conditions and the priority of resources on the page. The specific implementation steps are as follows: 1. Network status detection and resource loading optimization.
[0028] 2. Use the Navigator.connection API to obtain the device's network information, such as download speed, upload speed, and whether it is using cellular data. Then, compare this network information with preset network condition standards to determine the current network status.
[0029] 3. We assign a priority to each resource on the page, with higher-priority resources loaded first. Then, we dynamically adjust the loading order of resources based on network conditions. When network conditions are good, we load resources in descending order of priority. When network conditions are poor, we prioritize loading higher-priority resources while delaying the loading of lower-priority resources.
[0030] Therefore, by dynamically adjusting the resource loading order, this invention can effectively improve webpage loading speed, thereby enhancing the user experience.
[0031] Exemplary device Figure 2This is a schematic diagram of the structure of an apparatus for dynamically loading website resources provided in an exemplary embodiment of the present invention. Figure 2 As shown, the device 200 includes: The acquisition module 210 is used to acquire network information of the device in real time through a pre-built network condition detection interface; The judgment module 220 is used to judge the current network status based on the network information and the preset network status standard; The loading module 230 is used to load website resources according to the network conditions and the preset website resource priority.
[0032] Optionally, network information includes download speed, upload speed, and whether it is cellular data.
[0033] Optionally, the determination module 220 includes: The determination submodule is used to determine the current network condition as poor if the network information is lower than the network condition standard, and otherwise determine it as good.
[0034] Optionally, the device 200 further includes an adjustment module for dynamically adjusting the loading order of website resources according to the current network conditions.
[0035] Exemplary electronic devices Figure 3 This is the structure of an electronic device provided in an exemplary embodiment of the present invention. For example... Figure 3 As shown, the electronic device 30 includes one or more processors 31 and memory 32.
[0036] The processor 31 may be a central processing unit (CPU) or other form of processing unit with data processing and / or instruction execution capabilities, and may control other components in the electronic device to perform desired functions.
[0037] The memory 32 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 31 may execute the program instructions to implement the methods of the software programs of the various embodiments of the present invention described above, and / or other desired functions. In one example, the electronic device may also include an input device 33 and an output device 34, these components being interconnected via a bus system and / or other forms of connection mechanisms (not shown).
[0038] In addition, the input device 33 may also include, for example, a keyboard, a mouse, etc.
[0039] The output device 34 can output various information to the outside. The output device 34 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0040] Of course, for the sake of simplicity, Figure 3 Only some of the components of the electronic device relevant to the present invention are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device may include any other suitable components depending on the specific application.
[0041] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of the present invention may also be computer program products, which include computer program instructions that, when executed by a processor, cause the processor to perform the steps in the methods according to various embodiments of the present invention described in the "Exemplary Methods" section above.
[0042] The computer program product can be written in any combination of one or more programming languages to perform the operations of the embodiments of the present invention. The programming languages include object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C or similar languages. The program code can be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0043] Furthermore, embodiments of the present invention may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the methods for information mining of historical change records according to various embodiments of the present invention as described in the "Exemplary Methods" section above.
[0044] The computer-readable storage medium may be any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, system, or device, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0045] The basic principles of the present invention have been described above with reference to specific embodiments. However, it should be noted that the advantages, benefits, and effects mentioned in the present invention are merely examples and not limitations, and should not be considered as essential features of each embodiment of the present invention. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the present invention to the necessity of employing the aforementioned specific details.
[0046] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For system embodiments, since they largely correspond to method embodiments, the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0047] The block diagrams of devices, systems, devices, and systems involved in this invention are merely illustrative examples and are not intended to require or imply that they must be connected, arranged, or configured in the manner shown in the block diagrams. As those skilled in the art will recognize, these devices, systems, devices, and systems can be connected, arranged, and configured in any manner. Words such as “comprising,” “including,” “having,” etc., are open-ended terms meaning “including but not limited to,” and are used interchangeably with them. The terms “or” and “and” as used herein refer to the terms “and / or,” and are used interchangeably with them unless the context clearly indicates otherwise. The term “such as” as used herein refers to the phrase “such as but not limited to,” and is used interchangeably with it.
[0048] The methods and systems of the present invention may be implemented in many ways. For example, they may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order of steps for the methods is for illustrative purposes only, and the steps of the methods of the present invention are not limited to the order specifically described above unless otherwise specifically stated. Furthermore, in some embodiments, the present invention may also be implemented as a program recorded on a recording medium, the program comprising machine-readable instructions for implementing the methods according to the present invention. Thus, the present invention also covers recording media storing programs for performing the methods according to the present invention.
[0049] It should also be noted that in the systems, apparatus, and methods of the present invention, the components or steps can be disassembled and / or recombined. These disassemblies and / or recombinations should be considered equivalents of the present invention. The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the invention. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein can be applied to other aspects without departing from the scope of the invention. Therefore, the invention is not intended to be limited to the aspects shown herein, but rather to be carried out within the widest scope consistent with the principles and novel features disclosed herein.
[0050] The above description has been given for purposes of illustration and description. Furthermore, this description is not intended to limit the embodiments of the invention to the forms disclosed herein. Although numerous exemplary aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, alterations, additions, and sub-combinations therein.
Claims
1. A method for dynamically loading website resources, characterized in that, include: The network information of the device is obtained in real time through a pre-built network status detection interface; Based on the network information and preset network status standards, determine the current network status; Website resources are loaded based on the network conditions and preset website resource priorities.
2. The method according to claim 1, characterized in that, The network information includes download speed, upload speed, and whether it is cellular data.
3. The method according to claim 1, characterized in that, Based on the network information and preset network status standards, determine the current network status, including: If the network information is lower than the network condition standard, the current network condition is determined to be poor; otherwise, it is determined to be excellent.
4. The method according to claim 1, characterized in that, Also includes: The loading order of website resources is dynamically adjusted based on the current network conditions.
5. A device for dynamically loading website resources, characterized in that, include: The acquisition module is used to acquire network information of the device in real time through a pre-built network condition detection interface; The judgment module is used to determine the current network status based on the network information and preset network status standards; The loading module is used to load website resources based on the network conditions and preset website resource priorities.
6. The apparatus according to claim 5, characterized in that, The network information includes download speed, upload speed, and whether it is cellular data.
7. The apparatus according to claim 1, characterized in that, The judgment module includes: The determination submodule is used to determine the current network condition as poor if the network information is lower than the network condition standard, and otherwise determine it as good.
8. The apparatus according to claim 5, characterized in that, Also includes: The adjustment module is used to dynamically adjust the loading order of website resources based on the current network conditions.
9. A computer-readable storage medium, characterized in that, The storage medium stores a computer program for performing the method described in any one of claims 1-4.
10. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the instructions to implement the method described in any one of claims 1-4.
Citation Information
Patent Citations
Page loading method and device, electronic device and computer readable storage medium
CN110096663A
Method and computer system for managing resource loading process
CN116501408A
Self-adaptive page loading method and device, equipment and storage medium
CN117235393A