Resource allocation method and system for application program

By limiting the number of parallel execution task requests in the background task queue, the lag and delay problems caused by multiple applications competing for resources in the terminal device are solved, and the stable performance of foreground applications and the efficiency of background resource operations are achieved.

CN119902877APending Publication Date: 2025-04-29BEIJING DIDI INFINITY TECH & DEV CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311413007.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-27
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

When multiple applications running in the background of the terminal device compete for system resources, it may cause problems such as lag and delay in the foreground application.

Method used

By adding task requests from pending applications to the task queue in the background and limiting the number of task requests in the execution queue to not exceed the preset value, we realize parallel task requests, and at the same time add the exceeded task requests to the waiting queue to obtain new task requests in order.

Benefits of technology

It effectively avoids the problem of lag and delay in front-end applications caused by resource competition, and ensures the resource operation of multiple back-end applications and the performance of front-end applications.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119902877A_ABST
    Figure CN119902877A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a resource allocation method and system for an application program. The method comprises the steps of obtaining a to-be-processed application program, wherein the to-be-processed application program is an application program closed on a display interface of the terminal equipment; adding one or more task requests of the to-be-processed application program into a background task queue, wherein the task queue comprises an execution queue; and executing the task requests in the execution queue in parallel, wherein the number of the task requests in the execution queue does not exceed a preset value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of resource allocation, and in particular to a resource configuration method and system for an application. Background Art

[0002] When an application (e.g., mobile phone application, mini-app, etc.) is in use, it will not exit immediately after being closed, but will remain in the background of the terminal device (e.g., mobile phone) for a period of time, and during this period, the application can still access system resources (e.g., network, Bluetooth, memory, etc.). When multiple applications enter the background at the same time, the application currently being used in the foreground (e.g., the application currently displayed on the display interface of the terminal device) may experience freezes, delays, etc. due to competition with the background application for system resources, thereby affecting the use of the foreground application.

[0003] Based on this, it is desired to propose a resource configuration method and system for an application program to avoid problems such as application freezes and delays caused by resource competition. Summary of the invention

[0004] In one or more embodiments of the present specification, a resource configuration method for an application is provided. The resource configuration method for an application includes: obtaining an application to be processed, wherein the application to be processed is an application that is closed on the display interface of a terminal device; adding one or more task requests of the application to be processed to a background task queue, wherein the task queue includes an execution queue; and executing the task requests in the execution queue in parallel, wherein the number of task requests in the execution queue does not exceed a preset value.

[0005] In one or more embodiments of the present specification, a resource configuration system for an application is provided. The resource configuration system for the application includes: an acquisition module for acquiring an application to be processed, wherein the application to be processed is an application that is closed on the display interface of a terminal device; a management module for adding one or more task requests of the application to be processed to a background task queue, wherein the task queue includes an execution queue; and an execution module for executing the task requests in the execution queue in parallel, wherein the number of task requests in the execution queue does not exceed a preset value.

[0006] In one or more embodiments of the present specification, a resource configuration device for an application is provided, which includes: at least one storage medium storing computer instructions; and at least one processor executing the computer instructions to implement the resource configuration method for the application as described above.

[0007] One or more embodiments of the present specification provide a computer-readable storage medium that stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the resource configuration method for the application as described above. BRIEF DESCRIPTION OF THE DRAWINGS

[0008] This specification will be further described in the form of exemplary embodiments, which will be described in detail by the accompanying drawings. These embodiments are not restrictive, and in these embodiments, the same number represents the same structure, wherein:

[0009] Figure 1 It is a schematic diagram of an application scenario of a resource configuration system for an application program according to some embodiments of this specification;

[0010] Figure 2 is a module diagram of a resource configuration system for an application program according to some embodiments of this specification;

[0011] Figure 3 is an exemplary flow chart of a resource configuration method for an application program according to some embodiments of this specification;

[0012] Figure 4 is an exemplary flow chart of executing a queue to obtain a task request according to some embodiments of this specification;

[0013] Figure 5 is an exemplary flow chart of the sorting of update task requests in a waiting queue according to some embodiments of this specification;

[0014] Fig. 6A is a schematic diagram of a task queue according to some embodiments of this specification;

[0015] Figure 6B is a schematic diagram of sorting task requests in a waiting queue according to some embodiments of this specification;

[0016] Figure 6C is a schematic diagram of the ordering of update task requests in a waiting queue according to some embodiments of this specification;

[0017] Fig.6D It is a schematic diagram of obtaining a task request from a waiting queue and adding it to an execution queue according to some embodiments of this specification;

[0018] Fig. 6E It is a schematic diagram of the ordering of update task requests in a waiting queue according to other embodiments of this specification. DETAILED DESCRIPTION

[0019] In order to more clearly illustrate the technical solutions of the embodiments of this specification, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of this specification. For ordinary technicians in this field, this specification can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.

[0020] It should be understood that the "system", "device", "unit" and / or "module" used herein are a method for distinguishing different components, elements, parts, portions or assemblies at different levels. However, if other words can achieve the same purpose, the words can be replaced by other expressions.

[0021] As shown in this specification and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "comprise" and "include" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.

