A method and device for improving first screen performance
By preloading LAN shared resources in the client idle state, the problem of long first screen time in the existing technology is solved, and the performance of the first screen and the improvement of user experience is achieved.
Patent Information
- Application Number
- CN202210743114.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-28
- Publication Date
- 2025-06-06
- Estimated Expiration
- 2042-06-28
AI Technical Summary
When the existing technology improves the performance of the first screen, the first screen has a long time, resulting in poor user experience. It takes time for users to actively trigger the cache of static resources, which limits the improvement of the first screen performance.
When the client is idle, it actively acquires shared resources of the LAN, preloads, forms a loading resource collection, and directly renders the page when it is loaded without obtaining resources.
It has achieved the problem of shortening the time of the first screen, improving the performance of the first screen, improving user experience, saving time to acquire resources, and reducing the problem of long-term first screen time caused by user triggering.
Smart Images

Figure CN115016863B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for improving first screen performance. Background Art
[0002] As users' requirements for the experience of Internet products are increasing, the requirements for the experience of page loading on client devices related to Internet products are also getting higher and higher. For example, browser page loading. Improving the performance of the first screen to achieve a better user experience has become a focus of attention.
[0003] Existing technologies often use user-initiated triggering to improve first-screen performance, that is, after a user accesses a resource, static resources are cached to the client before rendering the page resources. Since it takes a certain amount of time to cache static resources to the client, the first-screen duration is long, which in turn limits the improvement of first-screen performance.
[0004] Therefore, how to shorten the first screen time becomes a technical problem that needs to be solved urgently by technicians in this field. Summary of the invention
[0005] In view of this, an embodiment of the present application provides a method and device for improving first screen performance, aiming to shorten the first screen duration and thereby improve the first screen performance.
[0006] In a first aspect, an embodiment of the present application provides a method for improving first screen performance, which is applied to a client, and the client belongs to a first local area network. The method includes:
[0007] Acquire a first shared resource set based on a preset algorithm; the first shared resource set includes a plurality of shared resources within the first local area network; the preset algorithm is used to discover a plurality of resources including a local area tag of the first local area network;
[0008] Determine a loading resource set according to the first shared resource set; the loading resource set is a resource set that is not buffered in a shared resource warehouse; the shared resource warehouse is a database in the first local area network for storing the shared resources;
[0009] In response to the client being in an idle state, loading the loading resource set.
[0010] Optionally, the first shared resource set includes a first shared resource; and determining the loading resource set according to the first shared resource set includes:
[0011] In response to the first shared resource not belonging to the shared resource warehouse, a first loaded resource is acquired; the loaded resource set includes the first loaded resource.
[0012] Optionally, before loading the resource set, the method further includes:
[0013] Obtaining the memory usage of the client;
[0014] In response to the memory usage being lower than a preset threshold, it is determined that the client is in the idle state.
[0015] Optionally, the method further includes:
[0016] Acquire a second shared resource set of the second local area network; the second shared resource set is the multiple resources within the second local area network;
[0017] The loading resource set is determined according to the second shared resource set.
[0018] Optionally, the second shared resource includes a second shared resource; and determining the loading resource set according to the second shared resource set includes:
[0019] In response to the second shared resource not belonging to the shared resource warehouse, obtaining a second loaded resource is performed; the loaded resource set includes the second loaded resource.
[0020] In a first aspect, an embodiment of the present application provides a device for improving first screen performance, which is applied to a client, the client belongs to a first local area network, and the device includes:
[0021] An acquisition unit, configured to acquire a first shared resource set based on a preset algorithm; the first shared resource set includes a plurality of shared resources within the first local area network; the preset algorithm is used to discover a plurality of resources including a local tag of the first local area network;
[0022] A loading resource determination unit, configured to determine a loading resource set according to the first shared resource set; the loading resource set is a resource set that is not buffered in a shared resource warehouse; the shared resource warehouse is a database in the first local area network for storing the shared resources;
[0023] The loading unit is used to load the loading resource set in response to the client being in an idle state.
[0024] Optionally, the first shared resource set includes a first shared resource, and the loading determination unit includes:
[0025] The response module is used to obtain a first loading resource in response to the first shared resource not belonging to the shared resource warehouse; the loading resource set includes the first loading resource.
[0026] Optionally, the device further comprises:
[0027] The idle state determining unit is used to determine that the client is in the idle state in response to the memory usage being lower than a preset threshold.
[0028] Optionally, the acquisition unit is further used to acquire a second shared resource set of a second local area network; the second shared resource set is the multiple resources within the second local area network.
[0029] In a third aspect, an embodiment of the present application provides a computer storage medium, in which code is stored. When the code is executed, a device executing the code implements any method described in the first aspect.
[0030] The present application provides a method and device for improving the first screen performance. When executing the method: first discover and obtain a first shared resource set based on a preset algorithm. The first shared resource set includes multiple shared resources within the first local area network. Then determine the loading resource set based on the first shared resource set. Finally, when the client is in an idle state, cache the loaded resource set to the current client. Therefore, the present application actively obtains resources from the local area network and preloads when the client is in an idle state, so that the page can be directly rendered when the page is loaded without obtaining resources. Therefore, the present application can save the time for obtaining resources and reduce the problem of long first screen time caused by user triggering in the prior art, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0031] In order to more clearly illustrate the technical solutions in this embodiment or the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0032] Figure 1 A flow chart of a method for improving first screen performance provided in an embodiment of the present application;
[0033] Figure 2 A flow chart of a method for determining a loading resource set provided in an embodiment of the present application;
[0034] Figure 3 A schematic diagram of a single pod node structure provided in an embodiment of the present application;
[0035] Figure 4 A flow chart of another method for improving first screen performance provided in an embodiment of the present application;
[0036] Figure 5 A schematic diagram of a local area network expansion model provided in an embodiment of the present application;
[0037] Figure 6 A schematic diagram of the structure of a device for improving the first screen performance provided in an embodiment of the present application;
[0038] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0039] The first screen refers to the client's homepage, such as the website that is accessed when the browser is opened. Taking Sohu as an example, the first screen of a search website refers to the main index page of a website, which is a guide that allows visitors to understand the overview of the website and guide them to access key content. As mentioned above, the existing technology uses user-initiated triggering to improve the first screen performance, that is, after the user accesses a certain resource, the static resources are cached to the client, and then the page resources are rendered. Since it takes a certain amount of time to cache static resources to the client, it will result in a longer first screen duration, which in turn limits the improvement of the first screen performance.
[0040] The inventors found through analysis that when the client is working, multiple processes are involved, which are mainly used to undertake the main scheduling work, including GPU processes, extension processes and usage processes that are used to specifically handle GPU tasks. When the client is working, not all processes are working, so there will be a lot of idle time. And through the analysis of page loading, it was found that resource loading time and idle time account for more than 90% of the page rendering time. Therefore, preloading resources can greatly shorten the first screen time, thereby improving the first screen performance.
[0041] In addition, the inventors have also found that when a page is loaded, it is necessary to obtain the necessary page resources before rendering. Increasing the page resource cache can save the time of obtaining the necessary page resources and directly render. Therefore, it is helpful to shorten the first screen time.
[0042] Based on this, the inventor proposed that when a user accesses a client, the client actively obtains page resources and preloads resources to the client during idle time to preload resources. That is, preloading is performed by making full use of idle time. In this way, when loading a page, the time for obtaining resources is saved, thereby shortening the first screen time and improving the user experience.
[0043] Figure 1 A flow chart of a method for improving first screen performance provided in an embodiment of the present application is applied to a client, the client belongs to a first local area network, and the method includes at least the following steps:
[0044] S101: Acquire a first shared resource set based on a preset algorithm.
[0045] In the process of improving the performance of the first screen, the client first obtains the first shared resource set within the first local area network through a preset algorithm. In an embodiment of the present application, the first shared resource set includes multiple shared resources within the first local area network. And these multiple shared resources can be predicted within the same local area network. In an embodiment of the present application, the first local area network range can be a computer communication network formed by multiple computers connected by routers or switches. And the first local area network can be connected to other local area networks through a data communication network or a dedicated data circuit to form a larger local area network.
[0046] In an embodiment of the present application, the client obtains the first shared resource set based on a preset algorithm. The function of the preset algorithm is to discover multiple resources including the local area tag of the first local area network. In an embodiment of the present application, a polling scheduling algorithm can be selected to discover the first shared resource set. The polling scheduling algorithm is to allocate the request from the user to the internal server in turn each time. That is, the allocation starts from the first server until the last server ends the allocation. Then, the allocation starts from the first server again.
[0047] As an exemplary explanation, the first shared resource set can be discovered and obtained in the following manner: set an interval length, assuming 1ms. Then send a query request every 1ms, and each query request can query whether there is a shared resource hash value set with the first LAN local area tag in the current LAN. Then store the discovered shared resource hash value set in the service layer to generate a shared resource set.
[0048] The use of a polling scheduling algorithm can continuously obtain new shared resources, making the acquired shared resource set more comprehensive and accurate.
[0049] In the embodiment of the present application, the polling scheduling algorithm can be implemented by integrating a plug-in in the client.
[0050] S102: Determine a loading resource set according to the first shared resource set.
[0051] After obtaining the first shared resource set through a preset algorithm, the client can then perform an operation to determine the loaded resource set. The loaded resource set includes multiple resources that need to be preloaded within the current first local area network. In an embodiment of the present application, the loaded resource set is a set of unbuffered resources in a shared resource warehouse. The shared resource warehouse is a database in the first local area network for storing the shared resources. The client can determine the unbuffered resource set in the first shared resource set in a variety of ways.
[0052] In an embodiment of the present application, the client can compare the first shared resource set with the resources in the shared resource warehouse to filter out the unbuffered resource set. Specifically, the first shared resource set includes the first shared resource. The client can determine whether the first shared resource exists in the shared resource warehouse. If not, the client can determine that the first shared resource belongs to an unbuffered resource and store it in the service layer. Correspondingly, if the first shared resource set includes other shared resources, it can also be determined whether it belongs to an unbuffered resource through the above-mentioned comparison method.
[0053] In an embodiment of the present application, it can be specifically implemented in the following manner: the acquired first shared resource set is synchronized to the service layer, the service layer compares the first shared resource set with the shared resource warehouse, filters out the unbuffered resource set, and generates a loaded resource set.
[0054] S103: In response to the client being in an idle state, loading the loading resource set.
[0055] The client loads the resource set in the idle state according to the determined loading resource set. The idle state means that multiple processes are not working. In other words, the idle state means that the client is in the idle time. Since the idle state means that multiple processes are not working, the memory usage of the client is small.
[0056] In an embodiment of the present application, whether the client is in an idle state can be determined by the memory usage of the current client. That is, the memory usage of the client is obtained. Then, it is determined whether the memory usage is lower than a preset threshold. If so, it indicates that the client is in an idle state. The judgment result is fed back to the client, and the loading operation of the resource collection can be performed. In an embodiment of the present application, the idle state judgment can be implemented by a plug-in integrated in the client. Thus, the obtained uncached resources are preloaded in idle time. When loading a page, if the resource is a cached resource, it is not necessary to obtain the resource and can be rendered directly. Therefore, the first screen time can be shortened and the first screen performance can be improved.
[0057] In an embodiment of the present application, the above method can also be applied to a second local area network different from the first local area network. That is, the client can obtain the second shared resource set of the second local area network by polling scheduling. The second shared resource set is the multiple resources within the scope of the second local area network; according to the second shared resource set, the loading resource set is determined.
[0058] In an embodiment of the present application, the client can determine in the following manner: when the second shared resource includes the second shared resource; determine whether the second shared resource does not belong to the shared resource warehouse of the first local area network. If so, execute to obtain the second loading resource and determine the loading resource set. The loading resource set includes the second loading resource.
[0059] An embodiment of the present application provides a method for improving first screen performance: first, based on a preset algorithm, discover and obtain a first shared resource set. The first shared resource set includes multiple shared resources within the first local area network. Then, a loading resource set is determined based on the first shared resource set. Finally, when the client is in an idle state, the loaded resource set is cached to the current client. Therefore, the present application actively obtains resources from the local area network and preloads when the client is in an idle state, thereby achieving direct page rendering when the page is loaded without the need to obtain resources. Therefore, the present application can save time in obtaining resources, reduce the problem of long first screen time caused by user triggering in the prior art, improve first screen performance, and thus improve user experience.
[0060] In the embodiment of the present application, the above Figure 1 There are multiple possible implementations of step S102, which are described below. It should be noted that the implementations described below are only exemplary and do not represent all implementations of the embodiments of the present application.
[0061] Figure 2 , is a flow chart of a method for determining a loading resource set provided in an embodiment of the present application. The method comprises at least the following steps:
[0062] S201: Acquire a shared resource set in local area network A.
[0063] The client determines LAN A based on the Pod node. The Pod node includes multiple computers, routers, shared plug-ins, service layers, and shared resource libraries. For example, a Pod node is composed of 1 router, 3 computers, a shared plug-in, a service layer buffer, and a shared resource library. Figure 3 As shown, a schematic diagram of a single pod node structure provided in an embodiment of the present application is shown.
[0064] In the embodiment of the present application, the shared resource set in A may be acquired through a polling scheduling algorithm. The above step S101 has been introduced and will not be described again here.
[0065] S202: Synchronize the shared resource set to the service layer.
[0066] The shared resource set and the addresses corresponding to the resources in the shared resource set are synchronized to the service layer for storage. The service layer can store and process the shared resource set and the addresses corresponding to the resources in the shared resource set.
[0067] S203: The service layer compares the shared resource collection and the shared resource warehouse, and selects the unbuffered resource collection as the loading resource collection.
[0068] In the embodiment of the present application, the service layer also has the function of sensing the change of shared warehouse resources and receiving plug-in data. In addition, it also has the function of comparing the shared resource collection with the shared resource warehouse and filtering out the resources that are not buffered by the current client.
[0069] The above describes the method for determining a set of loading resources provided in an embodiment of the present application. The following is an exemplary description of the method for determining a set of loading resources in combination with a specific application scenario.
[0070] Figure 4 A flowchart of another method for improving the first screen performance provided in an embodiment of the present application. The method at least includes:
[0071] S401: The browser obtains a first shared resource set AJ of a first local area network A.
[0072] S402: Determine a set of unbuffered resources in the first local area network A according to AJ.
[0073] Step S401 and step S402 are Figure 2 This will not be discussed in detail here.
[0074] S403: Acquire the second local area network B.
[0075] The second LAN is determined in the same manner as the first LAN A. That is, it is determined by the pod node, which also includes multiple computers, routers, shared plug-ins, service layer buffers, and shared resource libraries.
[0076] S404: Determine whether the number of hops between the Pod node of the first local area network and the Pod node of the second local area network is lower than a preset threshold, if so, proceed to step S405. Otherwise, proceed to step S407.
[0077] In an embodiment of the present application, a threshold value can be preset in advance. And resources within the LAN formed by all nodes within the threshold range can be shared. The preset threshold is a preset number of hops, which is equivalent to a resource threshold. When the number of hops between the pod node in the first LAN range and the pod node in the second LAN range is less than the preset threshold, all resources within the two LAN ranges can be shared. In this way, resource sharing within a controllable range can be achieved. When the number of hops between the two nodes is greater than the preset threshold, the client will reduce the frequency of resource loading. In this way, unnecessary performance loss caused by loading irrelevant resources can be achieved.
[0078] It should be noted that the second LAN in this embodiment is just a reference name, and all LANs within the preset threshold range can achieve resource sharing, which is equivalent to expanding outward with the pod node of the first LAN as the core to form a LAN composed of a larger pod node.
[0079] like Figure 5 As shown, it is a schematic diagram of a LAN expansion model provided in an embodiment of the present application. It can be seen from the figure that the expansion model is a pod network with a larger range, which is composed of 6 pod nodes connected by switches. Among them, the preset threshold is 3 hops, and the central node is the pod node in the lower left corner. Taking the lower left corner pod node as the center and expanding outward by 2 hops, the pod network can be obtained. In the pod network, the resources of each pod node can be shared. The central pod node can discover the shared resources of the local area network through the polling scheduling algorithm, and can also discover the shared resources in the other five pod nodes. In this way, the scope of the local area network can be expanded.
[0080] S405: Acquire the shared resource set BJ of the second local area network B.
[0081] S406: Determine an unbuffered resource set in the first local area network A according to the shared resource set BJ.
[0082] In the embodiment of the present application, the unbuffered resources in the shared resource set BJ can be screened out by comparing the shared resource set BJ with the shared resource warehouse in the first local area network A. Specifically:
[0083] The shared resource set BJ includes the second shared resource; it is determined whether the second shared resource does not belong to the shared resource warehouse of the first local area network, and if so, the second loading resource is acquired to determine the loading resource set, wherein the loading resource set includes the second loading resource.
[0084] S407: The unbuffered resource set in the first local area network A is used as a loading resource set, and the loading resource set is loaded when the client is idle.
[0085] In the embodiment of the present application, a router node of a local area network is expanded as a central node, and finally a node network composed of more router nodes is formed. Thus, resource sharing within a controllable range is achieved. In addition, resource thresholds are set by preset thresholds to reduce the loading of irrelevant resources as much as possible. Thus, unnecessary performance loss caused by loading irrelevant resources is achieved.
[0086] The above are some specific implementations of the method for improving the first screen performance provided in the embodiment of the present application. Based on this, the present application also provides a corresponding device. The device provided in the embodiment of the present application will be introduced from the perspective of functional modularization.
[0087] Figure 6 A schematic diagram of a structure of a device 600 for improving the first screen performance provided in an embodiment of the present application. The device 600 is applied to a client, and the client belongs to a first local area network, and includes:
[0088] The acquisition unit 601 is used to acquire a first shared resource set based on a preset algorithm. The first shared resource set includes multiple shared resources within the first local area network; the preset algorithm is used to discover multiple resources including the local area tag of the first local area network;
[0089] The loading resource determination unit 602 is used to determine a loading resource set according to the first shared resource set; the loading resource set is a resource set that is not buffered in the shared resource warehouse; the shared resource warehouse is a database in the first local area network for storing the shared resources;
[0090] The loading unit 603 is configured to load the loading resource set in response to the client being in an idle state.
[0091] Optionally, the first shared resource set includes the first shared resource, and the loading determination unit 602 includes:
[0092] The response module is used to obtain a first loading resource in response to the first shared resource not belonging to the shared resource warehouse; the loading resource set includes the first loading resource.
[0093] Optionally, the device 600 further includes:
[0094] The idle state determining unit is used to determine that the client is in an idle state in response to the memory usage being lower than a preset threshold.
[0095] Optionally, the acquisition unit 601 is further configured to acquire a second shared resource set of the second local area network, wherein the second shared resource set is a plurality of resources within the second local area network.
[0096] The embodiments of the present application also provide corresponding devices and computer-readable storage media for implementing the solutions provided by the embodiments of the present application.
[0097] The device includes a memory and a processor, the memory is used to store instructions or codes, and the processor is used to execute the instructions or codes so that the device executes the method for improving the first screen performance described in any embodiment of the present application.
[0098] In practical applications, the computer-readable storage medium can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0099] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0100] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0101] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0102] Figure 7 A schematic diagram of the structure of a computer device provided in an embodiment of the present application. Figure 5 The computer device 700 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0103] like Figure 7 As shown, computer device 700 is in the form of a general-purpose computing device. Components of computer device 700 may include, but are not limited to: one or more processors or processing units 702, system memory 707, and bus 703 connecting different system components (including system memory 707 and processing unit 702).
[0104] Bus 703 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0105] The computer device 700 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 700, including volatile and non-volatile media, removable and non-removable media.
[0106] System memory 707 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 708 and / or cache memory 709. Computer device 700 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 710 may be used to read and write non-removable, non-volatile magnetic media ( Figure 7 not shown, usually called a "hard drive"). Although Figure 7 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 703 via one or more data medium interfaces. The memory 707 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0107] A program / utility 711 having a set (at least one) of program modules 712 may be stored, for example, in the memory 707, such program modules 712 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 712 generally perform the functions and / or methods of the embodiments described herein.
[0108] The computer device 700 may also communicate with one or more external devices 701 (e.g., keyboard, pointing device, display 705, etc.), one or more devices that enable a user to interact with the computer device 700, and / or any device that enables the computer device 700 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 704. Furthermore, the computer device 700 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) through a network adapter 706. Figure 7 As shown, network adapter 706 communicates with other modules of computer device 700 via bus 703. It should be understood that although Figure 7 Not shown, other hardware and / or software modules may be used in conjunction with computer device 700, including but not limited to microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0109] The processor unit 702 executes various functional applications and data processing by running programs stored in the system memory 707, such as implementing the method for improving the first screen performance provided in the embodiment of the present application.
[0110] It should also be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.
[0111] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A method for improving the performance of the first screen, It is characterized in that Applied to a client, the client belongs to a first local area network, the method comprises: A first shared resource set and a second shared resource set are obtained based on a preset algorithm; the first shared resource set includes a plurality of shared resources within the first local area network, the second shared resource set includes a plurality of shared resources within the second local area network, and the number of hops between nodes in the second local area network and nodes in the first local area network is less than or equal to a preset threshold; the preset algorithm is used to discover a plurality of resources including a local tag of the first local area network and a plurality of resources including a local tag of the second local area network, and the preset algorithm is a polling scheduling algorithm; The obtaining of the first shared resource set and the second shared resource set based on a preset algorithm includes: Based on a preset interval time and the polling scheduling algorithm, actively query whether the current local area includes multiple shared resources with the local area mark of the first local area network and the local area mark of the second local area network, and store the discovered multiple shared resources with the local area mark of the first local area network and the local area mark of the second local area network in the service layer to generate the first shared resource set and the second shared resource set; In response to the client being in an idle state, a loading resource collection is loaded, and when the page is loaded, the resources in the loaded loading resource collection are directly used for page rendering; the loading resource collection is an unbuffered resource collection obtained by the service layer by comparing the first shared resource collection and the shared resource warehouse, and an unbuffered resource collection obtained by comparing the second shared resource collection and the shared resource warehouse; the shared resource warehouse is a database in the first local area network for storing the shared resources.
2. The method according to claim 1, It is characterized in that Before loading the loading resource set, the method further includes: Obtaining the memory usage of the client; In response to the memory usage being lower than a preset threshold, it is determined that the client is in the idle state.
3. A device for improving the performance of the first screen, It is characterized in that Applied to a client, the client belongs to a first local area network, and the device comprises: An acquisition unit, configured to acquire a first shared resource set and a second shared resource set based on a preset algorithm; the first shared resource set includes a plurality of shared resources within the first local area network, the second shared resource set includes a plurality of shared resources within the second local area network, and the number of nodes within the second local area network and the number of nodes within the first local area network are less than or equal to a preset threshold; the preset algorithm is used to discover a plurality of resources including a local tag of the first local area network and a plurality of resources including a local tag of the second local area network, and the preset algorithm is a polling scheduling algorithm; The acquiring the first shared resource set based on a preset algorithm includes: Based on a preset interval time and the polling scheduling algorithm, actively query whether the current local area includes multiple shared resources with the local area mark of the first local area network and the local area mark of the second local area network, and store the discovered multiple shared resources with the local area mark of the first local area network and the local area mark of the second local area network in the service layer to generate the first shared resource set and the second shared resource set; A loading unit, used for loading a loading resource collection in response to the client being in an idle state, and directly using the resources in the loaded loading resource collection to render the page when the page is loaded; the loading resource collection is an unbuffered resource collection obtained by the service layer by comparing the first shared resource collection and the shared resource warehouse, and an unbuffered resource collection obtained by comparing the second shared resource collection and the shared resource warehouse; the shared resource warehouse is a database in the first local area network for storing the shared resources.
4. The device according to claim 3, It is characterized in that The device also includes: The idle state determining unit is used to determine that the client is in an idle state in response to the memory usage being lower than a preset threshold.
5. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores a method for implementing the method of improving the first screen performance, and when the method for implementing the method of improving the first screen performance is executed by the processor, the steps of the method as claimed in claim 1 or 2 are implemented.
Citation Information
Patent Citations
Resource file synchronization method and device, equipment and storage medium
CN114372032A