Application loading optimization method and device

Through multi-level queue scheduling, the resource requests of bank websites are processed according to priority, which solves the problems of low page rendering speed and poor user experience caused by extended resource loading time, and achieves faster page rendering speed and better user experience.

CN119598047APending Publication Date: 2025-03-11AGRICULTURAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411642908.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

When the bank website page contains more resources, the resource loading time will be extended, resulting in low page rendering speed and poor user experience.

Method used

By randomly allocating multiple resource requests issued by the application page to multiple initial queues, the processing time and average processing time of resource requests are determined, and the resource requests are allocated to multiple waiting queues with different queue levels according to the processing time, the average processing time, and the number of resource requests in the initial queue. Add resource requests in the waiting queue with the highest queue level to the ready queue for processing until all resource requests are processed.

Benefits of technology

Through multi-level queue scheduling, the resource requests of each queue are processed in a timely manner, the resource loading time is reduced, and the page rendering speed and user experience are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598047A_ABST
    Figure CN119598047A_ABST
Patent Text Reader

Abstract

The invention provides an application loading optimization method and device. The method comprises the following steps: randomly distributing a plurality of resource requests sent by an application page to a plurality of initial queues; determining the processing time of each resource request and the average processing time of all resource requests; allocating the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue; sequentially adding the resource requests in the waiting queue with the highest queue level into a ready queue for processing; and updating the waiting queues, and returning to execute the step of sequentially adding the resource requests in the waiting queue with the highest queue level into the ready queue for processing until all the resource requests are processed. According to the scheme, the multiple resource requests sent by the application page are scheduled through the multi-level queues, it is guaranteed that the resource requests of each queue can be processed in time, the resource loading time is shortened, and the page rendering speed and the user experience are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to an application loading optimization method and device. Background Art

[0002] With the continuous development of Internet technology and the advancement of digital transformation of banks, banks' business processing has gradually become online, and more and more customer financial services have begun to adopt the form of web applications, and users' performance requirements for web applications have also become higher and higher.

[0003] As a platform that closely contacts users, bank websites no longer simply display some static images to users, but provide users with richer content and smoother interactive experience. However, when the pages of bank websites contain more resources, the loading time of these resources will be extended, and it will take a long time to complete the rendering of the page, resulting in lower page rendering speed and poor user experience. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides an application loading optimization method and device to improve page rendering speed and user experience.

[0005] To achieve the above objectives, the embodiments of the present invention provide the following technical solutions:

[0006] A first aspect of an embodiment of the present invention discloses an application loading optimization method, the method comprising:

[0007] Randomly assign multiple resource requests issued by the application page to multiple initial queues;

[0008] determining a processing time of the resource request and an average processing time of all the resource requests;

[0009] Allocate all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue;

[0010] Add the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing;

[0011] The waiting queue is updated, and the step of returning to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing is performed until all the resource requests are processed.

[0012] Preferably, allocating all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue includes:

[0013] Determining the queue level to which the resource requests in the initial queue belong according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue;

[0014] The resource request is allocated to a waiting queue corresponding to the queue level to which the resource request belongs.

[0015] Preferably, the resource requests in the waiting queue with the highest queue level are sequentially added to the ready queue for processing, including:

[0016] Calculating a comprehensive priority of the resource request, where the comprehensive priority is less than or equal to a priority threshold, and the priority threshold is set according to a queue level to which the resource request belongs;

[0017] According to the order of the comprehensive priorities of the resource requests in the waiting queue with the highest queue level from high to low, the resource requests in the waiting queue with the highest queue level are sequentially added to the ready queue for processing.

[0018] Preferably, calculating the comprehensive priority of the resource request includes:

[0019] assigning a corresponding initial priority to the resource request according to the processing time of the resource request;

[0020] Calculating a data size factor, a rendering time factor, and a waiting time factor of the resource request;

[0021] The comprehensive priority of the resource request is calculated according to the initial priority, the data size factor, the rendering time factor and the waiting time factor.

[0022] Preferably, updating the waiting queue and returning to execute the step of sequentially adding the resource requests in the waiting queue with the highest queue level to the ready queue for processing until all the resource requests are processed, including:

