A task allocation method and device in a computing power sharing scenario

By generating allocation schemes, determining task execution order, and optimizing task allocation using the Grey Wolf optimization algorithm in computing power sharing scenarios, the problem of low task allocation efficiency is solved, achieving more efficient resource utilization and operational efficiency.

CN122195590APending Publication Date: 2026-06-12SHENZHEN UNIV

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN UNIV
Filing Date
2026-01-28
Publication Date
2026-06-12

Smart Images

  • Figure CN122195590A_ABST
    Figure CN122195590A_ABST
Patent Text Reader

Abstract

The application relates to a task allocation method and device in a computing power sharing scene, an electronic device and a storage medium. The method comprises the following steps: generating an allocation scheme according to the number of tasks to be allocated in a task pool and the number of servers in a server cluster; determining a target task execution order of the allocation scheme according to the task amount of the tasks to be allocated; sorting the tasks to be allocated according to the target task execution order and determining a first allocation scheme from the allocation scheme; the first allocation scheme is an allocation scheme executed according to the target task execution order; constructing a complete service time model of the first allocation scheme according to the target time of the tasks to be allocated; optimizing the complete service time model according to a preset algorithm to obtain a second allocation scheme; and performing task allocation according to the second allocation scheme. Through the application, the task allocation efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and in particular to a task allocation method and apparatus, electronic device and storage medium in a computing power sharing scenario. Background Technology

[0002] In recent years, with the rapid development of cloud computing, edge computing, and distributed computing technologies, data volume has exploded in application areas such as large-scale model training and inference. Various complex artificial intelligence applications are constantly emerging, leading to unprecedented demands on various infrastructures, with the high demand for computing power being particularly noteworthy. As computing power demand surges, computing power sharing has gradually become a key paradigm for improving resource utilization and reducing computing costs. By integrating dispersed computing resources, computing power sharing can provide elastic service support for large-scale computing tasks. The efficiency of computing power sharing largely depends on how to optimize the scheduling of computing tasks. Task scheduling not only affects task completion time but also determines the rational utilization of resources and system energy efficiency. In complex environments with dynamic access to heterogeneous resources and diverse user needs, how to achieve efficient task scheduling to optimize global performance (such as task completion time, resource utilization, and energy consumption) remains a core challenge that urgently needs to be addressed in this field.

[0003] Task allocation is one of the core research problems in computing power sharing scenarios. It is NP-hard and essentially a planning problem involving resource optimization and task scheduling. Current related products and technologies focus on queuing theory and bipartite graph matching theory. The main purpose of queuing theory is to optimize service processes, reduce waiting time, and improve system efficiency by modeling and analyzing service systems. In computing power sharing and cloud computing scenarios, queuing theory is frequently used to analyze queuing systems due to its ease of modeling and analysis and its consistency with the realities of these scenarios.

[0004] In resource optimization and task scheduling problems, bipartite graph matching is a commonly used mathematical tool for effectively solving allocation problems. Bipartite graph matching is a graph theory model used to describe the relationship between two disjoint sets of nodes. In task allocation scenarios, the two sets of nodes in a bipartite graph are typically represented as a task set and a resource set. Edges in a bipartite graph represent the allocatable relationship between tasks and resources, and edge weights can represent some performance metric, such as task execution time, allocation cost, or completion probability. For NP-hard problems like task allocation, traditional search algorithms can find relatively good solutions with a certain time complexity. However, traditional search algorithms have long execution times and low task allocation efficiency, reducing overall efficiency. Currently, no effective solution has been proposed to address the low task allocation efficiency problem in related technologies. Summary of the Invention

[0005] This embodiment provides a task allocation method and apparatus, electronic device and storage medium in a computing power sharing scenario to solve the problem of low task allocation efficiency in related technologies.

