CN113467967A - Configuration method of network loading resources, resource configuration system and related device - Google Patents

Configuration method of network loading resources, resource configuration system and related device Download PDF

Info

Publication number
CN113467967A
CN113467967A CN202110655482.4A CN202110655482A CN113467967A CN 113467967 A CN113467967 A CN 113467967A CN 202110655482 A CN202110655482 A CN 202110655482A CN 113467967 A CN113467967 A CN 113467967A
Authority
CN
China
Prior art keywords
loading
network
priority queue
resource
resources
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110655482.4A
Other languages
Chinese (zh)
Inventor
杨皓
郑启光
高晓宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Huya Technology Co Ltd
Original Assignee
Guangzhou Huya Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Huya Technology Co Ltd filed Critical Guangzhou Huya Technology Co Ltd
Priority to CN202110655482.4A priority Critical patent/CN113467967A/en
Publication of CN113467967A publication Critical patent/CN113467967A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/546Message passing systems or structures, e.g. queues
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/548Queue

Abstract

The application discloses a configuration method of network loading resources and a related device, comprising the following steps: the intelligent system acquires a loading request of a user for network loading resources; setting a matching path and a loading weight corresponding to the matching path for network loading resources according to the loading request; and adding the network loading resources into the high-priority queue or the low-priority queue based on the loading weight, and loading the network loading resources according to the matching path. By the method, the priority loading of the important network resources is realized, so that the interactive experience of a user is improved.

Description