[0023] Updating the processing time of the resource request and updating the average processing time;

[0024] According to the updated processing time of the resource requests, the updated average processing time and the number of resource requests in the waiting queue, all the resource requests are reallocated to a plurality of waiting queues with different queue levels to update the waiting queue, and the step of sequentially adding the resource requests in the waiting queue with the highest queue level to the ready queue for processing is returned to be executed until all the resource requests are processed.

[0025] Preferably, it also includes:

[0026] The designated request in the ready queue is returned to the corresponding waiting queue, and the processing time and initial priority of the designated request are adjusted, wherein the designated request is any resource request that has not been processed after a preset maximum processing time.

[0027] Preferably, it also includes:

[0028] The comprehensive priority of the resource request is periodically updated.

[0029] A second aspect of an embodiment of the present invention discloses an application loading optimization device, the device comprising:

[0030] A first allocation unit, configured to randomly allocate multiple resource requests issued by the application page to multiple initial queues;

[0031] a determining unit, configured to determine a processing time of the resource request and an average processing time of all the resource requests;

[0032] A second allocation unit, configured to allocate all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue;

[0033] An adding unit, used for sequentially adding the resource requests in the waiting queue with the highest queue level to the ready queue for processing;

[0034] The updating unit is used to update the waiting queue and return to execute the adding unit until all the resource requests are processed.

[0035] Preferably, the second allocation unit comprises:

[0036] a determination subunit, configured to determine the queue level to which the resource requests in the initial queue belong according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue;

[0037] The allocation subunit is used to allocate the resource request to the waiting queue corresponding to the queue level to which it belongs.

[0038] Preferably, the adding unit comprises:

[0039] a calculation subunit, configured to calculate a comprehensive priority of the resource request, wherein the comprehensive priority is less than or equal to a priority threshold, and the priority threshold is set according to a queue level to which the resource request belongs;

[0040] The adding subunit is used to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing according to the order of the comprehensive priorities of each resource request in the waiting queue with the highest queue level from high to low.

[0041] Based on the above-mentioned embodiment of the present invention, an application loading optimization method and device are provided, the method is: randomly assign multiple resource requests issued by an application page to multiple initial queues; determine the processing time of each resource request and the average processing time of all resource requests; assign resource requests to multiple waiting queues with different queue levels according to the processing time of the resource request, the average processing time and the number of resource requests in the initial queue; add the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing; update the waiting queue, return to execute the step of adding the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing, until all resource requests are processed. This scheme schedules multiple resource requests issued by an application page through multi-level queues, ensuring that the resource requests in each queue can be processed in a timely manner, reducing the loading time of resources, and improving page rendering speed and user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in 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 embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0043] Figure 1 A flowchart of an application loading optimization method provided by an embodiment of the present invention;

[0044] Figure 2 An example diagram of an initial queue provided by an embodiment of the present invention;

[0045] Figure 3 A schematic diagram of an application loading optimization method provided by an embodiment of the present invention;

[0046] Figure 4 A structural block diagram of an application loading optimization device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0047] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0048] In this application, the terms "comprises", "comprising" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device comprising 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, an element defined by the sentence "comprising a ..." does not exclude the presence of other identical elements in the process, method, article or device comprising the element.

[0049] As banks undergo digital transformation, web applications have become a mainstream market force as they are cross-platform and do not require downloading or installation, thus offering certain advantages in terms of improving user experience and saving development costs.

[0050] With the increasing popularity of the Internet, users have higher and higher requirements for websites, which makes the content of websites more and more complex, and web pages generally have performance problems such as slow loading. For corporate units, user visits determine the download volume and revenue of their applications, and the access speed and response time of the website directly affect user choices. Therefore, performance optimization of page loading is crucial.

[0051] A web page usually contains static resources (such as pictures, audio and video) and dynamic resources (such as various interactive scripts). The loading speed of these resources has a great impact on user experience and server resources, so corresponding strategies need to be adopted to optimize the overall performance of the web page.

[0052] In terms of static resources, caching is mainly used to reduce the number of repeated resource downloads, but dynamic resources are more inclined to interface updates and personalized content, and dynamic resources cannot be cached directly in the browser.