[0006] Firstly, this embodiment provides a task allocation method in a computing power sharing scenario, the method comprising: A distribution scheme is generated based on the number of tasks to be assigned in the task pool and the number of servers in the server cluster. The target task execution order of the allocation scheme is determined based on the amount of tasks to be assigned. Based on the execution order of the target tasks, the tasks to be assigned are sorted and a first assignment scheme is determined from the assignment schemes; the first assignment scheme is an assignment scheme that is executed according to the execution order of the target tasks. Based on the target time of the task to be assigned, construct a complete service time model for the first allocation scheme; Based on a preset algorithm, the complete service time model is optimized to obtain a second allocation scheme; Tasks are assigned according to the second allocation scheme.

[0007] In some embodiments, determining the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated includes: The target task execution order of the allocation scheme is determined based on the size of the tasks to be allocated.

[0008] In some of these embodiments, the target time includes platform waiting time, server waiting time, and task execution time.

[0009] In some embodiments, the task allocation according to the second allocation scheme includes: The second allocation scheme is encoded according to the target task execution order to generate a list, the first part of the list is the identifier of the server executing the task, and the second part of the list is the identifier of the task to be executed; Based on the list, perform task assignment.

[0010] In some embodiments, constructing a complete service time model based on the target time of the tasks to be assigned includes: dividing the tasks to be assigned in the task pool into sets... It means that, among them, Let be the number of tasks to be assigned, m be the number of tasks to be assigned, i be a positive integer, and m be an integer greater than 1. The complete service time model is constructed as follows: ;in,W ( X (This refers to the full service time.) X For the allocation scheme, For the task The platform's waiting time For the task The waiting time at the server. For the task The execution time of the task.

[0011] In some of these embodiments, the preset algorithm is the Grey Wolf Optimization Algorithm.

[0012] In some embodiments, the method further includes: temporarily storing real-time computing tasks in a task pool, and then uniformly scheduling and allocating multiple tasks in the task pool when at least one server is detected to be idle or when a preset scheduling trigger condition is met.

[0013] Secondly, this embodiment provides a task allocation device for a computing power sharing scenario, the device comprising: The generation module is used to generate an allocation scheme based on the number of tasks to be allocated in the task pool and the number of servers in the server cluster. The first determining module is used to determine the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated; The second determining module is used to sort the tasks to be assigned according to the execution order of the target tasks and determine a first allocation scheme from the allocation schemes; the first allocation scheme is an allocation scheme that is executed according to the execution order of the target tasks. A construction module is used to construct a complete service time model of the first allocation scheme based on the target time of the task to be allocated; The optimization module is used to optimize the complete service time model according to a preset algorithm to obtain a second allocation scheme; The allocation module is used to allocate tasks according to the second allocation scheme.

[0014] Thirdly, this embodiment provides an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to execute the task allocation method in the computing power sharing scenario described in the first aspect.

[0015] Fourthly, this embodiment provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the task allocation method in the computing power sharing scenario described in any one of the first aspects.

[0016] Compared with related technologies, the task allocation method, apparatus, electronic device, and storage medium provided in this embodiment for a computing power sharing scenario determine the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated; determine a first allocation scheme from the allocation schemes based on the target task execution order; the first allocation scheme is an allocation scheme that executes according to the target task execution order; construct a complete service time model of the first allocation scheme based on the target time of the tasks to be allocated; optimize the complete service time model according to a preset algorithm to obtain a second allocation scheme; and allocate tasks according to the second allocation scheme. This application first sorts the tasks to obtain the first allocation scheme with the optimal execution order, and only optimizes the mapping relationship between the sorted tasks and the server, without performing a combined search of the task execution order within the server, thereby reducing algorithm execution time, improving task allocation efficiency, and ultimately improving operational efficiency.

[0017] Details of one or more embodiments of this application are set forth in the following drawings and description to make other features, objects and advantages of this application more readily apparent. Attached Figure Description

[0018] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings: Figure 1 This is a hardware structure block diagram of a terminal for a task allocation method in a computing power sharing scenario provided in an embodiment of this application; Figure 2 This is a flowchart of a task allocation method in a computing power sharing scenario provided in an embodiment of this application; Figure 3 This application provides a scenario-related task allocation model. Figure 4 This is a schematic diagram of a search space provided in an embodiment of this application; Figure 5 This is another search space diagram provided in an embodiment of this application; Figure 6 This is a schematic diagram of an encoding provided in an embodiment of this application; Figure 7 This is a structural block diagram of a task allocation device in a computing power sharing scenario according to an embodiment of this application. Detailed Implementation

[0019] To better understand the purpose, technical solution, and advantages of this application, the application is described and illustrated below in conjunction with the accompanying drawings and embodiments.

[0020] Unless otherwise defined, the technical or scientific terms used in this application shall have the general meaning understood by one of ordinary skill in the art to which this application pertains. Words such as “a,” “an,” “an,” “the,” “the,” and “these” used in this application do not indicate quantitative limitation and may be singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or modules (units) is not limited to the listed steps or modules (units) but may include steps or modules (units) not listed, or may include other steps or modules (units) inherent to these processes, methods, products, or devices. Words such as “connected,” “linked,” and “coupled” used in this application are not limited to physical or mechanical connections but may include electrical connections, whether direct or indirect. “Multiple” used in this application refers to two or more. “And / or” describes the relationship between related objects, indicating that three relationships may exist; for example, “A and / or B” can represent: A alone, A and B simultaneously, and B alone. Normally, the character " / " indicates that the objects before and after it are in an "or" relationship. The terms "first," "second," "third," etc., used in this application are merely to distinguish similar objects and do not represent a specific order of objects.

[0021] The method embodiments provided in this example can be executed on a terminal, computer, or similar computing device. For example, it can run on a terminal. Figure 1 This is a hardware structure block diagram of a terminal for a task allocation method in a computing power sharing scenario provided in an embodiment of this application. For example... Figure 1 As shown, a terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 and a memory 104 for storing data are also included. The processor 102 may be, but is not limited to, a microprocessor (MCU) or a programmable logic device (FPGA). The terminal may also include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that… Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the terminal described above. For example, the terminal may also include components that are larger than... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown are illustrated.

[0022] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to a task allocation method in a computing power sharing scenario in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0023] The transmission device 106 is used to receive or send data via a network. This network includes a wireless network provided by the terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 can be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0024] This embodiment provides a task allocation method in a computing power sharing scenario. Figure 2 This is a flowchart of a task allocation method in a computing power sharing scenario provided in an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps: S210 generates an allocation scheme based on the number of tasks to be allocated in the task pool and the number of servers in the server cluster.