Configuration method of network loading resources, resource configuration system and related device
Technical Field
The present invention relates to the field of network resource loading applications, and in particular, to a method, a system, and a related device for configuring network loading resources.
Background
With the rapid development of internet technology and the increasing strength of browser capability, Web applications are changing from architectural to interactive. Due to the popularity of Ajax (Web data interaction mode), the page performance is greatly improved from the traditional single JSP (java server page) architecture to the front-end and back-end separation architecture, and meanwhile, the quality of the webpage application performance is rapidly amplified along with the improvement of the network speed. However, the goodness of performance largely determines whether the user would like to open your application again. Therefore, focusing on the improvement of the application performance is a necessary condition for the success of the product and is a necessary way for developers.
FP (functional programming), FCP (video clip software) and FID (instrumentation) are often the objects of interest as important measures of application performance. In general, a developer develops according to a business logic sequence, and codes are executed according to the sequence, but when a plurality of Long tasks (i.e. requests for resources which take more than 50 ms) which are not needed for the initial rendering are executed, page body rendering is blocked, so that core content is delayed to be loaded, performance indexes are increased, and user experience is finally reduced.
Therefore, in the operation process, it is very important to realize the preferential loading of the core resources and the delayed loading of the secondary network resources, and to improve the control capability and effectiveness of the network resource loading.
Disclosure of Invention
The technical problem mainly solved by the application is to provide a configuration method, a resource configuration system and a related device for network loading resources, so as to realize priority loading of important network resources, thereby improving the interaction experience of users.
In order to solve the above technical problem, the present application provides a configuration method for network loading resources, where the configuration method includes: the intelligent system acquires a loading request of a user for network loading resources; setting a matching path and a loading weight corresponding to the matching path for network loading resources according to the loading request; and adding the network loading resources into the high-priority queue or the low-priority queue based on the loading weight, and loading the network loading resources according to the matching path.
The intelligent system comprises a client and a server; the steps of the intelligent system for acquiring the loading request of the user to the network loading resource comprise: acquiring a loading request of a user for network loading resources through a server; the method comprises the following steps of setting a matching path and a loading weight corresponding to the matching path for network loading resources according to a loading request, wherein the steps comprise: setting a matching path and a matching path for network loading resources according to the loading request through the server; sending the matching path to the client; adding the network loading resources into a high-priority queue or a low-priority queue based on the loading weight, and loading the network loading resources according to the matching path, wherein the step comprises the following steps: and adding the network loading resources into the high-priority queue or the low-priority queue through the client based on the loading weight, and loading the network loading resources according to the matching path.
The method comprises the following steps that the server sets a matching path and a loading weight corresponding to the matching path for network loading resources according to a loading request, and comprises the following steps: setting a matching path and a loading weight for the network loading resource by using a key value pair form, and writing the set network loading resource into a cache queue; after the step of setting the matching path and the loading weight corresponding to the matching path for the network loading resource according to the loading request, the method further comprises the following steps: monitoring that a user modifies network loading resources in a cache queue; and the server acquires the modified matching path and loading weight of the network loading resource from the cache queue and sends the matching path and loading weight of the network loading resource to the client through a full-duplex communication protocol.
The method comprises the following steps of adding network loading resources into a high-priority queue or a low-priority queue based on loading weights, and loading the network loading resources according to a matching path, wherein the method comprises the following steps: editing a data request layer of a client, and adding an interceptor to intercept a loading request; the step of adding network loading resources to a high priority queue or a low priority queue based on a loading weight includes: acquiring a loading request, a matching path and a loading weight of a network loading resource by using an interceptor; and adding the loading request into the high-priority queue or the low-priority queue according to the loading weight, and loading the request according to the matching path.
The method comprises the following steps of adding network loading resources into a high-priority queue or a low-priority queue based on loading weights, and loading the network loading resources according to a matching path: writing the network loading resources with loading weights smaller than the preset weight into a low-priority queue; and writing the network loading resources with the loading weight not less than the preset weight into the high-priority queue.
The network loading resources in the low-priority queue are sorted according to the loading weight; the network loading resources in the high priority queue are ordered according to time sequence.
Before the step of acquiring the network loading resource of the low priority queue if the high priority queue is empty, the method further includes: judging whether the network loading resources are loaded completely; and if the loading is finished, deleting the network loading resources from the high-priority queue.
The step of acquiring the network loading resource of the low priority queue if the high priority queue is empty includes: detecting whether the high priority queue is empty; if the queue is empty, acquiring a low-priority queue, and detecting whether the low-priority queue is empty; and if the low-priority queue is not empty, acquiring a loading request of the network loading resources at the head of the low-priority queue, and deleting the network loading resources at the head of the queue from the low-priority queue after the loading is finished.
In order to solve the above technical problem, the present application further provides a resource allocation system, including: the acquisition module is used for acquiring a loading request of a user for a resource to be loaded; the configuration module is used for setting a matching path and a loading weight corresponding to the matching path for the resource to be loaded according to the loading request; and the distribution module is used for adding the resources to be loaded into the high-priority queue or the low-priority queue based on the loading weight and loading the resources to be loaded according to the matching path.
In order to solve the above technical problem, the present application further provides an intelligent terminal, where the intelligent terminal includes a processor and a memory, which are coupled to each other, the memory is used to store program instructions, and the processor is used to execute the program instructions stored in the memory to implement the configuration method of network loading resources according to any of the above embodiments.
In order to solve the above technical problem, the present application further provides a computer-readable storage medium, which includes a processor and a memory, where the memory stores computer program instructions, and the processor is configured to execute the program instructions to configure the network loading resource according to any one of the above embodiments.
The beneficial effect of this application is: the network loading resources are distributed to a high-priority queue and a low-priority queue through the matching path and the loading weight of the network loading resources, the high-priority queue is loaded preferentially, and the low-priority queue is loaded afterwards, so that the aims of preferentially loading important resources and obtaining all the resources are fulfilled.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart illustrating an embodiment of a method for configuring network loading resources according to the present application;
FIG. 2 is a schematic flow chart illustrating an embodiment of step S12 of the present application;
FIG. 3 is a flowchart illustrating an embodiment of a loading method for loading resources in a network according to the present application;
FIG. 4 is a flowchart illustrating another embodiment of a loading method for loading resources in a network according to the present application;
fig. 5 is a schematic frame diagram illustrating an embodiment of a method for configuring network loading resources according to the present application;
FIG. 6 is a schematic diagram of an embodiment of a resource allocation system according to the present application;
FIG. 7 is a schematic structural diagram of an embodiment of an intelligent terminal according to the present application;
FIG. 8 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The application provides a configuration method of network loading resources, which is applied to a Client (Client SDK) and a Server (configServer) cooperative system. The client is used for obtaining network loading resources, the server is used for providing the network loading resources for the client, and the server is also used for receiving configuration issued by a user. Network data loading is carried out between the client and the server through webscolet (full-duplex communication protocol). It should be noted that, generally, an application needs to have a developer, an administrator and a user, where the user in this embodiment refers to a developer user and an administrator user, and the user configures the configuration of the developer user or the administrator user on the network loading resource, where the configuration includes setting a matching path and a corresponding loading weight for the network loading resource in a form of a key value pair.
Specifically, referring to fig. 1, fig. 1 is a schematic flowchart illustrating an embodiment of a method for configuring network loading resources according to the present application. As shown in fig. 1, includes:
step S11: the intelligent system obtains a loading request of a user for network loading resources.
The intelligent system comprises a client and a server. Specifically, both the client and the server receive a loading request of a user for loading resources on the network.
And after receiving the loading request of the network loading resource, the server sets a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request.
And the client receives the loading request of the network loading resource and simultaneously acquires the matching path and the loading weight which are set for the network loading resource by the server in real time.
The network loading resource comprises a loading request, a loading weight and a matching path. The matching path is a loading path for loading resources for the network. The load request includes a user request for configuration of a network load resource, such as a priority load request. The users in this embodiment refer to a developer user and an administrator user, and the users can directly modify the configuration of the network loading resources at the server. The configuration includes loading weights and loading paths for loading resources on the network.
Step S12: and setting a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request.
In this embodiment, this step is performed at the server, and a matching path and a loading weight corresponding to the matching path are set for the network loading resource by the server according to the loading request for loading the network loading resource; and sending the matching path of the network loading resource and the loading weight of the network loading resource to the client.
Specifically, a matching path and a loading weight are set for the network loading resource in a key value pair form at the server side, and the set network loading resource is written into a cache queue. At this time, the network loading resource in the cache queue includes a matching path and a loading weight.
The server side also comprises a monitoring user which modifies the network loading resources in the cache queue. The server receives the configuration (including the loading weight and the matching path) of the network loading resource modified by the user, and modifies the configuration (the loading weight and the matching path) of the network loading resource in the cache queue.
The server side also comprises a matching path and a loading weight which are used for obtaining the network loading resources from the cache queue, and actively sends the matching path and the loading weight of the network loading resources to the client side, or pushes the cache queue to the client side, so that the client side can directly obtain the network loading resources from the cache queue.
Specifically, please refer to fig. 2, wherein fig. 2 is a flowchart illustrating an embodiment of step S12 according to the present application. The method comprises the following steps:
step S21: and acquiring the network loading resource configured by the user.
The users include development users and management users. The user publishes the configuration at the server, which in this embodiment is mainly for low priority configurations. Specifically, the server obtains a loading request of the network loading resource configured by the user, and executes step S22.
Step S22: and setting a matching path and a loading weight for the network loading resource by using a key value pair form, and writing the set network loading resource into a cache queue.
The cache queue is a redis queue, and the redis is a storage system in a computer and can provide APIs (application programming interfaces) of multiple languages. The set network loading resources comprise matching paths and loading weights of the network loading resources.
In this embodiment, the network loading resource of the server may be the same as or different from the network loading resource of the client, and specifically, the network loading resource provided by the server is more than the network loading resource acquired by the client.
In this step, the server further includes: and monitoring the change of the cache queue at all times, and capturing the change of network loading resources and configuration thereof.
Step S23: and reading the matching path and the loading weight of the network loading resource of the cache queue, and sending the matching path and the loading weight to the client through a full-duplex communication protocol.
Specifically, the server reads the matching path and the loading weight of the network loading resource from the cache queue, wherein the matching path and the loading weight of the network loading resource modified by the user are included. After the configuration of the network loading resource is obtained, the configuration is actively pushed to a corresponding client through a Websocket (full duplex communication protocol, a protocol for performing full duplex communication on a single TCP connection), specifically, to a client that establishes a network communication connection with the server.
Step S13: and adding the network loading resources into the high-priority queue or the low-priority queue based on the loading weight, and loading the network loading resources according to the matching path.
In this embodiment, this step is performed at the client, specifically, the network loading resource is added to the high priority queue or the low priority queue by the client based on the loading weight, and the network loading resource is loaded according to the matching path. The method comprises the steps that a client receives a matching path and a loading weight of network loading resources sent by a server, the network loading resources are added into a high-priority queue or a low-priority queue according to the loading weight, and then the network loading resources are sequentially loaded from the matching path according to the matching path of the network loading resources.
Specifically, the method further comprises the following steps of: and editing a data request layer of the client, and adding an interceptor to intercept the loading request. Specifically, the XMLHttpRequest of the client is edited, wherein the XMLHttpRequest is a way for the client to exchange data with the server. XMLHTTP is a set of API functions that can be called by JavaScript, JScript, VBScript, and other scripting languages embedded in a Web browser to send and receive XML or other data between the browser and a Web server via HTTP. The greatest benefit of XMLHTTP is that the web page can be dynamically updated without having to re-read the entire web page from the server and without having to install additional plug-ins. This technique is used by many web sites to implement fast-responding dynamic web applications. The XMLHttpRequest object is used for exchanging data with the server in the background, and the following advantages can be realized: 1) updating the web page without reloading the page; 2) requesting data from a server after a page has been loaded; 3) receiving data from the server after the page has been loaded; 4) and sending the data to the server in the background. The XMLHttpRequest is edited or rewritten at the client, an interceptor (interceptor) is added to the XMLHttpRequest, the message event can be monitored through the interceptor, and the configuration change of the network loading resource of the server in the running process can be captured. The interceptor intercepts the load requests of the network load resources and sorts the load requests into a high priority queue or a low priority queue.
It should be noted that, the browser kernel is based on the chrome v8 engine and is a javascript runtime, and the compiling and execution of the javascript are generally divided into the compiling time and the execution time, and the compiling time is processed by providing api, for example, for a certain interface, priority is already set for the interface during development, and then code compiling is performed; the configuration is issued by the server during the operation, when the configuration on the server is changed, the client can continuously poll to dynamically sense the change of the configuration, and the network loading resources are reprocessed according to the change of the configuration. In this embodiment, during operation, a user realizes priority loading of network loading resources by issuing configuration at a server.
The method specifically comprises the following steps: acquiring a loading request, a matching path and a loading weight of a network loading resource by using an interceptor; and adding the network loading resources into the high-priority queue or the low-priority queue according to the loading weight, and loading the network loading resources according to the matching path.
Wherein the high priority queue is a first load queue and the low priority queue is a second load queue.
This step is done within the interceptor. In this embodiment, in the interceptor, the network loading resource of the client is hierarchically processed according to the configuration change of the network loading resource by the user. Specifically, the interceptor acquires a loading request of the network loading resource issued by a user, acquires a matching path and a loading weight of the network loading resource corresponding to the loading request of the network loading resource from the server, and classifies the network loading resource into a high-priority queue or a low-priority queue in the client interceptor according to the loading weight of the network loading resource. In this embodiment, the interceptor further completes the parsing of the request parameter, assigning the page form parameter to the corresponding attribute in the value stack, performing function check, program exception debugging, and the like.
Referring to fig. 3, fig. 3 is a schematic flow chart illustrating an embodiment of a loading method for loading resources in a network according to the present application. As shown in fig. 3, includes:
step S31: and writing the network loading resources with the loading weight smaller than the preset weight into the low-priority queue.
Step S32: and writing the network loading resources with the loading weight not less than the preset weight into the high-priority queue.
Specifically, all the requests matched with the loading paths are sorted into the high-priority queue and the low-priority queue according to whether the weight value is not less than the preset weight value. In this embodiment, the preset weight is 1, and in other embodiments, the preset weight may be set according to a user requirement, which is not limited herein. In this embodiment, the low priority queues are preferentially allocated, the high priority queues are reallocated, specifically, the load requests of the network load resources with the load weights smaller than the preset weights are written into the low priority queues, and the load requests of the rest of the network load resources are written into the high priority queues. The network loading resource comprises a loading request, a loading weight and a matching path.
The network loading resources in the low-priority queue are sorted according to the loading weight, specifically, the network loading resources with higher weight values are arranged in front of the network loading resources, the network loading resources with lower weight values are arranged in back of the network loading resources, and the network loading resources in the low-priority queue are sequentially loaded according to the FIFO (first-in first-out principle). And the network loading resources in the high-priority queue are sorted according to the time sequence and are sequentially loaded according to a first-in first-out principle.
In this embodiment, the loading process specifically includes: the client and the server establish network connection, the client sends a loading request of network loading resources to the server, and the server sends the network loading resources to the client according to the loading request. The establishment of the network connection between the client and the server follows the three-way handshake four-way split-hand principle.
Loading the network loading resource according to the matching path at step S13 further includes: and firstly loading the network loading resources in the high-priority queue, and then loading the network loading resources in the low-priority queue. Specifically, referring to fig. 4, fig. 4 is a schematic flowchart illustrating another embodiment of a loading method for loading resources in a network according to the present application. As shown in fig. 4, includes:
step S41: and preferentially acquiring the network loading resources in the high-priority queue.
Specifically, the loading requests of all network loading resources in the high-priority queue are obtained, and the network loading resources of the high-priority queue are loaded from the matching path in sequence. In this embodiment, the network loading resources in the high-priority queue and the low-priority queue are dynamically changed, specifically, the interceptor of the client captures a matching path and a loading weight of the service end for the network loading resources to be modified, and the network loading resources changed according to the matching path and the loading weight are rewritten into the high-priority queue or the low-priority queue according to a new loading weight, so that the high-priority queue and the low-priority queue are dynamically changed.
In this embodiment, the high priority queue and the low priority queue are proxied through proxy (queue proxy service of the client), and write or delete events are captured. The proxy is used for controlling the sending of the client request, so as to control the loading of the network loading resource.
Step S42: and sequentially loading the network loading resources of the high-priority queue from the matching path according to a first-in first-out principle.
The network loading resources in the high-priority queue are written into the high-priority queue according to a time sequence, so that the loading requests of the network loading resources in the high-priority queue are sequentially loaded in the high-priority queue according to a first-in first-out principle.
In this embodiment, the matching path refers to a loading interface for the client to load the network loading resource from the server. Generally, different interfaces have different request amounts in different time periods, for example, during a period of a activity explosion, a large number of loading requests exist on an interface related to the activity a, at this time, resources and priorities are biased to the interface related to the activity a, after the activity a is ended, a user needs to lower the priority of the request of the activity a, and at this time, the user needs to modify the priority of a loading interface/loading path through a server for an item running on a line. In this embodiment, the user modifies the matching path of the network loading resource through the server, so as to modify the configuration of the network loading resource.
Specifically, the proxy acquires a loading request of a first network loading resource in the high-priority queue, loads the network loading resource according to the loading request, deletes a loading task of the network loading resource from the high-priority queue once the network loading resource is loaded, acquires a loading request of a second network loading resource, and sequentially loads the network loading resource in the high-priority queue until all network loading resources in the high-priority queue are loaded.
Step S43: it is detected whether the high priority queue is empty.
Specifically, the proxy detects whether the high priority queue is empty, and if not, repeatedly executes step S42, and if so, executes step S44.
Step S44: and if so, acquiring the network loading resources of the low-priority queue.
Specifically, the method includes detecting whether the low-priority queue is empty while acquiring the network loading resource of the low-priority queue, if not, initiating a queue head request task, and if so, waiting for the interceptor to redistribute the loading request of the network loading resource.
Specifically, when the low-priority queue is not empty, a loading request of the network loading resources at the head of the low-priority queue is obtained, the network loading resources are loaded according to the loading request, the network loading resources are deleted from the low-priority queue after the loading is completed, and the interceptor is waited to reallocate new network loading resources until the loading task in the low-priority queue is empty.
The beneficial effect of this embodiment is: the method comprises the steps that a server side obtains a loading request of a user for network loading resources, a matching path and a loading weight are set for the network loading resources according to the loading request, the matching path and the loading weight are sent to a client side, the client side adds the network loading resources into a high-priority queue or a low-priority queue based on the loading weight, the loading weight of the network loading resources is specifically written into the low-priority queue according to the weight, the loading weight of the network loading resources is smaller than a preset weight, the rest of the network loading resources are written into the high-priority queue sequentially according to a time sequence, the high-priority queue is loaded preferentially, the low-priority queue is loaded afterwards, the purpose of preferentially loading important resources is achieved, and all the resources are loaded completely so as to improve user experience.
To describe the technical solution of the present application more clearly, please further refer to fig. 5, where fig. 5 is a schematic diagram of a framework of an embodiment of a configuration method for network loading resources of the present application. As shown in fig. 5, the Client (Client SDK) and the Server (Config Server) are communicatively connected via a full duplex protocol (Websocket). A user issues the configuration of the network loading resource at an application layer, a Server (Config Server) acquires the configuration change of the network loading resource through a Load Balancer, changes/adjusts the configuration of the network loading resource according to the configuration change, specifically sets a matching path and a corresponding weight for the network loading resource by using a key value pair form, and writes the set network loading resource into a cache queue (redis). A Client side (Client SDK) sends a loading request of network loading resources to a Server side (Config Server) through a full duplex protocol (Websocket), and the Server side (Config Server) sends configuration changes (including changes of a matching path and a loading weight) of the network loading resources to the Client side (Client SDK) according to the loading request; or the Server (Config Server) reads the configuration change of the network loading resource from the redis queue and actively pushes the configuration change of the network loading resource to the client (Config Server). The Client side (Client SDK) receives the configuration change of the network loading resource sent by the Server side (configServer), divides the network loading resource into a High Priority Queue (High Priority Queue) and a Low Priority Queue (Low Priority Queue) through an Interceptor (Interceptor), uses proxy (Queue proxy service) to load the network loading resource in the High Priority Queue (High Priority Queue) according to the first-in first-out principle in sequence, concretely, uses fetch protocol to send network data request to the Server side (configServer) to obtain the network loading resource from the Server side (configServer), deletes the loaded network loading resource from the High Priority Queue (High Priority Queue), detects whether the High Priority Queue (High Priority Queue) is empty, if empty, carries out the first-in first-out loading resource loading in the Low Priority Queue (Low Priority Queue) according to the same principle, and deleting the loaded network loading resources from a Low Priority Queue (Low Priority Queue) until all the network loading resources are loaded, so as to wait for the next loading request of the network loading resources. The fetch protocol in the figure is a HTTP data request mode, and is an alternative to XMLHttpRequest.
The beneficial effect of this embodiment is: by combining the SDK of the client and the release configuration of the server, the changes of queues with different priorities are captured by proxy, and then the priority control of the network resource request is completed. The method has the advantages that the first screen rendering of a user is not influenced, the secondary network resources consuming larger resources are loaded in a delayed mode, the network resources required by core interaction and rendering are loaded preferentially, and the effect that all request resources can be reached but the core resources are preferred is achieved. The measurement index values of FP, FCP, FID and the like are obviously reduced, and the interactive experience of the user is greatly improved.
Please refer to fig. 6, wherein fig. 6 is a schematic structural diagram of an embodiment of the resource allocation system according to the present application. As shown in fig. 6, includes: the obtaining module 61 is configured to obtain a loading request of a user for a resource to be loaded, where the resource to be loaded is a network resource that the user wants to load. A configuration module 62, where the configuration module 62 is coupled to the obtaining module 61, and is configured to set a matching path and a loading weight corresponding to the matching path for the resource to be loaded according to the loading request. And the allocating module 63 is coupled to the configuring module 62, and configured to add the resource to be loaded to the high priority queue or the low priority queue based on the loading weight, and load the resource to be loaded according to the matching path. The resources to be loaded in this embodiment may be the same as the network loading resources in the above embodiments, and are all network resources. Wherein the configuration module 62 and the allocation module 63 are communicatively coupled via a full duplex communication protocol.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an embodiment of the intelligent terminal of the present application, and as shown in fig. 7, the intelligent terminal 70 includes a processor 701 and a memory 702 that are coupled to each other, where the processor 701 is configured to execute program instructions stored in the memory 702 to implement steps in the foregoing client method embodiment or steps correspondingly executed by the client in any one of the foregoing method embodiments. The terminal 70 may include a touch screen, a printing component, a communication circuit, etc. according to requirements, in addition to the processor 701 and the memory 702, which is not limited herein.
In particular, the processor 701 is adapted to control itself and the memory 702 to implement the steps of any of the above-described method embodiments. Processor 701 may also be referred to as a CPU (Central Processing Unit). The processor 701 may be an integrated circuit chip having signal processing capabilities. The Processor 701 may also be a general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 701 may be implemented collectively by a plurality of integrated circuit chips.
The present application further provides a computer-readable storage medium, as shown in fig. 8, fig. 8 is a schematic structural diagram of an embodiment of the computer-readable storage medium of the present application.
The computer-readable storage medium 80 includes a computer program 801 stored on the computer-readable storage medium 80, and when executed by the processor, the computer program 801 implements the steps in any of the above method embodiments or the steps correspondingly executed by the error correction method for network time service in the above method embodiments.
In particular, the integrated unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium 80. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a computer-readable storage medium 80 and includes several instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method of the embodiments of the present application. And the aforementioned computer-readable storage medium 80 includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
In the several embodiments provided in the present application, it should be understood that the disclosed method and apparatus may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, a division of a module or a unit is merely a logical division, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some interfaces, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are merely examples and are not intended to limit the scope of the present disclosure, and all modifications, equivalents, and flow charts using the contents of the specification and drawings of the present disclosure or those directly or indirectly applied to other related technical fields are intended to be included in the scope of the present disclosure.

