Task processing method and device, equipment, storage medium and program product
By dynamically allocating tasks to solvers in different modes, the problem of low resource utilization of solvers in the prior art is solved, and the effect of improving task solution throughput and resource utilization is achieved.
Patent Information
- Application Number
- CN202311520504.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-14
- Publication Date
- 2025-05-16
AI Technical Summary
The prior art cannot maximize the utilization of solver resources in task solving in the supply chain field, resulting in low throughput of task solving.
By iteratively executing task processing methods, obtaining a set of tasks, and dynamically assigning tasks based on the constraints of solvers of different modes. Specifically, based on the constraints of the solver of the first mode, a first number of tasks in the task set is assigned to the solver of the first mode; if the remaining tasks meet the preset conditions, a second number of tasks in the remaining tasks is assigned to the solver of the second mode, and the task set is updated.
The throughput and resource utilization of the solver are improved, and task allocation is optimized between heterogeneous solver modes through dynamic routing strategies, improving the efficiency of task solving.
Smart Images

Figure CN120011004A_ABST
Abstract
Description
Technical Field
[0001] Example embodiments of the present disclosure generally relate to the field of computers, and more particularly, to task processing methods, apparatuses, devices, computer-readable storage media, and computer program products. Background Art
[0002] Operations research is widely used in the field of supply chain, such as inventory management, resource scheduling, logistics network optimization, etc. Operations research itself and its supply chain tasks are extremely complex, which has given rise to solvers for operations research optimization tasks, such as CPLEX, GUROBI, LINDO API, etc. These solvers have demonstrated sufficient usability and ease of use in solving tasks in the supply chain field, but at the same time they bring high costs. For example, the current sales price of commercial solvers is generally around one million. Therefore, how to maximize the use of solver resources deserves attention. Summary of the invention
[0003] In a first aspect of the present disclosure, a method for task processing is provided. The method comprises: iteratively performing the following process at least once: obtaining a task set; assigning a first number of tasks in the task set to a solver of the first mode based on the constraint conditions of the solver of the first mode; if the remaining tasks in the task set except the first number of tasks meet a first preset condition, assigning a second number of tasks in the remaining tasks to a solver of the second mode; and taking the tasks in the remaining tasks except the second number of tasks as a task set.
[0004] In a second aspect of the present disclosure, a device for task processing is provided. The device includes: an acquisition module configured to acquire a task set; a first allocation module configured to allocate a first number of tasks in the task set to a solver of the first mode based on the constraint conditions of the solver of the first mode; a second allocation module configured to allocate a second number of tasks in the task set to a solver of the second mode if the remaining tasks in the task set except the first number of tasks meet a first preset condition; and a task set update module configured to use the remaining tasks except the second number of tasks as a task set.
[0005] In a third aspect of the present disclosure, an electronic device is provided. The electronic device includes at least one processing unit; and at least one memory, the at least one memory is coupled to the at least one processing unit and stores instructions for execution by the at least one processing unit, and when the instructions are executed by the at least one processing unit, the electronic device executes the method of the first aspect of the present disclosure.
[0006] In a fourth aspect of the present disclosure, a computer-readable storage medium is provided, wherein a computer program is stored on the computer-readable storage medium, and the computer program can be executed by a processor to perform the method according to the first aspect of the present disclosure.
[0007] In a fifth aspect of the present disclosure, a computer program product is provided, which includes computer executable instructions, and when the instructions are executed by a processor, the method according to the first aspect of the present disclosure is implemented.
[0008] It should be understood that the content described in this section is not intended to limit the key features or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] In the following, in conjunction with the accompanying drawings and with reference to the following detailed description, the above and other features, advantages and aspects of various implementations of the present disclosure will become more apparent. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, wherein:
[0010] Figure 1 A schematic diagram showing an example environment in which embodiments of the present disclosure can be implemented;
[0011] Figure 2 A schematic diagram showing a process of dynamically allocating tasks between solvers of different modes according to some embodiments of the present disclosure;
[0012] Figure 3 A flowchart showing a process of task processing according to some embodiments of the present disclosure;
[0013] Figure 4 A block diagram showing an apparatus for task processing according to some embodiments of the present disclosure; and
[0014] Figure 5 A block diagram of an electronic device is shown in which one or more embodiments of the present disclosure may be implemented. DETAILED DESCRIPTION
[0015] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although some embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein. On the contrary, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0016] In the description of the embodiments of the present disclosure, the term "including" and similar terms should be understood as open inclusion, that is, "including but not limited to". The term "based on" should be understood as "based at least in part on". The term "one embodiment" or "the embodiment" should be understood as "at least one embodiment". The term "some embodiments" should be understood as "at least some embodiments". Other explicit and implicit definitions may also be included below.
[0017] It should be noted that the acquisition, storage and application of user personal information involved in the technical solution of the present disclosure are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0018] As explained above, how to maximize the use of solver resources deserves attention. At present, there are two sales modes for commercial solvers: token authentication (token) mode and firmware mode. A solver in token mode means that the token of the solver is sold. The constraint of the solver in token mode is the concurrency of task solving limited by the number of tokens. For example, if there are only three tokens, the number of tasks that the solver in token mode can process in parallel will be limited by the number of tokens. The solver in token mode has no restrictions on task scale and hardware resources. A solver in firmware mode means that the solver software is sold. The constraint of the solver in firmware mode is the hardware resources of the device on which the solver in firmware mode is installed, and there is no restriction on the concurrency of task solving. In other words, for the solver in firmware mode, the concurrency of task solving is liberalized at the software level, but the hardware resources themselves imply the concurrency constraints of task solving.
[0019] The constraints and unrestricted conditions (expressed as openness in Table 1) of the solvers of these two modes are shown in Table 1 below.
[0020] Table 1
[0021] Constraints Openness Token Mode Task solving concurrency Task size, hardware resources Firmware Mode Hardware resources for task solving Concurrency of task solving
[0022] In the application scenario where two modes of solvers coexist to provide services, the business application is the service requester, the task to be solved is the input, and the solver is the service provider. In this scenario, it is necessary to determine which solver will perform the solution. Furthermore, regardless of the mode of the solver, the solver is usually installed on a server. Accordingly, routing tasks are introduced in the task solving in this scenario where multiple modes of solvers coexist, that is, which solver deployed on which server is selected to solve the task.
[0023] In the current scheme, static routing (also known as polling) is generally used to assign tasks to solvers of different modes. Specifically, the characteristics of different modes are reflected by different weights. For example, the weight of the token mode solver is 1, and the weight of the firmware mode solver is 4. Then, the ratio or probability of tasks assigned to solvers of different modes is proportional to the weight set for them. For example, for 100 tasks to be solved, 20 tasks are assigned to the token mode solver, and 80 tasks are assigned to the firmware mode solver.
[0024] In the field of supply chain planning, the correctness of task solving is very important. However, because the planning task itself does not pursue real-time performance, the static routing method based on artificial experience does not consider the characteristics of solvers in different modes, so it is impossible to maximize the use of solver resources. In other words, when the solver resources are fixed, the throughput of task solving is low.
[0025] In view of this, the present disclosure provides a task processing scheme. In the scheme, a task set is obtained; based on the constraint conditions of the solver of the first mode, a first number of tasks in the task set are assigned to the solver of the first mode; if the remaining tasks in the task set except the first number of tasks meet the first preset condition, a second number of tasks in the remaining tasks are assigned to the solver of the second mode; and the tasks in the remaining tasks except the second number of tasks are taken as the task set.
[0026] In this way, in actual application scenarios where heterogeneous solver modes coexist, the solver throughput can be improved, that is, the utilization rate of solver resources can be improved.
[0027] Example environment and basic working principle
[0028] Figure 1 1 shows a schematic diagram of an example environment 100 in which embodiments of the present disclosure can be implemented. The environment 100 involves multiple servers deployed with solvers. Figure 1 In the example, the multiple servers include server 110 and server 120 deployed with solvers in token mode, and also include server 130 deployed with solvers in firmware mode. The present disclosure does not limit the number of servers deployed with solvers in token mode, nor does it limit the number of solvers deployed with firmware mode.
[0029] The environment 100 also includes a task allocation device 140. A user 150 can input a set of tasks to be solved to the task allocation device 140. The task allocation device 140 can allocate multiple tasks in the task set to each server where a solver is deployed based on a preset task allocation strategy. For example, Figure 1In this way, the solver can process the assigned tasks.
[0030] In an embodiment of the present disclosure, a preset task allocation strategy may be based on the constraints of a token mode solver, and some tasks are allocated to a token mode solver. The remaining tasks are allocated to a firmware mode solver. If the hardware resources required for the remaining tasks exceed the hardware resources that can be provided by the server on which the firmware mode solver is deployed, some of the remaining tasks are allocated to the firmware mode solver for processing, and the other tasks are reallocated as a new task set based on the task allocation strategy. It is understandable that during the reallocation process, some tasks will be reallocated to the token mode solver again. The specific implementation of allocating tasks based on the task allocation strategy can be referred to the detailed description below, and the present disclosure is not limited thereto.
[0031] In the environment 100, the task allocation device 140 can be any type of device with computing capabilities, including a terminal device or a server device. The terminal device can be any type of mobile terminal, fixed terminal or portable terminal, including a mobile phone, a desktop computer, a laptop computer, a notebook computer, a netbook computer, a tablet computer, a media computer, a multimedia tablet, a personal communication system (PCS) device, a personal navigation device, a personal digital assistant (PDA), an audio / video player, a digital camera / camcorder, a positioning device, a television receiver, a radio broadcast receiver, an e-book device, a game device or any combination of the foregoing, including accessories and peripherals of these devices or any combination thereof. The server device can include, for example, a computing system / server, such as a mainframe, an edge computing node, an electronic device in a cloud environment, and the like. Although shown as separate devices, the task allocation device 140 and a server (e.g., any of the server 110, the server 120 or the server 130) deployed with a solver can be the same device or included in the same system.
[0032] It should be understood that the structure and functionality of environment 100 are described for exemplary purposes only and does not imply any limitation on the scope of the present disclosure.
[0033] Example Task Processing Embodiments
[0034] As mentioned above, the task allocating device 140 may allocate multiple tasks in the task set to each server where a solver is deployed based on a preset task allocation strategy.
[0035] The task allocation device 140 can obtain a task set. The task set includes multiple tasks that need to be processed by the solver. For example, the tasks that need to be processed by the solver are usually problems that need to be solved by the solver. Therefore, the task set in the embodiment of the present disclosure can be a problem set.
[0036] In some embodiments, the task size can be estimated based on the task type, and the hardware resources consumed by the task can be estimated based on the task size. In the disclosed embodiment, multiple tasks can be sorted based on the estimated task size and the hardware resources consumed.
[0037] The hardware resources consumed during task processing mainly include memory and CPU. The task scale is determined based on the resources consumed by the task. The size of the hardware resources consumed by different types of tasks is determined based on the type of task.
[0038] Generally, insufficient CPU resources will only slow down the problem solving process, while insufficient memory resources may lead to degradation of the optimization problem results. Therefore, in the analysis of the impact of problem scale on resource consumption, memory resources have a higher priority than CPU resources. The hardware resources involved in the embodiments of the present disclosure generally refer to memory resources.
[0039] In some embodiments, a first storage resource required to read input data associated with a task set may be determined. A second storage resource required for performing a preset process on the input data may also be determined. Further, the size of the hardware resources required for solving the problem using the solver may be determined based on the maximum value of the first storage resource and the second storage resource.
[0040] For example, in a network planning problem, the resources consumed by the problem are determined in terms of storage of input data and model construction.
[0041] Input data: a one-time reading of large amounts of basic information including node information, transportation information, order information, etc. The maximum memory usage in this process is recorded as Memory1.
[0042] Model construction: construct edges through the dimensions of starting point-end point-transportation mode-product, and store the resulting large objects. The data volume calculation formula for this process is: min(number of starting points * number of end points * transportation mode * aggregated products, transportation information * aggregated products). The maximum memory usage in this process is recorded as Memory2.
[0043] Then, Max{Memory1,Memory2} (that is, the maximum value of Memory1 and Memory2) can be taken as the system memory requirement of the task.
[0044] Alternatively or additionally, the consumption of CPU computing power may be estimated based on the scale of the model after construction.
[0045] It is understandable that different types of tasks have different data input and model building methods. Through model analysis and Cartesian product calculation of core data, we can get a more accurate estimate of the resource consumption of the problem scale.
[0046] In the disclosed embodiment, multiple tasks may be sorted based on the estimated task size and the hardware resources consumed. For example, multiple tasks may be sorted in descending order of the hardware resources consumed to form a task list. For another example, multiple tasks may be sorted in descending order of the hardware resources consumed to form a task list.
[0047] In the disclosed embodiment, for a task list including multiple tasks, how to optimally distribute and deploy multiple tasks in a heterogeneous mode (i.e., different modes) solver is what needs to be considered when designing a routing allocation strategy. In the disclosed embodiment, tasks are allocated based on the characteristics of solvers in different modes. For example, a token mode solver does not limit resource usage, so it is possible to dynamically pull up services and select a machine or container (cloud service) of appropriate resource size to adapt to the tasks with the most resource usage in the task list, and solve such tasks. Dynamically pulled up server resources can be reused in subsequent calculations.
[0048] That is, the task allocating device 140 may allocate a first number of tasks in the task set to the solver of the first mode based on the constraint conditions of the solver of the first mode.
[0049] In some embodiments, the task allocation device 140 may determine the first number based on the constraint condition of the solver of the first mode. Then, the task allocation device 140 may allocate the first number of tasks in the task set that meet the second preset condition to the solver of the first mode.
[0050] Exemplarily, the solver of the first mode may be a solver of the token mode. Accordingly, the constraint condition of the solver of the first mode may be the number of tokens. Then, the task allocation device 140 may determine the number of tasks allocated to the solver of the token mode based on the number of tokens. For example, if the number of tokens is three, the number of tasks allocated to the solver of the token mode matches it, for example, is also three.
[0051] As an implementation, as mentioned above, the task allocation device 140 may sort the multiple tasks in the task set according to the number of hardware resources required for each task. For example, the tasks may be sorted in a sequence from more to less or from less to more according to the number of hardware resources required for each task. Then, the tasks whose number of hardware resources required for use in the sorted multiple tasks is greater than a first number of a preset threshold value may be allocated to the solver of the first mode.
[0052] For example, if the first number is three, the tasks whose numbers of required hardware resources are arranged in the order of most to least may be allocated to the token mode solver.
[0053] As another implementation, multiple tasks in the task set may be sorted according to the time when the task is generated or the time when the task assignment device 140 acquires the task. The earlier the task is generated or the earlier the task assignment device 140 acquires the task, the higher the ranking of the task in the task set. Accordingly, the first number of tasks with higher rankings may be assigned to the solver of the first mode.
[0054] In the disclosed embodiment, the initially acquired task set may be divided into two subsets or two task lists, such as task list 1 and task list 2. The tasks in task list 1 (e.g., the first number of tasks with the largest number of hardware resources required as mentioned above) will be assigned to the solver in token mode. The tasks in task list 2 will be further assigned.
[0055] That is, through the above process, some of the tasks are assigned to the token mode solver. Next, the remaining tasks need to be further assigned.
[0056] In some embodiments, if the remaining tasks in the task set except the first number of tasks meet the first preset condition, a second number of tasks in the remaining tasks may be assigned to the solver of the second mode.
[0057] It can be understood that the first preset condition here refers to the condition that the solver of the second mode cannot handle all the remaining tasks.
[0058] The setting of the first preset condition can give priority to whether the solver resources meet the problem scale. For example, if the problem scale of the same batch of problems just exhausts the solver resources (usually refers to the resources that can be provided by the device where the solver is deployed (such as the server mentioned above)), then the resources of the solver are fully utilized. It can be understood that the exhaustion of the solver resources is theoretically 100% resource utilization, but the probability that the problem scale is equal to 100% is too low, so in fact the resource utilization rate is generally set below 100%. That is, the first preset condition can be that the resources required for the remaining tasks (task list 2) are greater than the solver resources * preset resource utilization. In this case, batch calculation can be triggered. Batch calculation here refers to splitting task list 2 again and assigning the tasks that can be processed by the solver of the second mode (that is, the second number of tasks mentioned above) to the solver of the second mode. And the tasks other than the second number of tasks in the remaining tasks are used as a new task set. That is, the task set is updated, and the above task allocation process is performed again for the updated task set.
[0059] In other words, if the number of hardware resources required by the remaining tasks in the task set except the first number of tasks is greater than or equal to the number of hardware resources that can be provided by the device with the solver of the second mode deployed (as mentioned above, the number of hardware resources that can be provided by the device with the solver of the second mode deployed is determined based on the preset resource usage rate), then the second number of tasks can be determined from the remaining tasks based on the number of hardware resources that can be provided by the device with the solver of the second mode deployed. Then, the second number of tasks can be assigned to the solver of the second mode.
[0060] In addition, while pursuing full utilization of solver resources, the real-time nature of problem solving is introduced as a constraint. For example, when the waiting time of the task list exceeds the preset time threshold, batch calculation is also triggered.
[0061] In other words, if the waiting time required to process the remaining tasks in the task set except the first number of tasks using the second mode solver is greater than or equal to a preset time threshold, the second number of tasks can be allocated to the second mode solver.
[0062] For example, the preset time threshold may be the average time for solving problems of the same size. The average time for solving problems of average size may be calculated and updated by setting a statistical formula using information calculated by the solver as input. In some embodiments, the corresponding relationship between the task size and the hardware resources consumed and / or the corresponding relationship between the task size and the average time for task processing may be obtained.
[0063] In some embodiments, if the remaining tasks in the task set except the first number of tasks do not meet the first preset condition, all the remaining tasks may be assigned to the solver of the second mode.
[0064] As mentioned above, the first preset condition may be that the number of hardware resources required by the remaining tasks (e.g., the tasks in task list 2) is greater than or equal to the number of hardware resources that can be provided by the device with the solver of the second mode deployed. The first preset condition may also be that the waiting time of the remaining tasks (e.g., the tasks in task list 2) exceeds a preset threshold. If the remaining tasks do not meet the first preset condition, it means that the solver of the second mode has sufficient resources or processes tasks faster, and all the remaining tasks may be assigned to the solver of the second mode.
[0065] Figure 2 An example process of allocating tasks between solvers of different modes using the task allocation strategy disclosed in the present invention is shown.
[0066] refer to Figure 2 The initially acquired task set 210 includes multiple tasks. Figure 2 In the example, the multiple tasks are shown as task 1, task 2, task 3, task n, and task n+1. Task 1, task 2, and task 3 in task set 210 are assigned to a server in token mode, for example Figure 1 For the remaining tasks, they are split again, and based on the resources of the firmware mode solver, tasks 2 to n that can be processed by the firmware mode solver are assigned to the firmware mode server, for example Figure 1 The remaining tasks, such as task n+1 and other tasks, will be used as a new task set 220. The tasks in the new task set 220 will be reassigned using the same task allocation strategy. During the reassignment process, some tasks will be assigned to the solver in token mode.
[0067] In order to more clearly illustrate the effect of the embodiment of the present disclosure, two problem lists with different average sizes are used to test and compare the task allocation strategy provided by the embodiment of the present disclosure (also called a dynamic routing solution) and the conventional solver weight-based task allocation strategy (also called a static routing solution).
[0068] All resources used in this comparison include: 3 servers equipped with token mode solvers and 1 server equipped with firmware mode solver. Four comparison indicators are selected: throughput, maximum memory usage, maximum CPU usage (only the firmware mode solver is constrained by hardware resources, so only the memory usage and maximum CPU usage of the server equipped with the firmware mode solver are concerned), and average problem calculation time.
[0069] The comparison results of the effects of different routing schemes for small-scale question lists are shown in Table 2. The comparison results of the effects of different routing schemes for large-scale question lists are shown in Table 3.
[0070] Table 2
[0071]
[0072] Table 3
[0073]
[0074] From the comparison results, it can be seen that under small-scale problems, when the length of the problem list is small, the problem assigned to the token mode solver by the static routing scheme does not reach the maximum concurrency of 3 for this mode. Although the overall concurrency is the same as that of the dynamic routing scheme, the average calculation time of the problem is slightly longer than that of the dynamic routing scheme. The dynamic routing scheme is due to the static routing scheme. As the length of the problem list increases, the tasks assigned to the token mode solver by the static routing scheme trigger batch processing (exceeding the maximum concurrency of 3 for problem solving in this mode), resulting in the overall throughput being inferior to the dynamic routing scheme. When the length of the problem list is large, the task assignment of the static routing scheme to the firmware mode solver is likely to cause the solver optimization result to be degraded. For example, when the problem list size in Table 3 is 20, the memory usage of the server deployed with the firmware mode solver is 99% using the static routing scheme, which is close to 100%. The allocation of tasks to the firmware mode solver using a dynamic routing solution will trigger batch processing (when the maximum memory usage reaches a preset resource utilization value, such as 90%), which can ensure resource stability while maximizing resource utilization.
[0075] In summary, the task allocation strategy (ie, dynamic routing solution) designed in the present disclosure is superior to conventional static routing solutions in terms of throughput and stability.
[0076] Example Process
[0077] Figure 3 A flowchart of a process 300 of task processing according to some embodiments of the present disclosure is shown. The process 300 may be implemented at the task allocating device 140. The process 300 includes iteratively executing the following blocks 310, 320, 330, and 340.
[0078] In block 310 , the task allocation device 140 obtains a task set.
[0079] In block 320 , the task allocating device 140 allocates a first number of tasks in the task set to the solver of the first mode based on the constraint conditions of the solver of the first mode.
[0080] In block 330 , if the remaining tasks in the task set except the first number of tasks meet the first preset condition, the task allocating device 140 allocates a second number of tasks in the remaining tasks to the solver in the second mode.
[0081] In block 340 , the task allocating device 140 takes the remaining tasks except the second number of tasks as a task set.
[0082] As mentioned above, the task set is updated at block 340 , and blocks 310 to 340 are executed again for the updated task set.
[0083] In some embodiments, assigning a first number of tasks in a task set to a solver of a first mode includes: determining the first number based on constraints of the solver of the first mode; and assigning a first number of tasks in the task set that meet a second preset condition to the solver of the first mode.
[0084] In some embodiments, assigning a first number of tasks in a task set that meet a second preset condition to a solver of a first mode includes: sorting multiple tasks in the task set according to the number of hardware resources required for each task; and assigning a first number of tasks in the sorted multiple tasks whose number of hardware resources required is greater than a preset threshold to the solver of the first mode.
[0085] In some embodiments, allocating a second number of tasks from the remaining tasks to the solver of the second mode includes: if the number of hardware resources required by the remaining tasks in the task set except the first number of tasks is greater than or equal to the number of hardware resources that can be provided by the device deployed with the solver of the second mode, and the number of hardware resources that can be provided by the device deployed with the solver of the second mode is determined based on a preset resource utilization rate, then determining a second number of tasks from the remaining tasks based on the number of hardware resources that can be provided by the device deployed with the solver of the second mode; and allocating the second number of tasks to the solver of the second mode.
[0086] In some embodiments, allocating a second number of tasks from the remaining tasks to the solver of the second mode includes: if the waiting time required to process the remaining tasks in the task set except the first number of tasks using the solver of the second mode is greater than or equal to a preset time threshold, then allocating the second number of tasks to the solver of the second mode.
[0087] In some embodiments, process 300 further includes: obtaining a corresponding relationship between the task size and the consumed hardware resources and / or a corresponding relationship between the task size and the average task processing time from solver statistics.
[0088] In some embodiments, process 300 also includes: determining a first storage resource required to read input data associated with a task set; determining a second storage resource required to perform a preset processing on the input data; and determining the size of hardware resources required to solve the problem using a solver based on a maximum value between the first storage resource and the second storage resource.
[0089] Example Device
[0090] Figure 4 A block diagram of a task processing apparatus 400 according to some embodiments of the present disclosure is shown. The apparatus 400 may be implemented in the task allocation apparatus 140. Each module / component in the apparatus 400 may be implemented by hardware, software, firmware or any combination thereof.
[0091] The device 400 includes an acquisition module 410, which is configured to acquire a task set; the device 400 also includes a first allocation module 420, which is configured to allocate a first number of tasks in the task set to the solver of the first mode based on the constraints of the solver of the first mode; the device 400 also includes a second allocation module 430, which is configured to allocate a second number of tasks in the task set to the solver of the second mode if the remaining tasks except the first number of tasks in the task set meet a first preset condition; and the device 400 also includes a task set update module 440, which is configured to treat the tasks except the second number of tasks in the remaining tasks as a task set.
[0092] In some embodiments, the first allocation module 420 is further configured to determine a first number based on constraints of the solver of the first mode; and allocate a first number of tasks in the task set that meet a second preset condition to the solver of the first mode.
[0093] In some embodiments, the first allocation module 420 is also configured to: sort multiple tasks in the task set according to the number of hardware resources required for each task; and assign tasks among the sorted multiple tasks whose number of hardware resources required is greater than a first number of a preset threshold to the solver of the first mode.
[0094] In some embodiments, the second allocation module 430 is further configured to determine a second number of tasks from the remaining tasks based on the number of hardware resources that can be provided by the device deployed with the solver of the second mode if the number of hardware resources required by the remaining tasks in the task set except the first number of tasks is greater than or equal to the number of hardware resources that can be provided by the device deployed with the solver of the second mode, and the number of hardware resources that can be provided by the device deployed with the solver of the second mode is determined based on a preset resource utilization rate; and allocate the second number of tasks to the solver of the second mode.
[0095] In some embodiments, the second allocation module 430 is further configured to allocate a second number of tasks to the solver of the second mode if the waiting time required to process the remaining tasks in the task set except the first number of tasks using the solver of the second mode is greater than or equal to a preset time threshold.
[0096] In some embodiments, the acquisition module 410 is further configured to acquire the corresponding relationship between the task scale and the consumed hardware resources and / or the corresponding relationship between the task scale and the average task processing time statistically calculated by the solver.
[0097] In some embodiments, the device 400 also includes a determination module configured to determine a first storage resource required to read input data associated with a task set; determine a second storage resource required for performing a preset processing on the input data; and determine the size of hardware resources required to solve the problem using a solver based on a maximum value between the first storage resource and the second storage resource.
[0098] The units included in the device 400 can be implemented in various ways, including software, hardware, firmware, or any combination thereof. In some embodiments, one or more units can be implemented using software and / or firmware, such as machine executable instructions stored on a storage medium. In addition to or as an alternative to machine executable instructions, some or all of the units in the device 400 can be implemented at least in part by one or more hardware logic components. As an example and not limitation, exemplary types of hardware logic components that can be used include field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0099] Figure 5 1 shows a block diagram of an electronic device 500 in which one or more embodiments of the present disclosure may be implemented. It should be understood that Figure 5 The electronic device 500 shown is merely exemplary and should not constitute any limitation on the functionality and scope of the embodiments described herein. Figure 5 The electronic device 500 shown can be used to implement Figure 1The task allocating device 140 is used as the task allocation device.
[0100] like Figure 5 As shown, the electronic device 500 is in the form of a general electronic device. The components of the electronic device 500 may include, but are not limited to, one or more processors or processing units 510, a memory 520, a storage device 530, one or more communication units 540, one or more input devices 550, and one or more output devices 560. The processing unit 510 may be an actual or virtual processor and is capable of performing various processes according to a program stored in the memory 520. In a multi-processor system, multiple processing units execute computer executable instructions in parallel to improve the parallel processing capability of the electronic device 500.
[0101] The electronic device 500 typically includes a plurality of computer storage media. Such media may be any available media accessible to the electronic device 500, including but not limited to volatile and non-volatile media, removable and non-removable media. The memory 520 may be a volatile memory (e.g., a register, a cache, a random access memory (RAM)), a non-volatile memory (e.g., a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), flash memory), or some combination thereof. The storage device 530 may be a removable or non-removable medium, and may include a machine-readable medium, such as a flash drive, a disk, or any other medium, which may be capable of being used to store information and / or data (e.g., training data for training) and may be accessed within the electronic device 500.
[0102] The electronic device 500 may further include additional removable / non-removable, volatile / non-volatile storage media. Figure 5 As shown in , a disk drive for reading or writing from a removable, non-volatile disk (e.g., a "floppy disk") and an optical drive for reading or writing from a removable, non-volatile optical disk may be provided. In these cases, each drive may be connected to the bus (not shown) by one or more data media interfaces. The memory 520 may include a computer program product 525 having one or more program modules that are configured to perform various methods or actions of various embodiments of the present disclosure.
[0103] The communication unit 540 implements communication with other electronic devices through a communication medium. Additionally, the functions of the components of the electronic device 500 can be implemented in a single computing cluster or multiple computing machines that can communicate through a communication connection. Therefore, the electronic device 500 can operate in a networked environment using a logical connection with one or more other servers, a network personal computer (PC), or another network node.
[0104] The input device 550 may be one or more input devices, such as a mouse, a keyboard, a tracking ball, etc. The output device 560 may be one or more output devices, such as a display, a speaker, a printer, etc. The electronic device 500 may also communicate with one or more external devices (not shown) through the communication unit 540 as needed, such as a storage device, a display device, etc., communicate with one or more devices that allow a user to interact with the electronic device 500, or communicate with any device that allows the electronic device 500 to communicate with one or more other electronic devices (e.g., a network card, a modem, etc.). Such communication may be performed via an input / output (I / O) interface (not shown).
[0105] According to an exemplary implementation of the present disclosure, a computer-readable storage medium is provided, on which one or more computer instructions are stored, wherein the one or more computer instructions are executed by a processor to implement the method described above. According to an exemplary implementation of the present disclosure, a computer program product is also provided, which is tangibly stored on a non-transitory computer-readable medium and includes computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the method described above.
[0106] Various aspects of the present disclosure are described herein with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products implemented according to the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by computer-readable program instructions.
[0107] These computer-readable program instructions can be provided to a processing unit of a general-purpose computer, a special-purpose computer, or other programmable data processing device, thereby producing a machine, so that when these instructions are executed by the processing unit of the computer or other programmable data processing device, a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram is generated. These computer-readable program instructions can also be stored in a computer-readable storage medium, and these instructions cause the computer, programmable data processing device, and / or other equipment to work in a specific manner, so that the computer-readable medium storing the instructions includes a manufactured product, which includes instructions for implementing various aspects of the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0108] Computer-readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operating steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, thereby causing the instructions executed on the computer, other programmable data processing apparatus, or other device to implement the functions / actions specified in one or more boxes in the flowchart and / or block diagram.
[0109] The flow chart and block diagram in the accompanying drawings show the possible architecture, function and operation of the system, method and computer program product according to multiple implementations of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a part of a module, program segment or instruction, and a part of a module, program segment or instruction includes one or more executable instructions for realizing the logical function of the specification. In some implementations as replacements, the function marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two continuous square boxes can actually be executed substantially in parallel, and they can sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be realized by a special hardware-based system that performs the function or action of the specification, or can be realized by a combination of special hardware and computer instructions.
[0110] The above descriptions of various implementations of the present disclosure are exemplary, non-exhaustive, and not limited to the disclosed implementations. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described implementations. The selection of terms used herein is intended to best explain the principles of the implementations, practical applications, or improvements to the technology in the marketplace, or to enable other persons of ordinary skill in the art to understand the implementations disclosed herein.
Claims
1. A task processing method, comprising: Iteratively perform the following process at least once: Get the task collection; Based on the constraints of the solver of the first mode, assigning a first number of tasks in the task set to the solver of the first mode; If the remaining tasks in the task set except the first number of tasks meet a first preset condition, assigning a second number of tasks in the remaining tasks to a solver of a second mode; and Tasks other than the second number of tasks among the remaining tasks are taken as a task set.
2. The method of claim 1, wherein assigning a first number of tasks in the task set to the solver of the first mode comprises: determining the first quantity based on constraints of the solver of the first mode; as well as The first number of tasks in the task set that meet a second preset condition are allocated to the solver of the first mode.
3. The method according to claim 2, wherein allocating the first number of tasks in the task set that meet the second preset condition to the solver of the first mode comprises: Sorting the multiple tasks in the task set according to the quantity of hardware resources required by each task; The tasks of the sorted plurality of tasks, for which the number of hardware resources required to be used is greater than the first number of the preset threshold, are allocated to the solver of the first mode.
4. The method according to any one of claims 1 to 3, wherein allocating a second number of tasks among the remaining tasks to the solver of the second mode comprises: If the number of hardware resources required by the remaining tasks in the task set except the first number of tasks is greater than or equal to the number of hardware resources that can be provided by the device deployed with the solver of the second mode, and the number of hardware resources that can be provided by the device deployed with the solver of the second mode is determined based on a preset resource usage rate, then the second number of tasks is determined from the remaining tasks based on the number of hardware resources that can be provided by the device deployed with the solver of the second mode; as well as The second number of tasks is assigned to the solver of the second mode.
5. The method according to any one of claims 1 to 3, wherein allocating a second number of the remaining tasks to the solver of the second mode comprises: If the waiting time required for processing the remaining tasks in the task set except the first number of tasks by using the solver of the second mode is greater than or equal to a preset time threshold, the second number of tasks are allocated to the solver of the second mode.
6. The method according to claim 1, further comprising: Obtain the corresponding relationship between the task scale and the consumed hardware resources and / or the corresponding relationship between the task scale and the average task processing time statistically calculated by the solver.
7. The method according to claim 1, further comprising: determining a first storage resource required to read input data associated with the set of tasks; Determining a second storage resource required in a process of performing a preset processing on the input data; as well as The size of hardware resources required for solving the problem using a solver is determined based on a maximum value of the first storage resource and the second storage resource.
8. An information processing device, comprising: An acquisition module, configured to acquire a set of tasks; A first allocation module is configured to allocate a first number of tasks in the task set to the solver of the first mode based on the constraint condition of the solver of the first mode; A second allocation module is configured to allocate a second number of tasks in the task set to a solver of a second mode if the remaining tasks except the first number of tasks in the task set meet a first preset condition; and The task set updating module is configured to take the tasks among the remaining tasks except the second number of tasks as a task set.
9. An electronic device, comprising: at least one processing unit; as well as At least one memory, the at least one memory being coupled to the at least one processing unit and storing instructions for execution by the at least one processing unit, the instructions causing the electronic device to perform the method according to any one of claims 1 to 7 when executed by the at least one processing unit.
10. A computer-readable storage medium having a computer program stored thereon, wherein the computer program can be executed by a processor to implement the method according to any one of claims 1 to 7.