[0025] S220, determine the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated.

[0026] Specifically, the execution order of the target tasks can be sorted according to the size of the task volume. For example, tasks with smaller volumes are executed first. For instance, given tasks a, b, and c, where task a has a volume of 2, task b has a volume of 1, and task c has a volume of 3, the execution order of the target tasks could be task b, task a, and task c. Alternatively, the tasks in the task pool can also be sorted according to their computational load. Since the computing power of each server is fixed, on the same server, the number of tasks and the execution time are directly proportional.

[0027] S230, sort the tasks to be assigned according to the execution order of the target tasks and determine the first allocation scheme from the allocation schemes; the first allocation scheme is the allocation scheme that is executed according to the execution order of the target tasks.

[0028] Specifically, the tasks to be assigned are sorted according to the execution order of the target tasks. For example, if the target task execution order is sorted by the number of tasks, then the tasks to be assigned are sorted by the number of tasks. For example, if there are m tasks to be assigned and n servers, there are a total of... There are m! possible execution orders for each allocation scheme. The first allocation scheme is the one that sorts the tasks according to their size among the m! possible orders. In other words, the optimal execution order is selected as the first allocation scheme from the m! possible orders.

[0029] S240, construct a complete service time model for the first allocation scheme based on the target time of the task to be allocated.

[0030] S250 optimizes the complete service time model according to the preset algorithm to obtain the second allocation scheme.

[0031] Specifically, the optimization decision is made only on the mapping relationship between the sorted tasks and the servers, without combining and searching the execution order of tasks within the servers, to obtain the optimal allocation scheme in the first allocation scheme, i.e., the second allocation scheme. The optimization objective here can be to minimize the complete service time.

[0032] S260, according to the second allocation scheme, the task is allocated.