[0053] The inventor has found through research that, under the premise of concurrent connection limit of the browser, although the total number of connections of the browser cannot be directly changed, the order of resource requests can be adjusted. This solution calculates the priority of different resource requests and implements multi-level queue scheduling based on the priority of resource requests, thereby effectively improving the page response speed and rendering speed of the bank's web application and improving the user experience. The following is a detailed description of this solution through various embodiments.

[0054] It should be noted that the following solution will involve calculating the comprehensive priority of resource requests. Here we first explain how to calculate the comprehensive priority of resource requests:

[0055] Assume that there is a request queue waiting to be sent in the application page. Any resource request in the request queue is denoted as q. The data size factor of resource request q is α q , the rendering time factor of resource request q is denoted as β q , the waiting time factor of resource request q is denoted as γ q ; Wherein, the data size factor α is calculated by formula (1), formula (2) and formula (3) respectively q , rendering time factor β q and the waiting time factor γ q .

[0056]

[0057]

[0058] In formula (1) to formula (3), S q is the data size of resource request q, S max is the maximum value of data requested by all resources in the request queue, T min is the minimum rendering time of all resource requests in the request queue, T q The rendering time for resource request q;

[0059] W q is the waiting time required for resource request q, W max is the maximum waiting time of all resource requests in the request queue, W q and W max The ratio of makes the waiting time factor γ q The value of is between 0 and 1, which reflects the scheduling idea of ​​waiting time.

[0060] Based on the above formulas (1) to (3), the comprehensive priority of resource request q is calculated by formula (4).

[0061] P=P init +λ(α q +β q +γ q ) (4)

[0062] In formula (4), P initis the initial priority of the resource request q at any time; λ is the introduced weight factor, which is used to determine the proportion of each factor of the resource request q. The value of λ is: the ratio of the critical running time of all resource requests in the application page to the running time of the queue where the resource request q is located.

[0063] See also Figure 1 , shows a flow chart of an application loading optimization method provided by an embodiment of the present invention, the application loading optimization method comprising:

[0064] Step S101: randomly assigning multiple resource requests issued by an application page to multiple initial queues.

[0065] In the specific implementation of step S101, multiple resource requests issued by an application page (such as a web application page) (or resource requests that the application page needs to load) are divided into several initial queues, and each initial queue is optimized respectively.

[0066] Specifically, multiple resource requests issued by the application page can be randomly and evenly distributed to multiple initial queues; from an overall perspective, the queues involved in this solution are mainly divided into two categories: waiting queues and ready queues. Each waiting queue has a corresponding queue level (that is, the waiting queue is divided into queues with different queue levels). The resource requests in the waiting queue are updated at regular intervals, and the resource requests in the waiting queue with a high queue level are put into the ready queue according to priority. The ready queue processes resource requests according to the principle of "first come, first served".

[0067] It should be noted that, assuming that there are S resource requests issued simultaneously in the application page, then these S resource requests are randomly divided into n initial queues (n>1), each of which contains m resource requests; if the processing time required for each resource request in the ready queue is t e , then the specific content of the average time t of n initial queues is as shown in formula (5).

[0068]

[0069] Since n is greater than 1, when S resource requests are divided into multiple initial queues, the average processing time t must be less than the total time for each resource request to be queued and processed one by one; according to the above content, all resource requests are randomly assigned to n initial queues, and the processing time of each resource request is estimated to give an initial priority. In this way, the multiple initial queues obtained are as follows Figure 2 As shown; Figure 2 In, T1 to T n There are n initial queues, req 1,1 、req 2,1 and req n,1etc. are resource requests in the initial queue.

[0070] Step S102: Determine the processing time of the resource request and the average processing time of all resource requests.

[0071] In the specific implementation of step S102, for each resource request in the initial queue, the processing time of each resource request is determined, and the processing time of each resource request is recorded as T e .

[0072] Determine the average processing time of all resource requests, denoted as T a .

[0073] Step S103: allocating all resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of resource requests in the initial queue.

[0074] It should be noted that for all resource requests in the initial queue, in order to prevent the processing time T of some resource requests from being too long, e The value is too large or too small and the average processing time T a This solution introduces the median processing time of all resource requests, T m , and the critical value T used to judge the length of resource request is obtained through formula (6) c .