Claims (12)

1. A configuration method for network loading resources is characterized in that the configuration method comprises the following steps:
the intelligent system acquires a loading request of a user for the network loading resource;
setting a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request;
and adding the network loading resources into a high-priority queue or a low-priority queue based on the loading weight, and loading the network loading resources according to the matching path.
2. The configuration method according to claim 1, wherein the intelligent system comprises a client and a server;
the step of the intelligent system acquiring the loading request of the user to the network loading resource comprises the following steps:
acquiring a loading request of a user for the network loading resource through a server;
the step of setting a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request includes:
setting a matching path and the matching path for the network loading resource according to the loading request by the server; sending the matching path and the loading weight to the client;
the step of adding the network loading resource to a high priority queue or a low priority queue based on the loading weight and loading the network loading resource according to the matching path includes:
and adding the network loading resources into a high-priority queue or a low-priority queue through the client based on the loading weight, and loading the network loading resources according to the matching path.
3. The configuration method according to claim 1 or 2, wherein the step of setting a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request comprises:
the server sets the matching path and the loading weight for the network loading resource in a key value pair form, and writes the set network loading resource into a cache queue;
after the step of setting a matching path and a loading weight corresponding to the matching path for the network loading resource according to the loading request, the method further includes:
monitoring that the user modifies the network loading resource in the cache queue;
and the server acquires the modified matching path and the modified loading weight of the network loading resource from the cache queue, and sends the matching path and the loading weight of the network loading resource to the client through a full-duplex communication protocol.
4. The method according to claim 1 or 2, wherein the step of adding the network loading resource to a high priority queue or a low priority queue based on the loading weight and loading the network loading resource according to the matching path is preceded by the step of:
editing a data request layer of the client, and adding an interceptor to intercept the loading request of the network loading resource;
the step of adding the network loading resource to a high priority queue or a low priority queue based on the loading weight comprises:
acquiring the loading request, the matching path and the loading weight of the network loading resource by using the interceptor;
and adding the loading request into the high-priority queue or the low-priority queue according to the loading weight, and loading the loading request according to the matching path.
5. The method according to claim 4, wherein the step of adding the network loading resource to a high priority queue or a low priority queue based on the loading weight and loading the network loading resource according to the matching path comprises:
writing the network loading resources with the loading weight smaller than a preset weight into the low-priority queue;
and writing the network loading resources with the loading weight not less than the preset weight into the high-priority queue.
6. The configuration method according to claim 5,
the network loading resources in the low priority queue are sorted according to the loading weight;
the network loading resources in the high priority queue are ordered according to a time sequence.
7. The method according to claim 1 or 2, wherein after the step of adding the network loading resource to a high priority queue or a low priority queue based on the loading weight and loading the network loading resource according to the matching path, the method further comprises:
preferentially acquiring the network loading resources in the high-priority queue;
sequentially loading the network loading resources of the high-priority queue from the matching path according to a first-in first-out principle;
and if the high priority queue is empty, the network loading resource of the low priority queue is acquired.
8. The method according to claim 7, wherein before the step of acquiring the network loading resource of the low priority queue if the high priority queue is empty, the method further comprises:
judging whether the network loading resource is loaded completely;
and if the loading is finished, deleting the network loading resources from the high-priority queue.
9. The method according to claim 7, wherein the step of acquiring the network loading resource of the low priority queue if the high priority queue is empty comprises:
detecting whether the high priority queue is empty;
if the queue is empty, acquiring the low-priority queue, and detecting whether the low-priority queue is empty;
and if the low-priority queue is not empty, acquiring a loading request of the network loading resources of the head of the low-priority queue, and deleting the network loading resources of the head of the queue from the low-priority queue after the loading is finished.
10. A resource configuration system, the resource configuration system comprising:
the acquisition module is used for acquiring a loading request of a user for a resource to be loaded;
the configuration module is used for setting a matching path and a loading weight corresponding to the matching path for the resource to be loaded according to the loading request;
and the distribution module is used for adding the resources to be loaded into a high-priority queue or a low-priority queue based on the loading weight and loading the resources to be loaded according to the matching path.
11. An intelligent terminal, characterized in that the intelligent terminal comprises a processor and a memory coupled to each other, the memory is used for storing program instructions, and the processor is used for executing the program instructions stored in the memory to realize the configuration method of network loading resources according to any one of the above claims 1 to 9.
12. A computer-readable storage medium comprising a processor and a memory, the memory storing computer program instructions, the processor being configured to execute the program instructions to implement the method of configuring a network loading resource according to any one of claims 1 to 9.
CN202110655482.4A 2021-06-11 2021-06-11 Configuration method of network loading resources, resource configuration system and related device Pending CN113467967A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110655482.4A CN113467967A (en) 2021-06-11 2021-06-11 Configuration method of network loading resources, resource configuration system and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110655482.4A CN113467967A (en) 2021-06-11 2021-06-11 Configuration method of network loading resources, resource configuration system and related device