[0033] Through the above steps, the target task execution order of the allocation scheme is determined based on the task volume of the tasks to be assigned; based on the target task execution order, a first allocation scheme is determined from the allocation schemes; the first allocation scheme is an allocation scheme that executes according to the target task execution order; based on the target time of the tasks to be assigned, a complete service time model of the first allocation scheme is constructed; based on a preset algorithm, the complete service time model is optimized to obtain a second allocation scheme; and tasks are allocated according to the second allocation scheme. This application first sorts the tasks to obtain the first allocation scheme with the optimal execution order, and only optimizes the mapping relationship between the sorted tasks and the server, without performing a combined search of the task execution order within the server, thereby reducing algorithm execution time, improving task allocation efficiency, and ultimately improving operational efficiency.

[0034] In some embodiments, the target task execution order of the allocation scheme is determined based on the workload of the tasks to be allocated, including: The execution order of the target tasks in the allocation scheme is determined based on the size of the tasks to be assigned.

[0035] In some of these embodiments, the target time includes platform waiting time, server waiting time, and task execution time.

[0036] In some embodiments, task allocation is performed according to a second allocation scheme, including: The second allocation scheme is encoded into a list according to the execution order of the target tasks. The first part of the list is the identifier of the server executing the task, and the second part of the list is the identifier of the task to be executed. Based on the list, perform task assignment.