[0075] T c =min{T a ,T m}(6)

[0076] For a resource request, if the processing time of the resource request is T e >Threshold value T c , it indicates that the resource request belongs to a long task; otherwise, it indicates that the resource request belongs to a short task.

[0077] Similarly, let the number of resource requests in each initial queue be N. e The average number of resource requests in all initial queues (also called the average number of requests) is recorded as N a , the median number of resource requests of all initial queues is recorded as N m , then the critical value N of the number of resource requests can be obtained by formula (7) c .

[0078] N c =min{N a ,N m}(7)

[0079] In the specific implementation of step S103, the queue level to which the resource requests in the initial queue belong is determined according to the processing time of the resource requests, the average processing time and the number of resource requests in the initial queue; and the resource requests are allocated to the waiting queue corresponding to the queue level to which they belong.

[0080] Specifically, for each resource request in the initial queue, according to the average processing time of the resource request, the processing time of each resource request in the initial queue and the number of resource requests in the initial queue, the critical value T is obtained by combining the above formula (6) and formula (7): c and critical value N c , determine the queue level to which each resource request in the initial queue belongs;

[0081] This solution pre-sets waiting queues of different queue levels. After determining the queue level to which each resource request belongs, the resource request is allocated to the waiting queue corresponding to the queue level to which the resource request belongs.

[0082] For example, the waiting queues are pre-divided into four queue levels, namely, the waiting queue of queue level A, the waiting queue of queue level B, the waiting queue of queue level C, and the waiting queue of queue level D; for each initial queue, the discriminant function shown in formula (8) is used to determine the queue level to which each resource request in the initial queue belongs;

[0083]

[0084] In formula (8), A, B, C, and D represent four queue levels from high to low, N e is the number of resource requests in the initial queue, T e is the processing time of the resource request, F(req) is the queue level to which the resource request belongs;

[0085] If the queue level of a resource request is A, then the resource request is assigned to the waiting queue of queue level A;

[0086] If the queue level of a resource request is B, then the resource request is assigned to the waiting queue of queue level B;

[0087] If the queue level of a resource request is C, then the resource request is assigned to the waiting queue of queue level C;

[0088] If the queue level to which a resource request belongs is D, then the resource request is assigned to the waiting queue with queue level D.

[0089] Step S104: adding the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing.

[0090] In the specific implementation of step S104, after all resource requests are assigned to waiting queues of different queue levels, the comprehensive priority of the resource request is calculated, and the comprehensive priority is less than or equal to the priority threshold, and the priority threshold is set according to the queue level to which the resource request belongs;

[0091] In some embodiments, the specific implementation method of calculating the comprehensive priority of resource requests is: assigning a corresponding initial priority to the resource request according to the processing time of the resource request; calculating the data size factor, rendering time factor and waiting time factor of the resource request through the above formulas (1) to (3); and calculating the comprehensive priority of the resource request based on the initial priority, data size factor, rendering time factor and waiting time factor in combination with the above formula (4).

[0092] It should be noted that the meaning of the weight factor λ mentioned in the above formula (4) and the specific content of the weight factor λ are as shown in formula (9).

[0093]

[0094] In formula (9), m is the total number of requests in the initial queue where the resource request is located, T i is the running time required for the i-th resource request, T c The threshold for determining the length of a resource request.

[0095] In some embodiments, after calculating the comprehensive priority of the resource request, in order to ensure the real-time performance of the comprehensive priority, the comprehensive priority of the resource request needs to be updated periodically, that is, the comprehensive priority of each resource request in the waiting queue is recalculated at regular intervals, and the period T for updating the comprehensive priority is u It can be calculated by formula (10), T a The average processing time for resource requests.

[0096]

[0097] According to the queue level to which the resource request belongs, there exists a mapping relationship T(Q, F(req)) as shown in formula (11) between each resource request in the waiting queue and each individual request task.

[0098]

[0099] In order to avoid the phenomenon of "long queue starvation", this solution sets the priority threshold P(T(Q,F(req))) corresponding to different queue levels based on the idea of ​​prioritizing short tasks and combining the above formula (11). maxThe priority thresholds corresponding to different queue levels are shown in formula (12). The priority thresholds are used to limit the maximum value of the comprehensive priority of resource requests corresponding to different queue levels.

