Task scheduling method, system and equipment and storage medium
By prioritizing the tasks generated by the current business scenario in task scheduling, the problem that the application cannot respond to user operations in a timely manner is solved, and the user experience is improved.
Patent Information
- Application Number
- CN202410005913.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-02
- Publication Date
- 2025-07-04
AI Technical Summary
In the prior art, task scheduling methods cause applications to be unable to respond to user operations in a timely manner, and the user experience is poor.
By obtaining the tasks to be executed in the business scenario, finding the first target task generated by the current business scenario, and using it as the task with the highest priority, and executing the tasks to be executed in order of priority from high to bottom.
Ensure that tasks related to the user's current operations are executed in a timely manner, improving the response speed and experience of user operations.
Smart Images

Figure CN120256034A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technologies, and particularly to a task scheduling method, system, device, and storage medium. Background Art
[0002] In the field of computers, a task can be understood as program code executed in a computer. During the running of an application program, one or more tasks can be generated. Task scheduling refers to determining the execution order between tasks and the execution threads of each task, etc.
[0003] Currently, in some technologies, task scheduling is mainly achieved by relying on the native scheduling capabilities of the operating system. In this task scheduling method, the application program may have problems such as being unable to respond to user operations in a timely manner.
[0004] Therefore, there is an urgent need for a task scheduling method that can respond to user operations in a timely manner. Summary of the Invention
[0005] 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, which can respond to user operations in a timely manner.
[0006] On the one hand, the present disclosure provides a task scheduling method, and the method includes:
[0007] Obtain tasks to be executed in one or more service scenarios, where the service scenario represents a set of capabilities provided by an application program to achieve a specific goal;
[0008] Based on the current service scenario entered by the user, search for a first target task generated in the current service scenario among the tasks to be executed;
[0009] Take the first target task as the task with the highest priority, and sequentially execute the tasks to be executed in order of priority from high to low.
[0010] On the other hand, the present disclosure also provides a task scheduling system, and the system includes:
[0011] A task acquisition module, configured to obtain tasks to be executed in one or more service scenarios, where the service scenario represents a set of capabilities provided by an application program to achieve a specific goal;
[0012] A task search module, configured to search for a first target task generated in the current service scenario among the tasks to be executed based on the current service scenario entered by the user;
[0013] A task execution module, configured to take the first target task as the task with the highest priority to be executed, and sequentially execute the tasks to be executed in the order of decreasing priority.
[0014] On the other hand, the present disclosure also provides a computer-readable storage medium for storing a computer program, which when executed by a processor, implements the method as described above.
[0015] On the other hand, the present disclosure also provides an electronic device, which includes a processor and a memory. The memory is used to store a computer program, which when executed by the processor, implements the method as described above.
[0016] 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 taken as the task with the highest priority, and the tasks to be executed are sequentially executed in the order of decreasing priority. In this way, it can be ensured that the tasks related to the user's current operation can be executed in a timely manner, so as to quickly respond to the user's operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The features and advantages of the present disclosure will be more clearly understood by referring to the accompanying drawings. The drawings are schematic and should not be construed as imposing any limitation on the present disclosure. In the drawings:
[0018] Figure 1 Shows a schematic diagram of task scheduling in some technologies;
[0019] Figure 2 Shows a schematic diagram of the task scheduling method provided by an embodiment of the present application;
[0020] Figure 3 Shows a schematic diagram of the relationship between the current business scenario and the next business scenario provided by an embodiment of the present application;
[0021] Figure 4 Shows a schematic diagram of the relationship between the current business scenario and the next business scenario provided by another embodiment of the present application;
[0022] Figure 5 Shows a schematic diagram of the relationship between the current business scenario and the next business scenario provided by another embodiment of the present application;
[0023] Figure 6 Shows a schematic diagram of the business scenario stack provided by an embodiment of the present application;
[0024] Figure 7 Shows a schematic diagram of the modules of the task scheduling system provided by an embodiment of the present application;
[0025] Figure 8 The figure shows a schematic diagram of an electronic device provided by an embodiment of the present application. Detailed implementation manners
[0026] To make the objectives, technical solutions, and advantages of the embodiments of the present disclosure clearer, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present disclosure. Apparently, the described embodiments are only a part rather than all of the embodiments of the present disclosure. Based on the embodiments of the present disclosure, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present disclosure.
[0027] It can be understood that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, usage scopes, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to users and the authorization of users should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0028] For example, when a user's active request is received, a prompt message is sent to the user to clearly prompt the user that the operation requested by the user will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, an application program, a server, or a storage medium that performs the operations of the technical solutions of the present disclosure according to the prompt message.
[0029] As an optional but non-limiting implementation manner, the manner of sending a prompt message to the user in response to receiving the user's active request may be, for example, in the form of a pop-up window, and the prompt message may be presented in text in the pop-up window. In addition, the pop-up window may also carry a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0030] It can be understood that the above process of notifying and obtaining the user's authorization is only illustrative and does not limit the implementation manners of the present disclosure. Other manners that meet relevant laws and regulations can also be applied to the implementation manners of the present disclosure.
[0031] Please refer to Figure 1 , which is a schematic diagram of task scheduling in some technologies. Figure 1 In, when application 11 starts running, the operating system will start one or more threads 12 for application 11. Among these threads 12, at least one main thread is included. In addition to the main thread, one or more child threads may also be included. For a series of tasks generated during the running of application 11, these tasks can be placed in the task queue 13 of one or more of these threads 12 to execute the tasks in the corresponding threads 12.
[0032] The problem with these technologies is that after a task is 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 task is generated, which results in that some tasks related to user operations cannot be executed preferentially. Furthermore, after the user performs an operation on the operation interface of the application 11, it may take a long time to get a response from the application, and the user experience is not good.
[0033] In view of this, the present application provides a task scheduling method, which can respond to user operations in a timely manner. The task scheduling method can be applied to an electronic device. The electronic device includes, but is not limited to, a tablet computer, a notebook computer, a desktop computer, etc. Please refer to Figure 2 , which is a schematic diagram of the task scheduling method provided by an embodiment of the present application. Figure 2 In, the task scheduling method includes the following steps:
[0034] Step S21, obtain tasks to be executed in one or more service scenarios, where the service scenario represents a set of capabilities provided by an application for achieving a specific goal.
[0035] Specifically, the so-called set of capabilities can refer to one or more capabilities that an application should possess to achieve a specified goal. For example, to achieve the goal of video playback, the application should possess capabilities such as video clarity control and video progress control. An application can include multiple sets of one or more capabilities, that is, one or more service scenarios.
[0036] For ease of understanding, the concept of a service scenario is illustrated by way of example below. For example, for an application with a video publishing function, it can include a first set of capabilities for obtaining videos, a second set of capabilities for performing special effects processing on videos, and a third set of capabilities for performing pre-publishing settings on videos. Each of these sets of capabilities can be regarded as a service scenario. In each service scenario, there can be further included multiple sub-service scenarios. For example, in the service scenario of performing special effects processing on videos, there can be further included a first sub-service scenario of adding text to the video, a second sub-service scenario of trimming the playing length of the video, etc.
[0037] The tasks to be executed can refer to tasks generated by the application in response to various operations performed by the user in one or more service scenarios, as well as tasks that are allowed to be executed in advance in each service scenario that the user is about to enter in the future. For example, in the service scenario of performing special effects processing on videos, in response to the user's selection operation for the "trimming" function, a trimming task for the video can be generated. Also, for example, before the user enters the service scenario of special effects processing, preloading tasks for each sub-service scenario are generated.
[0038] Step S22: Based on the current business scenario entered by the user, search for the first target task generated in the current business scenario among the tasks to be executed.
[0039] Among them, the tasks to be executed may specifically include the tasks that have not been executed yet and were generated in the historical business scenarios that the user has exited, the tasks generated in the current business scenario that the user has currently entered, and the tasks that are allowed to be executed in advance in the business scenarios that the user will enter in the future. In step S22, the first target task generated in the current business scenario is filtered out from these tasks to be executed.
[0040] Step S23: 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 the highest priority to the lowest priority.
[0041] Specifically, compared with the historical business scenarios and the business scenarios that the user has not entered yet, the current business scenario is the business scenario that the user is currently operating. Therefore, taking the first target task generated in the current business scenario as the task with the highest priority can ensure that the tasks in the current business scenario can be executed in a timely manner, and thus the operations that the user is currently performing can be quickly responded to, improving the user experience.
[0042] In this embodiment, executing the tasks to be executed in order from the highest priority to the lowest priority may specifically include the following two situations:
[0043] The first situation is that after obtaining the tasks to be executed, the tasks to be executed are not directly put into the task queue of the thread. Instead, the first target task filtered out from the tasks to be executed is first put into the task queue of the thread, and for the time being, the other tasks other than the first target task are not put into the task queue of the thread. After the first target task is executed, the other tasks in the tasks to be executed are put into the task queue of the thread. In this way, by controlling the order of putting tasks into the task queue of the thread, the execution order between tasks can be controlled, so that the first target task is executed first. In this case, after putting the tasks into the task queue of the thread, the execution order between tasks can be controlled according to the default task scheduling logic of the operating system.
[0044] Another situation is to customize the default task scheduling logic of the operating system so that after all the tasks to be executed are put into the task queue of the thread, the first target task generated in the current business scenario can be executed first, and then the other tasks other than the first target task are executed. In this way, after obtaining the tasks to be executed, the tasks to be executed can be directly put into the task queue of the thread, and there is no need to control the order of putting tasks into the task queue anymore.
[0045] In summary, 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 taken as the task with the highest priority, and the tasks to be executed are sequentially executed in the order of decreasing priority. In this way, it can be ensured that the tasks related to the user's current operation can be executed in a timely manner, so as to quickly respond to the user's operation.
[0046] The following further describes the present application.
[0047] In some embodiments, after taking the first target task as the task with the highest priority to be executed, the task scheduling method of the present application further includes:
[0048] Among the tasks to be executed, find the second target task that is allowed to be executed in advance in the next business scenario of the current business scenario, and take the second target task as the task with the highest priority to be executed.
[0049] After taking the second target task that is allowed to be executed in advance in the next business scenario as the task with the highest priority, it is possible to pre-execute a part of the tasks in the next business scenario before the user enters the next business scenario. In this way, after the user enters the next business scenario, the user can be responded to in a timely manner, reducing the user's operation waiting time and improving the user experience.
[0050] The following describes how to determine the next business scenario based on the current business scenario.
[0051] In some embodiments, the next business scenario of the current business scenario may 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 by an embodiment of the present application. Figure 3 In, after the user completes the relevant operations in the current business scenario, the business scenario that the application jumps to in response to the user's click operation on the confirmation button can be the next business scenario of the current business scenario.
[0052] In some embodiments, a business scenario can be represented by a scenario identifier. Through the scenario identifier, one can enter the business scenario. If the scenario identifier of a business scenario is in the same list as and adjacent to the scenario identifier of the current business scenario, then this 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 by another embodiment of the present application. Figure 4Four scenario identifiers are exemplarily shown, and the four scenario identifiers can be swiped 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, assume 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 swiped 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 swiped right, the business scenario represented by the first scenario identifier can be the next business scenario of the current business scenario.
[0053] In some embodiments, the next business scenario of the current business scenario can be predicted based on the pattern of the user entering different business scenarios. For example, please refer to Figure 5 , which 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. Similar to Figure 4 Figure 5 Four scenario identifiers are exemplarily shown, but Figure 5 in which the user can randomly enter the business scenario represented by a scenario identifier according to actual needs. For example, if the user exits the business scenario represented by the first scenario identifier, the user can enter the business scenario represented by the third scenario identifier, or can also enter the business scenario represented by the second scenario identifier or the fourth scenario identifier. In this case, the next business scenario of the current business scenario can be determined according to the pattern of the user entering the business scenario. For example, if the user usually enters the business scenario represented by the fourth scenario identifier after exiting the business scenario represented by the first scenario identifier, then when the business scenario represented by the first scenario identifier is the current business scenario, the business scenario represented by the fourth scenario identifier is the next business scenario of the current business scenario.
[0054] Thus, the description of the relationship between the current business scenario and the next business scenario is completed.
[0055] In some embodiments, after the first target task is found, the method further includes:
[0056] When 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, the priority of the first target task is reduced or the first target task is deleted, and the third target task generated in the next business scenario is used as the new task with the highest priority.
[0057] It can be understood 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 received a response (i.e., the first target task has not been executed or has not been completely executed), then these unresponded operations are no longer important. Therefore, it is possible to no longer execute the first target task, that is, to allow the deletion of the first target task, or the priority of the first target task can be reduced. At the same time, as the user enters the next business scenario, the operations performed by the user 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 used 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 the user's operation and improving the user experience.
[0058] The following describes how to distinguish tasks in each business scenario among the tasks to be executed.
[0059] In some embodiments, for any business scenario, after the user enters the business scenario, the task scheduling method of the present application further includes:
[0060] In a pre-established business scenario stack, a scenario identifier representing the business scenario is pushed onto the top of the stack, and the tasks generated in the business scenario are associated with the scenario identifier of the business scenario. For ease of understanding, three business scenarios are used as examples for illustration. Suppose the user enters each business scenario in the order of the first business scenario > the second business scenario > the third business scenario. Then the obtained business scenario stack can be as Figure 6 shown. Figure 6 In the figure, 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 onto the top of the business scenario stack. At the same time, the tasks generated in the first business scenario are associated with the scenario identifier of the first business scenario. After the user enters the second business scenario from the first business scenario, the scenario identifier of the second business scenario is pushed onto the top of the business scenario stack. At the same time, the tasks generated in the second business scenario are associated with the scenario identifier of the second business scenario. After pushing the scenario identifier of the second business scenario onto the business scenario stack, looking from the top of the business scenario stack into the interior of the business scenario stack, the scenario identifier of the second business scenario will cover the scenario identifier of the first business scenario. Similarly, after the user enters the third business scenario from the second business scenario, the scenario identifier of the third business scenario is pushed onto the top of the business scenario stack, and the tasks generated in the third business scenario are associated with the scenario identifier of the third business scenario. After pushing the scenario identifier of the third business scenario onto the business scenario stack, looking from the top of the business scenario stack into the interior of the business scenario stack, the scenario identifier of the third business scenario will cover the scenario identifier of the second business scenario.
[0061] Based on the above description of the business scenario stack, finding the first target task generated in the current business scenario among the tasks to be executed may include:
[0062] Enter the business scenario stack from the top of the stack, and determine the task associated with the first scenario identifier;
[0063] Search for the task associated with the first scenario identifier among the tasks to be executed, and use it as the first target task to be executed in the current business scenario.
[0064] Combined with Figure 6 According to the relevant description of the business scenario stack, looking into the business scenario stack from the top, the first scenario identifier is always the scenario identifier of the business scenario that the user currently enters. Therefore, 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 the user enters different business scenarios can be accurately recorded, and the tasks generated in each business scenario can be distinguished, which is convenient for managing tasks according to business scenarios in the tasks to be executed (such as modifying task priorities, deleting tasks, etc.).
[0065] Furthermore, in some embodiments, 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 may include:
[0066] In the business scenario stack, if the first scenario identifier is overwritten by a new scenario identifier, or the first scenario identifier is popped 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 in the tasks to be executed, reduce the priority of the task associated with the first scenario identifier or delete the task associated with the first scenario identifier.
[0067] Combined with reference to Figure 6 . According to the above relevant 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 popped 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 in the tasks to be executed or the priority of the task associated with the first scenario identifier can be reduced.
[0068] Thus, the relevant description of the business scenario stack is completed.
[0069] 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 the business scenario of 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 tasks in the current business scenario cannot be deleted. In view of this, the business scenario where the tasks cannot be deleted can be set as the resident business scenario. When it is monitored that the user enters the next business scenario from the current business scenario and is about 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, the first target task is deleted. If so, the first target task is continued to be executed. In this way, the tasks can be prevented from being accidentally deleted and the reliability of task scheduling can be improved.
[0070] In some embodiments, after the user enters the current business scenario, the application can generate tasks based on all the operations that the user may perform in the current business scenario. However, in reality, when the user is in the current business scenario, the user may only perform a small number of operations. This makes it possible that some of the tasks to be executed are not related to the user's actual operations. If these tasks that are not related to the user's actual operations are put into the thread task queue and executed, on the one hand, it will inevitably cause waste of hardware resources. On the other hand, it may also cause the tasks related to the user's actual operations not to be executed in time. In view of this, when searching for the first target task generated in the current business scenario among the tasks to be executed, a trained prediction model can be used to predict the target operations that will be performed by the user in the current business scenario. Furthermore, the tasks related to the target operations are searched for among the tasks to be executed, and the tasks found are used as the first target tasks generated in the current business scenario. In this way, the execution of tasks that are not related to the user's actual operations can be avoided and the response efficiency of the user's actual operations can be improved.
[0071] The task scheduling method of the present application will be further described below.
[0072] In some embodiments, the tasks in 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:
[0073] When the number of tasks of the first type is greater than the first quantity threshold and the number of tasks of the second type is less than the second quantity threshold, if it is necessary to execute tasks of the first type and tasks of the second type based on the same hardware resources, then adjust the priorities of tasks of the first type and tasks of the second type so that the priority of tasks of the second type is higher than the priority of tasks of the first type.
[0074] For ease of understanding, take the tasks of the first type as CPU-intensive tasks and the tasks of the second type as IO-intensive tasks as an example for illustration. When the number of CPU-intensive tasks is greater than the first quantity threshold, it can indicate that there are more CPU-intensive tasks, which will occupy CPU resources for a long time and there may also be problems that tasks cannot be processed in time. And when the number of IO-intensive tasks is less than the second quantity threshold, it can indicate that there are fewer IO-intensive tasks and the 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), then the priorities of IO-intensive tasks and CPU-intensive tasks can be adjusted so that the priority of IO-intensive tasks is higher than the priority of CPU-intensive tasks. In this way, IO-intensive tasks can be executed prior to 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 ensured that IO-intensive tasks can be processed in time.
[0075] In some embodiments, for a device running an application program, if the power of the device is lower than the power threshold or the heat generation of the device is higher than the heat generation threshold, tasks with low priority can be deleted from the tasks to be executed. In this way, the power consumption and heat generation of the device can be reduced.
[0076] So far, the related description of the task scheduling method of this application has been completed.
[0077] Please refer to Figure 7 , which is a schematic diagram of the modules of the task scheduling system provided by an embodiment of this application. Figure 7 In
[0078] A task acquisition module, configured to acquire tasks to be executed in one or more service scenarios, where a service scenario represents a set of capabilities provided by an application program for achieving a specific goal;
[0079] A task search module, configured to search for first target tasks generated in the current service scenario among the tasks to be executed based on the current service scenario entered by the user;
[0080] A task execution module, configured to use the first target task as the task with the highest priority to be executed, and sequentially execute the tasks to be executed in the order of decreasing priority.
[0081] Please refer to Figure 8 , which is a schematic diagram of an electronic device provided for an embodiment of the present application. The electronic device includes a processor and a memory. The memory is used to store a computer program. When the computer program is executed by the processor, the above-mentioned method is implemented.
[0082] Among them, the processor can be a Central Processing Unit (CPU). The processor can also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. chips, or combinations of the above types of chips.
[0083] As a non-transitory computer-readable storage medium, the memory 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 method in the embodiment of the present invention. By running the non-transitory software programs, instructions, and modules stored in the memory, the processor can execute various functional applications and data processing of the processor, that is, implement the method in the above method embodiment.
[0084] The memory can include a program storage area and a data storage area. Among them, the program storage area can store an operating system and application programs required for at least one function; the data storage area can store data created by the processor, etc. In addition, the memory can include high-speed random access memory, and can also include non-transitory memory, such as at least one disk storage device, a flash memory device, or other non-transitory solid-state storage devices. In some embodiments, the memory may optionally include a memory remotely provided relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above networks include, but are not limited to, the Internet, an enterprise intranet, a local area network, a mobile communication network, and combinations thereof.
[0085] An embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium is used to store a computer program. When the computer program is executed by the processor, the above-mentioned method is implemented.
[0086] Although the embodiments of the present disclosure have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present disclosure, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A task scheduling method, characterized in that, The method includes: Obtaining tasks to be executed in one or more business scenarios, where the business scenarios represent a set of capabilities provided by an application for achieving 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; Regarding the first target task as the task with the highest priority, and sequentially executing the tasks to be executed in the order of highest to lowest priority.
2. The method according to claim 1, wherein After regarding the first target task as the task with the highest priority to be executed, the method further includes: 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 regarding the second target task as the task with the highest priority to be executed.
3. The method according to claim 1, characterized in that After finding the first target task, the method further includes: 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 regarding the third target task generated in the next business scenario as the new task with the highest priority.
4. The method according to claim 3, characterized in that For any business scenario, after the user enters the business scenario, the method further includes: In a pre-established business scenario stack, pushing a scenario identifier for 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 to determine 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, it is determined that the user enters the next business scenario from the current business scenario, and in the tasks to be executed, reducing the priority of the task associated with the first scenario identifier or deleting the task associated with the first scenario identifier.
6. The method according to claim 3, wherein If it is detected that the user enters the next business scenario from the current business scenario, deleting the first target task 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 The searching for a first target task generated in the current business scenario among the tasks to be executed includes: Based on a trained prediction model, predicting the target operation to be executed by the user in the current business scenario; Searching for the task related to the target operation among the tasks to be executed, and regarding the found task as the first target task.
8. The method according to claim 1, wherein The to-be-executed tasks include first-type tasks and second-type tasks, and the method further includes: When the number of first-type tasks is greater than a first quantity threshold and the number of second-type tasks is less than a second quantity threshold, if it is necessary to execute the first-type tasks and the second-type tasks based on the same hardware resources, then adjust the priorities of the first-type tasks and the second-type tasks so that the priority of the second-type tasks is higher than that of the first-type tasks.
9. A task scheduling system, characterized in that, The system includes: A task acquisition module, configured to acquire to-be-executed tasks in one or more service scenarios, where the service scenario represents a set of capabilities provided by an application program for achieving a specific goal; A task search module, configured to search for first target tasks generated in the current service scenario among the to-be-executed tasks based on the current service scenario entered by the user; 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 of priority from high to low.
10. A computer-readable storage medium, characterized in that, 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 in any one of claims 1 to 8 is implemented.
11. An electronic device, characterized in that, 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 described in any one of claims 1 to 8 is implemented.