[0037] In some embodiments, constructing a complete service time model based on the target time of the tasks to be assigned includes: organizing the tasks to be assigned within the task pool into a set... It means that, among them, Let be the number of tasks to be assigned, m be the number of tasks to be assigned, i be a positive integer, and m be an integer greater than 1. The complete service time model is constructed as follows: ;in, W ( X (This refers to the full service time.) X For the allocation scheme, For the task The platform's waiting time For the task The waiting time at the server. For the task The execution time of the task.

[0038] In some of these embodiments, the preset algorithm is the Grey Wolf Optimization Algorithm.

[0039] In some embodiments, the method further includes: temporarily storing real-time computing tasks in a task pool, and then uniformly scheduling and allocating multiple tasks in the task pool when at least one server is detected to be idle or when a preset scheduling trigger condition is met.

[0040] The present embodiment will be described and explained below through specific examples.

[0041] The task allocation model diagram related to the scenario is as follows: Figure 3 As shown, after a task arrives, it enters the task pool. After a waiting period, until a server in the server cluster becomes idle, tasks within the task pool are then batch-allocated. This scenario addresses the need for efficient allocation of continuously arriving tasks. Figure 3The architecture represents the continuous arrival of tasks. Suppose task 1 arrives on the client side, and all servers in the server cluster are working (i.e., not idle). Task 1 is then temporarily stored in the task pool. Other arriving tasks are processed in the same way until one of the servers in the cluster becomes idle (this is the point at which scheduling is triggered). At this point, tasks 1, 2, ..., m are taken from the task pool and an allocation algorithm is called to assign them. The final result of the allocation algorithm is that these tasks are assigned to specific servers and executed in a certain order. For example, if there are three tasks 1, 2, and 3, the allocation result might be that tasks 1 and 2 are assigned to server 1, and task 3 is assigned to server 2. On server 1, task 2 is executed first, followed by task 1.

[0042] Figure 3 The specific modules include a three-tier task allocation system consisting of users, an allocation platform, and a server cluster. Users, as task submitters, immediately send newly generated computational tasks to the allocation platform. The allocation platform comprises three interconnected modules: a task pool, a scheduler, and a monitor. The task pool temporarily stores arriving platform tasks until they can be scheduled. The scheduler is responsible for invoking the task allocation algorithm, processing the tasks in the task pool, and pushing the generated allocation results to the corresponding server queues. The monitor continuously tracks the running status of each server and the system clock to ensure real-time synchronization of the server cluster in time and status. Based on the optimization goal of reducing the average complete service time of arriving tasks (from task arrival to completion), a mathematical model can be constructed using a physical model. The total service time consists of three parts: platform-side waiting time, server-side waiting time, and task execution time. The server-side waiting time is further divided into waiting time caused by tasks left over from before this allocation round and waiting time caused by tasks scheduled before this task in this allocation round. By distinguishing these times, a complete mathematical model can be constructed, namely the complete service time model in the aforementioned embodiment.

[0043] After clarifying the mathematical model and optimization objective, an innovative allocation algorithm is designed to solve the mathematical model within the system. The optimization objective is to minimize the average complete service time of tasks within the task pool. This algorithm mainly consists of two parts: sorting and the Grey Wolf optimization algorithm.

[0044] Sorting: Mathematical derivation shows that the optimal execution order after tasks are assigned to the server is from smallest to largest. Adding a sorting operation beforehand to the algorithm simplifies the search space. The original search space was as follows: Figure 4 As shown, there are m tasks to be assigned, n servers, and a total of One allocation scheme, namely Figure 4allocation 1 to allocation The execution order of each allocation scheme can be ordered in multiple ways, namely... Figure 4 order 1 to order Where bestorder is the optimal sort. After mathematical derivation, the search space is simplified to become as follows: Figure 5 The search space is shown. These represent the number of tasks on servers 1, 2, and n, respectively. The servers have... When there is a task, there will be Execution order.

[0045] For example, consider tasks a, b, and c, and servers 1 and 2. Task a has a workload of 2, task b has a workload of 1, and task c has a workload of 3. The complete search space should include how tasks a, b, and c are allocated to these two servers: are they both allocated to server 1, or are there other possibilities? Under each possibility, there are multiple possible execution orderings. For example, if they are both allocated to server 1, should they be executed in the order of tasks a, b, and c, or in the order of tasks ac, b, or some other order? Mathematical derivation shows that executing in ascending order of workload is optimal. This means that if they are all allocated to server 1, executing in the order of tasks b, b, and c is optimal. Therefore, regardless of the allocation scheme, the execution order can be fixed, simplifying the search space for the execution order; we only need to search for the allocation scheme.

[0046] The mathematical derivation is as follows: Lemma 1: When a batch of tasks is assigned to a server, executing them in ascending order minimizes the average complete service time. Proof: Suppose there are n tasks assigned to the same server, and the execution time of these tasks is... Average complete service time of the task , The sum of the total service time for all tasks , These represent the sum of waiting times for all tasks on the platform, the sum of pre-processing waiting times for all tasks, the sum of sorting waiting times for all tasks, and the sum of execution times for all tasks, respectively.

[0047] After breaking down the complete service time, it can be seen that only the sum of the task sorting wait times is related to the task execution order. , This represents the sorting wait time for task i.

[0048] Will Sort by size from smallest to largest, and get Furthermore, the execution order is from smallest to largest, resulting in the final... , By setting Tasks a and b are located at positions x and y respectively in the execution order, where y > x. If we swap the execution order of a and b (i.e., execute b first and then a), the sum of the sorting wait times for all tasks will be [not specified]. , because ,so Proof: Executing tasks from smallest to largest can improve the efficiency of the task. Minimum.

[0049] The Grey Wolf Optimization Algorithm is employed, with the established mathematical model set as the objective function. An optimization space search is performed to find the optimal allocation scheme. The relationship between sorting and the Grey Wolf Optimization Algorithm is that task sorting is performed first, followed by the Grey Wolf Optimization Algorithm. Mathematical derivation shows that the optimal order for task execution is from smallest to largest; therefore, sorting is performed first to narrow the search space, and then the Grey Wolf Optimization Algorithm is used for the final search.

[0050] Mathematical model: The tasks in the task pool are divided into sets. express, It has two parameters, namely the computational load of the task. And the time when the task arrives at the system. The server cluster in the system consists of a set express, It has two parameters: the server's own computing power and the set. This indicates, and the server's next idle time, determined by the set. express.

[0051] For a task In general, the service completion time consists of three parts: the waiting time on the platform, etc. Waiting time at the server and the execution time of the task .

[0052] This allows us to define the formula for the average complete service time of these tasks in a single allocation (assignment of tasks within the pool): , in, W ( X (This refers to the full service time.) XThis is the allocation scheme.

[0053] For the task Waiting time at the platform It can be calculated using the following formula , in, This represents the time point in this allocation. It represents the task. The arrival time corresponds to the above. .

[0054] For the task Waiting time at the server The following formula can be used to calculate , in, This refers to the waiting time the server spends processing the remaining tasks before this allocation, also known as the pre-emptive waiting time. This indicates that the server is processing the queued tasks assigned in this instance. The waiting time caused by previous tasks is called sorting wait time.

[0055] The Grey Wolf Optimizer (GWO) is a swarm intelligence optimization algorithm based on the hunting behavior of grey wolf packs in nature. This algorithm simulates the social hierarchy and hunting strategies of grey wolf packs, solving optimization problems by mimicking their search, encirclement, and attack behaviors. In this system, each individual wolf corresponds to an independent allocation scheme. The Grey Wolf Optimizer sorts the fitness of all grey wolves and selects three types of wolves based on their fitness values. Wolf (the best wolf). Wolf (second best wolf), and Wolves (third best wolf). These three types of wolves will act as leaders to guide the remaining wolves. The behavior of wolves represents the optimal solution to an optimization problem, and the prey represents the optimal solution. The following is the process of the gray wolf optimization algorithm, which mainly includes four steps: Initialization: Randomly generate a set of quantities. In the initial population, the position of each gray wolf represents a solution. The gray wolves in the initial population are sorted according to their fitness, and three types of wolves are selected based on their fitness values: Wolf, wolves and Wolf.

[0056] Encircling the prey: In the hunting process, the core idea of ​​this stage is to gradually reduce the distance between the wolf pack and the prey (i.e., the optimal solution to the optimization problem) through cooperation. This is calculated using the following formula. , , Where t represents the current iteration number. and This represents the coefficient vector. This represents the position of the current optimal value, while the position of the solution is represented by... Represented as follows. Wherein, the coefficient vector... and The calculation formula is from , , in, During the iteration process, the number of iterations decreases from 2 to 0 first, while... and It is a random vector.

[0057] Hunting prey: for the produced Wolf, wolves and The three better solutions (wolf, wolf, and three others) have the best understanding of the potential location of the optimal solution. Each solution is repositioned based on the location of the optimal solution, and the locations of other solutions are updated using these three solutions. A new solution is then evaluated using subsequent equations. The mathematical formula for position update is as follows: , , , , , , , It is the distance vector between the prey and the gray wolf, representing the distance between the current solution and the optimal solution. Depend on Independently and randomly generated, each used to generate based on Wolf, wolves and The wolf's location has been updated.

[0058] The original Grey Wolf optimization algorithm was designed to solve continuous optimization problems, meaning the solution space of the optimization problem is continuous. However, task scheduling is a discrete combinatorial optimization problem, which is different from the continuous optimization space. Furthermore, in our mathematical model, the optimization variable is represented as a three-dimensional scalar, where the optimization variable is the allocation scheme in the aforementioned embodiments. X Furthermore, the majority of elements are 0, while a small portion are 1, exhibiting sparsity and reducing computational and storage efficiency. To address these issues, we encode the optimization variable as a list of integers, using the first and second halves of the list to represent different information, which improves the efficiency of the algorithm's execution.

[0059] like Figure 6 As shown, a complete solution is represented by a list `solution`. The solution is divided into two parts of equal length. The first part is named the `allocation` list, where the `index` represents the task number and the `value` represents the server to which the task is assigned. The second part is named the `order` list, with values ​​ranging from [1, m] and without repetition. The `index` represents the task number and the `value` represents the overall execution order (assignment order) of the tasks. Tasks 1 to Task 5 represent the tasks.

[0060] This invention employs a task pool + batch allocation mechanism, differing from existing technologies that immediately allocate tasks to server queues upon arrival. It introduces a task pool mechanism on the scheduling platform side, temporarily storing real-time arriving computational tasks in the task pool. When at least one server is detected to be idle or a preset scheduling trigger condition is met, multiple tasks in the task pool are then uniformly scheduled and allocated. This mechanism allows for more complete task information during scheduling, significantly expanding the matching space between tasks and servers and avoiding the local optimum problem caused by insufficient decision-making information in real-time scheduling. A two-stage scheduling framework is constructed, separating task sorting and task allocation. Without increasing server computing power, it effectively reduces the average service time and average waiting time of tasks, improving the overall utilization efficiency of computing resources.

[0061] This invention divides the task scheduling process into two independent stages: the task sorting stage and the task allocation stage. During the task sorting phase, the tasks in the task pool are sorted according to their computational load, and the sorting is verified through mathematical reasoning to be the optimal sorting. During the task allocation phase, only the mapping relationship between the sorted tasks and the server is optimized, and the combined search of the task execution order within the server is no longer performed.

[0062] This design breaks away from the traditional scheduling model's approach of simultaneously searching for "task-server-execution order" and restructures the problem structure from the scheduling process level.

[0063] While ensuring optimal or near-optimal scheduling performance, the combinatorial complexity of the scheduling problem is significantly reduced, making complex scheduling problems engineering feasible.

[0064] This invention employs an encoding method adapted to heuristic algorithms for task scheduling problems. Addressing the difficulty of heuristic optimization algorithms directly handling discrete scheduling variables, this invention designs an encoding method for task scheduling solutions, representing the scheduling scheme as a solution vector containing the mapping relationship between tasks and servers. This allows discrete task scheduling problems to be efficiently searched by swarm intelligence optimization algorithms. It avoids the storage and computational overhead caused by high-dimensional sparse variable representations, improving the actual operating efficiency of scheduling algorithms in dynamic computing power sharing scenarios.

[0065] It should be noted that the steps shown in the above process or in the flowchart of the accompanying figures can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0066] This embodiment also provides a task allocation device for a computing power sharing scenario. This device is used to implement the above embodiments and preferred embodiments, and will not be repeated for details already described. The terms "module," "unit," "subunit," etc., used below can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0067] Figure 7 This is a structural block diagram of a task allocation device in a computing power sharing scenario according to an embodiment of this application, such as... Figure 7 As shown, the device includes: The generation module 710 is used to generate an allocation scheme based on the number of tasks to be allocated in the task pool and the number of servers in the server cluster. The first determining module 720 is used to determine the target task execution order of the allocation scheme based on the task quantity of the tasks to be allocated. The second determining module 730 is used to sort the tasks to be assigned according to the execution order of the target tasks and determine a first allocation scheme from the allocation schemes; the first allocation scheme is an allocation scheme executed according to the execution order of the target tasks. The construction module 740 is used to construct a complete service time model of the first allocation scheme based on the target time of the task to be allocated; The optimization module 750 is used to optimize the complete service time model according to a preset algorithm to obtain a second allocation scheme; The allocation module 760 is used to allocate tasks according to the second allocation scheme.