[0100]

[0101] In formula (12), for a resource request whose queue level is A, the maximum value of the comprehensive priority of the resource request is 8; for a resource request whose queue level is B, the maximum value of the comprehensive priority of the resource request is 4, and so on.

[0102] After the comprehensive priority of all resource requests in each waiting queue is calculated, the resource requests in the waiting queue with the highest queue level are added to the ready queue for processing in descending order of the comprehensive priority of each resource request in the waiting queue with the highest queue level.

[0103] That is to say, after calculating the comprehensive priority of each resource request in each waiting queue, for the waiting queue with the highest queue level, the resource requests in the "waiting queue with the highest queue level" are put into the ready queue according to the size of the comprehensive priority, and the ready queue schedules and processes all resource requests according to the "first come, first served" principle.

[0104] Step S105: Update the waiting queue and return to execute step S104 until all resource requests are processed.

[0105] It should be noted that after the resource requests in the "waiting queue with the highest queue level" are put into the ready queue according to the comprehensive priority, the relevant data of the resource requests in each waiting queue (such as processing time, average processing time) will change, and the queue level to which each resource request belongs may also change. Therefore, it is necessary to update the waiting queue (equivalent to updating or re-determining the queue level to which the resource request belongs).

[0106] In the process of implementing step S105, the processing time of resource requests and the average processing time are updated; according to the updated processing time of resource requests, the updated average processing time and the number of resource requests in the waiting queue, all resource requests are reallocated to multiple waiting queues with different queue levels to update the waiting queue, and the process returns to step S104 until all resource requests are processed.

[0107] That is to say, after the resource requests in the "waiting queue with the highest queue level" are put into the ready queue according to the comprehensive priority level, the queue level to which each resource request in the waiting queue belongs is re-determined, thereby updating the resource requests contained in the waiting queue of each queue level, and then returning to execute step S104 to continue to put the resource requests in the "waiting queue with the highest queue level" into the ready queue according to the comprehensive priority level until all resource requests are processed.

[0108] It should be noted that the manner of re-determining the queue level to which the resource request belongs can be referred to the content of "determining the queue level to which the resource request in the initial queue belongs" in the above step S103, which will not be described in detail here.

[0109] It should be noted that there may be errors in the judgment of the processing time of resource requests during the queue scheduling process. In order to ensure that resource requests in multiple waiting queues can be processed in a timely manner, this solution presets the maximum processing time R of a single resource request. The definition of the maximum processing time R is as shown in formula (13).

[0110] R=T e (P init +1)(13)

[0111] In formula (13), T e is the processing time of resource request, P init The initial priority of the resource request.

[0112] In some embodiments, a specified request in a ready queue is returned to a corresponding waiting queue, and the processing time and initial priority of the specified request are adjusted. The specified request is: any resource request that has not been processed after a preset maximum processing time; wherein the "corresponding waiting queue" is the waiting queue from which the specified request originates.

[0113] That is to say, for a certain resource request, if the resource request has not been completed after its corresponding maximum processing time, then the resource request is a designated request; the scheduling process of the designated request is forcibly stopped, and the designated request is returned to the initial waiting queue (the waiting queue from which the designated request originated), and the processing time and initial priority of the designated request are adjusted when the comprehensive priority of the designated request is recalculated.

[0114] For example, for a resource request, if the resource request has not been completed after its corresponding maximum processing time, the scheduling process of the resource request (that is, the specified request) is forced to stop, and the resource request is returned to the initial waiting queue. When the comprehensive priority of the resource request is recalculated, the processing time T of the resource request is e With a 50% increase, the initial priority of that resource request is decreased by 20%.

[0115] In an embodiment of the present invention, multiple resource requests issued by an application page are scheduled through a multi-level queue to ensure that the resource requests of each queue can be processed in a timely manner, reduce the loading time of resources, and improve the page rendering speed and user experience.

[0116] To better understand the above embodiments of the present invention Figure 1 The following content is combined Figure 3 A schematic diagram of an application load optimization method is shown, and a multi-level queue scheduling algorithm is explained.