[0022] Flowcharts are used in this specification to illustrate the operations performed by the system according to the embodiments of this specification. It should be understood that the preceding or following operations are not necessarily performed precisely in order. Instead, the steps may be processed in reverse order or simultaneously. At the same time, other operations may also be added to these processes, or one or more operations may be removed from these processes.

[0023] Figure 1 Schematic diagram of an application scenario of a resource configuration system for an application program according to some embodiments of this specification. Figure 1 As shown, an application scenario 100 of the resource configuration system for an application may include a user 110 and a terminal device 120 .

[0024] The user 110 refers to a person who controls the terminal device 120, for example, a user of the terminal device 120, a research and development personnel, etc. The user 110 can issue an operation instruction to the terminal device 120 by voice, manual input, touch, etc., for example, by touch, initiate an application startup or shutdown instruction, call an application function, etc. In some embodiments, the user 110 may be the owner of the terminal device 120.

[0025] The terminal device 120 refers to a device capable of running an application program, and may include an independent terminal device (eg, a mobile device, a tablet computer, a laptop computer, a desktop computer, etc. or any combination thereof), a vehicle-mounted terminal device (eg, a vehicle-mounted tablet computer), etc.

[0026] An application refers to a computer software program with a specific function (e.g., image editing, audio playback, etc.). For example, an application may include a program application that can realize at least one of the functions of video, reading, social networking, finance, services, music, entertainment, etc. In some embodiments, the application may include a first type of application and a second type of application. The first type of application refers to an application that needs to be downloaded and installed to the terminal device to run. For example, the first type of application may include navigation apps (e.g., Amap, Baidu Map, etc.), audio playback apps (e.g., QQ Music, NetEase Cloud Music, etc.), shopping apps (e.g., Taobao, JD.com, etc.), and social apps (e.g., DingTalk, WeChat, QQ, etc.) that need to be downloaded and installed to run. The second type of application refers to a lightweight application that uses other applications (e.g., the first type of application) as a host program and can run its functions on a terminal device without downloading and installing, also known as a mini-program application. For example, the second type of application may include a game mini-program, a taxi mini-program, etc. that uses a social app (e.g., WeChat, DingTalk, QQ, etc.) as a host platform. It is understandable that the second category of applications refers to applications that use other applications as host programs, which means that the second category of applications need to be started or closed via the host program (for example, the user starts the corresponding applet through the applet start button on the host program), and can call the data obtained by the host program. However, the process of the second category of applications can run independently without being affected by the host program, and can implement functions different from those of the host program. In some embodiments, the application may also include other types of programs, such as patches, plug-ins, etc., which are not limited here. In some embodiments, the terminal device 120 may install one or more applications.

[0027] like Figure 1 As shown, the terminal device 120 may include a foreground 121 and a background 122. The application currently being used by the user is called the main program application (foreground application). When the current application is closed, the application will enter the background mode (background application), and the process will be managed by the container background (hereinafter referred to as the background).

[0028] The front desk 121 refers to the part of the terminal device 120 that interacts with the user 110, such as the touch-sensitive display screen and its display interface of the terminal device 120. The front desk 121 can receive operation instructions issued by the user 110 and transmit the above operation instructions to the back desk 122. The front desk 121 can also show the running results of the application to the user 110, for example, displaying the main page of the application in response to the user's start instruction, displaying the relevant function page in response to the user's selection instruction of the function button, etc.

[0029] The background 122 refers to the program running system of the terminal device 120. The background 122 may include a processing device (for running applications and creating task requests for applications), a storage unit (for storing input data of the user 110 and / or data generated during the running of the application), etc. The background 122 can run the corresponding application (create a task request for the application and execute it) according to the operation instruction, and then return the running result to the foreground 121. The background 122 can run multiple applications at the same time, that is, it can execute task requests of multiple applications in parallel. Parallel execution means that the background of the terminal device can allocate the required system resources to each task request being executed, so that each task request can execute its task content at the same time. For example, Figure 1 As shown, the background 122 can simultaneously run application 131 (such as a navigation APP), application 132 (such as a social APP), etc. During the running of the application, the background 122 can concurrently execute task requests 131-1 (such as downloading files), task requests 131-2 (such as network access), and task requests 131-3 (such as Bluetooth access) included in the application 131, as well as task requests 132-1, task requests 132-2, and task requests 132-3, etc. included in the application 132.

[0030] Due to business needs or user demands, multiple applications or applets installed on the terminal device are often switched back and forth, resulting in multiple applications existing in the background at the same time. For example, switching between different social apps (such as WeChat, DingTalk, QQ, etc.) or switching between apps with different functions (such as switching between map navigation and social software). An application that enters the background will not exit immediately, but will be retained for a period of time, during which time the application can still access the network, Bluetooth and other system resources of the terminal device.

[0031] In the resource processing scheme for background applications, the task queue usually executes resource operations of multiple background applications concurrently according to the first-come, first-served policy. However, when the task requests in the task queue have not been completed, and new task requests are generated and need to be executed over time, due to problems such as the performance of the terminal device, the foreground application will experience network delays and freezes due to resource competition.