[0068] It should be noted that the above modules can be functional modules or program modules, and can be implemented through software or hardware. For modules implemented through hardware, the above modules can reside in the same processor; or the above modules can be located in different processors in any combination.

[0069] This embodiment also provides an electronic device including a memory and a processor, the memory storing a computer program and the processor being configured to run the computer program to perform the steps in any of the above method embodiments.

[0070] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0071] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program: S1, Generate an allocation scheme based on the number of tasks to be allocated in the task pool and the number of servers in the server cluster; S2, determine the target task execution order of the allocation scheme based on the amount of tasks to be assigned; S3, according to the execution order of the target tasks, sort the tasks to be assigned and determine a first assignment scheme from the assignment schemes; the first assignment scheme is an assignment scheme that is executed according to the execution order of the target tasks; S4. Based on the target time of the task to be assigned, construct a complete service time model for the first allocation scheme; S5. Optimize the complete service time model according to a preset algorithm to obtain a second allocation scheme; S6. Tasks are assigned according to the second allocation scheme.

[0072] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated in this embodiment.

[0073] Furthermore, in conjunction with the task allocation method for a computing power sharing scenario provided in the above embodiments, this embodiment can also provide a storage medium for implementation. The storage medium stores a computer program; when executed by a processor, the computer program implements any of the task allocation methods for a computing power sharing scenario in the above embodiments.