[0117] Figure 3 In the process, a multi-level waiting queue is first initialized (i.e., waiting queues of different queue levels are initialized), and then the comprehensive priority of each resource request is calculated, and the comprehensive priority is updated periodically; resource requests in the waiting queue with a high queue level are put into the ready queue in descending order of comprehensive priority, and the ready queue is processed according to the principle of "first come, first served"; for a certain resource request, if the resource request is not completed within the maximum processing time, the resource request is returned to the waiting queue; if the resource request is completed within the maximum processing time, the resource request is terminated.

[0118] It can be seen from the contents of the above embodiments that the present solution provides a more complete method for calculating the comprehensive priority of resource requests, and the calculation of the comprehensive priority takes into account multiple factors. When there is a resource request with a large data volume, a long waiting time, and a short rendering time in a web application page, the comprehensive priority of the resource request is higher and will be sent for processing first, thereby ensuring that the document download completion time (Time to DownloadDocument, TDD) and the document start rendering time (Time to Start Render, TSR) are small while avoiding long waiting times for some resource requests to avoid wasting resources. In addition, the present solution can also achieve optimal scheduling of all resource requests in the shortest time, ensuring that each resource request in the waiting queue can be processed in a timely manner, thereby effectively improving the response speed of the web application page, so that various customer financial service websites can bring users richer business content and a smoother interactive experience, thereby improving user experience and satisfaction.

[0119] Corresponding to the application loading optimization method provided by the above embodiment of the present invention, see Figure 4 , the embodiment of the present invention also provides a structural block diagram of an application load optimization device, the application load optimization device includes: a first allocation unit 100, a determination unit 200, a second allocation unit 300, an adding unit 400 and an updating unit 500;

[0120] The first allocating unit 100 is used to randomly allocate multiple resource requests issued by the application page to multiple initial queues.

[0121] The determining unit 200 is used to determine the processing time of the resource request and the average processing time of all resource requests.

[0122] The second allocation unit 300 is used to allocate all resource requests to a plurality of waiting queues with different queue levels according to the processing time, average processing time and number of resource requests in the initial queue.

[0123] The adding unit 400 is used to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing.

[0124] The updating unit 500 is used to update the waiting queue and return to execute the adding unit 400 until all resource requests are processed.

[0125] In the specific implementation, the update unit 500 is specifically used to: update the processing time of resource requests and update the average processing time; according to the updated processing time of resource requests, the updated average processing time and the number of resource requests in the waiting queue, reallocate all resource requests to multiple waiting queues with different queue levels to update the waiting queue, and return to execute the adding unit 400 until all resource requests are processed.

[0126] In an embodiment of the present invention, multiple resource requests issued by an application page are scheduled through a multi-level queue to ensure that the resource requests of each queue can be processed in a timely manner, reduce the loading time of resources, and improve the page rendering speed and user experience.

[0127] Preferably, combined Figure 4 As shown in the figure, the second allocation unit 300 includes a determination subunit and an allocation subunit, and the execution principle of each subunit is as follows:

[0128] The determination subunit is used to determine the queue level to which the resource requests in the initial queue belong according to the processing time, average processing time and number of resource requests in the initial queue.

[0129] The allocation subunit is used to allocate resource requests to the waiting queue corresponding to the queue level to which the resource request belongs.

[0130] Preferably, combined Figure 4 As shown in the figure, the adding unit 400 includes a calculating subunit and an adding subunit, and the execution principle of each subunit is as follows:

[0131] The calculation subunit is used to calculate the comprehensive priority of the resource request. The comprehensive priority is less than or equal to the priority threshold. The priority threshold is set according to the queue level to which the resource request belongs.

[0132] In the specific implementation, the calculation subunit is specifically used to: assign a corresponding initial priority to the resource request according to the processing time of the resource request; calculate the data size factor, rendering time factor and waiting time factor of the resource request; and calculate the comprehensive priority of the resource request based on the initial priority, data size factor, rendering time factor and waiting time factor.

[0133] The adding subunit is used to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing according to the order of the comprehensive priorities of the resource requests in the waiting queue with the highest queue level from high to low.

[0134] Preferably, combined Figure 4 The application loading optimization device further includes:

[0135] The return unit is used to return the specified request in the ready queue to the corresponding waiting queue and adjust the processing time and initial priority of the specified request. The specified request is: any resource request that has not been processed after a preset maximum processing time.

[0136] The priority updating unit is used to periodically update the comprehensive priority of resource requests.

[0137] In summary, the embodiments of the present invention provide an application loading optimization method and device, which schedules multiple resource requests issued by application pages through multi-level queues to ensure that the resource requests of each queue can be processed in a timely manner, reduce resource loading time, and improve page rendering speed and user experience.

[0138] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without creative work.

[0139] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.

[0140] The above description of the disclosed embodiments enables those skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for optimizing application loading, characterized in that: The method comprises: Randomly assign multiple resource requests issued by the application page to multiple initial queues; determining a processing time of the resource request and an average processing time of all the resource requests; Allocate all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue; Add the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing; The waiting queue is updated, and the step of returning to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing is performed until all the resource requests are processed.

2. The method according to claim 1, characterized in that Allocating all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue, including: Determining the queue level to which the resource requests in the initial queue belong according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue; The resource request is allocated to a waiting queue corresponding to the queue level to which the resource request belongs.

3. The method according to claim 2, characterized in that Adding the resource requests in the waiting queue with the highest queue level to the ready queue in sequence for processing includes: Calculating a comprehensive priority of the resource request, where the comprehensive priority is less than or equal to a priority threshold, and the priority threshold is set according to a queue level to which the resource request belongs; According to the order of the comprehensive priorities of the resource requests in the waiting queue with the highest queue level from high to low, the resource requests in the waiting queue with the highest queue level are sequentially added to the ready queue for processing.

4. The method according to claim 3, characterized in that Calculating the comprehensive priority of the resource request, including: assigning a corresponding initial priority to the resource request according to the processing time of the resource request; Calculating a data size factor, a rendering time factor, and a waiting time factor of the resource request; The comprehensive priority of the resource request is calculated according to the initial priority, the data size factor, the rendering time factor and the waiting time factor.

5. The method according to claim 1, characterized in that The waiting queue is updated, and the step of returning to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing until all the resource requests are processed includes: Updating the processing time of the resource request and updating the average processing time; According to the updated processing time of the resource requests, the updated average processing time and the number of resource requests in the waiting queue, all the resource requests are reallocated to a plurality of waiting queues with different queue levels to update the waiting queue, and the step of sequentially adding the resource requests in the waiting queue with the highest queue level to the ready queue for processing is returned to be executed until all the resource requests are processed.

6. The method according to any one of claims 1 to 5, characterized in that: Also includes: The designated request in the ready queue is returned to the corresponding waiting queue, and the processing time and initial priority of the designated request are adjusted, wherein the designated request is any resource request that has not been processed after a preset maximum processing time.

7. The method according to claim 3 or 4, characterized in that: Also includes: The comprehensive priority of the resource request is periodically updated.

8. An application loading optimization device, characterized in that: The device comprises: A first allocation unit, configured to randomly allocate multiple resource requests issued by the application page to multiple initial queues; a determining unit, configured to determine a processing time of the resource request and an average processing time of all the resource requests; A second allocation unit, configured to allocate all the resource requests to a plurality of waiting queues with different queue levels according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue; An adding unit, used for sequentially adding the resource requests in the waiting queue with the highest queue level to the ready queue for processing; The updating unit is used to update the waiting queue and return to execute the adding unit until all the resource requests are processed.

9. The device according to claim 8, characterized in that The second allocation unit comprises: a determination subunit, configured to determine the queue level to which the resource requests in the initial queue belong according to the processing time of the resource requests, the average processing time and the number of the resource requests in the initial queue; The allocation subunit is used to allocate the resource request to the waiting queue corresponding to the queue level to which it belongs.

10. The device according to claim 9, characterized in that The adding unit comprises: a calculation subunit, configured to calculate a comprehensive priority of the resource request, wherein the comprehensive priority is less than or equal to a priority threshold, and the priority threshold is set according to a queue level to which the resource request belongs; The adding subunit is used to sequentially add the resource requests in the waiting queue with the highest queue level to the ready queue for processing according to the order of the comprehensive priorities of each resource request in the waiting queue with the highest queue level from high to low.