Task allocation method, device and equipment
By dynamically generating a second partitioning pattern with the lowest overlap with existing partitioning patterns, task allocation is optimized, solving the problems of uneven resource utilization and low computational efficiency, and realizing a more efficient real-time rendering service for the metaverse.
Patent Information
- Application Number
- CN202511698691.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-19
- Publication Date
- 2026-02-17
AI Technical Summary
In existing technologies, fixed partitioning patterns lead to uneven resource utilization and low computational efficiency when resources are scarce or tasks are complex and varied, making it difficult to adapt to the rich and complex needs of metaverse content.
By dynamically generating a second partitioning pattern with the lowest overlap with the existing partitioning pattern, and combining processor resource status and task characteristics, task partitioning is optimized to reduce redundant calculations and improve resource utilization efficiency.
It achieves more balanced resource utilization and improved computational efficiency, adapts to complex and ever-changing task requirements, reduces redundant calculations, and improves the computational efficiency and stability of real-time rendering of the metaverse.
Smart Images

Figure CN121542039A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of video processing technology, and in particular to a task allocation method, apparatus, and device. Background Technology
[0002] Existing metaverse real-time rendering technologies rely on powerful hardware, requiring high-performance computers or virtual reality (VR) devices. However, they also place high demands on client hardware and are limited by network bandwidth and latency. The existing "Tianyuan" system faces challenges due to the diversity of user terminals and inconsistent hardware performance, making it difficult to control user terminal upgrades and configurations. Furthermore, as the content of the metaverse becomes richer and more complex, the demands on rendering performance are increasing.
[0003] In existing technologies, distributed graphics processing unit (GPU) resource management and task partitioning mainly rely on fixed patterns and simple load balancing strategies. When resources are scarce or tasks are complex and varied, fixed partitioning patterns lead to uneven resource utilization and low computational efficiency. Summary of the Invention
[0004] The purpose of this invention is to provide a task allocation method, apparatus, and device to solve the problems of uneven resource utilization and low computational efficiency caused by fixed partitioning patterns in the prior art when resources are scarce or tasks are complex and variable.
[0005] To achieve the above objectives, embodiments of the present invention provide a task allocation method, comprising:
[0006] When a task to be assigned is obtained that requires computation by at least one processor, the task to be assigned is divided into a first subtask according to at least one first partitioning pattern; wherein, the first partitioning pattern is a partitioning pattern that has been used before.
[0007] At least one second partitioning pattern is generated based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the processor requirements and expected computation results of the task to be assigned;
[0008] The task to be assigned is divided into tasks according to the second division mode to obtain the second sub-task;
[0009] Based on the first subtask and the second subtask, obtain at least one target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern;
[0010] The tasks to be assigned are divided according to the target second partitioning mode, and the divided tasks are assigned to the at least one processor for processing.
[0011] Optionally, the method, wherein obtaining at least one target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning patterns based on the first subtask and the second subtask, includes:
[0012] Based on the first subtask and the second subtask, calculate the first overlap between each second partitioning pattern and each first partitioning pattern;
[0013] Based on the first overlap, calculate the target overlap corresponding to each of the second partitioning patterns;
[0014] Based on the target overlap, obtain the second target partitioning pattern;
[0015] Wherein, the second target partitioning mode is the second partitioning mode with the lowest target overlap among the at least one second partitioning modes.
[0016] Optionally, the method, wherein calculating a first overlap degree between each second partitioning pattern and each first partitioning pattern based on the first subtask and the second subtask includes:
[0017] Obtain the first set corresponding to the first partitioning pattern, wherein the first set is a set consisting of all first subtasks corresponding to the first partitioning pattern;
[0018] Obtain the second set corresponding to the second partitioning pattern, where the second set is a set consisting of all second subtasks corresponding to the second partitioning pattern;
[0019] The first degree of overlap is obtained based on the ratio of the intersection to the union of the first set and the second set.
[0020] Optionally, the method, wherein dividing the tasks to be assigned according to the target second partitioning pattern and assigning the divided tasks to the at least one processor for processing, includes:
[0021] The tasks to be assigned are divided according to the second target division pattern to obtain the third sub-task;
[0022] Based on the subtask list and the third subtask, determine whether there is a fourth subtask in the subtask list that is the same as the third subtask; wherein, the subtask list is a list including at least one historical subtask that has been calculated using the processor and the calculation results of the historical subtask;
[0023] If it is determined that there is a fourth subtask in the subtask list that is the same as the third subtask, then the calculation result of the third subtask is obtained from the subtask list.
[0024] If it is determined that there is no fourth subtask in the subtask list that is the same as the third subtask, the third subtask is assigned to the processor with the lowest current load for calculation.
[0025] Optionally, the method, before dividing the task to be assigned according to at least one first partitioning pattern to obtain the first subtask, further includes:
[0026] Obtain the resource idle time of the processor and at least one candidate partitioning mode; wherein, the candidate partitioning mode is a partitioning mode that has been used.
[0027] If the resource idleness is less than a preset value, the first partitioning mode is selected from the at least one candidate partitioning mode.
[0028] If the resource idleness is greater than or equal to the preset value, all the candidate partitioning modes are determined as the first partitioning mode.
[0029] Optionally, the method, wherein selecting the first partitioning mode from the at least one candidate partitioning modes when the resource idleness is less than a preset value, includes:
[0030] Based on the historical execution data of the at least one candidate partitioning pattern, a fifth subtask for each candidate partitioning pattern is obtained; wherein, the historical execution data is data recorded during the execution of historical tasks;
[0031] Based on the ratio of the number of repeated subtasks in the fifth subtask of each candidate partitioning pattern to the total number of the fifth subtasks, the repetition rate corresponding to each candidate partitioning pattern is obtained.
[0032] Based on the repetition rate of each of the third partitioning patterns, obtain the first partitioning pattern;
[0033] The candidate partitioning pattern with the highest repetition rate is selected as the first partitioning pattern.
[0034] Optionally, the method, wherein generating at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource state of the processor, includes:
[0035] Construct a graph structure; wherein the graph structure includes multiple nodes and edges connecting the nodes; the nodes are obtained by splitting the tasks to be assigned according to the task characteristics and the resource status, and the edges are the dependencies between the nodes;
[0036] The edges of the graph structure are cut to obtain at least one cutting result; wherein each cutting result corresponds to a number of cut edges; each cutting result includes multiple subgraph structures, and each subgraph structure includes at least one node;
[0037] The second partitioning pattern is obtained based on the cutting results; wherein each cutting result corresponds to one second partitioning pattern.
[0038] To achieve the above objectives, embodiments of the present invention provide a task allocation device, comprising:
[0039] The first acquisition module is used to, when acquiring a task to be assigned that requires computation by at least one processor, divide the task to be assigned according to at least one first partitioning mode to acquire a first subtask; wherein, the first partitioning mode is a partitioning mode that has been used before.
[0040] A first generation module is configured to generate at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the requirements of the task to be assigned on the processor and the expected computation results;
[0041] The second acquisition module is used to divide the task to be assigned according to the second division mode to obtain the second sub-task;
[0042] The third acquisition module is used to acquire the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern based on the first subtask and the second subtask.
[0043] The first processing module is used to divide the tasks to be assigned according to the target second division mode, and to assign the divided tasks to the at least one processor for processing.
[0044] To achieve the above objectives, embodiments of the present invention provide a task allocation device, including: a transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; wherein, when the processor executes the program or instructions, it implements the task allocation method described above.
[0045] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the task allocation method described above.
[0046] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the task allocation method described above.
[0047] The beneficial effects of the above-described technical solution of the present invention are as follows:
[0048] In this embodiment of the invention, when a task to be assigned is obtained that requires computation by at least one processor, the task to be assigned is divided by selecting a second partitioning mode with the lowest overlap with the subtasks of the first partitioning mode that has already been used. This results in the processor allocation results of the subtasks divided in this instance being the most different from those of the subtasks divided using the first partitioning mode. This allows for the coverage of more unique processor computation areas, resulting in more balanced resource utilization, reduced redundant computation, and improved computational efficiency. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the task allocation method described in an embodiment of the present invention;
[0050] Figure 2 This is a schematic diagram illustrating the specific implementation process of step S40 of the task allocation method described in this embodiment of the invention;
[0051] Figure 3 This is a schematic diagram illustrating the specific implementation flow of step S50 of the task allocation method described in this embodiment of the invention;
[0052] Figure 4 This is a schematic diagram illustrating the specific implementation process of step S20 of the task allocation method described in this embodiment of the invention;
[0053] Figure 5 This is a schematic diagram of the task allocation device according to an embodiment of the present invention;
[0054] Figure 6 This is a structural diagram of the task allocation device described in an embodiment of the present invention. Detailed Implementation
[0055] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.
[0056] It should be understood that the phrase "one embodiment" or "an embodiment" throughout the specification means that a specific feature, structure, or characteristic related to the embodiment is included in at least one embodiment of the invention. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification do not necessarily refer to the same embodiment. Furthermore, these specific features, structures, or characteristics can be combined in any suitable manner in one or more embodiments.
[0057] In various embodiments of the present invention, it should be understood that the sequence number of each process described below does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0058] In addition, the terms "system" and "network" are often used interchangeably in this article.
[0059] In the embodiments provided by this invention, it should be understood that "B corresponding to A" means that B is associated with A, and B can be determined based on A. However, it should also be understood that determining B based on A does not mean that B is determined solely based on A; B can also be determined based on A and / or other information.
[0060] For ease of understanding, the following describes some aspects of the embodiments of the present invention:
[0061] like Figure 1 As shown, an embodiment of the present invention provides a task allocation method, which includes:
[0062] Step S10: In the case of obtaining a task to be assigned that requires computation by at least one processor, the task to be assigned is divided into a first subtask according to at least one first partitioning mode; wherein, the first partitioning mode is a partitioning mode that has been used before.
[0063] It should be noted that the embodiments of the present invention are built on a cloud platform with distributed processor resources. Therefore, the task to be assigned requires at least one processor for computation. Dividing the task to be assigned into at least one subtask and assigning it to the corresponding processor for computation is the implementation objective of the embodiments of the present invention. In the first example of the embodiments of the present invention, a rendering task is assigned, and real-time rendering is performed by the local graphics processor. During the rendering process, 3D models, textures, and other resources are downloaded from the server and rendered on the local graphics processor to generate the final image presented to the user. The task to be assigned is divided into tasks according to at least one previously used first partitioning mode to obtain the first subtask. The newly received task to be assigned is then divided into tasks using the existing partitioning mode to obtain the first subtask, thereby enabling the evaluation of subsequently generated partitioning modes based on the existing partitioning modes.
[0064] Step S20: Generate at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the requirements of the task to be assigned for the processor and the expected computation results;
[0065] It should be noted that the task partitioning mode described in this embodiment of the invention is not fixed, but dynamically generated based on the task characteristics and the processor's resource status. By partitioning a large task (i.e., the task to be assigned) into multiple smaller, independently executable subtasks, and distributing these subtasks across distributed processor resources for parallel processing, computational efficiency can be improved. This allows for flexible adaptation to different task requirements, avoids the limitations of a fixed partitioning mode, and ensures the most efficient use of resources. Different partitioning modes represent different partitioning logics, resulting in different combinations of subtasks and partitioning results. Therefore, dynamically generating a second partitioning mode based on real-time data such as task characteristics and processor resource status can produce a partitioning mode that better meets actual needs.
[0066] Step S30: Divide the task to be assigned into a second sub-task according to the second partitioning mode;
[0067] It should be noted that when the second partitioning mode is applied to the task allocation method, the task to be allocated is partitioned to obtain the second subtask.
[0068] Step S40: Based on the first subtask and the second subtask, obtain the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern;
[0069] It should be noted that the overlap between the first subtask divided by the first partitioning mode and the second subtask divided by the second partitioning mode is calculated. The overlap between the subtask of each second partitioning mode and each first partitioning mode is calculated, and the second partitioning mode with the lowest subtask overlap is determined as the target second partitioning mode.
[0070] Step S50: Divide the tasks to be assigned according to the target second partitioning mode, and assign the divided tasks to the at least one processor for processing.
[0071] It should be noted that the tasks to be assigned are divided according to the target second partitioning mode with the lowest subtask overlap, and the divided tasks are assigned to the at least one processor for processing. The lowest overlap indicates that the second partitioning mode differs significantly from at least one of the first partitioning modes in subtask allocation, thus covering more unique computing areas, reducing redundant computation, and improving resource utilization.
[0072] In this embodiment, when a task to be assigned requires computation by at least one processor, a target second partitioning pattern with the lowest overlap is obtained by dividing the task to be assigned using a first partitioning pattern that has already been used, and dividing the task to be assigned using a second partitioning pattern generated based on the task characteristics and processor resource status. The task to be assigned is then partitioned according to the target second partitioning pattern and assigned to the corresponding processor for processing. Selecting the second partitioning pattern with the lowest overlap with the first subtask of the already used first partitioning pattern maximizes the difference in processor allocation between the second subtask and the first subtask, thereby covering more unique processor computational regions, resulting in more balanced resource utilization, reduced redundant computation, and improved computational efficiency.
[0073] It should be noted that the purpose of the first example of this invention is to achieve a high-efficiency and flexible real-time rendering service for the metaverse. The task allocation method is applied to a task allocation system, the core framework of which includes a cloud rendering server cluster, a load balancer, a task scheduler, and a client interface.
[0074] The cloud rendering server cluster is the core computing resource of the task allocation system, consisting of multiple high-performance graphics processing unit (GPU) nodes. These GPU nodes are connected via a high-speed network, forming a powerful pool of rendering capabilities. Each GPU node has independent rendering capabilities and can execute complex 3D rendering tasks.
[0075] The load balancer is responsible for intelligently distributing rendering tasks among multiple graphics processing unit (GPU) nodes. It dynamically selects the most suitable GPU node to execute the task based on the current load, performance parameters, and task requirements of each GPU node. This load balancing mechanism ensures efficient execution of rendering tasks and avoids resource idleness or overload.
[0076] The task scheduler is responsible for receiving rendering requests from clients and transforming them into specific rendering tasks. It rationally arranges the execution order and allocation of tasks based on their priority, urgency, and resource availability. The task scheduler works closely with the load balancer to achieve efficient scheduling and execution of rendering tasks.
[0077] The client interface serves as the interaction bridge between the task allocation system and the user. It provides a simple and easy-to-use interface, enabling users to easily submit rendering requests and obtain rendering results. The client interface supports multiple devices and platforms, achieving a consistent experience across different terminals.
[0078] In summary, the task allocation system's framework achieves efficient and flexible real-time rendering services for the metaverse through the organic integration of a cloud-based rendering server cluster, load balancer, task scheduler, and client interface. The core of this example is task division, and the entire process is implemented within the task scheduler.
[0079] like Figure 2 As shown, optionally, the method, wherein step S40 includes:
[0080] Step A10: Based on the first subtask and the second subtask, calculate the first overlap between each second partitioning pattern and each first partitioning pattern;
[0081] Step A20: Based on the first overlap, calculate the target overlap corresponding to each of the second partitioning patterns;
[0082] Step A30: Obtain the second target partitioning pattern based on the target overlap.
[0083] Wherein, the second target partitioning mode is the second partitioning mode with the lowest target overlap among the at least one second partitioning modes.
[0084] In this embodiment, for each second partitioning mode, the first overlap degree is calculated with each of the at least one first partitioning modes. The target overlap degree is obtained by adding the first overlap degrees of each second partitioning mode or by weighted summation. Alternatively, all the first partitioning modes can be treated as a whole to calculate the target overlap degree between the second subtask of each second partitioning mode and the first subtask of all the first partitioning modes. The second partitioning mode with the lowest target overlap degree is determined as the target second partitioning mode.
[0085] Optionally, the method, wherein step A10 includes:
[0086] Obtain the first set corresponding to the first partitioning pattern, wherein the first set is a set consisting of all first subtasks corresponding to the first partitioning pattern;
[0087] Obtain the second set corresponding to the second partitioning pattern, where the second set is a set consisting of all second subtasks corresponding to the second partitioning pattern;
[0088] The first degree of overlap is obtained based on the ratio of the intersection to the union of the first set and the second set.
[0089] In this embodiment, an overlap measurement function is defined. The overlap can be calculated using the ratio of the intersection size to the union size, or only the size of the intersection can be used as the overlap. The formula is as follows:
[0090] ;
[0091] in, Represents the second set, Represents the first set, Indicates the size of the set. The intersection of the sets is represented. All first subtasks divided by each first partitioning pattern are taken as a first set, and all second subtasks divided by each second partitioning pattern are taken as a second set. The intersection of the first set and the second set, or the ratio of the intersection to the union, is determined as the first overlap of the second partitioning pattern.
[0092] like Figure 3 As shown, optionally, the method, wherein step S50 includes:
[0093] Step B10: Divide the task to be assigned according to the second target partitioning mode to obtain the third sub-task;
[0094] Step B20: Based on the subtask list and the third subtask, determine whether there is a fourth subtask in the subtask list that is the same as the third subtask; wherein, the subtask list is a list including at least one historical subtask that has been calculated by the processor and the calculation results of the historical subtask.
[0095] Step B30: If it is determined that there is a fourth subtask in the subtask list that is the same as the third subtask, then the calculation result of the third subtask is obtained from the subtask list.
[0096] Step B40: If it is determined that there is no fourth subtask in the subtask list that is the same as the third subtask, the third subtask is assigned to the processor with the lowest current load for calculation.
[0097] In this embodiment, the third subtask obtained by dividing the task to be assigned using the second target partitioning mode is compared with the historical subtasks calculated by the processor in the subtask list. If there are identical subtasks, the calculation result can be directly obtained from the subtask list without recalculation. If there are no identical subtasks, the third subtask is assigned to the processor with the lowest current load for calculation, thereby ensuring balanced utilization of processor resources.
[0098] Optionally, the method further includes, prior to step S10:
[0099] Obtain the resource idle time of the processor and at least one candidate partitioning mode; wherein, the candidate partitioning mode is a partitioning mode that has been used.
[0100] If the resource idleness is less than a preset value, the first partitioning mode is selected from the at least one candidate partitioning mode.
[0101] If the resource idleness is greater than or equal to the preset value, all the candidate partitioning modes are determined as the first partitioning mode.
[0102] In this embodiment, monitoring tools are used to collect real-time status information of each processor node, including the number of assigned tasks, memory usage, and computing unit utilization, to assess the current resource idleness of the processors. This resource idleness is then quantified to obtain metrics such as the proportion of idle processors and average load. If the resource idleness is greater than or equal to a preset value, the third partitioning mode is determined as the first partitioning mode, and the second partitioning mode is generated directly in subsequent steps. If the resource idleness is less than the preset value, it indicates that resources are currently strained, and a first partitioning mode that meets the selection strategy needs to be determined from the third partitioning mode.
[0103] Optionally, the method, wherein selecting the first partitioning mode from the at least one candidate partitioning modes when the resource idleness is less than a preset value, includes:
[0104] Based on the historical execution data of the at least one candidate partitioning pattern, a fifth subtask for each candidate partitioning pattern is obtained; wherein, the historical execution data is data recorded during the execution of historical tasks;
[0105] Based on the ratio of the number of repeated subtasks in the fifth subtask of each candidate partitioning pattern to the total number of the fifth subtasks, the repetition rate corresponding to each candidate partitioning pattern is obtained.
[0106] The candidate partitioning pattern with the highest repetition rate is selected as the first partitioning pattern.
[0107] In this embodiment, when resource idleness is low and processor resources are scarce, a selection strategy based on repetition probability is adopted. This strategy drives decision-making through historical data to ensure optimal resource utilization. Historical execution data is analyzed, and the repetition probability of the fifth subtask in each of the third partitioning modes is calculated as the repetition rate of the third partitioning mode. The repetition rate is the proportion of the number of repetitive subtasks to the total number of subtasks. When there are multiple repetitive subtasks, the one with the largest value is selected as the number of repetitive subtasks. The third partitioning mode with the highest repetition rate is selected as the first partitioning mode. If the repetition rates are the same, the third partitioning mode with the lower computational load is selected as the first partitioning mode by calculating the computational load of the subtasks. A second example is provided: if partitioning mode A has 3 m subtasks and 7 s subtasks, and partitioning mode B has 7 m subtasks, 1 s subtask, and 2 u subtasks, both partitioning modes have a repetition rate of 7 / 10. However, partitioning mode B requires three processors, while partitioning mode A has a lower computational load; therefore, the superior mode A is selected. In the first example, when rendering a city, dividing the task by region might generate sub-tasks such as "commercial area" and "residential area"; dividing it by object type might generate sub-tasks such as "building" and "vehicle". The same task to be assigned can have multiple partitioning patterns. A partitioning pattern with a high repetition rate indicates that its sub-tasks are highly reusable, reducing redundant computation and resource contention. This invention automatically generates multiple second partitioning patterns through an algorithm and selects one based on overlap and repetition probability, achieving intelligent and adaptive partitioning patterns. The repetition probability calculation based on historical execution data is used to evaluate the repetition of the fifth sub-task under different third partitioning patterns. Through this invention, the third partitioning pattern with a high repetition probability can be preferentially selected as the first partitioning pattern, reducing redundant computation and resource contention, and improving computational efficiency.
[0108] like Figure 4 As shown, optionally, the method, wherein step S20 includes:
[0109] Step C10: Construct a graph structure; wherein the graph structure includes multiple nodes and edges connecting the nodes; the nodes are obtained by splitting the tasks to be assigned according to the task characteristics and the resource status, and the edges are the dependencies between the nodes;
[0110] Step C20: Cut the edges of the graph structure to obtain at least one cutting result; wherein each cutting result corresponds to a number of cut edges; each cutting result includes multiple subgraph structures, and each subgraph structure includes at least one node;
[0111] Step C30: Obtain the second partitioning pattern based on the cutting results; wherein each cutting result corresponds to one second partitioning pattern.
[0112] In this embodiment, a series of partitioning constraints and objectives are defined based on the task characteristics, such as scene type, scene complexity, scale, and rendering quality requirements, as well as the resource status, such as the number of idle processors and the load of each processor. These constraints may include subtask size limits, computational dependencies, and resource consumption limits, while the objectives may be minimizing task completion time, maximizing resource utilization, or balancing the load. Based on these constraints and objectives, multiple algorithms are used to generate multiple second partitioning patterns. For example, a graph partitioning algorithm can be used to represent the task to be assigned as a graph structure, where nodes represent potential subtasks and edges represent dependencies between potential subtasks. Then, the graph is partitioned using strategies such as minimizing edge cutting. The graph is divided into several subgraph structures, each corresponding to a logical unit containing multiple potential subtasks. Different edge cutting numbers are set according to requirements to obtain different cutting results. Each cutting result corresponds to a different partitioning state of the subgraph structure, and different second partitioning patterns are generated corresponding to the cutting results. Alternatively, a heuristic algorithm can be used to dynamically combine natural subtasks by progressively optimizing the objective function, ultimately generating a second partitioning pattern that adapts to the task characteristics and the resource status. By employing heuristic methods such as greedy algorithms and simulated annealing, the second partitioning pattern is constructed step by step, and the objective function is optimized as much as possible in each selection step, thereby generating at least one second partitioning pattern more efficiently and flexibly, providing a rich candidate set for subsequent selection of the optimal partitioning pattern.
[0113] If the third partitioning pattern has not been used before, a second partitioning pattern is directly generated to divide the tasks to be assigned and allocate them to the corresponding processors for computation.
[0114] It should be noted that the embodiments of the present invention effectively avoid resource idleness and overload by dynamically generating and selecting the optimal partitioning mode and using an intelligent scheduling strategy based on repetition probability. Processor resources are utilized more evenly and efficiently, improving task allocation capabilities. Compared to existing technologies, the embodiments of the present invention can more fully utilize the potential of distributed processor resources to meet complex and ever-changing task requirements. The embodiments of the present invention calculate the repetition probability of each third partitioning mode and prioritizes the first partitioning mode with a high repetition probability to calculate the overlap with the newly generated second partitioning mode, selecting the second partitioning mode with the lowest overlap for task partitioning, significantly reducing redundant calculations and resource contention. This mechanism not only improves computational efficiency but also reduces energy consumption and cost. Compared to existing technologies, the embodiments of the present invention have a more significant advantage in handling repetitive tasks, providing users with faster and more stable task partitioning services.
[0115] like Figure 5As shown, to achieve the above objectives, embodiments of the present invention provide a task allocation device, comprising:
[0116] The first acquisition module 501 is used to acquire a first subtask by dividing the task to be assigned according to at least one first partitioning mode when acquiring a task to be assigned that requires computation by at least one processor; wherein the first partitioning mode is a partitioning mode that has been used before.
[0117] The first generation module 502 is configured to generate at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the requirements of the task to be assigned on the processor and the expected calculation results;
[0118] The second acquisition module 503 is used to divide the task to be assigned according to the second division mode to obtain the second sub-task;
[0119] The third acquisition module 504 is used to acquire the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern based on the first subtask and the second subtask.
[0120] The first processing module 505 is used to divide the task to be assigned according to the target second division mode, and to assign the divided task to the at least one processor for processing.
[0121] Optionally, in the aforementioned apparatus, the third acquisition module 504 includes:
[0122] The first computing unit is configured to calculate, based on the first subtask and the second subtask, a first degree of overlap between each second partitioning pattern and each first partitioning pattern;
[0123] The second calculation unit is used to calculate the target overlap degree corresponding to each of the second partitioning patterns based on the first overlap degree;
[0124] The first acquisition unit is used to acquire the second division pattern of the target based on the target overlap.
[0125] Wherein, the second target partitioning mode is the second partitioning mode with the lowest target overlap among the at least one second partitioning modes.
[0126] Optionally, in the apparatus, the first computing unit includes:
[0127] The first acquisition component is used to acquire the first set corresponding to the first partitioning pattern, wherein the first set is a set consisting of all first subtasks corresponding to the first partitioning pattern.
[0128] The second acquisition component is used to acquire the second set corresponding to the second partitioning pattern, wherein the second set is a set consisting of all the second subtasks corresponding to the second partitioning pattern.
[0129] The third acquisition component is used to acquire the first overlap degree based on the ratio of the intersection to the union of the first set and the second set.
[0130] Optionally, in the aforementioned apparatus, the first processing module 505 includes:
[0131] The second acquisition unit is used to divide the task to be assigned according to the target second division mode and acquire the third sub-task.
[0132] The first processing unit is configured to determine, based on the subtask list and the third subtask, whether there is a fourth subtask in the subtask list that is the same as the third subtask; wherein, the subtask list is a list including at least one historical subtask that has been calculated by the processor and the calculation results of the historical subtask;
[0133] The third acquisition unit is used to acquire the calculation result of the third subtask from the subtask list if it is determined that there is a fourth subtask in the subtask list that is the same as the third subtask.
[0134] The second processing unit is configured to assign the third subtask to the processor with the lowest current load for calculation if it is determined that there is no fourth subtask in the subtask list that is the same as the third subtask.
[0135] Optionally, the device further includes:
[0136] The fourth acquisition module is used to acquire the resource idleness of the processor and at least one candidate partitioning mode; wherein the candidate partitioning mode is a partitioning mode that has been used.
[0137] The second processing module is used to select the first partitioning mode from the at least one candidate partitioning modes when the resource idleness is less than a preset value.
[0138] The first determining module is used to determine all the candidate partitioning modes as the first partitioning mode when the resource idleness is greater than or equal to the preset value.
[0139] Optionally, in the aforementioned apparatus, the second processing module includes:
[0140] The fourth acquisition unit is used to acquire the fifth sub-task of each candidate partitioning pattern based on the historical execution data of the at least one candidate partitioning pattern; wherein the historical execution data is data recorded during the execution of historical tasks;
[0141] The fifth acquisition unit is used to acquire the repetition rate corresponding to each candidate partitioning pattern based on the ratio of the number of repeated subtasks in the fifth subtask of each candidate partitioning pattern to the total number of the fifth subtasks.
[0142] The third processing unit is used to select the candidate partitioning pattern with the highest repetition rate as the first partitioning pattern.
[0143] Optionally, in the apparatus, the first generation module 502 includes:
[0144] The fourth processing unit is used to construct a graph structure; wherein the graph structure includes multiple nodes and edges connecting the nodes; the nodes are obtained by splitting the tasks to be assigned according to the task characteristics and the resource status, and the edges are the dependencies between the nodes;
[0145] The sixth acquisition unit is used to cut the edges of the graph structure and acquire at least one cutting result; wherein each cutting result corresponds to a number of cut edges; each cutting result includes multiple sub-graph structures, and each sub-graph structure includes at least one node;
[0146] The seventh acquisition unit is used to acquire the second division pattern based on the cutting result; wherein each cutting result corresponds to one second division pattern.
[0147] It should be noted that the apparatus provided in this embodiment of the invention can implement all the method steps implemented in the above method embodiment and can achieve the same technical effect. Therefore, the parts and beneficial effects that are the same as those in the method embodiment will not be described in detail here.
[0148] like Figure 6 As shown, to achieve the above objectives, an embodiment of the present invention provides a task allocation device, including: a transceiver 601, a processor 602, a memory 603, and a program or instructions stored in the memory 603 and executable on the processor 602; wherein, when the processor 602 executes the program or instructions, it implements the task allocation method as described above.
[0149] The transceiver 601 is used to receive and send data under the control of the processor 602.
[0150] Among them, Figure 6In this context, the bus architecture may include any number of interconnected buses and bridges, specifically linking various circuits together, represented by one or more processors (processor 602) and memory (memory 603). The bus architecture may also link together various other circuits such as peripheral devices, voltage regulators, and power management circuits, which are well known in the art and therefore will not be described further herein. The bus interface provides an interface. The transceiver 601 may be multiple elements, including transmitters and receivers, providing a unit for communicating with various other devices over a transmission medium. The processor 602 is responsible for managing the bus architecture and general processing, and the memory 603 may store data used by the processor 602 during operation.
[0151] To achieve the above objectives, embodiments of the present invention provide a readable storage medium having a program or instructions stored thereon, wherein the program or instructions, when executed by a processor, implement the steps in the task allocation method described above.
[0152] To achieve the above objectives, embodiments of the present invention provide a computer program product, which includes computer instructions that, when executed by a processor, implement the steps of the task allocation method described above.
[0153] It should be further noted that the task allocation devices described in this specification include, but are not limited to, smartphones, tablets, etc., and many of the described functional components are referred to as modules in order to more specifically emphasize the independence of their implementation.
[0154] In this embodiment of the invention, the module can be implemented in software so that it can be executed by various types of processors. For example, an identified executable code module may include one or more physical or logical blocks of computer instructions, which may be constructed as objects, procedures, or functions. Nevertheless, the executable code of the identified module does not need to be physically located together, but may include different instructions stored in different bits, which, when logically combined, constitute the module and achieve the module's intended purpose.
[0155] In practice, an executable code module can be a single instruction or many instructions, and can even be distributed across multiple different code segments, different programs, and across multiple memory devices. Similarly, operational data can be identified within the module and can be implemented in any suitable form and organized within any suitable data structure. This operational data can be collected as a single dataset or distributed across different locations (including different storage devices), and can exist, at least in part, solely as electronic signals within the system or network.
[0156] When a module can be implemented using software, considering the current level of hardware technology, modules that can be implemented in software can be implemented using hardware circuits by those skilled in the art to achieve the corresponding functions, without considering cost. These hardware circuits include conventional very-large-scale integrated circuits (VLSI) or gate arrays, as well as existing semiconductors such as logic chips and transistors, or other discrete components. Modules can also be implemented using programmable hardware devices, such as field-programmable gate arrays, programmable array logic, and programmable logic devices.
[0157] The exemplary embodiments described above are with reference to the accompanying drawings. Many different forms and embodiments are feasible without departing from the spirit and teachings of the invention. Therefore, the invention should not be construed as limiting the exemplary embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention complete and convey the scope of the invention to those skilled in the art. In these drawings, component dimensions and relative dimensions may be exaggerated for clarity. The terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. As used herein, unless clearly indicated otherwise, the singular forms “a,” “an,” and “the” are intended to include all such forms. It will be further understood that the terms “comprising” and / or “including”, when used in this specification, indicate the presence of the stated features, integers, steps, operations, components, and / or elements, but do not exclude the presence or addition of one or more other features, integers, steps, operations, components, and / or groups thereof. Unless otherwise indicated, when stated, a range of values includes the upper and lower limits of the range and any subranges in between.
[0158] The above description represents the preferred embodiments of the present invention. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.
Claims
1. A task allocation method, characterized in that, include: When a task to be assigned is obtained that requires computation by at least one processor, the task to be assigned is divided into a first subtask according to at least one first partitioning pattern; wherein, the first partitioning pattern is a partitioning pattern that has been used before. At least one second partitioning pattern is generated based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the processor requirements and expected computation results of the task to be assigned; The task to be assigned is divided into tasks according to the second division mode to obtain the second sub-task; Based on the first subtask and the second subtask, obtain the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern; The tasks to be assigned are divided according to the target second partitioning mode, and the divided tasks are assigned to the at least one processor for processing.
2. The method according to claim 1, characterized in that, The step of obtaining the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning patterns based on the first subtask and the second subtask includes: Based on the first subtask and the second subtask, calculate the first overlap between each second partitioning pattern and each first partitioning pattern; Based on the first overlap, calculate the target overlap corresponding to each of the second partitioning patterns; Based on the target overlap, obtain the second target partitioning pattern; Wherein, the second target partitioning mode is the second partitioning mode with the lowest target overlap among the at least one second partitioning modes.
3. The method according to claim 2, characterized in that, Based on the first subtask and the second subtask, calculate the first overlap degree between each of the second partitioning patterns and each of the first partitioning patterns, including: Obtain the first set corresponding to the first partitioning pattern, wherein the first set is a set consisting of all first subtasks corresponding to the first partitioning pattern; Obtain the second set corresponding to the second partitioning pattern, where the second set is a set consisting of all second subtasks corresponding to the second partitioning pattern; The first degree of overlap is obtained based on the ratio of the intersection to the union of the first set and the second set.
4. The method according to claim 1, characterized in that, The step of dividing the tasks to be assigned according to the target second partitioning pattern and assigning the divided tasks to the at least one processor for processing includes: The tasks to be assigned are divided according to the second target division pattern to obtain the third sub-task; Based on the subtask list and the third subtask, determine whether there is a fourth subtask in the subtask list that is the same as the third subtask; wherein, the subtask list is a list including at least one historical subtask that has been calculated using the processor and the calculation results of the historical subtask; If it is determined that there is a fourth subtask in the subtask list that is the same as the third subtask, then the calculation result of the third subtask is obtained from the subtask list. If it is determined that there is no fourth subtask in the subtask list that is the same as the third subtask, the third subtask is assigned to the processor with the lowest current load for calculation.
5. The method according to claim 1, characterized in that, Before dividing the task to be assigned according to at least one first partitioning pattern to obtain the first subtask, the method further includes: Obtain the resource idle time of the processor and at least one candidate partitioning mode; wherein, the candidate partitioning mode is a partitioning mode that has been used. If the resource idleness is less than a preset value, the first partitioning mode is selected from the at least one candidate partitioning mode. If the resource idleness is greater than or equal to the preset value, all the candidate partitioning modes are determined as the first partitioning mode.
6. The method according to claim 5, characterized in that, When the resource idleness is less than a preset value, selecting the first partitioning mode from the at least one candidate partitioning mode includes: Based on the historical execution data of the at least one candidate partitioning pattern, a fifth subtask for each candidate partitioning pattern is obtained; wherein, the historical execution data is data recorded during the execution of historical tasks; Based on the ratio of the number of repeated subtasks in the fifth subtask of each candidate partitioning pattern to the total number of the fifth subtasks, the repetition rate corresponding to each candidate partitioning pattern is obtained. The candidate partitioning pattern with the highest repetition rate is selected as the first partitioning pattern.
7. The method according to claim 1, characterized in that, Generate at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource status of the processor, including: Construct a graph structure; wherein the graph structure includes multiple nodes and edges connecting the nodes; the nodes are obtained by splitting the tasks to be assigned according to the task characteristics and the resource status, and the edges are the dependencies between the nodes; The edges of the graph structure are cut to obtain at least one cutting result; wherein each cutting result corresponds to a number of cut edges; each cutting result includes multiple subgraph structures, and each subgraph structure includes at least one node; The second partitioning pattern is obtained based on the cutting results; wherein each cutting result corresponds to one second partitioning pattern.
8. A task allocation device, characterized in that, include: The first acquisition module is used to, when acquiring a task to be assigned that requires computation by at least one processor, divide the task to be assigned according to at least one first partitioning mode to acquire a first subtask; wherein, the first partitioning mode is a partitioning mode that has been used before. A first generation module is configured to generate at least one second partitioning pattern based on the task characteristics of the task to be assigned and the resource status of the processor; wherein, the task characteristics are the requirements of the task to be assigned on the processor and the expected computation results; The second acquisition module is used to divide the task to be assigned according to the second division mode to obtain the second sub-task; The third acquisition module is used to acquire the target second partitioning pattern with the lowest overlap with the first partitioning pattern from the second partitioning pattern based on the first subtask and the second subtask. The first processing module is used to divide the tasks to be assigned according to the target second division mode, and to assign the divided tasks to the at least one processor for processing.
9. A task allocation device, comprising: A transceiver, a processor, a memory, and a program or instructions stored in the memory and executable on the processor; characterized in that, when the processor executes the program or instructions, it implements the task allocation method as described in any one of claims 1-7.
10. A readable storage medium having a program or instructions stored thereon, characterized in that, When the program or instructions are executed by the processor, they implement the steps in the task allocation method as described in any one of claims 1-7.
11. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the steps of the task allocation method as described in any one of claims 1-7.