[0032] In an embodiment of the present specification, a method for resource configuration of an application is provided. By limiting the maximum concurrency of the execution queue (the maximum number of parallel executions), the excess task requests are added to the waiting queue. When the task requests in the execution queue are completed, new task requests are obtained from the waiting queue in sequence. This can ensure that multiple background applications occupy a certain amount of resources for operation without affecting the performance of the foreground application.

[0033] Figure 2 Schematic diagram of a module of a resource configuration system for an application program according to some embodiments of this specification. Figure 2 As shown, the resource configuration system 200 of the application may include an acquisition module 210, a management module 220 and an execution module 230. In some embodiments, the resource configuration system 200 is a part of the terminal device 120.

[0034] The acquisition module 210 can be used to acquire the pending application, which is an application that is closed on the display interface of the terminal device. For more information about the functions of the acquisition module 210, see Figure 3 and its related description.

[0035] The management module 220 may be used to add one or more task requests of the to-be-processed application to a background task queue, where the task queue includes an execution queue.

[0036] In some embodiments, the management module 220 is further used to sort the task requests in the waiting queue according to priority; when the task requests in the execution queue are completed, a corresponding number of task requests are obtained from the waiting queue according to the sorting and added to the execution queue.

[0037] In some embodiments, the management module 220 is further used to obtain target task requests in the waiting queue whose waiting time exceeds a preset time; and adjust the position of the target task request in the waiting queue. For more information about the functions of the management module 220, see Figure 3 , Figure 4 and / or Figure 5 and its related description.

[0038] The execution module 230 can be used to execute the task requests in the execution queue in parallel, and the number of task requests in the execution queue does not exceed a preset value. For more information about the functions of the execution module 230, see Figure 3 and its related description.

[0039] It should be noted that the above description of the resource configuration system and its modules of the application is only for the convenience of description and cannot limit this specification to the scope of the embodiments. It is understandable that for those skilled in the art, after understanding the principle of the system, it is possible to arbitrarily combine the modules or form a subsystem to connect with other modules without deviating from this principle. In some embodiments, Figure 2 The acquisition module 210, management module 220 and execution module 230 disclosed in the specification can be different modules in a system, or one module can realize the functions of two or more modules. For example, each module can share a storage module, or each module can have its own storage module. Such variations are all within the protection scope of this specification.

[0040] Figure 3 is an exemplary flow chart of a resource configuration method for an application program according to some embodiments of this specification. Figure 3 As shown, the process 300 includes the following steps: In some embodiments, the process 300 may be executed by the terminal device 120 or the resource configuration system 200 of the application.

[0041] Step 310 , obtaining the application to be processed. In some embodiments, step 310 may be performed by the obtaining module 210 .

[0042] The application to be processed is an application that is closed on the display interface of the terminal device (such as the terminal device 120). In some embodiments, the application to be processed may include a program application (such as a first type of application) that is directly downloaded and installed on the terminal device (such as the terminal device 120), and / or a small program application (such as a second type of application) that does not need to be downloaded and installed but can be run on the terminal device (such as the terminal device 120).

[0043] When an application is closed, it means that the application exits the foreground and enters the background running state. When an application is closed, it no longer occupies the foreground display interface of the terminal device, that is, no relevant content of the application (such as the main page of the application, the function buttons contained therein, the running results obtained after the operation button, etc.) is displayed on the display interface. When the application is closed on the display interface, the processing device of the terminal device will not destroy it immediately, but will retain it in the background for a certain period of time (such as the first time period). That is, the terminal device still executes the task request of the closed application in the background, and terminates the execution of the task request of the application after the first time period, releasing the system resources occupied by the application (for example, network bandwidth, memory, etc.). If the user pulls up the closed application again within the first time period (such as within 20 minutes) (such as clicking to enter the application), the application can be hot-started to avoid restarting. The length of the first time period can be preset manually, for example, it can be preset to 20 minutes. For more information about terminal devices and applications, please refer to Figure 1 and its related description.

[0044] In some embodiments, the duration of the first time period can be adjusted in real time based on the performance of the terminal device, the amount of system resources occupied by the application to be processed, etc. The performance of the terminal device refers to the strength of the terminal device's ability to execute task requests (such as the strength of the processing device's processing power, memory size, cache performance, etc.). The stronger the performance of the terminal device, the shorter the time required for the terminal device to execute a single task request and / or the greater the number of task requests that can be executed concurrently. For example, the worse the performance of the terminal device, the more system resources are occupied by the application to be processed, and the shorter the duration of the first time period.

[0045] In some embodiments, the acquisition module 210 can acquire the pending application based on the closing time of each application and / or the first time period. For example, assuming that the closing time of a certain application is 13:15:10, the first time period is preset to 20 minutes, and the current time is 13:19:25, then the time interval between the current time and the closing time is 4 minutes and 15 seconds (less than the first time period), and the application will be determined as a pending application and acquired.

[0046] Step 320 , adding one or more task requests of the pending application to a background task queue, wherein the task queue includes an execution queue. In some embodiments, step 320 may be performed by the management module 220 .

[0047] A task request refers to a computing task created by a program execution system (e.g., a background processor of the terminal device 120) to achieve the function of an application. For example, a task request can be a process or thread of an application (e.g., downloading a file, calling Bluetooth, calling a network interface, etc.).