Publications (1)

Publication Number Publication Date
CN113467967A true CN113467967A (en) 2021-10-01

Family

ID=77870020

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110655482.4A Pending CN113467967A (en) 2021-06-11 2021-06-11 Configuration method of network loading resources, resource configuration system and related device

Country Status (1)

Country Link
CN (1) CN113467967A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984275A (en) * 2012-12-14 2013-03-20 北京奇虎科技有限公司 Method and browser for web downloading
CN108763297A (en) * 2018-04-18 2018-11-06 Oppo广东移动通信有限公司 Web page resources processing method, device and mobile terminal

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102984275A (en) * 2012-12-14 2013-03-20 北京奇虎科技有限公司 Method and browser for web downloading
CN108763297A (en) * 2018-04-18 2018-11-06 Oppo广东移动通信有限公司 Web page resources processing method, device and mobile terminal

Similar Documents

Publication Publication Date Title
US11243953B2 (en) Mapreduce implementation in an on-demand network code execution system and stream data processing system
CN107729139B (en) Method and device for concurrently acquiring resources
US9621441B2 (en) Methods and computer program products for analysis of network traffic by port level and/or protocol level filtering in a network device
US8516509B2 (en) Methods and computer program products for monitoring system calls using safely removable system function table chaining
EP1723569B1 (en) Remote system administration using command line environment
US20140068624A1 (en) Quota-based resource management
US8589537B2 (en) Methods and computer program products for aggregating network application performance metrics by process pool
US9557880B2 (en) Shared user interface services framework
US8935288B2 (en) User specific logs in multi-user applications
US20220124087A1 (en) Secure web application delivery platform
CN112087520B (en) Data processing method, device, equipment and computer readable storage medium
US11281511B2 (en) Predictive microservice systems and methods
US20150067013A1 (en) Methods for servicing web service requests using parallel agile web services and devices thereof
TW200404225A (en) Dynamic wizard interface system and method
CN111045782A (en) Log processing method and device, electronic equipment and computer readable storage medium
CN113641410A (en) Netty-based high-performance gateway system processing method and system
US9432448B2 (en) Load dispersion system, control method for load dispersion system, and storage medium
CN113467967A (en) Configuration method of network loading resources, resource configuration system and related device
CN114281258A (en) Service processing method, device, equipment and medium based on data storage
US9753682B2 (en) Information processing apparatus, information processing method, and computer-readable storage medium
CN113067878A (en) Information acquisition method, information acquisition device, information acquisition apparatus, information acquisition medium, and program product
CN112965796B (en) Task scheduling system, method and device
US20240004734A1 (en) Event processing systems and methods
CN110557428B (en) Script interpretation type service agent method and system based on Kubernetes
WO2023203731A1 (en) Arithmetic processing offloading system, arithmetic processing offloading method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination