Task scheduling method and system, device, and storage medium
By prioritizing the execution of tasks generated by the current business scenario, the problem of application response to user operations is solved, achieving rapid response and improving user experience.
Patent Information
- Application Number
- PCT/CN2024/127325
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-01-02
- Filing Date
- 2024-10-25
- Publication Date
- 2025-07-10
AI Technical Summary
In the prior art, applications have delays in responding to user operations, resulting in poor user experience and inability to perform tasks related to user operations in a timely manner.
By obtaining the tasks to be executed in the business scenario, prioritize the identification and execution of the first target tasks generated by the current business scenario, and perform tasks in sequence in priority order, adjust the order of placement of the task queue or customize the task scheduling logic of the operating system to ensure timely response of the tasks in the current business scenario.
It improves the application's response speed to user operations, improves user experience, and reduces operation waiting time.
Smart Images

Figure CN2024127325_10072025_PF_FP_ABST
Abstract
Description
Task scheduling method, system, device and storage medium
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to Chinese patent application No. 2024100059136, filed on January 2, 2024, entitled “Task Scheduling Method, System, Device and Storage Medium”, the entire contents of which are incorporated herein by reference. Technical Field
[0003] The present disclosure relates to the field of computer technology, and in particular to a task scheduling method, system, device, and storage medium. Background Art
[0004] In the computer field, a task can be understood as program code executed within a computer. During the execution of an application, one or more tasks may be generated. Task scheduling refers to determining the execution order of tasks and the execution threads of each task. Currently, some technologies rely primarily on the native scheduling capabilities of the operating system to implement task scheduling.
[0005] Summary of the Invention
[0006] In view of this, embodiments of the present disclosure provide a task scheduling method, a task scheduling system, an electronic device, and a computer-readable storage medium.
[0007] In one aspect, the present disclosure provides a task scheduling method, the method comprising:
[0008] Obtaining tasks to be performed in one or more business scenarios, where the business scenarios represent a set of capabilities provided by the application program for achieving a specific goal;
[0009] Based on the current business scenario entered by the user, searching the tasks to be executed for a first target task generated in the current business scenario;
[0010] The first target task is regarded as the task with the highest priority, and the tasks to be executed are executed in order from high to low priority.
[0011] Another aspect of the present disclosure provides a task scheduling system, the system comprising:
[0012] A task acquisition module is used to acquire tasks to be performed in one or more business scenarios, where the business scenarios represent a set of capabilities provided by the application program for achieving a specific goal;
[0013] A task search module, configured to search, based on a current business scenario entered by a user, for a first target task generated in the current business scenario from among the tasks to be executed;
[0014] The task execution module is used to take the first target task as the task with the highest priority to be executed, and execute the tasks to be executed in order from high to low priority.
[0015] On the other hand, the present disclosure further provides a computer-readable storage medium, wherein the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0016] On the other hand, the present disclosure further provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer program, and when the computer program is executed by the processor, the method described above is implemented.
[0017] In some embodiments of the present application, after obtaining the tasks to be executed in one or more business scenarios, the first target task generated in the current business scenario is used as the task with the highest priority, and the tasks to be executed are executed in order from high to low priority. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings, which are schematic and should not be construed as limiting the present disclosure in any way. In the accompanying drawings:
[0019] FIG1 shows a schematic diagram of task scheduling in some technologies;
[0020] FIG2 is a schematic diagram showing a task scheduling method provided by an embodiment of the present application;
[0021] FIG3 shows a schematic diagram showing the relationship between the current business scenario and the next business scenario provided by an embodiment of the present application;
[0022] FIG4 shows a schematic diagram showing the relationship between the current business scenario and the next business scenario provided by another embodiment of the present application;
[0023] FIG5 is a schematic diagram showing the relationship between the current business scenario and the next business scenario provided by another embodiment of the present application;
[0024] FIG6 shows a schematic diagram of a business scenario stack provided by an embodiment of the present application;
[0025] FIG7 shows a module diagram of a task scheduling system provided by an embodiment of the present application;
[0026] FIG8 shows a schematic diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0027] To make the purpose, technical solutions, and advantages of the embodiments of the present disclosure more clear, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are only part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present disclosure.
[0028] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0029] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0030] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, for example, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also include a selection control for the user to select "Agree" or "Disagree" to provide personal information to the electronic device.
[0031] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0032] Under the existing task scheduling method, the application may not be able to respond to user operations in a timely manner. Therefore, a task scheduling method that can respond to user operations in a timely manner is urgently needed.
[0033] Please refer to Figure 1 for a diagram of task scheduling in some technologies. In Figure 1, when an application 11 starts running, the operating system will start one or more threads 12 for application 11. These threads 12 include at least one main thread. In addition to the main thread, one or more child threads may also be included. For a series of tasks generated during the execution of application 11, these tasks can be placed in a task queue 13 of one or more threads 12, so that the tasks can be executed in the corresponding threads 12.
[0034] The problem with these technologies is that after tasks are placed in the task queue 13, the execution order between tasks is controlled according to the default task scheduling logic of the operating system. For example, each task is executed in the order of the time when the tasks were generated. This results in some tasks related to user operations not being executed first. As a result, after the user performs an operation in the operation interface of the application 11, it may take a long time to get a response from the application, which results in a poor user experience.
[0035] In view of this, the present application provides a task scheduling method that can respond to user operations in a timely manner. The task scheduling method can be applied to electronic devices. Electronic devices include but are not limited to tablet computers, laptop computers, desktop computers, etc. Please refer to Figure 2, which is a schematic diagram of the task scheduling method provided by one embodiment of the present application. In Figure 2, the task scheduling method includes the following steps:
[0036] Step S21 : obtaining tasks to be executed in one or more business scenarios, where a business scenario represents a set of capabilities provided by an application program for achieving a specific goal.
[0037] Specifically, a capability set refers to one or more capabilities that an application must possess to achieve a specific goal. For example, to achieve the goal of video playback, an application must have capabilities such as video clarity control and video progress control. An application can include multiple or multiple capability sets, that is, one or more business scenarios.
[0038] To facilitate understanding, the concept of business scenarios is explained below by way of examples. For example, for an application with a video publishing function, it may include a first capability set for obtaining videos, a second capability set for performing special effects processing on videos, and a third capability set for setting up videos before publishing. Each capability set here can be regarded as a business scenario. In each business scenario, multiple sub-business scenarios can be further included. For example, in the business scenario of performing special effects processing on videos, a first sub-business scenario for adding text to videos, a second sub-business scenario for trimming the playback length of videos, and so on can be further included.
[0039] Pending tasks can refer to tasks generated by an application in response to various user actions in one or more business scenarios, as well as tasks that can be pre-executed in business scenarios that the user will enter in the future. For example, in a business scenario involving special effects processing of a video, a cropping task can be generated in response to the user selecting the "crop" function. Another example is that before the user enters the special effects processing business scenario, pre-loaded tasks for various sub-business scenarios can be generated.
[0040] Step S22: Based on the current business scenario entered by the user, searching for a first target task generated in the current business scenario among the tasks to be executed.
[0041] Specifically, the pending tasks may include unexecuted tasks generated in past business scenarios that the user has exited, tasks generated in the current business scenario that the user is currently entering, and tasks that are allowed to be executed in advance in business scenarios that the user will enter in the future. In step S22, the first target task generated in the current business scenario is selected from these pending tasks.
[0042] In step S23 , the first target task is taken as the task with the highest priority to be executed, and the tasks to be executed are executed in order from the highest priority to the lowest priority.
[0043] Specifically, compared with historical business scenarios and business scenarios that the user has not yet entered, the current business scenario is the business scenario that the user is currently operating. Therefore, the first target task generated in the current business scenario is set as the task with the highest priority. This can ensure that the tasks in the current business scenario can be executed in a timely manner, thereby enabling the user's currently performing operations to receive a quick response, thereby improving the user experience.
[0044] In this embodiment, tasks to be executed are executed in order of priority from highest to lowest, which may include the following two situations:
[0045] The first situation is that after obtaining the task to be performed, the task to be performed is not directly placed in the task queue of the thread, but the first target task screened out from the task to be performed is first placed in the task queue of the thread, and, temporarily, other tasks outside the first target task are not placed in the task queue of the thread. After the first target task is executed, the other tasks in the task to be performed are placed in the task queue of the thread. In this way, the execution order between the tasks can be controlled by controlling the order in which tasks are placed in the task queue, thereby giving priority to the first target task. In this case, after the task is placed in the task queue of the thread, the execution order between the tasks can be controlled according to the default task scheduling logic of the operating system.
[0046] Alternatively, the default task scheduling logic of the operating system can be customized so that after all pending tasks are placed in the thread's task queue, the first target task generated in the current business scenario is executed first, followed by other tasks. This allows pending tasks to be placed directly into the thread's task queue after being acquired, eliminating the need to control the order in which tasks are placed into the task queue.
[0047] In summary, in some embodiments of the present application, after obtaining pending tasks in one or more business scenarios, the first target task generated in the current business scenario is designated as the highest priority task, and the pending tasks are executed sequentially in descending order of priority. This ensures that tasks related to the user's current operation can be executed promptly, thereby enabling rapid response to user operations.
[0048] The following is a further description of this application.
[0049] In some embodiments, after the first target task is set as the task with the highest priority to be executed, the task scheduling method of the present application further includes:
[0050] Among the tasks to be executed, a second target task that is allowed to be executed in advance in the next business scenario of the current business scenario is searched, and the second target task is taken as the task with the highest priority to be executed.
[0051] By assigning the second target task in the next business scenario, which is allowed to be executed in advance, as the highest priority task, some of the tasks in the next business scenario can be pre-executed before the user enters the next business scenario. This allows for timely responses after the user enters the next business scenario, reducing user wait time and improving the user experience.
[0052] The following describes how to determine the next business scenario based on the current business scenario.
[0053] In some embodiments, the next business scenario of the current business scenario can be a business scenario that has a jump relationship with the current business scenario. For example, please refer to Figure 3, which is a schematic diagram of the relationship between the current business scenario and the next business scenario provided in one embodiment of the present application. In Figure 3, after the user completes the relevant operations in the current business scenario, the business scenario to which the application jumps in response to the user clicking the OK button can be the next business scenario of the current business scenario.
[0054] In some embodiments, a business scenario can be represented by a scenario identifier. The business scenario can be entered through the scenario identifier. If the scenario identifier of a business scenario is in the same list and adjacent to the scenario identifier of the current business scenario, then the business scenario can be used as the next business scenario of the current business scenario. For ease of understanding, please refer to Figure 4, which is a schematic diagram of the relationship between the current business scenario and the next business scenario provided in another embodiment of the present application. Figure 4 exemplarily shows four scenario identifiers, and the four scenario identifiers can be slid left and right. When a scenario identifier is selected, the business scenario represented by the scenario identifier can be entered. For example, when the first scenario identifier is selected, the business scenario represented by the first scenario identifier can be entered. On this basis, it is assumed that the second scenario identifier is the currently selected scenario identifier, that is, the current business scenario is the business scenario represented by the second scenario identifier. In this case, in response to the four scenario identifiers being slid to the left, the business scenario represented by the third scenario identifier can be the next business scenario of the current business scenario, and in response to the four scenario identifiers being slid to the right, the business scenario represented by the first scenario identifier can be the next business scenario of the current business scenario.
[0055] In some embodiments, the next business scenario of the current business scenario can be predicted based on the regularity of users entering different business scenarios. For example, please refer to Figure 5, which is a schematic diagram of the relationship between the current business scenario and the next business scenario provided in another embodiment of the present application. Similar to Figure 4, Figure 5 exemplarily shows four scene identifiers, but in Figure 5, the user can randomly enter a business scenario represented by a scene identifier according to actual needs. For example, the user exits the business scenario represented by the first scene identifier and can enter the business scenario represented by the third scene identifier, or the business scenario represented by the second scene identifier or the fourth scene identifier. In this case, the next business scenario of the current business scenario can be determined based on the regularity of users entering business scenarios. For example, the user usually exits the business scenario represented by the first scene identifier and continues to enter the business scenario represented by the fourth scene identifier. Then, when the business scenario represented by the first scene identifier is the current business scenario, the business scenario represented by the fourth scene identifier is the next business scenario of the current business scenario.
[0056] This completes the description of the relationship between the current business scenario and the next business scenario.
[0057] In some embodiments, after finding the first target task, the method further includes:
[0058] When the first target task has not been executed or has not been completed, if it is detected that the user enters the next business scenario from the current business scenario, the priority of the first target task will be lowered or deleted, and the third target task generated in the next business scenario will be used as the new highest priority task.
[0059] It is understandable that as the user leaves the current business scenario, if the operations that the user has performed in the current business scenario have not yet been responded to (that is, the first target task has not yet been executed or has not yet been completed), then these unresponded operations are no longer important. Therefore, there is no need to execute the first target task again, that is, the first target task is allowed to be deleted, or the priority of the first target task can be lowered. At the same time, as the user enters the next business scenario, the operations that the user performs in the next business scenario need to be responded to in a timely manner. Therefore, the second target task to be executed in the next business scenario can be regarded as the task with the highest priority. In this way, among the tasks to be executed, the task with the highest priority can always be related to the user's current operation, so that these tasks related to the user's current operation can be executed in a timely manner, thereby quickly responding to user operations and improving user experience.
[0060] The following describes how to distinguish tasks in various business scenarios among tasks to be executed.
[0061] In some embodiments, for any business scenario, after the user enters the business scenario, the task scheduling method of the present application further includes:
[0062] In a pre-established business scenario stack, a scenario identifier representing that business scenario is pushed from the top of the stack, and tasks generated within that business scenario are associated with the scenario identifier of that business scenario. For ease of understanding, three business scenarios are used as an example. Assuming a user enters each business scenario in the order of first business scenario > second business scenario > third business scenario, the resulting business scenario stack may be as shown in Figure 6. In Figure 6, the scenario identifiers of each business scenario are represented by gray boxes. When the user enters the first business scenario, the scenario identifier of the first business scenario is pushed from the top of the stack onto the business scenario stack. Simultaneously, the tasks generated within the first business scenario are associated with the scenario identifier of the first business scenario. When the user enters the second business scenario from the first business scenario, the scenario identifier of the second business scenario is pushed from the top of the stack onto the business scenario stack. Simultaneously, the tasks generated within the second business scenario are associated with the scenario identifier of the second business scenario. After the scenario identifier of the second business scenario is pushed onto the business scenario stack, the scenario identifier of the second business scenario will overlay the scenario identifier of the first business scenario when viewed from the top of the stack toward the interior of the business scenario stack. Similarly, when a user enters a third business scenario from the second business scenario, the scenario identifier of the third business scenario is pushed from the top of the stack into the business scenario stack, and tasks generated in the third business scenario are associated with the scenario identifier of the third business scenario. After the scenario identifier of the third business scenario is pushed into the business scenario stack, the scenario identifier of the third business scenario will be overlaid on the scenario identifier of the second business scenario when viewed from the top of the business scenario stack.
[0063] Based on the above description of the business scenario stack, searching for the first target task generated in the current business scenario among the tasks to be executed may include:
[0064] Enter the business scenario stack from the top of the stack and determine the task associated with the first scenario identifier;
[0065] Search for the task associated with the first scenario ID among the tasks to be executed, and use it as the first target task to be executed in the current business scenario.
[0066] Combined with the relevant description of the business scenario stack in Figure 6, it can be seen that when looking from the top of the stack to the inside of the business scenario stack, the first scenario identifier is always the scenario identifier of the business scenario currently entered by the user, so the task associated with the first scenario identifier found in the tasks to be executed can be used as the first target task to be executed in the current business scenario. In this application, based on the business scenario stack, the order in which users enter different business scenarios can be accurately recorded, and the tasks generated in each business scenario can be distinguished, which facilitates the management of tasks according to the business scenario in the tasks to be executed (such as modifying task priorities, deleting tasks, etc.).
[0067] Furthermore, in some embodiments, if it is detected that the user enters the next business scenario from the current business scenario, lowering the priority of the first target task or deleting the first target task may include:
[0068] In the business scenario stack, if the first scenario identifier is overwritten by a new scenario identifier, or the first scenario identifier is pushed out from the bottom of the business scenario stack, it is determined that the user enters the next business scenario from the current business scenario, and among the tasks to be executed, the priority of the task associated with the first scenario identifier is reduced or the task associated with the first scenario identifier is deleted.
[0069] Refer to Figure 6. Based on the above description, since the first scenario identifier is the scenario identifier corresponding to the current business scenario, when the first scenario identifier is overwritten by a new scenario identifier, or when the first scenario identifier is pushed out from the bottom of the business scenario stack, it can be determined that the user has entered the next business scenario from the current business scenario. Furthermore, the task associated with the first scenario identifier can be deleted from the tasks to be executed or the priority of the task associated with the first scenario identifier can be lowered.
[0070] This completes the description of the business scenario stack.
[0071] In some embodiments, after the user enters the next business scenario from the current business scenario, there may be a situation where the first target task in the current business scenario still needs to be continued. For example, in a business scenario for video publishing, after the user clicks the publish button, the application can automatically exit the video publishing business scenario for the user and enter the video playback business scenario. In this case, although the user has entered the next business scenario (i.e., the video playback business scenario) from the current business scenario (i.e., the video publishing business scenario), the video publishing task generated in the video publishing business scenario still needs to be continued, that is, when the user enters the next business scenario from the current business scenario, the task in the current business scenario cannot be deleted. In view of this, the business scenario in which this task cannot be deleted can be set as a resident business scenario. When monitoring the user entering the next business scenario from the current business scenario and preparing to delete the first target task corresponding to the current business scenario, it can first be determined whether the current business scenario is a preset resident business scenario. If not, delete the first target task. If so, continue to execute the first target task. In this way, tasks can be avoided from being accidentally deleted and the reliability of task scheduling can be improved.
[0072] In some embodiments, after a user enters the current business scenario, an application can generate tasks based on all the operations that the user may perform in the current business scenario. However, the actual situation is that when a user is in the current business scenario, he or she may only perform a small number of operations. This means that some of the tasks to be executed may be irrelevant to the user's actual operations. If these tasks irrelevant to the user's actual operations are placed in a thread task queue and executed, on the one hand, hardware resources will inevitably be wasted, and on the other hand, tasks related to the user's actual operations may not be executed in a timely manner. In view of this, when searching for the first target task generated in the current business scenario among the tasks to be executed, the target operation to be performed by the user in the current business scenario can be predicted based on a trained prediction model. Then, tasks related to the target operation can be searched among the tasks to be executed, and the found tasks can be used as the first target task generated in the current business scenario. In this way, the execution of tasks irrelevant to the user's actual operations can be avoided, thereby improving the response efficiency of the user's actual operations.
[0073] The task scheduling method of this application is further explained below.
[0074] In some embodiments, the tasks to be executed may include first-type tasks and second-type tasks. The task scheduling method of the present application may further include:
[0075] When the number of tasks of the first type is greater than a first number threshold and the number of tasks of the second type is less than a second number threshold, if the first type and the second type need to be executed based on the same hardware resources, the priorities of the first type and the second type are adjusted so that the priority of the second type is higher than the priority of the first type.
[0076] For ease of understanding, the first type of task is a CPU-intensive task, and the second type of task is an IO-intensive task. When the number of CPU-intensive tasks is greater than the first number threshold, it can be said that there are many CPU-intensive tasks, which will occupy CPU resources for a long time, and there may also be a problem that tasks cannot be processed in time. When the number of IO-intensive tasks is less than the second number threshold, it can be said that there are fewer IO-intensive tasks and IO resources are relatively sufficient. In this case, if it is necessary to execute CPU-intensive tasks and IO-intensive tasks based on the same hardware resources (such as CPU resources), the priorities of IO-intensive tasks and CPU-intensive tasks can be adjusted so that the priority of IO-intensive tasks is higher than that of CPU-intensive tasks. In this way, IO-intensive tasks can be executed before CPU-intensive tasks, and then the task execution results of IO-intensive tasks can be returned based on relatively sufficient IO resources. In this way, at least it can be guaranteed that IO-intensive tasks can be processed in a timely manner.
[0077] In some embodiments, for a device running an application, if the device's battery level is lower than a battery threshold, or the device's heat generation is higher than a heat generation threshold, low-priority tasks can be deleted from the pending tasks, thereby reducing the device's power consumption and heat generation.
[0078] This concludes the description of the task scheduling method of this application.
[0079] Please refer to Figure 7, which is a module diagram of a task scheduling system provided by an embodiment of the present application. In Figure 7, the task scheduling system includes:
[0080] A task acquisition module is used to obtain tasks to be executed in one or more business scenarios. A business scenario represents a set of capabilities provided by an application to achieve a specific goal.
[0081] A task search module is used to search for a first target task generated in the current business scenario among the tasks to be executed based on the current business scenario entered by the user;
[0082] The task execution module is used to take the first target task as the task with the highest priority to be executed, and execute the tasks to be executed in order from high to low priority.
[0083] Please refer to Figure 8, which is a schematic diagram of an electronic device provided in one embodiment of the present application. The electronic device includes a processor and a memory, wherein the memory is used to store a computer program. When the computer program is executed by the processor, the above method is implemented.
[0084] The processor may be a central processing unit (CPU). The processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or a combination of the above chips.
[0085] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs, non-transitory computer-executable programs, and modules, such as the program instructions / modules corresponding to the methods described in the embodiments of the present invention. The processor executes the non-transitory software programs, instructions, and modules stored in the memory to perform various processor functions and data processing, thereby implementing the methods described in the aforementioned method embodiments.
[0086] The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the processor, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0087] One embodiment of the present application further provides a computer-readable storage medium, which is used to store a computer program. When the computer program is executed by a processor, the above method is implemented.
[0088] Although the embodiments of the present disclosure have been described with reference to the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A task scheduling method, the method comprising: Obtaining tasks to be executed in one or more business scenarios, where the business scenarios represent a set of capabilities provided by an application program to achieve specific goals; Based on the current business scenario entered by the user, searching for a first target task generated in the current business scenario among the tasks to be executed; Taking the first target task as the task with the highest priority, and sequentially executing the tasks to be executed in the order of decreasing priority.
2. The method according to claim 1, wherein after taking the first target task as the task with the highest priority to be executed, the method further comprises: Searching for a second target task that is allowed to be executed in advance in the next business scenario of the current business scenario among the tasks to be executed, and taking the second target task as the task with the highest priority to be executed.
3. The method according to claim 1, wherein after finding the first target task, the method further comprises: In the case where the first target task has not been executed or has not completed execution, if it is detected that the user enters the next business scenario from the current business scenario, reducing the priority of the first target task or deleting the first target task, and taking a third target task generated in the next business scenario as the new task with the highest priority.
4. The method according to claim 3, wherein for any business scenario, after the user enters the business scenario, the method further comprises: In a pre-established business scenario stack, pushing a scenario identifier representing the business scenario onto the top of the stack, and associating the tasks generated in the business scenario with the scenario identifier of the business scenario; The searching for a first target task generated in the current business scenario among the tasks to be executed includes: Entering the business scenario stack from the top of the business scenario stack, and determining the task associated with the first scenario identifier; Searching for the task associated with the first scenario identifier among the tasks to be executed as the first target task to be executed in the current business scenario.
5. The method according to claim 4, wherein the reducing the priority of the first target task or deleting the first target task if it is detected that the user enters the next business scenario from the current business scenario includes: In the business scenario stack, if the first scenario identifier is overwritten by a new scenario identifier, or the first scenario identifier is popped from the bottom of the business scenario stack, determining that the user enters the next business scenario, and reducing the priority of the task associated with the first scenario identifier or deleting the task associated with the first scenario identifier among the tasks to be executed.
6. The method according to claim 3, wherein the deleting the first target task if it is detected that the user enters the next business scenario from the current business scenario includes: Judging whether the current business scenario is a preset permanent business scenario, if not, deleting the first target task, if so, continuing to execute the first target task.
7. The method according to claim 1, wherein finding the first target task generated in the current business scenario in the to-be-executed task includes: Predicting, based on a trained prediction model, a target operation to be performed by a user in the current business scenario; Finding, in the to-be-executed task, a task related to the target operation, and using the found task as the first target task.
8. The method according to claim 1, wherein the to-be-executed task includes a first type of task and a second type of task, and the method further includes: When the number of tasks of the first type is greater than a first quantity threshold and the number of tasks of the second type is less than a second quantity threshold, if it is necessary to execute the first type of task and the second type of task based on the same hardware resources, adjusting the priorities of the first type of task and the second type of task so that the priority of the second type of task is higher than that of the first type of task.
9. A task scheduling system, the system includes: A task acquisition module, configured to acquire to-be-executed tasks in one or more business scenarios, where the business scenario represents a set of capabilities provided by an application program for achieving a specific goal; A task finding module, configured to find, based on the current business scenario entered by the user, a first target task generated in the current business scenario in the to-be-executed tasks; A task execution module, configured to use the first target task as the to-be-executed task with the highest priority, and sequentially execute the to-be-executed tasks in order from the highest priority to the lowest priority.
10. A computer-readable storage medium, the computer-readable storage medium is used to store a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
11. An electronic device, the electronic device includes a processor and a memory, the memory is used to store a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Task scheduling method and device, electronic equipment and readable storage medium
CN113282390A
Thread scheduling method and device, electronic equipment and storage medium
CN114816748A
Game task reminding method and device, electronic equipment and storage medium
CN116688498A
Systems and methods for scheduling, processing, and monitoring tasks
US20080120620A1