[0048] A task queue refers to an ordered sequence of task requests of pending applications. At least one task request in a task queue can be orderly executed in parallel by the background of a terminal device. The task requests in a task queue can be sorted based on their creation time, for example, the earlier the creation time, the higher the position of the task request in the task queue. In some embodiments, the task requests in a task queue can be sorted based on the time when the application to which it belongs enters the background.

[0049] Fig. 6A FIG. 1 is a schematic diagram of a task queue according to some embodiments of this specification. Fig. 6A As shown, in the order of creation time (as shown in the timeline of the figure), the task queue includes task request C1, task request A2, task request B2, task request A1, task request C2, task request B1, task request A3, task request C3, task request A4 and task request B3, etc. Among them, task request A1, task request A2, task request A3 and task request A4 are task requests of application A to be processed, task request B1, task request B2 and task request B3 are task requests of application B to be processed, and task request C1, task request C2 and task request C3 are task requests of application C to be processed.

[0050] In some embodiments, the task queue includes an execution queue. The number of task requests in the execution queue does not exceed a preset value. The execution queue refers to a sequence of task requests in the task queue that are being concurrently executed by the background of the terminal device. The size of the preset value can be preset manually. For example, the preset value can be preset to 3, 5, 7, 10, etc.

[0051] In some embodiments, the management module 220 may determine the preset value based on the performance of the terminal device, the resource occupation of the application to be processed, etc. For example, the worse the performance of the terminal device (such as the processing power of the central processing unit, memory performance, etc.), the smaller the preset value. For another example, the greater the amount of system resources occupied by the application to be processed, the smaller the preset value.

[0052] In some embodiments, the preset value can be adjusted in real time according to the execution of the task request. For example, the initial preset value is 5, and in response to the fact that the execution time of the first number of task requests is greater than the second time period, the value of the preset value is increased by the second amount. Among them, both the first number and the second time period can be preset, for example, the first number is preset to 2, and the second time period is preset to 10 minutes. The second number can be calculated based on the first number, for example, the second number can be equal to half of the first number (if the calculation result is not an integer, it is rounded up).

[0053] In some embodiments, the management module 220 may add the task requests with a higher order to the execution queue according to the order of the task requests in the task queue, such as adding the task requests with a number equal to or less than a preset value to the execution queue.

[0054] Still Fig. 6A For example, Fig. 6A As shown, the preset value is preset to 5. Based on this, the top five task requests in the task queue (including task request C1, task request A2, task request B2, task request A1 and task request C2) are added to the execution queue and executed by the corresponding task modules (such as download module, network module, Bluetooth module, etc.).

[0055] In some embodiments, the task queue may also include a wait queue.

[0056] The waiting queue refers to the sequence of task requests in the task queue that have not been added to the execution queue.

[0057] In some embodiments, when the number of task requests in the execution queue exceeds a preset value, the excess task requests are added to a waiting queue.

[0058] Still Fig. 6A For example, Fig. 6A As shown, the preset value is preset to 5, and the five task requests (including task request C1, task request A2, task request B2, task request A1 and task request C2) that are ranked first in the task queue according to the timeline have been added to the execution queue. At this time, the total amount of task requests in the task queue reaches the preset value, and other task requests (including task request B1, task request A3, task request C3, task request A4 and task request B3, etc.) that exceed the preset value are added to the waiting queue.

[0059] It is understandable that after the waiting queue is created, if the background creates a new task request for an existing pending application, or a new pending application enters the background and creates a task request for it, the above two task requests can be added to the subsequent positions of the waiting queue in real time according to the order of creation time, such as according to Fig. 6A The timeline shown adds new task requests to the waiting queue.

[0060] In some embodiments of this specification, the task queue is divided into an execution queue and a waiting queue, so that the total number of task requests executed in parallel does not exceed a preset value, thereby avoiding the situation where too many task requests compete for system resources and cause the foreground application to freeze when they are executed simultaneously. The preset value is determined / adjusted according to the performance of the terminal device, the resource usage of the application, the execution status of the task request, etc., so that the size of the preset value is more adaptable and flexible, and the execution efficiency of the task request is guaranteed while avoiding the above-mentioned freeze in the foreground application.

[0061] In some embodiments, the task requests in the waiting queue may be sorted based on the creation time. For example, the task request with an earlier creation time is ranked higher in the waiting queue.

[0062] In some embodiments, the management module 220 can sort the task requests in the waiting queue according to the priority; when the task requests in the execution queue are completed, the corresponding number of task requests are obtained from the waiting queue according to the sorting and added to the execution queue. For more information about the above embodiments, please refer to Figure 4 and its related description.

[0063] In some embodiments, the number of task requests in the waiting queue may be less than or equal to a preset number value, such as 10, 20, 30, 50, etc. In some embodiments, the number of task requests in the waiting queue may be unlimited.

[0064] Step 330, execute the task requests in the execution queue in parallel. In some embodiments, step 330 may be executed by the execution module 230. For more information about parallel execution, see Figure 1 and its related description.

[0065] Still Fig. 6A For example, Fig. 6A As shown, task request C1, task request A2, task request B2, task request A1 and task request C2 in the execution queue are executed in parallel. When one or more task requests in the execution queue are completed, a corresponding number of task requests can be obtained from the waiting queue, and the corresponding number of task requests can be added to the execution queue, and the corresponding task modules continue to execute them in parallel. For more details, see Figure 4 Related description.

