Task processing method and apparatus, device, storage medium, and program product
By splitting tasks into subtasks and executing them in parallel, the problem of low efficiency in traditional task processing is solved, achieving more efficient task execution and resource utilization.
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2025-09-22
- Publication Date
- 2026-05-07
AI Technical Summary
In traditional task processing methods, the serial execution of multiple task requests leads to inefficiency, task execution failure when resources are scarce, and the limited system resources when multiple tasks involve multiple applications result in long task execution times.
The task is broken down into multiple subtasks, task groups are determined based on the dependencies between subtasks, subtasks in the task groups are executed in parallel, and task groups are scheduled according to their execution order to improve execution efficiency.
By executing subtasks in parallel, the efficiency of multitasking is improved, task execution time is reduced, and the risk of resource conflicts and failures is lowered.
Smart Images

Figure CN2025123003_07052026_PF_FP_ABST
Abstract
Description
Methods, apparatus, devices, storage media, and program products for task processing
[0001] This application claims priority to Chinese Patent Application No. 202411535542.9, filed on October 30, 2024, entitled “Method, Apparatus, Device, Storage Medium and Program Product for Task Processing”, the entire contents of which are incorporated herein by reference. Technical Field
[0002] The exemplary embodiments disclosed herein relate generally to the field of computers, and more particularly to methods, apparatuses, electronic devices, computer-readable storage media, and computer program products for task processing. Background Technology
[0003] With the development of information technology, various terminal devices can provide people with a variety of services in work and life. For example, terminal devices can be equipped with applications that provide services. Terminal devices or applications can provide users with task processing functions to assist users in using the terminal devices or applications. Terminal devices can receive task requests from users, execute the tasks corresponding to the task requests, and provide corresponding responses to users based on the task execution results. Summary of the Invention
[0004] In a first aspect of this disclosure, a task processing method is provided. The method includes: determining, based on multiple task requests indicating corresponding tasks, subtasks contained in multiple tasks corresponding to the multiple task requests, and dependencies between the subtasks of each task; determining, at least based on the dependencies between the subtasks of the multiple tasks, the partitioning of the subtasks in the multiple tasks into one or more task groups, and the execution order between the one or more task groups, each task group including one or more subtasks from the multiple tasks; sequentially scheduling each task group in the one or more task groups for execution according to the execution order between the task groups, wherein for each scheduled task group, one or more subtasks in the scheduled task group are executed in parallel; and for each task in the multiple tasks, generating a task response corresponding to the corresponding task based on the execution results of the subtasks contained in the corresponding task.
[0005] In a second aspect of this disclosure, an apparatus for task processing is provided. The apparatus includes: a subtask determination module configured to determine, based on multiple task requests indicating corresponding tasks, subtasks contained in multiple tasks corresponding to the multiple task requests, and dependencies between the subtasks of each task; a task group determination module configured to determine, at least based on the dependencies between the subtasks of the multiple tasks, the partitioning of the subtasks in the multiple tasks into one or more task groups, and the execution order between the one or more task groups, each task group including one or more subtasks from the multiple tasks; a task group scheduling module configured to sequentially schedule each of the one or more task groups for execution according to the execution order between the task groups, wherein for each scheduled task group, one or more subtasks in the scheduled task group are executed in parallel; and a task response generation module configured to generate a task response corresponding to each task from the multiple tasks, based on the execution results of the subtasks contained in the corresponding task.
[0006] In a third aspect of this disclosure, an electronic device is provided. The device includes at least one processor; and at least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor. When executed by the at least one processor, the instructions cause the electronic device to perform the method of the first aspect.
[0007] In a fourth aspect of this disclosure, a computer-readable storage medium is provided. The computer-readable storage medium stores computer-executable instructions that, when executed by a processor, implement the method of the first aspect.
[0008] In a fifth aspect of this disclosure, a computer program product is provided. The computer program product includes computer-executable instructions, wherein when executed by a processor, the computer-executable instructions implement the method according to a first aspect of this disclosure.
[0009] It should be understood that the content described in this content section is not intended to limit the key or essential features of the embodiments of this disclosure, nor is it intended to restrict the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0010] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. In the drawings, the same or similar reference numerals denote the same or similar elements, wherein:
[0011] Figure 1 shows a schematic diagram of an example environment in which embodiments of the present disclosure can be implemented;
[0012] Figure 2 shows a flowchart of a method for task processing according to some embodiments of the present disclosure;
[0013] Figure 3 illustrates an example of determining subtasks and dependencies between subtasks according to some embodiments of the present disclosure;
[0014] Figure 4 illustrates an example of determining a task group according to some embodiments of the present disclosure;
[0015] Figure 5 illustrates an example of a scheduling tree according to some embodiments of the present disclosure;
[0016] Figure 6 illustrates an example structural block diagram of a task processing apparatus according to some embodiments of the present disclosure; and
[0017] Figure 7 shows a block diagram of an electronic device that can implement one or more embodiments of the present disclosure. Detailed Implementation
[0018] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0019] In the description of embodiments of this disclosure, the term "comprising" and similar terms should be understood as open-ended inclusion, i.e., "including but not limited to". The term "based on" should be understood as "at least partially based on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0020] In this document, unless explicitly stated otherwise, performing a step in response to A does not mean that the step is performed immediately after A, but may include one or more intermediate steps.
[0021] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition, use, storage or deletion of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0022] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure through appropriate means in accordance with relevant laws and regulations, and user authorization should be obtained.
[0023] For example, in response to receiving a user's active request, a prompt message is sent to the user to clearly inform the user that the requested operation will require the acquisition and use of the user's personal information, thereby enabling the user to choose whether to provide personal information to the software or hardware such as electronic devices, applications, servers or storage media that perform the operation of the technical solution disclosed herein, based on the prompt message.
[0024] As an optional but non-restrictive implementation, in response to a user's active request, a prompt message can be sent to the user, such as a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0025] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0026] As used in this paper, the term "model" refers to a model that learns the relationship between inputs and outputs from training data, enabling it to generate corresponding outputs for a given input after training. Model generation can be based on machine learning techniques. Deep learning is a machine learning algorithm that processes inputs and provides corresponding outputs using multiple layers of processing units. A neural network model is an example of a deep learning-based model. In this paper, "model" may also be referred to as a "machine learning model," "learning model," "machine learning network," or "learning network," and these terms are used interchangeably.
[0027] A neural network is a machine learning network based on deep learning. A neural network processes input and provides a corresponding output, typically consisting of an input layer, an output layer, and one or more hidden layers between the input and output layers. Neural networks used in deep learning applications often include many hidden layers, thus increasing the network's depth. The layers of a neural network are connected sequentially, so that the output of the previous layer is provided as the input to the next layer. The input layer receives the input to the neural network, while the output layer's output serves as the final output. Each layer of a neural network includes one or more nodes (also called processing nodes or neurons), each node processing the input from the layer above.
[0028] Machine learning typically comprises three phases: training, testing, and application (also known as inference). In the training phase, a given model is trained using a large amount of training data, iteratively updating parameter values until the model can consistently generate inferences that meet the expected goals from the training data. Through training, the model can be considered to have learned the relationship between inputs and outputs (also known as an input-output mapping) from the training data. The parameter values of the trained model are determined. In the testing phase, test inputs are applied to the trained model to test whether it can provide the correct output, thus determining the model's performance. The testing phase can sometimes be integrated into the training phase. In the application or inference phase, the trained model can be used to process actual model inputs based on the trained parameter values to determine the corresponding model output.
[0029] Figure 1 illustrates a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. In this example environment 100, an application 112 and a digital assistant 114 are installed on a client device 110. A user 130 can interact with the application 112 via the client device 110 and / or an attached device to the client device 110. In some implementations, the application 112 may be authorized to capture the user 130's voice via an audio capture device (e.g., a microphone) of the client device 110.
[0030] In some embodiments, application 112 and digital assistant 114 may be downloaded and installed on client device 110. In some embodiments, application 112 and digital assistant 114 may also be accessed in other ways, such as through a web page.
[0031] In embodiments of this disclosure, application 112 can be any suitable application with task processing capabilities, including but not limited to one or more of the following: chat application components (also known as instant messaging application components), browser application components, planning application components, document application components, audio / video conferencing application components, email application components, task application components, calendar application components, goal and key results (OKR) application components, etc. It is understood that although a single application business component is shown in Figure 1, multiple application business components can actually be installed on the client device 110. In some embodiments, application 112 may include a multi-functional collaboration platform, such as an office collaboration platform (also known as an office suite) that can provide integration of various types of business components to facilitate people's office work, communication, and other activities. In a multi-functional collaboration platform, people can launch different business components as needed to complete corresponding information processing, sharing, communication, etc.
[0032] In some embodiments, the digital assistant 114 may be provided by a separate application business component, or it may be integrated into an application 112 capable of providing content entities. The application business component providing the client interface for the digital assistant may correspond to a single-function application business component or a multi-functional collaboration platform, such as an office suite or other collaboration platform capable of integrating multiple components. It is understood that, similar to application business components, although a single digital assistant is shown in Figure 1, there may actually be multiple digital assistants.
[0033] In some embodiments, the digital assistant 114 supports the use of plugins. Each plugin can provide one or more functions of the application. Such plugins include, but are not limited to, one or more of the following: search plugin, contact plugin, messaging plugin, document plugin, form plugin, email plugin, calendar plugin, schedule plugin, task plugin, etc.
[0034] Digital assistant 114 is a user's intelligent assistant, possessing intelligent dialogue and information processing capabilities. In embodiments of this disclosure, digital assistant 114 is used to interact with user 130 to assist user 130 in using terminal devices or applications. In some embodiments, multiple interaction modes between user 130 and digital assistant 114 can be provided, and users can flexibly switch between these modes. When a certain interaction mode is triggered, a corresponding interaction area is presented to facilitate interaction between user 130 and digital assistant 114. The interaction methods between user 130 and digital assistant 114 differ under different interaction modes, thus flexibly adapting to the interaction needs of different application scenarios.
[0035] In environment 100, in response to the launch of application 112, client device 110 may present an interface 140 of application 112 and / or digital assistant 114. Interface 140 may include, for example, an interactive interface for application 112 and digital assistant 114, which may display an interaction window between user 130 and digital assistant 114. In the interaction window, user 130 can interact with digital assistant 114 by inputting natural language, images, audio files, video files, web pages, etc., to instruct the digital assistant to assist in completing various tasks.
[0036] The interaction window between the digital assistant 114 and the user 130 may include a session window, such as a session window in an instant messaging application or an instant messaging module of a specific application. In the session window, the interaction between the digital assistant 114 and the user 130 may be presented in the form of session messages. Alternatively or additionally, the interaction window between the digital assistant 114 and the user 130 may also include other types of windows, such as a floating window, in which the user 130 can trigger the digital assistant 114 to perform corresponding operations by entering commands, selecting shortcuts, etc.
[0037] In some embodiments, the digital assistant 114 may support a conversation window interaction mode, also known as conversation mode. In this interaction mode, a conversation window is presented between the user 130 and the digital assistant 114, where the user 130 and the digital assistant 114 interact through conversation messages. In conversation mode, the digital assistant 114 can perform tasks based on the conversation messages in the conversation window. In the interaction window, the user 130 inputs interaction messages, and the digital assistant 114 responds to the user's input by providing a reply message. A conversation window with the digital assistant 114 can be opened by selecting the digital assistant 114. The conversation window may include interface elements for information interaction, such as input boxes, message lists, message bubbles, etc.
[0038] In some embodiments, a communication connection is established between the client device 110 and the server device 120. The communication connection can be established via wired or wireless means. The communication connection may include, but is not limited to, Bluetooth, mobile network, Universal Serial Bus (USB), and Wireless Fidelity (WiFi) connections, etc., and the embodiments of this disclosure are not limited in this respect. In the embodiments of this disclosure, the client device 110 and the server device 120 can perform signaling interaction through their communication connection to provide services to the application 112 and / or the digital assistant 114.
[0039] In some embodiments, client device 110 and / or server device 120 may invoke one or more machine learning models to support the task processing functions of application 112 based on the output of the machine learning models. The machine learning models may be deployed locally on client device 110 and / or server device 120, or they may be deployed on other devices. The machine learning models may be based on any suitable model architecture, including but not limited to Transformer models, convolutional neural networks (CNNs), recurrent neural networks (RNNs), deep neural networks (DNNs), and so on. In some embodiments, the machine learning model may be based on a language model (LM). Language models, by learning from a large corpus, are capable of question answering. Machine learning models may also be based on other suitable models. It should be noted that if the machine learning model includes multiple machine learning models, these multiple machine learning models may have different uses and functions, and this disclosure does not limit this.
[0040] Client device 110 can be any type of mobile terminal, fixed terminal, or portable terminal, including mobile phones, desktop computers, laptop computers, notebook computers, netbook computers, tablet computers, media computers, multimedia tablets, personal communication system (PCS) devices, personal navigation devices, personal digital assistants (PDAs), audio / video players, digital cameras / camcorders, positioning devices, television receivers, radio receivers, e-book devices, gaming devices, or any combination thereof, including accessories and peripherals of these devices or any combination thereof. In some embodiments, client device 110 may also support any type of user-facing interface (such as "wearable" circuitry).
[0041] The server-side device 120 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms. The server-side device 120 may include, for example, computing systems / servers such as mainframes, edge computing nodes, and computing devices in a cloud environment, etc.
[0042] It should be understood that the structure and function of the various elements in environment 100 are described for illustrative purposes only and do not imply any limitation on the scope of this disclosure.
[0043] In human-computer interaction, users can input task requests via voice or text, and the system analyzes these requests to determine and execute the tasks. Traditionally, only a question-and-answer type of task execution is supported, meaning only one task request from the user can be executed at a time. If a user inputs multiple task requests, the corresponding tasks must be executed sequentially, leading to prolonged execution times and poor efficiency. Furthermore, multiple tasks often involve multiple applications. Since system resources are often limited, under resource constraints, tasks may fail due to processes being killed while executing them, or due to insufficient resource availability, resulting in prolonged execution times. Therefore, traditional task execution methods suffer from poor efficiency and low success rates.
[0044] In view of the above, according to embodiments of this disclosure, an improved task processing scheme is provided. According to the scheme of embodiments of this disclosure, based on multiple task requests indicating corresponding tasks, the subtasks contained in the multiple tasks corresponding to the multiple task requests are determined, as well as the dependencies between the subtasks of each task. At least based on the dependencies between the subtasks of each of the multiple tasks, the subtasks in the multiple tasks are divided into one or more task groups, and the execution order between the one or more task groups is determined, where each task group includes one or more subtasks from the multiple tasks. According to the execution order between task groups, each task group in the one or more task groups is sequentially scheduled for execution, wherein for each scheduled task group, one or more subtasks in the scheduled task group are executed in parallel. For each task in the multiple tasks, a task response corresponding to the corresponding task is generated based on the execution results of the subtasks contained in the corresponding task.
[0045] In this way, a task can be broken down into multiple subtasks, and then task groups can be determined based on the dependencies between the subtasks. Each task group can include at least one subtask belonging to at least one task. Tasks assigned to a task group can be executed in parallel, which can improve the execution efficiency of multiple tasks.
[0046] The following description will continue with reference to the accompanying drawings, which will provide some exemplary embodiments of this disclosure.
[0047] Figure 2 shows a flowchart of a method 200 for task processing according to some embodiments of the present disclosure. For ease of discussion, method 200 will be described with reference to the environment 100 of Figure 1. Method 200 may be implemented at client device 110 and / or server device 120. For ease of description, it will be illustrated by taking the implementation of method 200 at client device 110 as an example.
[0048] It should be noted that some operations described with reference to client device 110 may require the assistance of server device 120. Specifically, the operations performed by client device 110 may be performed by relevant applications and / or digital assistants installed on client device 110.
[0049] In box 210, client device 110 determines the subtasks contained in the multiple tasks corresponding to the multiple task requests, as well as the dependencies between the subtasks of each task, based on the multiple task requests indicating the corresponding tasks.
[0050] In some embodiments, client device 110 may receive task requests from a user (e.g., user 130) in any suitable manner. For example, client device 110 may receive task requests input by the user via a microphone, input field, etc. In some embodiments, a task request may include a user question to the digital assistant. Client device 110 receives user questions during user interaction with the digital assistant. For example, client device 110 may receive user questions from the user in the interactive interface of application 112 and / or digital assistant 114, and determine the user question as a task request in response to the user question indicating a task. The task request may be presented in the interactive interface, for example, in the form of a conversation message from the user. It is understood that during user interaction with the digital assistant, client device 110 may receive multiple task requests, which correspond to multiple tasks.
[0051] Each task can include at least one subtask. A subtask is the smallest unit / granularity of a task. A subtask can also be referred to as the atomic unit, atomic capability, or atomic operation of a task. In other words, each task can include at least one atomic unit, atomic capability, or atomic operation. It can be understood that if a task includes only one subtask, then that subtask is itself. The following example illustrates this with multiple subtasks per task. For instance, if a user initiates a task via voice with the command "Turn on Bluetooth and send a file to friend A via Bluetooth," this task can be broken down into two subtasks: "Turn on Bluetooth" and "Send a file to friend A via Bluetooth."
[0052] In some embodiments, the client device 110 may first determine the task corresponding to the task request, and then determine the multiple subtasks included in the task. For example, the client device 110 may determine the task corresponding to the task request and the multiple subtasks included in the task based on the semantics of the task request. Alternatively, the client device 110 may also determine keywords in the task request and determine the task corresponding to the task request and the multiple subtasks included in the task through keyword matching.
[0053] The client device 110 can then determine the dependencies between subtasks based on the execution conditions (or execution parameters, etc.) required for each subtask. The client device 110 can determine the execution conditions (also known as the inputs required by the atomic unit) and execution results (also known as the outputs of the atomic unit) corresponding to each of the multiple subtasks, and can determine the dependencies between multiple subtasks based on their respective execution conditions and results. For example, if subtask A is "turn on Bluetooth" and subtask B is "send a file to friend A via Bluetooth", then subtask B needs to be executed only after subtask A is successfully executed. This can be described as subtask B's execution conditions including the execution result of subtask A. In this case, it can be determined that subtask B depends on subtask A. Subtasks and their corresponding execution conditions and results can be collectively referred to as atomic capabilities; that is, atomic capabilities can be viewed as encapsulated descriptions of atomic units, including the inputs and outputs corresponding to the atomic units.
[0054] In some embodiments, dependencies between subtasks indicate the execution order of multiple subtasks. For example, if subtask B depends on subtask A, then subtask A must be executed first, followed by subtask B. In some embodiments, dependencies between subtasks can also indicate sequential and / or parallel execution relationships. For example, if subtask A depends on subtask B, then subtask A and subtask B can be determined to have a sequential execution relationship (i.e., one is executed first, then the other). If subtask A does not depend on subtask B, and the two do not affect each other, then subtask A and subtask B can be determined to have a parallel execution relationship (i.e., both subtasks can be executed simultaneously). In other words, subtasks that do not have dependencies on each other can be determined to have a parallel execution relationship. If a subtask directly or indirectly depends on other subtasks, then the sequential execution order of these subtasks needs to be determined.
[0055] In some embodiments, the client device 110 may include a task parsing unit and a task execution unit. The parsing unit may be configured to determine, based on the task request, the task corresponding to the task request, the subtasks included in the task, and the dependencies between the subtasks. The parsing unit may also be further configured to determine, based on the task corresponding to the task request, the subtasks included in the task, and the dependencies between the subtasks, a task delivery protocol that may indicate the subtasks included in the task corresponding to the task request and the dependencies between the subtasks.
[0056] The parsing unit can provide the task distribution protocol to the execution unit. The execution unit can then determine the subtasks included in the task request and the dependencies between them based on the task distribution protocol. Furthermore, the execution unit can determine the dependency graph (DAG) between the subtasks based on the determined subtasks and their dependencies, and then determine the sequence list of the subtasks based on the dependency graph.
[0057] Referring to FIG3, FIG3 illustrates an example 300 of determining subtasks and dependencies between subtasks according to some embodiments of the present disclosure. As shown in example 300, client device 110 may determine that task 310 includes nine subtasks, subtask 1 to subtask 9. In some embodiments, client device 110 may, for example, determine a dependency graph (DAG, directed acyclic graph) between subtasks based on the dependencies between subtasks, and then determine a sequence list between subtasks based on the dependency graph.
[0058] For example, if the execution conditions of subtask 3 include the execution results of subtask 4 and subtask 5, then client device 110 can determine that subtask 3 depends on subtasks 4 and 5. Further, if subtask 4 depends on subtasks 6 and 7, subtask 5 depends on subtasks 7 and 8, and subtask 8 depends on subtask 9, then it can also be determined that subtask 3 indirectly depends on subtasks 6, 7, 8, and 9. Client device 110 can then determine the dependency graph 320 for subtask 3 based on the above dependencies. Each circle in dependency graph 320 represents a subtask.
[0059] Client device 110 can determine the order list 330 between subtasks based on dependency graph 320. For example, client device 110 can determine based on dependency graph 320 that subtask 3 needs to be executed after subtasks 4 and 5, subtask 4 needs to be executed after subtasks 6 and 7, subtask 5 needs to be executed after subtasks 7 and 8, and subtask 8 needs to be executed after subtask 9. Client device 110 can also determine based on dependency graph 320 that there is no dependency between subtasks 6, 7, and 9, and no dependency between subtasks 4 and 8.
[0060] Client device 110 can then determine that subtasks 6, 7, and 9 need to be executed first. Since the execution conditions for subtasks 4 and 8 include the execution results of these three subtasks, client device 110 can further determine that subtasks 4 and 8 can be executed next. Similarly, since the execution conditions for subtask 5 include the execution results of subtasks 7 and 8, client device 110 can determine that subtask 5 can be executed next. Finally, since the execution conditions for subtask 3 include the execution results of subtasks 4 and 5, client device 110 can determine that subtask 3 will be executed last. Therefore, client device 110 can determine that the execution order of subtasks 1 to 9 is: Subtask 1 - Subtask 2 - (Subtasks 6, 7, and 9) - (Subtasks 4 and 8) - Subtask 5 - Subtask 3, where subtasks 6, 7, and 9 can be executed in parallel, and subtasks 4 and 8 can be executed in parallel.
[0061] It is understood that the above sequence list 330 and the execution order of multiple subtasks are merely examples. Client device 110 may also determine other suitable sequence lists and execution orders based on dependency graph 320. For example, client device 110 may also determine the execution order of subtasks 1 to 9 based on the hierarchy of dependency graph 320 as subtask 1 --> subtask 2 --> subtask 9 --> (subtask 6, subtask 7, and subtask 8) --> (subtask 4 and subtask 5) --> subtask 3, where subtasks 6, 7, and 8 can be executed in parallel, and subtasks 4 and 5 can be executed in parallel.
[0062] In some embodiments, the client device 110 may also utilize a trained machine learning model to determine the task corresponding to the task request, the subtasks contained in the task, and the dependencies between the subtasks. This trained machine learning model may be deployed locally on the client device 110 or on another device. The trained machine learning model can be any suitable model, for example, a language model. The client device 110 may utilize the trained machine learning model to perform semantic analysis on the task request to determine the task corresponding to the task request, the subtasks contained in the task, and the dependencies between the subtasks. The model input to the machine learning model may be, for example, the task request, and the model output may be, for example, the task corresponding to the task request, the subtasks contained in the task, and the dependencies between the subtasks.
[0063] In some embodiments, the execution unit can also transform the dependency graph and sequence list into jobs corresponding to the task requests. A "job" refers to an execution abstraction of a task, which may contain one or more atomic capabilities and dependencies between different atomic capabilities (this can indicate the execution order of subtasks). The execution unit may, for example, perform subsequent partitioning, sorting, and execution of task groups based on jobs, which will be described in detail later.
[0064] In box 220, the client device 110 determines, at least based on the dependencies between the subtasks of the multiple tasks, the partitioning of the subtasks of the multiple tasks into one or more task groups, and the execution order between the one or more task groups, each task group including one or more subtasks of the multiple tasks.
[0065] For a given task (which can be any of multiple tasks), in some embodiments, the client device 110 can group subtasks that are executed in parallel into the same task group. For example, referring to FIG3, the client device 110 can group subtasks 6, 7, and 9 that are executed in parallel into the same task group, and subtasks 4 and 8 that are executed in parallel into the same task group. In some embodiments, the client device 110 can also group subtasks that are executed sequentially into different task groups. For example, referring to FIG3, the client device 110 can group subtasks 1, 2, 6, 4, 5, and 3 that are executed sequentially into different task groups. It is understood that the execution order of different task groups is based on the order among the subtasks that are executed sequentially. For example, if a dependency indicates that subtask 2 is executed after subtask 1, then the task group to which subtask 2 is assigned needs to be executed after the task group to which task 1 is assigned.
[0066] The client device 110 can determine the task groups to which subtasks from multiple tasks are assigned using the method described above. Considering that task requests will continuously arrive, the client device 110 will continuously parse newly arriving tasks and divide them into subtasks. In some embodiments, multiple tasks can be sequentially placed into a task queue, and the task scheduler can schedule the tasks in the task queue and parse the subtasks. For subtasks of multiple tasks, in some embodiments, since the execution between task groups has a serial order, while subtasks within a task group will be executed in parallel, the client device 110 can also perform conflict detection on multiple tasks based on predetermined conflict detection rules to avoid conflicts in the execution of certain subtasks of multiple tasks. The client device 110 can then determine the allocation of subtasks from multiple tasks to one or more task groups, and the execution order between one or more task groups, based on the conflict detection results of multiple tasks.
[0067] In some embodiments, conflict detection rules may stipulate that multiple subtasks belonging to different tasks and used to call the same functional unit cannot be assigned to the same task group. Specifically, if it is detected that a first subtask of a first task and a second subtask of a second task are configured to call the same first functional unit, the client device 110 can assign the first subtask and the second subtask to different task groups. For example, if the first subtask is to turn on Bluetooth and the second subtask is to turn off Bluetooth, then the first subtask and the second subtask need to be assigned to different task groups.
[0068] In some embodiments, the conflict detection rules may further stipulate that multiple subtasks belonging to different tasks and configured to perform user interface operations cannot be grouped into the same task group. Specifically, if it is detected that a third subtask of a third task and a fourth subtask of a fourth task are configured to perform user interface operations, the client device 110 may group the third and fourth subtasks into different task groups. For example, if the third subtask is playing video A via the screen and the fourth subtask is presenting a chat window via the screen, then the third and fourth subtasks need to be grouped into different task groups.
[0069] In some embodiments, the conflict detection rule may further stipulate that multiple subtasks belonging to different tasks and having a result dependency relationship cannot be assigned to the same task group. Specifically, if it is detected that the fifth subtask of the fifth task depends on the target state of the second functional unit and the sixth subtask of the sixth task is configured to change the target state of the second functional unit, the client device 110 can determine that the fifth subtask and the sixth subtask have a result dependency relationship, and thus assign the fifth subtask and the sixth subtask to different task groups. For example, if the fifth subtask is to send a file to a friend via Bluetooth and the sixth subtask is to turn off Bluetooth, since the execution of the fifth subtask requires Bluetooth to be on and the sixth subtask is configured to switch Bluetooth to off, it can be determined that the fifth subtask and the sixth subtask have a result dependency relationship, and thus assign the fifth subtask and the sixth subtask to different task groups.
[0070] It's important to note that if the fifth subtask is assigned to the first task group and the sixth subtask to the second task group, the second task group will be executed after the first task group. Continuing with the example above, the fifth subtask relies on Bluetooth to turn on, so the sixth subtask's task of turning off Bluetooth must be executed only after the fifth subtask has finished. Therefore, the first task group to which the fifth subtask is assigned must be executed before the sixth task group to which the sixth subtask is assigned.
[0071] Referring to FIG4, FIG4 illustrates an example 400 of determining task groups according to some embodiments of the present disclosure. As shown in Example 400, client device 110 can determine the multiple subtasks included in each of the N tasks, from task 1 to task N (task N can be any suitable positive integer), and the dependencies between the subtasks of each task. If task 1 includes K subtasks from subtask 11 to subtask 1K, task 2 includes L subtasks from subtask 21 to subtask 2L, and task N includes M subtasks from subtask N1 to subtask NM (where K, L, and M can be any suitable positive integers), then client device 110 can determine, based on the dependencies between the subtasks of each subtask and the conflict detection results of multiple tasks, that the subtasks included in these N tasks should be divided into O (O can be any suitable positive integer) task groups, each task group including at least one subtask.
[0072] It should be noted that in some embodiments, the client device 110 can continuously receive task instructions, that is, the client device 110 can receive new tasks. For example, the client device 110 can first determine a task group based on a plurality of already determined tasks and their corresponding subtasks. In response to receiving a new task, the client device 110 can update this task group based on the subtasks included in the new task. It is understood that the number of task groups included in the updated task group and the subtasks included in the unexecuted task groups may differ from the number of task groups included in the original task group and the subtasks included in the unexecuted task groups.
[0073] In some embodiments, to improve the efficiency of task execution, the client device 110 may determine only one task group to be executed at a time, and in response to the completion (or imminent completion) of that task group, determine the next task group to be executed based on the subtasks included in the newly received task. For example, the client device 110 may determine the task group A to be executed based on the multiple subtasks included in task A (e.g., which may include subtasks A, B, and C) and task B (e.g., which may include subtasks D and E), where task group A may include, for example, subtasks A and D.
[0074] If client device 110 receives task request C during the execution of task group A, then client device 110 can determine the task C corresponding to task request C, the subtasks included in task C (e.g., subtasks F and G), and the dependencies between the subtasks included in task C. Client device 110 can combine the subtasks included in task C to determine the task group B to be executed, which may include, for example, subtasks B, E, and F. Client device 110 can execute task group B in response to the completion of task group A.
[0075] Referring back to Figure 2, in box 230, client device 110 sequentially schedules each task group for execution according to the execution order among the task groups. One or more subtasks within a scheduled task group are executed in parallel.
[0076] In some embodiments, different task groups are executed sequentially. The client device 110 schedules different task groups according to their execution order. For example, referring to Figure 4, the client device 110 may first schedule task group 1 to execute task group 1. If the next task group to be called after task group 1 is task group 2, the client device 110 may schedule task group 2 to execute task group 2 in response to the completion of task group 1. For a scheduled task group, one or more subtasks included therein are executed in parallel. For example, referring to Figure 3, if subtasks 6, 7, and 9 are assigned to a task group, then when that task group is scheduled, subtasks 6, 7, and 9 are executed in parallel.
[0077] The operating system of client device 110 typically schedules resources for each process according to a certain resource scheduling strategy. Generally, the operating system prioritizes scheduling the application currently being used by the user. To ensure that certain tasks, such as those related to a digital assistant, are given priority in resource scheduling, in some embodiments, client device 110 can construct a scheduling tree corresponding to the scheduled task group for tasks initiated by a specific application, such as those initiated via a digital assistant. For example, to schedule task group 1, client device 110 can construct scheduling tree 1 corresponding to task group 1. It can be understood that, in response to task group 1 completing execution, if client device 110 wants to schedule task group 2, then client device 110 can construct scheduling tree 2 corresponding to task group 2. Client device 110 can allocate resources for one or more subtasks within the scheduled task group by traversing the scheduling tree, and utilize the allocated resources to execute one or more subtasks within the scheduled task group.
[0078] Each application corresponds to one process. As mentioned earlier, multiple tasks often involve multiple applications, meaning the client device 110 often needs to schedule multiple processes to execute multiple tasks involving multiple applications. This can be viewed as one task corresponding to one process. Since a task is a collection of multiple subtasks, executing a task requires executing multiple subtasks. The process used to execute the task can include multiple threads corresponding to the subtasks. A thread is also a scheduling unit. In the case of tasks initiated via a digital assistant, the constructed scheduling tree can include multiple nodes. Each child node in the scheduling tree corresponds to a thread of a subtask. The client device 110 can start from the root node of the scheduling tree and sequentially allocate resources to the threads corresponding to each node to schedule multiple threads. In some embodiments, for each child node in the scheduling tree, the client device 110 can delete the child node from the scheduling tree in response to the completion of scheduling of the thread corresponding to that child node.
[0079] Regarding the specific construction method of the scheduling tree, in some embodiments, if multiple task requests are initiated by the user to the digital assistant, in order to ensure that the digital assistant and the user can always maintain interaction and that the tasks can be executed smoothly, the client device 110 can construct a root node in the scheduling tree based on the thread corresponding to the digital assistant. The root node indicates the thread corresponding to the digital assistant.
[0080] Client device 110 can construct one or more first nodes in the scheduling tree connected to the root node based on the threads of subtasks in the task group to be scheduled, each first node indicating a thread for executing the subtasks in the task group to be scheduled. Referring to FIG5, FIG5 illustrates an example 500 of a scheduling tree according to some embodiments of the present disclosure. As shown in example 500, client device 110 can construct the scheduling tree with the digital assistant thread corresponding to the digital assistant as the root node of the scheduling tree. If the task group to be scheduled includes subtask 2 and subtask 4, client device 110 can construct two first nodes to be connected to the root node based on thread 2 corresponding to subtask 2 and thread 4 corresponding to subtask 4. Client device 110 can schedule multiple threads to execute the corresponding multiple subtasks by allocating resources to multiple threads corresponding to multiple first nodes. It is understood that thread 2 and thread 4 here can be scheduled in parallel.
[0081] For a given subtask in a task group to be scheduled (which can be any subtask in the task group), if it is determined that one or more associated threads will be called during the execution of the given subtask, the client device 110 can also construct one or more second nodes in the scheduling tree connected to the first node corresponding to the given subtask. Each second node indicates an associated thread among the one or more associated threads. Continuing to refer to Figure 5, if scheduling thread 2 requires waiting for the resource release of thread 3, the client device 110 can construct a second node connected to the first node corresponding to thread 2 based on thread 3. If scheduling thread 4 requires scheduling thread 5, the client device 110 can construct a second node connected to the first node corresponding to thread 4 based on thread 5.
[0082] Referring back to Figure 2, in box 240, the client device 110 generates the corresponding task response for each of the multiple tasks based on the execution results of the subtasks contained in the corresponding task.
[0083] In some embodiments, the client device 110 may, in response to the completion of subtasks included in a given task, determine the execution result of the given task based on the execution result of the subtasks, and then generate a task response corresponding to the given task based on the execution result of the given task. The task response may indicate the execution result of the task. For example, the task response of task A may indicate that task A was successfully executed. The client device 110 may generate corresponding task responses for each task separately. The client device 110 may also provide the task responses to the user.
[0084] The client device 110 may provide task responses in any suitable manner, including but not limited to playing audio, playing video, displaying images, displaying text, vibrating, flashing the screen, highlighting the screen, etc. In some embodiments, the task request includes a user question to the digital assistant, and the client device 110 may determine the digital assistant's response to the user question based on the task response corresponding to the task request. For example, if the task request is "Turn on Bluetooth and send a file to friend A via Bluetooth," the task response may indicate that the task was successfully executed and the file has been sent to friend A, then the client device 110 may determine that the response is "Okay, the file has been sent to friend A."
[0085] In summary, a task can be broken down into multiple subtasks, and then task groups can be determined based on the dependencies between these subtasks. Each task group can include at least one subtask belonging to at least one task. Multiple tasks can be executed by executing multiple task groups, which can improve the execution efficiency of multiple tasks. Furthermore, for a scheduled task group, resources can be allocated and the subtasks within that task group can be executed according to a scheduling tree, improving the rationality of resource allocation and increasing the success rate of task execution.
[0086] It should be noted that, taking the implementation of process 200 at server device 120 as an example, in response to receiving a task request from the user, client device 110 sends the received task request to server device 120 via the communication connection with server device 120. Server device 120 may also, in response to determining the task response and / or reply, provide the task response and / or reply to client device 110 to instruct client device 110 to provide the task response and / or reply to the user.
[0087] Embodiments of this disclosure also provide corresponding apparatus for implementing the methods or processes described above. FIG6 shows an exemplary structural block diagram of an apparatus 600 for task processing according to some embodiments of this disclosure. The apparatus 600 may be implemented as or included in client device 110 and / or server device 120. The various modules / components in the apparatus 600 may be implemented by hardware, software, firmware, or any combination thereof.
[0088] As shown in Figure 6, the device 600 includes a subtask determination module 610, configured to determine, based on multiple task requests indicating corresponding tasks, the subtasks contained in the multiple tasks corresponding to the multiple task requests, and the dependencies between the subtasks of each task. The device 600 also includes a task group determination module 620, configured to determine, at least based on the dependencies between the subtasks of the multiple tasks, the partitioning of the subtasks in the multiple tasks into one or more task groups, and the execution order between the one or more task groups, where each task group includes one or more subtasks from the multiple tasks. The device 600 also includes a task group scheduling module 630, configured to sequentially schedule each task group in one or more task groups for execution according to the execution order between task groups, wherein for each scheduled task group, one or more subtasks in the scheduled task group are executed in parallel. The device 600 also includes a task response generation module 640, configured to generate a task response corresponding to each task in the multiple tasks, based on the execution results of the subtasks contained in the corresponding task.
[0089] In some embodiments, the task requests among the multiple task requests include user questions for the digital assistant, and the device 600 further includes: a response providing module configured to provide the digital assistant with a response to the user question based on a task response corresponding to the task indicated by the task request.
[0090] In some embodiments, the dependencies between subtasks in a task indicate serial execution relationships and / or parallel execution relationships, and the task group determination module 620 is further configured to: for a given task among a plurality of tasks, assign subtasks in a parallel execution relationship in the given task to the same task group, and / or assign subtasks in a serial execution relationship in the given task to different task groups, wherein the execution order of different task groups is based on the order among subtasks in a serial execution relationship.
[0091] In some embodiments, the task group determination module 620 is further configured to: determine the division of subtasks in the multiple tasks into one or more task groups, and the execution order among the one or more task groups, based on the conflict detection results of multiple tasks.
[0092] In some embodiments, the task group determination module 620 is further configured to: if it is determined that the first subtask of the first task and the second subtask of the second task are configured to call the same first functional unit, the first subtask and the second subtask are assigned to different task groups; if it is determined that the third subtask of the third task and the fourth subtask of the fourth task are configured to perform user interface operations, the third subtask and the fourth subtask are assigned to different task groups; if it is determined that the fifth subtask of the fifth task depends on the target state of the second functional unit and the sixth subtask of the sixth task is configured to change the target state of the second functional unit, the fifth subtask is assigned to the first task group and the sixth subtask is assigned to the second task group, wherein the second task group is invoked and executed after the first task group.
[0093] In some embodiments, multiple task requests are initiated by the user to the digital assistant, and the task group scheduling module 630 is further configured to: construct a scheduling tree corresponding to the scheduled task group by: constructing a root node in the scheduling tree, the root node indicating the thread corresponding to the digital assistant; constructing one or more first nodes connected to the root node in the scheduling tree, each first node indicating a thread for executing subtasks in the scheduled task group; allocating resources to one or more subtasks in the scheduled task group by traversing the scheduling tree; and using the allocated resources to execute one or more subtasks in the scheduled task group.
[0094] In some embodiments, constructing a scheduling tree for a scheduled task group further includes: for a given subtask in the scheduled task group, if it is determined that one or more associated threads will be invoked during the execution of the given subtask, constructing one or more second nodes in the scheduling tree that are connected to the first node corresponding to the given subtask, each second node indicating an associated thread among the one or more associated threads.
[0095] The modules included in device 600 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more modules may be implemented using software and / or firmware, such as machine-executable instructions stored on a storage medium. In addition to or as an alternative to machine-executable instructions, some or all of the modules in device 600 may be implemented at least partially by one or more hardware logic components. By way of example, and not limitation, exemplary types of hardware logic components that may be used include field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.
[0096] It should be understood that one or more steps in the above methods can be performed by appropriate electronic devices or combinations of electronic devices. Such electronic devices or combinations of electronic devices may, for example, include the client device 110 and / or the server device 120 in FIG1.
[0097] Figure 7 shows a block diagram of an electronic device 700 in which one or more embodiments of the present disclosure may be implemented. It should be understood that the electronic device 700 shown in Figure 7 is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. The electronic device 700 shown in Figure 7 can be used to implement the client device 110 of Figure 1 or the device 600 of Figure 6.
[0098] As shown in Figure 7, the electronic device 700 is in the form of a general-purpose electronic device. Components of the electronic device 700 may include, but are not limited to, one or more processing units or processors 710, memory 720, storage devices 730, one or more communication units 740, one or more input devices 750, and one or more output devices 760. The processor 710 may be a physical or virtual processor and is capable of performing various processes according to the programs stored in the memory 720. In a multiprocessor system, multiple processors execute computer-executable instructions in parallel to improve the parallel processing capability of the electronic device 700.
[0099] Electronic device 700 typically includes multiple computer storage media. Such media can be any accessible media that is accessible to electronic device 700, including but not limited to volatile and non-volatile media, removable and non-removable media. Memory 720 can be volatile memory (e.g., registers, cache, random access memory (RAM)), non-volatile memory (e.g., read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. Storage device 730 can be removable or non-removable media and can include machine-readable media, such as flash drives, disks, or any other media that can be used to store information and / or data and can be accessed within electronic device 700.
[0100] Electronic device 700 may further include additional removable / non-removable, volatile / non-volatile storage media. Although not shown in FIG. 7, disk drives for reading from or writing to removable, non-volatile disks (e.g., "floppy disks") and optical disk drives for reading from or writing to removable, non-volatile optical disks may be provided. In these cases, each drive may be connected to a bus (not shown) via one or more data media interfaces. Memory 720 may include computer program product 725 having one or more program modules configured to perform various methods or actions of various embodiments of the present disclosure.
[0101] The communication unit 740 enables communication with other electronic devices via a communication medium. Additionally, the functionality of the components of the electronic device 700 can be implemented using a single computing cluster or multiple computing machines capable of communicating via communication connections. Therefore, the electronic device 700 can operate in a networked environment using logical connections to one or more other servers, network personal computers (PCs), or another network node.
[0102] Input device 750 can be one or more input devices, such as a mouse, keyboard, trackball, etc. Output device 760 can be one or more output devices, such as a monitor, speaker, printer, etc. Electronic device 700 can also communicate with one or more external devices (not shown) via communication unit 740 as needed. These external devices include storage devices, display devices, etc., and can communicate with one or more devices that enable user interaction with electronic device 700, or with any device that enables electronic device 700 to communicate with one or more other electronic devices (e.g., network card, modem, etc.). Such communication can be performed via input / output (I / O) interface (not shown).
[0103] According to an exemplary implementation of this disclosure, a computer-readable storage medium is provided that stores computer-executable instructions thereon, wherein the computer-executable instructions are executed by a processor to implement the methods described above. According to an exemplary implementation of this disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, which are executed by a processor to implement the methods described above.
[0104] Various aspects of this disclosure are described herein with reference to flowchart illustrations and / or block diagrams of methods, apparatuses, devices, and computer program products implemented according to this disclosure. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer-readable program instructions.
[0105] These computer-readable program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing apparatus to produce a machine such that, when executed by the processor of the computer or other programmable data processing apparatus, they create means for implementing the functions / actions specified in one or more blocks of the flowchart and / or block diagram. These computer-readable program instructions can also be stored in a computer-readable storage medium that causes a computer, programmable data processing apparatus, and / or other device to operate in a particular manner; thus, the computer-readable medium storing the instructions comprises an article of manufacture that includes instructions for implementing aspects of the functions / actions specified in one or more blocks of the flowchart and / or block diagram.
[0106] Computer-readable program instructions can be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions that execute on the computer, other programmable data processing apparatus, or other device to perform the functions / actions specified in one or more boxes of a flowchart and / or block diagram.
[0107] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of an instruction, which contains one or more executable instructions for implementing the specified logical function. In some, as newer, implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0108] Various implementations of this disclosure have been described above. These descriptions are exemplary and not exhaustive, nor are they limited to the disclosed implementations. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described implementations. The terminology used herein is chosen to best explain the principles, practical applications, or improvements to technology in the market, or to enable others skilled in the art to understand the various implementations disclosed herein.
Claims
1. A task processing method, comprising: Based on multiple task requests indicating corresponding tasks, determine the subtasks contained in the multiple tasks corresponding to the multiple task requests, as well as the dependencies between the subtasks of each task. Based at least on the dependencies between the subtasks of the plurality of tasks, the division of the subtasks in the plurality of tasks into one or more task groups, and the execution order between the one or more task groups, are determined, wherein each task group includes one or more subtasks in the plurality of tasks; According to the execution order between the task groups, each task group in the one or more task groups is sequentially scheduled for execution, wherein one or more subtasks in the scheduled task group are executed in parallel for each scheduled task group. as well as For each of the multiple tasks, a task response corresponding to the task is generated based on the execution results of the subtasks contained in the corresponding task.
2. The method of claim 1, wherein the task request in the plurality of task requests includes user questions for a digital assistant, the method further comprising: Based on the task response corresponding to the task indicated by the task request, the digital assistant provides the answer to the user's question.
3. The method of claim 1, wherein the dependencies between subtasks in a task indicate serial execution relationships and / or parallel execution relationships, and wherein determining the partitioning of subtasks in the plurality of tasks into one or more task groups, and the execution order among the one or more task groups, comprises: For a given task among the plurality of tasks Subtasks that are executed in parallel within the given task are grouped into the same task group, and / or The subtasks in the given task that are in a sequential execution relationship are divided into different task groups, wherein the execution order of the different task groups is based on the order among the subtasks that are in a sequential execution relationship.
4. The method of claim 1, wherein determining the division of subtasks into one or more task groups among the plurality of tasks, and the execution order among the one or more task groups, comprises: Based on the conflict detection results of the multiple tasks, the division of subtasks in the multiple tasks into one or more task groups, and the execution order among the one or more task groups are determined.
5. The method according to claim 4, further comprising determining the division of subtasks into one or more task groups and the execution order among the one or more task groups based on conflict detection results of the plurality of tasks, including: If it is determined that the first subtask of the first task and the second subtask of the second task are configured to call the same first functional unit, the first subtask and the second subtask are assigned to different task groups; If it is determined that the third subtask of the third task and the fourth subtask of the fourth task are configured to perform user interface operations, the third subtask and the fourth subtask are assigned to different task groups. If it is determined that the fifth subtask of the fifth task depends on the target state of the second functional unit, and the sixth subtask of the sixth task is configured to change the target state of the second functional unit. The fifth subtask is assigned to the first task group and the sixth subtask is assigned to the second task group, wherein the second task group is invoked and executed after the first task group.
6. The method of claim 1, wherein the plurality of task requests are initiated by a user to a digital assistant, and the parallel execution of one or more subtasks in the scheduled task group comprises: The scheduling tree for the scheduled task group is constructed as follows: A root node is constructed in the scheduling tree, the root node indicating the thread corresponding to the digital assistant; In the scheduling tree, one or more first nodes are constructed connected to the root node, each first node indicating a thread for executing subtasks in the scheduled task group; Resources are allocated to one or more subtasks in the scheduled task group by traversing the scheduling tree. as well as Utilize the allocated resources to execute one or more subtasks within the scheduled task group.
7. The method according to claim 6, wherein constructing the scheduling tree corresponding to the scheduled task group further comprises: For a given subtask in the scheduled task group If it is determined that one or more associated threads will be invoked during the execution of the given subtask, In the scheduling tree, construct one or more second nodes connected to the first node corresponding to the given subtask, each second node indicating an associated thread among the one or more associated threads.
8. An apparatus for task processing, comprising: The subtask determination module is configured to determine, based on multiple task requests indicating corresponding tasks, the subtasks contained in the multiple tasks corresponding to the multiple task requests, as well as the dependencies between the subtasks of each task. The task group determination module is configured to determine, at least based on the dependencies between the subtasks of the plurality of tasks, the division of the subtasks of the plurality of tasks into one or more task groups, and the execution order between the one or more task groups, wherein each task group includes one or more subtasks of the plurality of tasks; The task group scheduling module is configured to sequentially schedule each task group in the one or more task groups for execution according to the execution order between the task groups, wherein one or more subtasks in the scheduled task group are executed in parallel for the scheduled task group. as well as The task response generation module is configured to generate a task response for each of the multiple tasks, based on the execution results of the subtasks contained in the corresponding task.
9. An electronic device, comprising: At least one processor; as well as At least one memory coupled to the at least one processor and storing instructions for execution by the at least one processor, the instructions causing the electronic device to perform the method according to any one of claims 1 to 7 when executed by the at least one processor.
10. A computer-readable storage medium having stored thereon computer-executable instructions that can be executed by a processor to implement the method according to any one of claims 1 to 7.
11. A computer program product comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Dynamic parallelization of a calculation process
CN110622128A
Task processing method, device and equipment
CN117193971A
Method and apparatus for task scheduling across multiple execution sessions
US5902352A