[0074] It should be understood that the specific embodiments described herein are merely illustrative of the application and not intended to limit it. All other embodiments derived by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0075] Obviously, the accompanying drawings are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar situations based on these drawings without any creative effort. Furthermore, it is understood that although the work done in this development process may be complex and lengthy, for those skilled in the art, certain design, manufacturing, or production modifications made based on the technical content disclosed in this application are merely conventional technical means and should not be considered as insufficient disclosure of this application.

[0076] The term "embodiment" in this application refers to a specific feature, structure, or characteristic described in connection with an embodiment that may be included in at least one embodiment of this application. The appearance of this phrase in various places in the specification does not necessarily imply the same embodiment, nor does it imply independence or alternativeity from other embodiments. It will be clearly or implicitly understood by those skilled in the art that the embodiments described in this application can be combined with other embodiments without conflict. The embodiments described above merely illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of patent protection. It should be noted that those skilled in the art can make several modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A task allocation method in a computing power sharing scenario, characterized in that, The method includes: A distribution scheme is generated based on the number of tasks to be assigned in the task pool and the number of servers in the server cluster. The target task execution order of the allocation scheme is determined based on the amount of tasks to be assigned. Based on the execution order of the target tasks, the tasks to be assigned are sorted and a first assignment scheme is determined from the assignment schemes; the first assignment scheme is an assignment scheme that is executed according to the execution order of the target tasks. Based on the target time of the task to be assigned, construct a complete service time model for the first allocation scheme; Based on a preset algorithm, the complete service time model is optimized to obtain a second allocation scheme; Tasks are assigned according to the second allocation scheme.