[0066] In some embodiments of the present specification, the task queue is divided into an execution queue and a waiting queue through the resource configuration method of the above-mentioned application, and the number of task requests in the execution queue is controlled, and the task requests in the waiting queue are prioritized, thereby avoiding problems such as freezes and delays caused by competition for system resources by the application's task requests.

[0067] It should be noted that the above description of process 300 is only for example and illustration, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to process 300 under the guidance of this specification. However, these modifications and changes are still within the scope of this specification. For example, the value of the second quantity is fixed to 1.

[0068] Figure 4 FIG. 1 is an exemplary flow chart of executing a queue to obtain a task request according to some embodiments of this specification. Figure 4 As shown, the process 400 includes the following steps: In some embodiments, the process 400 may be executed by the terminal device 120 or the resource configuration system 200 (eg, the management module 220).

[0069] Step 410: sort the task requests in the waiting queue according to their priorities.

[0070] The priority can reflect the priority of the task request in the waiting queue when it is transferred to the execution queue. For example, the priority can be represented by the first priority, the second priority, the third priority, etc., and the priority decreases in sequence. The higher the priority of the task request in the waiting queue, the earlier it is transferred to the execution queue.

[0071] In some embodiments, the management module 220 can determine the priority of the task request of the pending application based on the time when the pending application is closed. For example, the later the pending application is closed, the higher the priority of its task request. The later the application is closed, the closer the time when the application is accessed by the user is to the current time.

[0072] In some embodiments, the priority can be determined based on the access time of the pending application to which the task request belongs. Access refers to the process in which the user calls the pending application running in the background to the foreground through an application call instruction, or starts to enter the application by clicking the relevant button on the main screen of the terminal device to control it or display its running results. For example, the later the pending application is accessed, the higher the priority of its task request. Specifically, assuming that the order of time when pending applications A, B, and C are closed is CBA, then application A is the most recently accessed by the user from the current time, and its priority is the highest, followed by B and C.

[0073] It is understandable that the priorities of task requests belonging to different pending applications may be the same. For example, assuming that pending application A and pending application B are accessed at the same time, the priorities of task requests belonging to the two pending applications are the same.

[0074] In some embodiments, the priority may be determined based on the usage frequency of the to-be-processed application to which the task request belongs and / or user preferences.

[0075] Usage frequency refers to data reflecting how frequently a user accesses an application to be processed. Usage frequency can be represented by the number of times a user accesses an application within a unit of time (e.g., 1 hour, 1 day, 1 week, 1 month). For example, the usage frequency of an application may be 5 times / hour, which means that the user accessed the application 5 times within 1 hour, i.e., performed 5 "start-stop" operations.

[0076] User preferences refer to data that reflects the user's preference for the application to be processed. User preferences can be represented by the average daily access time of the user to the application to be processed. For example, the user preference of a certain application can be 3 hours / day, which means that the average daily access time of the user to the application is 3 hours.

[0077] In some embodiments, the greater the usage frequency of the application to be processed and / or the greater the value of the user preference, the higher the priority of the task request of the application to be processed.

[0078] In some embodiments, the management module 220 may sort the task requests in the waiting queue based on the priorities of the task requests in the waiting queue. For example, the higher the priority of a task request, the higher its sorting order.

[0079] Figure 6B FIG. 1 is a schematic diagram of sorting task requests in a waiting queue according to some embodiments of this specification. Figure 6B As shown, the waiting queue shown in the first column includes task request B1, task request A3, task request C3, task request A4 and task request B3. If the priorities of task request B1, task request A3, task request A4 and task request B3 are the same and higher than the priority of task request C3, then Figure 6B As shown in the second column, task request B1, task request A3, task request A4 and task request B3 are ranked first, and task request C3 is ranked last.

[0080] In some embodiments, if there are task requests belonging to different pending applications with the same priority, the order of the task requests is adjusted so that the task requests belonging to the same pending application are adjacent in order. In addition, based on the above adjustment, the order of the task requests belonging to different pending applications can be random or can be ordered according to a preset rule. For example, the preset rule can be that the task requests of the pending application that occupies less system resources are ordered higher.

[0081] For example, continuing with the previous example, Figure 6B As shown in the second column, task request B1, task request A3, task request A4 and task request B3 have the same priority, and task request A3 and task request A4 belong to pending application A, and task request B1 and task request B3 belong to pending application B. At this time, the order of the above four task requests can be adjusted, such as Figure 6B As shown in the third column of , task request A3 is adjacent to task request A4, and task request B1 is adjacent to task request B3. On this basis, Figure 6B As shown in the third column, if the amount of system resources occupied by the pending application A is less than that of the pending application B, the order of task request A3 and task request A4 is higher than that of task request B1 and task request B3.

[0082] In some embodiments, the management module 220 may sort multiple tasks belonging to the same to-be-processed application based on the type of task request and / or user usage, etc.

[0083] The types of task requests can include input, operation, and output. Input task requests refer to task requests that identify and classify user input content; operation task requests refer to task requests that analyze and operate existing data; and output task requests refer to task requests that convert analysis or operation results into a form recognizable by the front desk and transmit them to the front desk.

[0084] User usage refers to data that reflects the probability of a task request being created during the historical operation of the pending application to which the task request belongs. For example, pending application A has been run in the background 10 times, and task request A1 was created 6 times. Then the user usage of task request A1 is 60% (that is, when pending application A is running, there is a 60% probability that task request A1 will be created).

[0085] It is understandable that when the pending application to which the task request belongs is running, the task request may not be created. For example, task request A1 corresponds to function a1 of pending application A (for example, audio playback function), and task request A2 corresponds to function a2 of pending application A (for example, audio download function). When the user runs pending application A and only uses its function a2, task request A1 will not be created.

[0086] In some embodiments, the management module 220 may sort different types of task requests belonging to the same application to be processed according to a preset type order rule. For example, the type order rule may be that the output type is first, the input type is second, and the operation type is last.

[0087] In some embodiments, the management module 220 may sort different types of task requests belonging to the same to-be-processed application program based on user usage in descending order of user usage values.

[0088] Still Figure 6B For example, Figure 6B As shown in the third column, the task requests in the waiting queue have been sorted according to priority into task request A3, task request A4, task request B1, task request B3, and task request C3. Assume that the sorting of multiple task requests belonging to the same pending application is based on user usage, and among task requests A3 and A4 belonging to pending application A, the user usage value of task request A4 is greater than the user usage value of task request A3, and among task requests B1 and B3 belonging to pending application B, the user usage value of task request B1 is greater than the user usage value of task request B3. Then Figure 6B As shown in the fourth column, the order of task request A4 can be raised to before task request A3, and the order of task request B1 and task request B3 remains unchanged.

[0089] In some embodiments of the present specification, the priority of the determined task request is made more adaptable through the above-mentioned priority determination method, so that the sorting result of the task request based on the priority can well meet the user's running requirements for the application program; after sorting the task requests based on the priority, the sorting is further adjusted based on the type of task request and / or user usage, thereby further improving the degree to which the sorting result meets the above-mentioned running requirements.

[0090] In some embodiments, the management module 220 may update the order of the task requests in the waiting queue according to the waiting time of each task request in the waiting queue. The waiting time refers to the length of time after the task request is placed in the waiting queue.

[0091] The method for updating the order of the task requests in the waiting queue may be: adjusting the order of the task requests based on the time range of the waiting time of the task requests. For example, the order of the task requests with a waiting time between 5 and 10 minutes may be adjusted forward by 1 place, the order of the task requests with a waiting time between 10 and 15 minutes may be adjusted forward by 2 places, and so on.

[0092] Figure 6C FIG. 1 is a schematic diagram of the order of update task requests in a waiting queue according to some embodiments of this specification. Figure 6CAs shown in the first column, the current order of the task requests in the waiting queue is task request A4, task request A3, task request B1, task request B3, and task request C3. Assuming that the waiting time of task request C3 is 11 minutes and the number of bits adjusted forward for task requests with waiting times between 10 and 15 minutes is 2, task request C3 is adjusted forward by 2 bits. Figure 6C As shown in the second column, the order of the task requests in the updated waiting queue is task request A4, task request A3, task request C3, task request B1, and task request B3.

[0093] In some embodiments, the management module 220 can obtain the target task request whose waiting time in the waiting queue exceeds the preset time; and adjust the position of the target task request in the waiting queue. Figure 4 and its related description.

[0094] In some embodiments of the present specification, the method for adjusting the order of task requests in the waiting queue is used to enable task requests that have been waiting for a long time and were originally ordered later to be executed first, thereby avoiding the situation where a task request cannot be executed for a long time and affects the operation of the application to be processed, thereby optimizing the user experience.

[0095] Step 420: When the task requests in the execution queue are executed, a corresponding number of task requests are obtained from the waiting queue according to the order and added to the execution queue.

[0096] Fig.6D FIG. 1 is a schematic diagram of obtaining a task request from a waiting queue and adding it to an execution queue according to some embodiments of this specification. Fig.6D As shown in the first column, the execution queue includes task requests C1, A2, B2, A1, and C2 that are being executed in parallel, and the waiting queue includes task requests A4, A3, B1, B3, and C3 that have been sorted. Fig.6D As shown in the second column, assuming that after a period of time, task request A2 and task request B2 are completed, then Fig.6D As shown in the third column, task request A2 and task request B2 are removed from the execution queue, and the two task requests ranked first in the waiting queue (i.e., task request A4 and task request A3) are removed from the waiting queue and added to the execution queue (as shown by the arrows in the figure), so that these two task requests can be executed. Fig.6D As shown in the fourth column, the task requests being executed in parallel in the execution queue include task request C1, task request A4, task request A3, task request A1 and task request C2.

[0097] In some embodiments of the present specification, through the above-mentioned method of sorting task requests in the waiting queue and obtaining task requests from the waiting queue and adding them to the execution queue, the execution order of task requests can well meet the user's requirements for the operation of the application, and effectively reduce the possibility of problems such as freezes and delays in the application, thereby greatly optimizing the user experience.

[0098] It should be noted that the above description of the process 400 is only for example and explanation, and does not limit the scope of application of this specification. For those skilled in the art, various modifications and changes can be made to the process 400 under the guidance of this specification. However, these modifications and changes are still within the scope of this specification. For example, the task requests in the waiting queue can be sorted using a trained sorting model. For another example, the sorting of the task requests in the waiting queue can be updated by updating the model.

[0099] Figure 5 FIG. 1 is an exemplary flow chart of the ordering of update task requests in a waiting queue according to some embodiments of this specification. Figure 5 As shown, the process 500 includes the following steps: In some embodiments, the process 500 may be executed by the terminal device 120 or the resource configuration system 200 (eg, the management module 220).

[0100] Step 510: Obtain target task requests in the waiting queue whose waiting time exceeds a preset time.

[0101] The waiting time refers to the length of time from the time the task request enters the waiting queue to the present.

[0102] The duration of the preset time can be preset manually, for example, it can be preset to 10 minutes. In some embodiments, the preset time can be determined according to the frequency of use, importance, user preferences, etc. of the application to which the task request belongs. In some embodiments, the preset time of each task request can be the same or different. In some embodiments, the preset time can be dynamically adjusted according to the execution status of the task request in the execution queue, the performance of the terminal device (such as the execution capability of the processing device, the memory size, etc.), etc.

[0103] The target task request refers to the task request whose waiting time in the waiting queue exceeds the preset time.

[0104] In some embodiments, the management module 220 may be configured with a timing device to count the waiting time of each task request in the waiting queue in real time. The management module 220 may obtain the current waiting time of each task request in the waiting queue in real time based on the timing device, and determine the task request whose waiting time exceeds the preset time as the target task request.

[0105] Step 520: adjust the position of the target task request in the waiting queue.

[0106] In some embodiments, the management module 220 may adjust the position of the target task request to the front position of the waiting queue or move it forward by a preset number of positions.

[0107] Fig. 6E FIG. 1 is a schematic diagram of the order of update task requests in a waiting queue according to other embodiments of this specification. Fig. 6E As shown in the first column, the existing order of the task requests in the waiting queue is task request A4, task request A3, task request B1, task request B3, and task request C3. Assuming that the preset duration is preset to 15 minutes, the waiting durations of the above five task requests are 6 minutes, 8 minutes, 16 minutes, 12 minutes, and 17 minutes respectively, and the waiting durations of task request B1 and task request C3 exceed the preset time. Then task request B1 and task request C3 can be determined as target task requests, and these two target task requests can be adjusted to the front position of the waiting queue, as shown in FIG. Fig. 6E As shown in the second column, the adjusted order of the task requests in the waiting queue is task request B1, task request C3, task request A4, task request A3, and task request B3.

[0108] In some embodiments, the management module 220 may place the target task request with the longest waiting time at the front of the waiting queue.

[0109] Continuing with the above example, Fig. 6E For example, Fig. 6E As shown in the second column, the order of the task requests in the waiting queue has been adjusted to task request B1, task request C3, task request A4, task request A3, and task request B3 based on the above method. Since the waiting time of task request C3 (17 minutes) is the maximum waiting time among the above five task requests, the order of task request C3 can be adjusted to the front position of the waiting queue, as shown in FIG. Fig. 6E As shown in the third column, the adjusted order of the task requests in the waiting queue is task request C3, task request B1, task request A4, task request A3, and task request B3.

[0110] In some embodiments, the management module 220 can directly add a preset number of target task requests with the longest waiting time to the execution queue. The value of the preset number can be preset manually, for example, it can be preset to 1, 2, 3, etc. It can be understood that when a preset number of target task requests with the longest waiting time are added to the execution queue, the value of the preset value of the execution queue is also increased by the preset number. For example, assuming that the preset value of the execution queue is 5 and the preset number is 1, when the preset number of target task requests with the longest waiting time are added to the execution queue, the preset value of the execution queue increases by 1 and becomes 6. For more information about preset values, see Figure 3 and its related description.

[0111] Continuing with the above example, Fig. 6E For example, Fig. 6E As shown in the fourth column, assuming that the preset number is 1, the management module 220 can directly add the target task request with the longest waiting time (i.e., task request C3) to the execution queue. At this time, the preset value of the execution queue is increased from 5 to 6, and task request C3 is queued for execution and executed in parallel, while other task requests in the waiting queue still maintain their original order and wait.

[0112] In some embodiments, the management module 220 may reorder the target task requests based on the usage frequency of the pending application to which the target task request belongs. For example, the greater the usage frequency of the pending application to which the target task request belongs, the higher the position of the target task request after the target task request is reordered. For more information about the usage frequency of the pending application, see Figure 3 and its related description.

[0113] In some embodiments of the present specification, by determining the target task requests and sorting the target task requests, the execution order of the task requests can better meet the user's requirements for the operation of the application; by directly adding some target task requests to the execution queue, the waiting time of the task requests is further shortened and the execution efficiency of the task requests is improved.

[0114] The basic concepts have been described above. Obviously, for those skilled in the art, the above detailed disclosure is only for example and does not constitute a limitation of this specification. Although not explicitly stated here, those skilled in the art may make various modifications, improvements and corrections to this specification. Such modifications, improvements and corrections are suggested in this specification, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of this specification.

[0115] At the same time, this specification uses specific words to describe the embodiments of this specification. For example, "one embodiment", "an embodiment", and / or "some embodiments" refer to a certain feature, structure or characteristic related to at least one embodiment of this specification. Therefore, it should be emphasized and noted that "one embodiment" or "an embodiment" or "an alternative embodiment" mentioned twice or more in different positions in this specification does not necessarily refer to the same embodiment. In addition, certain features, structures or characteristics in one or more embodiments of this specification can be appropriately combined.

[0116] In addition, unless explicitly stated in the claims, the order of the processing elements and sequences described in this specification, the use of alphanumeric characters, or the use of other names are not intended to limit the order of the processes and methods of this specification. Although the above disclosure discusses some invention embodiments that are currently considered useful through various examples, it should be understood that such details are only for illustrative purposes, and the attached claims are not limited to the disclosed embodiments. On the contrary, the claims are intended to cover all modifications and equivalent combinations that are consistent with the essence and scope of the embodiments of this specification. For example, although the system components described above can be implemented by hardware devices, they can also be implemented only by software solutions, such as installing the described system on an existing server or mobile device.

[0117] Similarly, it should be noted that in order to simplify the description disclosed in this specification and thus help understand one or more embodiments of the invention, in the above description of the embodiments of this specification, multiple features are sometimes combined into one embodiment, figure or description thereof. However, this disclosure method does not mean that the features required by the subject matter of this specification are more than the features mentioned in the claims. In fact, the features of the embodiments are less than all the features of the single embodiment disclosed above.

[0118] In some embodiments, numbers describing the number of components and attributes are used. It should be understood that such numbers used in the description of the embodiments are modified by the modifiers "about", "approximately" or "substantially" in some examples. Unless otherwise specified, "about", "approximately" or "substantially" indicate that the numbers are allowed to vary by ±20%. Accordingly, in some embodiments, the numerical parameters used in the specification and claims are approximate values, which may change according to the required features of individual embodiments. In some embodiments, the numerical parameters should take into account the specified significant digits and adopt the general method of retaining digits. Although the numerical domains and parameters used to confirm the breadth of their range in some embodiments of this specification are approximate values, in specific embodiments, the setting of such numerical values ​​is as accurate as possible within the feasible range.

[0119] Each patent, patent application, patent application publication, and other materials, such as articles, books, specifications, publications, documents, etc., cited in this specification are hereby incorporated by reference in their entirety. Except for application history documents that are inconsistent with or conflicting with the contents of this specification, documents that limit the broadest scope of the claims of this specification (currently or later attached to this specification) are also excluded. It should be noted that if the descriptions, definitions, and / or use of terms in the materials attached to this specification are inconsistent or conflicting with the contents described in this specification, the descriptions, definitions, and / or use of terms in this specification shall prevail.

[0120] Finally, it should be understood that the embodiments described in this specification are only used to illustrate the principles of the embodiments of this specification. Other variations may also fall within the scope of this specification. Therefore, as an example and not a limitation, alternative configurations of the embodiments of this specification may be considered consistent with the teachings of this specification. Accordingly, the embodiments of this specification are not limited to the embodiments explicitly introduced and described in this specification.

Claims

1. A resource configuration method for an application, comprising: Obtaining an application to be processed, where the application to be processed is an application that is closed on a display interface of a terminal device; Adding one or more task requests of the to-be-processed application to a background task queue, wherein the task queue includes an execution queue; The task requests in the execution queue are executed in parallel, and the number of the task requests in the execution queue does not exceed a preset value.

2. The method according to claim 1, wherein the task queue further comprises a waiting queue, and the method further comprises: When the number of task requests in the execution queue exceeds the preset value, the excess task requests are added to the waiting queue.

3. The method according to claim 2, further comprising: Sorting the task requests in the waiting queue according to priority; When the task requests in the execution queue are executed, a corresponding number of task requests are obtained from the waiting queue according to the order and added to the execution queue. 4 . The method according to claim 3 , wherein the priority is determined based on an access time of the pending application program to which the task request belongs.

5. The method according to claim 3, further comprising: According to the waiting time of each task request in the waiting queue, the order of the task requests in the waiting queue is updated.

6. The method according to claim 5, wherein updating the order of the task requests in the waiting queue according to the waiting time of each task request in the waiting queue comprises: Obtain target task requests whose waiting time in the waiting queue exceeds a preset time; The position of the target task request in the waiting queue is adjusted.

7. The method according to claim 6, wherein adjusting the position of the target task request in the waiting queue comprises: The target task request with the longest waiting time is placed at the front of the waiting queue.

8. A resource configuration system for an application, comprising: An acquisition module, used to acquire an application to be processed, wherein the application to be processed is an application that is closed on a display interface of a terminal device; A management module, used for adding one or more task requests of the to-be-processed application to a background task queue, wherein the task queue includes an execution queue; The execution module is used to execute the task requests in the execution queue in parallel, and the number of task requests in the execution queue does not exceed a preset value.

9. A resource configuration device for an application, comprising: at least one storage medium storing computer instructions; At least one processor executes the computer instructions to implement the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, wherein the storage medium stores computer instructions. When a computer reads the computer instructions in the storage medium, the computer executes the method according to any one of claims 1 to 7.