A task scheduling method and device
Patent Information
- Application Number
- CN202510561674.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-29
- Publication Date
- 2026-10-30
AI Technical Summary
[0003]已有技术中,往往采用穷举的方式来进行调度问题的计算,这会导致计算开销过大
Smart Images

Figure CN123014427A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of scheduling, and more particularly to a task scheduling method and apparatus thereof. Background Technology
[0002] Scheduling is one of the most common problems in large-scale manufacturing, logistics, and production processes, and its meaning varies depending on the context. For example, logistics scheduling mainly refers to the rational arrangement and dispatching of vehicles and personnel by logistics companies based on factors such as the weight, destination, specifications, and urgency of goods to be shipped.
[0003] In existing technologies, exhaustive methods are often used to calculate scheduling problems, which leads to excessive computational overhead. Summary of the Invention
[0004] This application discloses a task scheduling method that can reduce the overhead (time overhead and computing power overhead) of solving the problem while ensuring the solution effect.
[0005] In a first aspect, this application provides a task scheduling method, the method comprising: obtaining a plurality of different combinations of first time windows for a first task; each combination of first time windows including a candidate time window for executing the first task and a candidate time window for executing each of a plurality of second tasks; the first task being a parent task of the plurality of second tasks and a child task of a third task; determining a combination of time windows for executing the first task and the plurality of second tasks from the plurality of first time window combinations based on the degree of overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each combination of first time windows; and determining a time window for executing the third task based on the combination of time windows used for executing the first task and the plurality of second tasks.
[0006] The approach of this application embodiment is as follows: when solving the parent-child task, multiple time window combinations of the parent-child task are first obtained. Different time window combinations are different combinations of candidate time windows of the parent-child task. Then, the time window combination with higher overlap between the parent and child tasks can be selected from the multiple time window combinations, thereby reducing the overall time cost. Moreover, the parent-child task solution is first performed at a finer granular level (that is, in the tree-like task structure, tasks closer to the leaf direction, that is, tasks further away from the root direction). Then, based on the solution results of the finer granular parent-child task, the solution of the parent-child task at the next higher level is performed. Compared with the method of solving by exhaustive search, the solution cost (time cost and computing power cost) can be reduced while ensuring the solution effect.
[0007] In one possible implementation, the third task includes multiple sub-tasks, including the first task. Determining the time window for executing the third task based on the time window combinations used when executing the first task and the multiple second tasks includes: acquiring multiple different second time window combinations for the third task; each second time window combination includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple sub-tasks; the candidate time window for the first task in each second time window combination is indicated in the time window combinations used when executing the first task and the multiple second tasks; determining the time window combination for executing the third task and the multiple sub-tasks from the multiple second time window combinations based on the degree of overlap between the candidate time windows for the third task and the candidate time windows for the multiple sub-tasks in each second time window combination.
[0008] In this embodiment, the finest-grained parent-child task can be solved first, and then the solution can be gradually applied to the coarser-grained parent task.
[0009] In one possible implementation, the overlap is related to first information: the first information is positively correlated with a first time length and negatively correlated with a second time length, where the first time length is the length of the overlapping time window between the parent task and one included child task, and the second time length is the length of the child task's time window. The first information can represent the relative compatibility of the time windows between the parent task and the child task; a larger value indicates a greater degree of matching between the parent task and the child task.
[0010] In one possible implementation, the first information is the ratio of the first time length to the second time length.
[0011] In one possible implementation, the overlap is related to a second piece of information: the second piece of information is positively correlated with a third time length and negatively correlated with a fourth time length, where the third time length is the sum of the lengths of the overlapping time windows between the parent task and each included subtask, and the fourth time length is the sum of the lengths of the time windows of each subtask of the parent task. The first piece of information can represent the relative compatibility of the time windows between the parent task and the subtasks throughout the entire system; a larger value indicates a greater degree of matching between the parent task and the subtasks.
[0012] In one possible implementation, the second information is the ratio of the third time length to the fourth time length.
[0013] Secondly, this application provides a task scheduling apparatus, the apparatus comprising:
[0014] The acquisition module is used to acquire multiple different combinations of first time windows for a first task; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of a third task.
[0015] The scheduling module is configured to determine, from the plurality of first time window combinations, a time window combination to be used when executing the first task and the plurality of second tasks, based on the overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination; and to determine, based on the time window combination used when executing the first task and the plurality of second tasks, a time window to be used when executing the third task.
[0016] In one possible implementation, the third task includes multiple sub-tasks, including the first task, and the scheduling module is configured to:
[0017] Obtain multiple different combinations of second time windows for the third task; each combination of second time windows includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple subtasks; the candidate time window for the first task in each combination of second time windows is indicated in the combination of time windows used when executing the first task and the multiple second tasks; determine the combination of time windows used when executing the third task and the multiple subtasks from the multiple combinations of second time windows based on the degree of overlap between the candidate time windows for the third task and the candidate time windows for the multiple subtasks in each combination of second time windows.
[0018] In one possible implementation, the overlap is related to first information: the first information is positively correlated with a first time length and negatively correlated with a second time length, the first time length being the length of the time window of overlap between the parent task and a included subtask, and the second time length being the length of the subtask's time window.
[0019] In one possible implementation, the first information is the ratio of the first time length to the second time length.
[0020] In one possible implementation, the overlap is related to second information: the second information is positively correlated with a third time length and negatively correlated with a fourth time length, the third time length being the sum of the lengths of the overlapping time windows between the parent task and each of its included subtasks, and the fourth time length being the sum of the lengths of the time windows of each subtask of the parent task.
[0021] In one possible implementation, the second information is the ratio of the third time length to the fourth time length.
[0022] Thirdly, embodiments of this application provide an apparatus including a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect and any optional method of the first aspect.
[0023] Fourthly, embodiments of the present invention also provide a system, the system including at least one processor, at least one memory, and at least one communication interface; the processor, memory, and communication interface are connected through a communication bus and complete communication with each other;
[0024] The memory stores the application code that executes the above scheme, and its execution is controlled by the processor. The processor executes the application code stored in the memory to obtain the task scheduling result; wherein the code stored in the memory can execute one of the task scheduling methods provided above.
[0025] A communication interface is used to communicate with other devices or communication networks to send the task solution results to the devices or communication networks.
[0026] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any of its optional methods.
[0027] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing one or more instructions that, when executed by one or more computers, cause the one or more computers to implement the second aspect described above and any of the alternative systems thereof.
[0028] In a seventh aspect, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the first aspect and any of its optional methods described above.
[0029] Eighthly, this application provides a chip system including a processor for supporting a terminal device or server in implementing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the terminal device or server. This chip system may be composed of chips or may include chips and other discrete devices.
[0030] Based on the implementation methods provided in the above aspects, this application can be further combined to provide more implementation methods. Attached Figure Description
[0031] Figure 1 This application provides a schematic diagram of an application architecture for an embodiment of the present application;
[0032] Figure 2 A schematic diagram of a server architecture provided for an embodiment of this application;
[0033] Figure 3 A flowchart illustrating a task scheduling method provided in an embodiment of this application;
[0034] Figure 4 This is a schematic diagram of a task structure according to an embodiment of this application;
[0035] Figure 5 This is an illustration of the selection of a time window combination according to an embodiment of this application;
[0036] Figure 6 This is a diagram illustrating multiple iterations of scheduling calculations.
[0037] Figure 7 This is a schematic diagram of the structure of a task scheduling device provided in this embodiment;
[0038] Figure 8 A schematic diagram of the structure of a terminal device provided in an embodiment of this application;
[0039] Figure 9 This is a schematic diagram of a storage medium provided in an embodiment of this application. Detailed Implementation
[0040] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.
[0041] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.
[0042] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.
[0043] The embodiments of this application can be applied to solving linear programming optimization problems in various scenarios (such as supply chain, cloud computing, scheduling, storage optimization, finance, etc.), accelerating the efficiency of linear programming solvers in solving these problems.
[0044] Reference Figure 1 , Figure 1 The following is a schematic diagram of the application structure provided in the embodiments of this application. The task scheduling method provided in this application can be deployed as a solver on a cloud-side server. The terminal device can transmit the model to be solved (such as the mixed integer programming task in the embodiments of this application) to the cloud-side server. The cloud-side server can solve the model to be solved based on its own deployed solver and transmit the solution result to the terminal device.
[0045] For example, users can build a model to be solved based on their own business scenarios. During the solving process, they can pass some models of similar problems from the past to the server. The server can then call the solver to quickly output the optimal solution of the user-input model. Users can then use the platform's functions to generate data reports or process the solution themselves to obtain the desired results.
[0046] Reference Figure 2 , Figure 2This is a schematic diagram of the server architecture provided in the embodiments of this application. Specifically, server 200 is implemented by one or more servers. Server 200 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 22 (e.g., one or more processors) and memory 232, and one or more storage media 230 (e.g., one or more mass storage devices) for storing application programs 242 or data 244. The memory 232 and storage media 230 can be temporary or persistent storage. The program stored in storage media 230 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 22 may be configured to communicate with storage media 230 and execute a series of instruction operations in storage media 230 on server 200.
[0047] Server 200 may also include one or more power supplies 222, one or more wired or wireless network interfaces 250, one or more input / output interfaces 258; or, one or more operating systems 241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.
[0048] In this embodiment of the application, the central processing unit 22 is used to execute the task scheduling method described in this embodiment of the application.
[0049] It should be understood that the task scheduling method provided in the embodiments of this application can also be deployed as a solver on the terminal device on the edge side, and this is not limited here.
[0050] For example, the model to be solved in the embodiments of this application can be used to solve the scheduling problem. The scheduling problem is one of the most common problems in large-scale manufacturing, logistics, and production, and scheduling always has different meanings in different scenarios. For example, logistics scheduling mainly refers to the reasonable arrangement and scheduling of vehicles and personnel by logistics companies according to the weight, destination, specifications, urgency, etc. of the goods to be shipped during the logistics process.
[0051] In a production environment, scheduling involves prioritizing tasks and matching them with production equipment based on the capacity and production demands of different machines on different production lines. This means allocating multiple tasks to production equipment on various production lines.
[0052] For example, in a job-shop scheduling scenario, n jobs are processed on m machines. Each job has a specific processing technology, and the processing order and time for each process are given. The goal is to arrange the processing order of the jobs on each machine to optimize a certain performance indicator. It is not required that every job be processed on every single machine.
[0053] For example, in flow-shop scheduling scenarios, this type of scheduling problem requires that each task must be executed sequentially through each stage. It doesn't involve matching tasks to stages, but primarily determines the execution order of tasks. This prevents excessively long waiting times from affecting the overall completion time.
[0054] Slightly different from general cargo scheduling, the scheduling of workers and timetabling in airports and large manufacturing plants is also a type of scheduling problem. This is because the goal of these problems is to achieve optimal matching within different time periods based on the characteristics of workers' work and the needs of the scenario. Therefore, the core is sorting and optimal allocation, regardless of whether the "task" is people or goods. Generally speaking, the goal of scheduling problems is to obtain the sorting corresponding to the minimum total working time given the number of tasks.
[0055] Meanwhile, scheduling in computing is a method of allocating resources needed for work. Resources can refer to virtual computing resources, such as threads, processes, or data streams; or they can refer to hardware resources, such as processors, network connections, or expansion cards. The program that performs scheduling is called a scheduler. A typical implementation of a scheduler keeps all computing resources busy (in load balancing), allowing multiple users to efficiently share system resources simultaneously or achieve a specified quality of service.
[0056] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application. See also... Figure 3 , Figure 3 A task scheduling method provided in this application embodiment includes:
[0057] 401. Obtain multiple different combinations of first time windows for the first task; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of the third task.
[0058] The embodiments of this application can be applied to the scheduling and calculation process of tasks, wherein a task can be split into multiple tasks, and specifically, the split tasks can form a tree structure of parent task-child task.
[0059] In this context, parent and child tasks can be concepts used in task scheduling to describe task dependencies and execution levels. The parent task is responsible for coordinating the execution logic, resource allocation, and state management of the child tasks, while the child tasks are the specific execution units.
[0060] In one possible implementation, the entity performing step 401 can be a server or a terminal device.
[0061] For example, a terminal device can pass a task to be scheduled to a server, and then the server can solve the task.
[0062] In one possible implementation, the scheduling resource is a production line, production equipment, or manufacturer. For example, in a product manufacturing scenario, the task to be scheduled can be a product to be produced; in a personnel scheduling scenario, the task to be scheduled can be a person to be produced, etc. The embodiments of this application are not limited to this.
[0063] In a product manufacturing scenario, each of the multiple schedulable resource groups can be a production line. For example, in a mobile phone manufacturing scenario, each of the multiple schedulable resource groups can be a production line for a mobile phone component, such as a battery production line, a casing production line, a chip production line, etc. Correspondingly, each schedulable resource group can include multiple schedulable resources, and each of the multiple schedulable resources is a production device in the production line. For example, a battery production line can include multiple battery production devices, and a casing production line can include multiple casing production devices. This is not a limitation.
[0064] In personnel scheduling scenarios, each of the multiple schedulable resource groups can be a time period. For example, in a personnel scheduling scenario, each of the multiple schedulable resource groups can be a day, such as Monday, Tuesday, Wednesday, or a certain day of some months. Correspondingly, each schedulable resource group can include multiple schedulable resources, and each schedulable resource in the multiple schedulable resources is a sub-time period in the time period. For example, a certain day can include multiple hours, multiple minutes, or other multiple sub-time periods, which is not limited here.
[0065] In this embodiment of the application, the task to be scheduled may include one or more tasks, each task may be further divided into multiple subtasks, and each subtask may be further divided into finer-grained subtasks.
[0066] For example, in an automotive production line scheduling scenario, the parent task is typically an integrated, global task type, such as:
[0067] Vehicle assembly (overall planning of the entire vehicle assembly process); quality inspection process (coordinating quality inspection at multiple stages); painting process (managing the vehicle body painting process).
[0068] Subtasks are specific execution units, such as: seat installation (completing seat fixing and adjustment); engine installation (performing powertrain assembly and calibration); tire installation (installing wheel hubs and completing dynamic balance testing). Subtasks can be further subdivided into more granular subtasks.
[0069] The parent task is responsible for resource allocation and process coordination, while the child task focuses on the refined operation of specific processes.
[0070] In this embodiment, the finest-grained parent-child task can be solved first, and then the solution can be gradually applied to the coarser-grained parent task.
[0071] For example, the task to be scheduled may include task 1, task 1 may include task 2 and task 3, task 2 may include subtask 1 and subtask 2, and task 3 may include subtask 3 and subtask 4. Then, task 2 and subtask 1 and subtask 2 can be solved to obtain solution result 1 (including the time window for executing task 2, subtask 1 and subtask 2). Task 3 and subtask 3 and subtask 4 can be solved to obtain solution result 2 (including the time window for executing task 3, subtask 3 and subtask 4). After that, task 1 can be solved based on solution result 1 and solution result 2 to obtain solution result 3 (including the time window for executing task 1).
[0072] A time window can refer to a limited time range within which an operation is performed, data is collected, or an event is triggered.
[0073] The approach of this application embodiment is as follows: when solving the parent-child task, multiple time window combinations of the parent-child task are first obtained. Different time window combinations are different combinations of candidate time windows of the parent-child task. Then, the time window combination with higher overlap between the parent and child tasks can be selected from the multiple time window combinations, thereby reducing the overall time cost. Moreover, the parent-child task solution is first performed at a finer granular level (that is, in the tree-like task structure, tasks closer to the leaf direction, that is, tasks further away from the root direction). Then, based on the solution results of the finer granular parent-child task, the solution of the parent-child task at the next higher level is performed. Compared with the method of solving by exhaustive search, the solution cost (time cost and computing power cost) can be reduced while ensuring the solution effect.
[0074] For example, the available candidate time windows for the parent task include TW0 and TW1, the available candidate time windows for subtask 1 include TW3, and the available candidate time windows for subtask 2 include TW5. Therefore, the combination of parent-subtask time windows can include [TW0, TW3, TW5] and [TW1, TW3, TW5].
[0075] In one possible implementation, multiple different combinations of first time windows for a first task can be obtained first; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of the third task.
[0076] A candidate time window for executing the first task can be determined based on at least one of the following: the end time of the preceding task, the available resources of the first task, and the relationship between the first task and its subtasks.
[0077] Among them, a candidate time window for executing each of the multiple second tasks can be determined based on at least one of the start time of the first task, the logical relationship or business constraints of the second tasks, and the available resources of the second task.
[0078] For example, there is an inheritance relationship between parent and child tasks: the start time of a child task must inherit both the start time of the parent task and the completion time of the preceding process, forming a double constraint. For instance, on an automobile assembly line, the start of the final assembly task (parent task) must wait for the supply of parts (preceding parent task), while the engine installation (child task) must wait for the final assembly to begin before it can start.
[0079] Furthermore, parent and child tasks can have relationships such as FS (Finish-to-Start), SS (Start-to-Start), SF (Start-to-Finish), and FF (Finish-to-Finish). For example, in chemical production, reactor heating (parent task) and temperature monitoring (child task) require an SS relationship to start, while the packaging task (child task) needs to be executed after the quality inspection (parent task) FF relationship is completed.
[0080] Furthermore, the SLA of the parent task is affected by the time of the child task: the Service Level Agreement (SLA) of the parent task is directly determined by the start and end times of the child task. For example, in e-commerce order processing, if inventory verification (the child task) is delayed, the SLA of order packaging (the parent task) (such as 24-hour delivery) will not be met.
[0081] Furthermore, parent tasks may nest higher-level parent tasks, forming multiple layers of circular dependencies. For example, in chip manufacturing, wafer lithography (the parent task) depends on mask design (a higher-level parent task), and mask design, in turn, needs to be adjusted based on lithography feedback, forming a closed-loop dependency. Precedence task constraints: The start time of a parent task must wait for the completion of its preceding task. For example, in railway construction, track laying (the parent task) must begin after the roadbed acceptance (the preceding parent task) is completed.
[0082] In addition, the parent task's time window must overlap with the time windows of available resources (such as equipment and manpower). For example, a factory production line maintenance period (resource unavailability) will directly compress the optional time range of the parent task.
[0083] Furthermore, subtasks must inherit the start time of their parent tasks while also meeting the completion time requirements of their preceding procedures. For example, in aircraft maintenance, engine overhaul (subtask) must begin after aircraft parking maintenance (parent task) has started, and must wait for hydraulic system testing (preceding subtask) to complete.
[0084] In addition, the end time of subtasks is determined jointly by resource allocation and consultation among multiple departments. For example, in cloud computing task scheduling, the release time of virtual machines needs to be coordinated between the operations and maintenance team and the business department.
[0085] Furthermore, tasks may rely on a variety of resources (such as equipment, energy, and network bandwidth). For example, in a digital twin railway, demonstrative tasks require high storage resources, analytical tasks require computing resources, and exploratory tasks require network bandwidth.
[0086] Reference Figure 4 , Figure 4 This is a schematic diagram of a task structure according to an embodiment of this application. The task structure is a tree structure, and the resources of the task may include personnel, workstations, turnover parts, and other resources.
[0087] 402. Based on the overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination, determine the time window combination used to execute the first task and the plurality of second tasks from the plurality of first time window combinations.
[0088] In this embodiment of the application, the overlap degree can be calculated for the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination, and then the candidate time window with a higher overlap degree (e.g., the highest) can be selected as the time window combination used when executing the first task and the plurality of second tasks.
[0089] Among these, overlap can also be referred to as foreground fit.
[0090] In one possible implementation, the overlap is related to first information: the first information is positively correlated with a first time length and negatively correlated with a second time length, where the first time length is the length of the overlapping time window between the parent task and one included child task, and the second time length is the length of the child task's time window. The first information can represent the relative compatibility of the time windows between the parent task and the child task; a larger value indicates a greater degree of matching between the parent task and the child task.
[0091] In one possible implementation, the first information is the ratio of the first time length to the second time length.
[0092] In one possible implementation, the overlap is related to a second piece of information: the second piece of information is positively correlated with a third time length and negatively correlated with a fourth time length, where the third time length is the sum of the lengths of the overlapping time windows between the parent task and each included subtask, and the fourth time length is the sum of the lengths of the time windows of each subtask of the parent task. The first piece of information can represent the relative compatibility of the time windows between the parent task and the subtasks throughout the entire system; a larger value indicates a greater degree of matching between the parent task and the subtasks.
[0093] In one possible implementation, the second information is the ratio of the third time length to the fourth time length.
[0094] Taking the example where the available candidate time windows for the parent task include TW0 and TW1, the available candidate time windows for child task 1 include TW3, and the available candidate time windows for child task 2 include TW5, the combination of parent and child task time windows can include [TW0, TW3, TW5] and [TW1, TW3, TW5]. The overlap between time windows can be calculated using the following formula:
[0095] 1. This indicates the overall temporal compatibility of the parent-child system; a higher value indicates a shorter overall parent-child time and a higher foreground fit. (Global)
[0096] 2. This indicates the relative compatibility between the parent and child layers. A higher value indicates a greater match between the parent and child layers, and also a higher foreground fit. (Local)
[0097] Note: The compatibility between sub-tasks can be determined by the pairwise product in step 2, without needing to be characterized separately.
[0098] TW0=[1,7] TW1=[11,17] d(TW0,TW3,TW5)=(0+5+0) / (6+6+10)*0*0=0
[0099] TW3=[11,17]TW5=[12,22] d(TW1,TW3,TW5)=(6+5+5) / (6+6+10)*1*1=0.8
[0100] Reference Figure 5 , Figure 5 The following is an illustration of how to select time window combinations, using the parent-child task time window combination as an example, which can include [TW0, TW3, TW5] and [TW1, TW3, TW5].
[0101] 403. Determine the time window to be used when executing the third task based on the combination of time windows used when executing the first task and the plurality of second tasks.
[0102] In one possible implementation, the third task includes multiple subtasks, including the first task, and multiple different combinations of second time windows can be obtained for the third task; each combination of second time windows includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple subtasks; the candidate time window for the first task in each combination of second time windows is indicated in the combination of time windows used when executing the first task and the multiple second tasks; based on the degree of overlap between the candidate time windows of the third task and the candidate time windows of the multiple subtasks in each combination of second time windows, the combination of time windows used when executing the third task and the multiple subtasks is determined from the multiple combinations of second time windows.
[0103] In this embodiment of the application, the logic of steps 401 to 402 can be used continuously to iteratively determine the solution of the entire task from bottom to top.
[0104] Reference Figure 6 The process of calculating Network1 to 4 can be performed sequentially, and the solution to the entire task can be determined iteratively from bottom to top.
[0105] Reference Figure 7 , Figure 7 This application provides a schematic diagram of the structure of a task scheduling device 700, which may include:
[0106] The acquisition module 701 is used to acquire multiple different combinations of first time windows for the first task; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of the third task.
[0107] The specific description of the acquisition module 701 can be found in the description of step 401 in the above embodiments, and will not be repeated here.
[0108] The scheduling module 702 is configured to determine, from the plurality of first time window combinations, a time window combination to be used when executing the first task and the plurality of second tasks, based on the overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination; and to determine, based on the time window combination used when executing the first task and the plurality of second tasks, a time window to be used when executing the third task.
[0109] The specific description of the scheduling module 702 can be found in the descriptions of steps 402 and 403 in the above embodiments, and will not be repeated here.
[0110] In one possible implementation, the third task includes multiple sub-tasks, including the first task, and the scheduling module 802 is used to:
[0111] Obtain multiple different combinations of second time windows for the third task; each combination of second time windows includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple subtasks; the candidate time window for the first task in each combination of second time windows is indicated in the combination of time windows used when executing the first task and the multiple second tasks; determine the combination of time windows used when executing the third task and the multiple subtasks from the multiple combinations of second time windows based on the degree of overlap between the candidate time windows for the third task and the candidate time windows for the multiple subtasks in each combination of second time windows.
[0112] In one possible implementation, the overlap is related to first information: the first information is positively correlated with a first time length and negatively correlated with a second time length, the first time length being the length of the time window of overlap between the parent task and a included subtask, and the second time length being the length of the subtask's time window.
[0113] In one possible implementation, the first information is the ratio of the first time length to the second time length.
[0114] In one possible implementation, the overlap is related to second information: the second information is positively correlated with a third time length and negatively correlated with a fourth time length, the third time length being the sum of the lengths of the overlapping time windows between the parent task and each of its included subtasks, and the fourth time length being the sum of the lengths of the time windows of each subtask of the parent task.
[0115] In one possible implementation, the second information is the ratio of the third time length to the fourth time length.
[0116] The following describes a terminal device provided in an embodiment of this application. Please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of a terminal device provided in an embodiment of this application. The terminal device 800 can specifically be a mobile phone, tablet, laptop, smart wearable device, etc., and is not limited thereto. The terminal device 800 may be equipped with... Figure 7 The task scheduling device described in the corresponding embodiment is used to implement Figure 7 This corresponds to the task-solving function in the embodiment. Specifically, the terminal device 800 includes: a receiver 801, a transmitter 802, a processor 803, and a memory 804 (wherein the terminal device 800 may have one or more processors 803). Figure 8 (Taking a processor as an example), the processor 803 may include an application processor 8031 and a communication processor 8032. In some embodiments of this application, the receiver 801, transmitter 802, processor 803, and memory 804 may be connected via a bus or other means.
[0117] Memory 804 may include read-only memory and random access memory, and provides instructions and data to processor 803. A portion of memory 804 may also include non-volatile random access memory (NVRAM). Memory 804 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.
[0118] The processor 803 controls the operation of the terminal device. In specific applications, the various components of the terminal device are coupled together through a bus system. This bus system includes not only the data bus but also power buses, control buses, and status signal buses. However, for clarity, all buses are referred to as the bus system in the diagram.
[0119] The methods disclosed in the embodiments of this application can be applied to or implemented by processor 803. Processor 803 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above methods can be completed by integrated logic circuits in the hardware of processor 803 or by instructions in software form. Processor 803 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 803 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. A general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 804. The processor 803 reads the information from memory 804 and, in conjunction with its hardware, completes the steps related to the terminal device in the above method.
[0120] Receiver 801 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the terminal device. Transmitter 802 can be used to output digital or character information through the first interface; transmitter 802 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 802 may also include a display device such as a display screen.
[0121] In one embodiment of this application, the processor 803 is used to execute the steps performed by the terminal device in the above embodiments.
[0122] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.
[0123] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.
[0124] The terminal device, server, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip in the terminal device to execute the data processing method described in the above embodiments, or to cause the chip in the server to execute the data processing method described in the above embodiments. Optionally, the storage unit is a storage unit within the chip, such as a register or cache. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, such as random access memory (RAM).
[0125] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.
[0126] Another embodiment of this application provides a computer-readable storage medium storing instructions that, when executed on a memory-sharing device, perform the various steps of the method flow shown in the above-described method embodiments. In some embodiments, the disclosed method can be implemented as computer program instructions encoded in a machine-readable format on a computer-readable storage medium or on other non-transitory media or articles of art.
[0127] Figure 9 A conceptual partial view of a computer program product provided in an embodiment of this application is shown schematically. The computer program product includes a computer program for executing computer processes on a computing device.
[0128] In one embodiment, a computer program product is provided using a signal bearer medium 900. The signal bearer medium 900 may include one or more program instructions that, when executed by one or more processors, can provide the above-mentioned... Figure 3 The described function or part of the function. Therefore, for example, refer to... Figure 3One or more features of 401-403 can be assumed by one or more instructions associated with the signal carrying medium 900. Furthermore, Figure 9 The program instructions in the document also describe example instructions.
[0129] In some examples, the signal carrying medium 900 may include a computer-readable medium 901, such as, but not limited to, a hard disk drive, a compact disc (CD), a digital video disc (DVD), a digital magnetic tape, a memory, a read-only memory (ROM), or a random access memory (RAM), etc.
[0130] In some implementations, the signal carrying medium 900 may include a computer recordable medium 902, such as, but not limited to, a memory, a read / write (R / W) CD, a R / W DVD, and so on.
[0131] In some implementations, the signal-bearing medium 900 may comprise a communication medium 903, such as, but not limited to, digital and / or analog communication media (e.g., fiber optic cables, waveguides, wired communication links, wireless communication links, etc.). The signal-bearing medium 900 may be transmitted by a wireless communication medium 903 (e.g., a wireless communication medium conforming to the IEEE 1502.11 standard or other transmission protocols). One or more program instructions may be, for example, computer-executable instructions or logic implementation instructions.
[0132] In some examples, such as targeting Figure 3 The task scheduling method can be configured to provide various operations, functions, or actions in response to one or more program instructions in a computer-readable medium 901, a computer-recordable medium 902, and / or a communication medium 903.
[0133] It should be understood that the arrangements described herein are for illustrative purposes only. Therefore, those skilled in the art will understand that other arrangements and other elements (e.g., machines, interfaces, functions, sequences, and functional groups, etc.) can be used instead, and some elements may be omitted depending on the desired outcome. Furthermore, many of the described elements are functional entities that can be implemented as discrete or distributed components, or in any suitable combination and location with other components.
[0134] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.
[0135] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0136] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.
[0137] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).
Claims
1. A task scheduling method, characterized in that, The method includes: Obtain multiple different combinations of first time windows for a first task; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of a third task; Based on the degree of overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination, determine the time window combination to be used when executing the first task and the plurality of second tasks from the plurality of first time window combinations; The time window used to execute the third task is determined based on the combination of time windows used when executing the first task and the plurality of second tasks.
2. The method according to claim 1, characterized in that, The third task includes multiple sub-tasks, including the first task. Determining the time window for executing the third task based on the combination of time windows used when executing the first task and the multiple second tasks includes: Obtain multiple different combinations of second time windows for the third task; each combination of second time windows includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple subtasks; the candidate time window for the first task in each combination of second time windows is indicated in the combination of time windows used when executing the first task and the multiple second tasks; Based on the degree of overlap between the candidate time windows of the third task and the candidate time windows of the plurality of subtasks in each of the second time window combinations, a time window combination for executing the third task and the plurality of subtasks is determined from the plurality of second time window combinations.
3. The method according to claim 1 or 2, characterized in that, The overlap is related to the first information: the first information is positively correlated with the first time length, the first information is negatively correlated with the second time length, the first time length is the length of the time window between the parent task and one of its included sub-tasks, and the second time length is the length of the sub-task's time window.
4. The method according to claim 3, characterized in that, The first information is the ratio of the first time length to the second time length.
5. The method according to any one of claims 1 to 4, characterized in that, The overlap is related to the second information: the second information is positively correlated with the third time length and negatively correlated with the fourth time length. The third time length is the sum of the lengths of the overlapping time windows between the parent task and each of its included sub-tasks, and the fourth time length is the sum of the lengths of the time windows of each sub-task of the parent task.
6. The method according to claim 5, characterized in that, The second information is the ratio of the third time length to the fourth time length.
7. A task scheduling device, characterized in that, The device includes: The acquisition module is used to acquire multiple different combinations of first time windows for a first task; each combination of first time windows includes a candidate time window for executing the first task and a candidate time window for executing each of the multiple second tasks; the first task is the parent task of the multiple second tasks and the first task is a child task of a third task. The scheduling module is configured to determine, from the plurality of first time window combinations, a time window combination to be used when executing the first task and the plurality of second tasks, based on the overlap between the candidate time windows of the first task and the candidate time windows of the plurality of second tasks in each first time window combination; and to determine, based on the time window combination used when executing the first task and the plurality of second tasks, a time window to be used when executing the third task.
8. The apparatus according to claim 7, characterized in that, The third task includes multiple sub-tasks, including the first task, and the scheduling module is used for: Obtain multiple different combinations of second time windows for the third task; each combination of second time windows includes a candidate time window for executing the third task and a candidate time window for executing each of the multiple subtasks; the candidate time window for the first task in each combination of second time windows is indicated in the combination of time windows used when executing the first task and the multiple second tasks; determine the combination of time windows used when executing the third task and the multiple subtasks from the multiple combinations of second time windows based on the degree of overlap between the candidate time windows for the third task and the candidate time windows for the multiple subtasks in each combination of second time windows.
9. The apparatus according to claim 7 or 8, characterized in that, The overlap is related to the first information: the first information is positively correlated with the first time length, the first information is negatively correlated with the second time length, the first time length is the length of the time window between the parent task and one of its included sub-tasks, and the second time length is the length of the sub-task's time window.
10. The apparatus according to claim 9, characterized in that, The first information is the ratio of the first time length to the second time length.
11. The apparatus according to any one of claims 7 to 10, characterized in that, The overlap is related to the second information: the second information is positively correlated with the third time length and negatively correlated with the fourth time length. The third time length is the sum of the lengths of the overlapping time windows between the parent task and each of its included sub-tasks, and the fourth time length is the sum of the lengths of the time windows of each sub-task of the parent task.
12. The apparatus according to claim 11, characterized in that, The second information is the ratio of the third time length to the fourth time length.
13. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers, cause the one or more computers to perform the operation of the method according to any one of claims 1-6.
14. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 6.
15. A system, characterized in that, It includes at least one processor and at least one memory; the processor and the memory are connected via a communication bus and communicate with each other. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the method as described in any one of claims 1-6.