2. The task allocation method in a computing power sharing scenario according to claim 1, characterized in that, The step of determining the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated includes: The target task execution order of the allocation scheme is determined based on the size of the tasks to be allocated.

3. The task allocation method in a computing power sharing scenario according to claim 1, characterized in that, The target time includes platform waiting time, server waiting time, and task execution time.

4. The task allocation method in a computing power sharing scenario according to claim 1, characterized in that, The step of allocating tasks according to the second allocation scheme includes: The second allocation scheme is encoded according to the target task execution order to generate a list, the first part of the list is the identifier of the server executing the task, and the second part of the list is the identifier of the task to be executed; Based on the list, perform task assignment.

5. The task allocation method in a computing power sharing scenario according to claim 3, characterized in that, The step of constructing a complete service time model based on the target time of the tasks to be assigned includes: dividing the tasks to be assigned in the task pool into sets... It means that, among them, Let be the number of tasks to be assigned, m be the number of tasks to be assigned, i be a positive integer, and m be an integer greater than 1. The complete service time model is constructed as follows: ;in, For full service time, X For the allocation scheme, For the task The platform's waiting time For the task The waiting time at the server. For the task The execution time of the task.

6. The task allocation method in a computing power sharing scenario according to claim 1, characterized in that, The preset algorithm is the Grey Wolf Optimization Algorithm.

7. The task allocation method in a computing power sharing scenario according to claim 1, characterized in that, The method further includes: temporarily storing real-time computing tasks in a task pool, and then uniformly scheduling and allocating multiple tasks in the task pool when at least one server is detected to be idle or when a preset scheduling trigger condition is met.

8. A task allocation device for a computing power sharing scenario, characterized in that, The device includes: The generation module is used to generate an allocation scheme based on the number of tasks to be allocated in the task pool and the number of servers in the server cluster. The first determining module is used to determine the target task execution order of the allocation scheme based on the task volume of the tasks to be allocated; The second determining module is used to sort the tasks to be assigned according to the execution order of the target tasks and determine a first allocation scheme from the allocation schemes; the first allocation scheme is an allocation scheme that is executed according to the execution order of the target tasks. A construction module is used to construct a complete service time model of the first allocation scheme based on the target time of the task to be allocated; The optimization module is used to optimize the complete service time model according to a preset algorithm to obtain a second allocation scheme; The allocation module is used to allocate tasks according to the second allocation scheme.

9. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to run the computer program to perform the task allocation method in the computing power sharing scenario according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the task allocation method in the computing power sharing scenario as described in any one of claims 1 to 7.