Multi-machine multi-task configuration method and device, medium and equipment
By building a quadratic unconstrained binary optimization model and using quantum computer solutions, the solution difficulty of large-scale multi-computer task configuration problems is solved, and the optimization effect of the shortest task completion time or load balancing is achieved.
Patent Information
- Application Number
- CN202311217722.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2025-03-21
AI Technical Summary
The existing technology is difficult to effectively solve the problem of large-scale multi-machine task configuration, and the calculation complexity has increased exponentially, resulting in a sharp increase in solution difficulty. It is difficult for existing solutions to complete the solution in a short time.
By setting configuration binary variables, building optimization models based on preset configuration goals, and converting them into quadratic unconstrained binary optimization models, and using quantum computers to accelerate the solution to solve the multi-machine multi-task configuration problem.
It improves the efficiency of solving large-scale multi-machine multi-task configuration problems, and can determine the task configuration plan in a shorter time, so that the overall task completion time is shorter or the load of each machine is most balanced.
Smart Images

Figure CN119668825A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of task management optimization, and in particular relates to a multi-machine multi-task configuration method, device, medium and equipment. Background Art
[0002] There are a series of tasks in production that require a certain amount of processing time. There are multiple machines that can perform task processing. The optimization goal is to reasonably allocate each task to each machine so that the overall task completion time is the shortest, or the load of each machine is the most balanced (the completion time is as close as possible). This problem has a wide range of application scenarios, including production line scheduling, cloud computing task allocation, etc.
[0003] Current computing technology is based on optimization algorithms of traditional computers, such as exact solution algorithms based on integer programming and mixed integer programming mathematical models (such as branch and bound algorithms), heuristic algorithms, deep reinforcement learning, etc.
[0004] Existing technologies have difficulties in large-scale task scheduling calculations. As the scale of the problem increases (the number of tasks and machines increases), the computational complexity increases exponentially, and the difficulty of solving the problem increases dramatically. Existing solution technologies are difficult to complete the solution in a short period of time.
[0005] The purpose of the present invention is to provide an optimization method for multi-machine multi-task configuration to solve the problem that large-scale multi-machine task configuration problems cannot be effectively solved in the prior art. Summary of the invention
[0006] In view of the above analysis, the embodiments of the present invention aim to provide a multi-machine multi-task configuration method, apparatus, medium and device to solve the problem in the prior art that large-scale multi-machine task configuration problems cannot be effectively solved.
[0007] A first aspect of the present invention provides a multi-machine multi-task configuration method, comprising the following steps:
[0008] Get the task set and machine set, and get the required processing time corresponding to each task in the task set;
[0009] Constructing a task configuration binary variable to indicate whether any of the tasks is configured to any of the machines;
[0010] Constructing an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable;
[0011] Forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model;
[0012] The quadratic unconstrained binary optimization model is solved to determine the value of each of the task configuration binary variables, and the task configuration scheme is determined according to the value of the task configuration binary variables.
[0013] In some embodiments, obtaining a task set and a machine set, and obtaining a required processing time corresponding to each task in the task set includes:
[0014] Obtain a machine set M, where M = {machine 1, machine 2, ...}, and the total number of machines in the machine set M is represented by |M|;
[0015] Get task set N, N = {task 1, task 2, ...};
[0016] The required processing time for task i is expressed as W i , where task i∈N;
[0017] Get the idle start time of machine j, denoted as S j , where machine j∈M.
[0018] In some embodiments, the task configuration binary variable is represented by x ij , if task i is assigned to machine j, then x ij =1, otherwise x ij =0;
[0019] Before constructing the optimization model, the process includes: representing the task completion time of any machine by using the task configuration binary variable and the required processing time, which is expressed as:
[0020] t j =∑ i∈N W i x ij +S j ;
[0021] Among them, t j represents the task completion time of machine j.
[0022] In some embodiments, an optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraints, including:
[0023] S311 obtains that the preset configuration target is to minimize the completion time of all machine tasks;
[0024] S321 constructs a variable u to represent the completion time of all machine tasks, and the objective function is expressed as:
[0025] S331 The constraint condition includes a first constraint condition and a second constraint condition, the first constraint condition being that the task completion time of all machines is not less than the task completion time of any machine, and the second constraint condition being that any task can only be configured to be executed on one of the machines;
[0026] The first constraint formula of the first constraint condition is expressed as:
[0027]
[0028] The second constraint formula of the second constraint condition is expressed as:
[0029]
[0030] In some embodiments, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model includes:
[0031] S411, performing secondary unconstraintization on the constraint and multiplying the constraint by a penalty coefficient to form a penalty term, wherein the penalty term formed according to the first constraint formula is expressed as:
[0032]
[0033] The penalty term formed according to the second constraint is expressed as:
[0034]
[0035] S421, adding the penalty term to the objective function to form a first optimization model, the first optimization model is expressed as:
[0036]
[0037] Where λ represents the penalty coefficient, γ j Indicates t j The corresponding slack variables;
[0038] S431. Convert the non-binary variables in the first optimization model into a combination of several auxiliary binary variables, so that the first optimization model is converted into the quadratic unconstrained binary optimization model.
[0039] In some embodiments, an optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraints, including:
[0040] S312 obtains the preset configuration target to minimize the variance of task completion time of each machine;
[0041] The objective function in S322 is expressed as:
[0042]
[0043] S332 The constraint condition includes a second constraint condition, wherein the second constraint condition is that any task can only be configured to be executed on one of the machines;
[0044] The second constraint formula of the second constraint condition is expressed as:
[0045]
[0046] In some embodiments, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model includes:
[0047] S412: perform secondary unconstraint on the constraint and multiply the constraint by a penalty coefficient to form a penalty term, wherein the penalty term formed according to the second constraint formula is expressed as:
[0048]
[0049] S422: adding the penalty term to the objective function to form a first optimization model, wherein the first optimization model is expressed as:
[0050]
[0051] Where λ represents the penalty coefficient, Indicates the task completion time evaluation value of each machine.
[0052] In some embodiments, the quadratic unconstrained binary optimization model is solved by a quantum computer.
[0053] A second aspect of the present invention provides a multi-machine multi-task configuration device, comprising the following steps:
[0054] An acquisition module is used to acquire a task set and a machine set, and acquire the required processing time corresponding to each task in the task set;
[0055] A variable construction module, constructing a task configuration binary variable to indicate whether any of the tasks is configured to any machine;
[0056] A model building module, building an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable;
[0057] A penalty generation module, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model;
[0058] A solution module solves the quadratic unconstrained binary optimization model to determine the value of each of the task configuration binary variables, and determines the task configuration scheme according to the value of the task configuration binary variables.
[0059] A third aspect of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the multi-machine multi-task configuration method as described in any of the above embodiments is implemented.
[0060] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the multi-machine multi-task configuration method as described in any of the above embodiments is implemented.
[0061] The embodiments of the present invention have at least the following beneficial effects:
[0062] The embodiment of the present invention constructs the multi-machine multi-task configuration problem into an optimization model according to preset configuration goals by setting appropriate configuration binary variables, and then converts the optimization model into a quadratic unconstrained binary optimization model that can be solved by a quantum computer, thereby solving the large-scale multi-machine multi-task configuration problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the embodiments of this specification or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this specification. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0064] Figure 1 A schematic flow chart of a multi-machine multi-task configuration method provided by an embodiment of the first aspect of the present invention;
[0065] Figure 2 This is a schematic diagram of an example of multi-machine multi-task configuration according to an embodiment of the present invention;
[0066] Figure 3 A schematic diagram of the architecture of a multi-machine multi-task configuration device provided by the present invention;
[0067] Figure 4 This is a schematic diagram of the electronic device architecture provided by the present invention. DETAILED DESCRIPTION
[0068] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. It should be noted that, in the absence of conflict, the embodiments and features in the embodiments disclosed in this disclosure can be combined, separated, interchanged and / or rearranged with each other. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0069] The terms used here are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used here, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "said (the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but it is not excluded that there are or add one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups. It should also be noted that, as used here, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values and / or the values provided that will be recognized by those of ordinary skill in the art.
[0070] The embodiment of the present invention is applied to the optimization of multi-processor task scheduling. For example, there are a series of tasks that require a certain processing time, and there are multiple machines that can perform task processing. The optimization goal is to reasonably allocate each task to each machine so that the overall task completion time is the shortest, or the load of each machine is the most balanced (the completion time is as close as possible). The application scenarios of this problem are relatively wide, including production line scheduling, cloud computing task allocation, etc.
[0071] The first embodiment of the present invention provides a multi-objective multi-task path allocation scheduling cost optimization method, such as Figure 1 As shown, the following steps are included:
[0072] Get the task set and machine set, and get the required processing time corresponding to each task in the task set;
[0073] Constructing a task configuration binary variable to indicate whether any of the tasks is configured to any of the machines;
[0074] Constructing an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable;
[0075] Forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model;
[0076] The quadratic unconstrained binary optimization model is solved to determine the value of each of the task configuration binary variables, and the task configuration scheme is determined according to the value of the task configuration binary variables.
[0077] In order to abstract and simplify the problem, the multi-machine multi-task configuration problem is summarized as follows based on the actual situation:
[0078] 1. The processing time required for each task is a fixed constant and is only related to the task.
[0079] 2. The processing time required for each task is independent of the machine on which it is located, that is, it is assumed that the task processing efficiency of each machine is consistent.
[0080] 3. Each machine can have a different idle start time. The idle start time means that the machine cannot process tasks before the idle start time ends.
[0081] 4. The same task can only be assigned to run on one machine.
[0082] 5. A machine can only process one task at a time.
[0083] 6. After processing a task, the machine immediately executes the next assigned task until all assigned tasks are completed.
[0084] 7. All tasks must be completed and processed.
[0085] 8. The running time required for each task and the idle start time of each machine are integers (for example, integer multiples of the defined time precision). This makes it easier to convert the combinatorial optimization model into QUBO (Quadratic Unconstrained Binary Optimization) form to adapt to dedicated quantum computers.
[0086] In some embodiments, obtaining a task set and a machine set, and obtaining a required processing time corresponding to each task in the task set includes:
[0087] Obtain a machine set M, where M = {machine 1, machine 2, ...}, and the total number of machines in the machine set M is represented by |M|;
[0088] Get task set N, N = {task 1, task 2, ...};
[0089] The required processing time for task i is denoted as W i , where task i∈N.
[0090] Get the idle start time of machine j, denoted as S j , where machine j∈M.
[0091] like Figure 2 As shown, in one embodiment, taking 4 machines processing 10 tasks as an example, the vertical axis is the machine, the horizontal axis is the time, the idle start time of each server is 1, 2, 3 and 4 respectively, and each square with a number behind it represents the duration corresponding to the task assigned to each machine. An allocation scheme that minimizes the overall completion time is shown in the figure. This scheme is also an optimal solution for balancing the load of each machine, that is, the completion time of each machine is as close as possible.
[0092] Combinatorial optimization is a mathematical optimization technique that abstracts the optimization problem into discrete decision variables, objective functions, and constraints. Under the condition of satisfying the constraints, the goal is to solve the optimal value of the objective function, and the corresponding solution is the optimal solution. If the objective function is quadratic, there are no constraints, and the decision variables can only be 0 or 1, then this combinatorial optimization model is called a quadratic unconstrained binary optimization model (QUBO). Problems in the form of QUBO can be solved by special quantum computers such as quantum annealing machines and coherent Ising machines (CIM). This scheme converts the combinatorial optimization model of multi-machine task scheduling optimization problems into a QUBO form suitable for special quantum computing, and solves it by a special quantum computer.
[0093] In some embodiments, the task configuration binary variable is represented by x ij , if task i is assigned to machine j, then x ij =1, otherwise x ij =0;
[0094] Before constructing the optimization model, the following steps are included: based on the above-mentioned problem summary, the task completion time of any machine is represented by the task configuration binary variable and the required processing time, which is expressed as:
[0095] t j =∑ i∈N W i x ij +S j ;
[0096] Among them, t j represents the task completion time of machine j.
[0097] In some embodiments, an optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraints, including:
[0098] S311 obtains that the preset configuration target is to minimize the completion time of all machine tasks;
[0099] S321 constructs a variable u to represent the completion time of all machine tasks, and the objective function is expressed as:
[0100] minu;
[0101] The completion time u of all machine tasks is the maximum value of the completion time of each machine, u = max j∈M t j .
[0102] S331 The constraint condition includes a first constraint condition and a second constraint condition. Therefore, the first constraint condition is that the task completion time of all machines is not less than the task completion time of any machine. Since the objective function is to minimize the latest completion time u, the variable u will take the minimum value that satisfies (1), that is, the completion time corresponding to the latest completed machine. The second constraint condition is that any task can only be configured to be executed on one of the machines.
[0103] The first constraint formula of the first constraint condition is expressed as:
[0104] Right now
[0105] The second constraint formula of the second constraint condition is expressed as:
[0106]
[0107] In some embodiments, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model includes:
[0108] S411, performing quadratic unconstraintization on the constraint and multiplying it by a penalty coefficient to form a penalty term, specifically, the quadratic unconstraintization of an equality constraint (e.g., the second constraint) includes rewriting the constraint equation into the form of f(x)=0, then squaring the left side of the equation and multiplying it by the penalty coefficient to form a penalty term. The quadratic unconstraintization of an inequality constraint (e.g., the first constraint) includes introducing a slack variable into the inequality constraint, converting it into an equality constraint, and then converting it into a penalty term according to the quadratic unconstraintization method of the equality constraint.
[0109] The penalty term formed according to the first constraint is expressed as:
[0110] λ∑ j∈M (u-∑ i∈N W i x ij -Sj -γ j ) 2 ;
[0111] The penalty term formed according to the second constraint is expressed as:
[0112] λ∑ i∈N (∑ j∈M x ij -1) 2 . Where λ represents the penalty coefficient, γ j Indicates t j The corresponding slack variable.
[0113] S421, adding the penalty term to the objective function to form a first optimization model, the first optimization model is expressed as:
[0114] min u,x,γ u+λ∑ j∈M (u-∑ i∈N W i x ij -S j -γ j ) 2 +λ∑ i∈N (∑ j∈M x ij -1) 2 ;
[0115] Where λ represents the penalty coefficient, γ j Indicates t j The corresponding slack variable.
[0116] S431. Convert the non-binary variables in the first optimization model into a combination of several auxiliary binary variables, so that the first optimization model is converted into the quadratic unconstrained binary optimization model.
[0117] In order to adapt to quantum computing, the above combinatorial optimization model needs to be converted into QUBO form. The characteristics of QUBO are that all decision variables are binary variables, the target is a quadratic function, and there are no constraints. The non-binary variables include u and γ, which can be represented by binary based on multiple binary variables: u = ∑ l∈L 2 l u l ,γ=∑ l∈L 2 l γ jl , where u l is an auxiliary binary variable of u, γ jl For γ j is an auxiliary binary variable, which takes the value 0 or 1. L is the required set of binary digits, which depends on the value of the data. In this way, solving the minimum value of u is transformed into solving u l The value of .
[0118] The final QUBO model is expressed as:
[0119] min u,x,γ ∑ l∈L 2 l u l +λ∑ j∈M (∑ l∈L 2 l u l -∑ i∈N W i x ij -S j -∑ l∈L 2 1 γ jl ) 2 +λ∑ i∈N (∑ j∈M x ij -1) 2 .
[0120] By solving the QUBO model with a quantum computer, we can obtain the solution of the binary variables of task configuration that minimizes the completion time of all machine tasks, and determine the task configuration plan through the solution.
[0121] In some embodiments, an optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraints, including:
[0122] S312 obtains the preset configuration goal of minimizing the variance of the task completion time of each machine. In other words, the goal is to balance the load of each machine.
[0123] S322 takes minimizing the variance of the task completion time of each machine as the optimization goal, and the objective function is expressed as:
[0124] The average task completion time of each machine has nothing to do with the allocation scheme, and is calculated by the constant It is indicated that the deduction is as follows:
[0125] The average task completion time
[0126] S332 The constraint condition includes a second constraint condition, wherein the second constraint condition is that any task can only be configured to be executed on one of the machines;
[0127] The second constraint formula of the second constraint condition is expressed as:
[0128]
[0129] In some embodiments, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model includes:
[0130] S412: perform secondary unconstraint on the constraint and multiply the constraint by a penalty coefficient to form a penalty term, wherein the penalty term formed according to the second constraint formula is expressed as:
[0131] λ∑ i∈N (∑ j∈M x ij -1) 2 ;
[0132] S422: adding the penalty term to the objective function to form a first optimization model, wherein the first optimization model is expressed as:
[0133]
[0134] Where λ represents the penalty coefficient, represents the task completion time evaluation value of each machine. At this time, the variable in the QUBO model is only the binary variable x ij , which can be solved by a quantum computer.
[0135] In some embodiments, the quadratic unconstrained binary optimization model is solved by a quantum computer.
[0136] Preferably, the QUBO model of the embodiment of the present invention is applicable to special quantum computers such as quantum annealing machines and coherent Ising machines. The implementation of the physical machine is solved by taking the CIM based on the degenerate optical parametric oscillator (DOPO) as an example, which is a hybrid quantum computing system consisting of an optical part and an electrical part. The optical part includes a laser, an amplifier, a periodically polarized lithium niobate crystal (PPLN) and an optical fiber loop. The laser uses a femtosecond pulse fiber laser and is equipped with an amplifier system. The amplified laser is first subjected to a frequency doubling process using a PPLN crystal. The frequency-doubled laser is used as a pump source to synchronously pump a PPLN crystal in an optical fiber loop to form a degenerate optical parametric oscillation, and hundreds of oscillation pulses can exist simultaneously in the optical fiber loop. The electrical part includes an FPGA (Field Programmable Gate Array), AD / DA (digital analog / analog digital conversion), and a phase detection part. The laser output from the optical fiber loop and the base frequency laser are measured by a phase detector, and the phase of the output light can be tested. FPGA is used with high-speed AD / DA to measure and feedback control the optical pulse.
[0137] Unlike classical computers that run on semiconductor integrated circuits, CIM uses laser pulses in optical fibers as quantum bits for calculations. In DOPO, pump light is incident on a nonlinear optical crystal and split into two beams of light. The two beams have the same polarization direction and half the frequency of the pump light. They are in a compressed state and can be used as a quantum bit. By gradually increasing the power of the pump light and exceeding the oscillation threshold, the generated light becomes a coherent state, and the phase of the light is divided into two states (phase 0 state and π state). At this time, the phase can be set to ±1 of the spin to solve the optimization problem.
[0138] The model can also be solved by the quantum approximate optimization algorithm (QAOA). QAOA is a hybrid algorithm of classical and quantum that can solve combinatorial optimization problems on gate-based quantum computers. Based on the QUBO form, it can be converted into the Ising model and the corresponding maximum cut problem. The objective function can be expressed as maximizing Define two rotation unitary matrices U(C,γ)=e -iγC and U(B,β)=e -iβB After repeating the operation p times, the following new state can be obtained:
[0139] |ψ(γ,β)〉=|γ,β〉=U(B,β p )U(C,γ p )…U(B, β2)U(C, γ2)U(B, β1)U(C, γ1)|ψ〉. The approximate solution is obtained by the following steps:
[0140] 1. Build a QAOA quantum circuit, which contains trainable parameters;
[0141] 2. Initialize the parameters in the circuit. Initialize the quantum state in the quantum computer;
[0142] 3. Run the quantum circuit to obtain the quantum state;
[0143] 4. Use quantum states to calculate the expected value of the target function and the Hamiltonian in a classical computer;
[0144] 5. Repeat steps 2-4 several times, that is, measure the same set of parameters γ and β multiple times to obtain the distribution of quantum states;
[0145] 6. Use grid search to optimize the parameters in the circuit. Repeat the results of steps 2-5 for a new set of parameters γ, β. After obtaining the distribution of quantum states, select the one with the largest target value;
[0146] 7. Based on the results of step 4, calculate the approximate solution to the target problem.
[0147] The present invention solves the problem of computational efficiency of traditional computer optimization algorithms in multi-machine task scheduling optimization by designing a solution model suitable for quantum computers. It can improve the efficiency of solving larger-scale problems, so that the machine can complete all tasks in the shortest time and make the load of each machine as balanced as possible.
[0148] A second aspect of the present invention provides a multi-machine multi-task configuration device, such as Figure 3 As shown, the following steps are included:
[0149] An acquisition module is used to acquire a task set and a machine set, and acquire the required processing time corresponding to each task in the task set;
[0150] A variable construction module, constructing a task configuration binary variable to indicate whether any of the tasks is configured to any machine;
[0151] A model building module, building an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable;
[0152] A penalty generation module, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model;
[0153] A solution module solves the quadratic unconstrained binary optimization model to determine the value of each of the task configuration binary variables, and determines the task configuration scheme according to the value of the task configuration binary variables.
[0154] A third aspect of the present invention provides an electronic device, such as Figure 4 As shown, it includes a memory and a processor, the memory stores a computer program, and when the computer program is executed by the processor, the multi-machine multi-task configuration method as described in any of the above embodiments is implemented.
[0155] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the multi-machine multi-task configuration method as described in any of the above embodiments is implemented.
[0156] Computer readable storage media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0157] The professionals should further realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0158] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
[0159] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A multi-machine multi-task configuration method, characterized in that: The following steps are involved: Get the task set and machine set, and get the required processing time corresponding to each task in the task set; Constructing a task configuration binary variable to indicate whether any of the tasks is configured to any of the machines; Constructing an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable; Forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model; The quadratic unconstrained binary optimization model is solved to determine the value of each of the task configuration binary variables, and the task configuration scheme is determined according to the value of the task configuration binary variables.
2. The multi-machine multi-task configuration method according to claim 1, characterized in that: Get the task set and machine set, and get the required processing time corresponding to each task in the task set, including: Obtain a machine set M, where M = {machine 1, machine 2, ...}, and the total number of machines in the machine set M is represented by |M|; Get task set N, N = {task 1, task 2, ...}; The required processing time for task i is denoted as W i , where task i∈N; Get the idle start time of machine j, denoted as S j , where machine j∈M.
3. The multi-machine multi-task configuration method according to claim 2, characterized in that: The task configuration binary variable is represented as x ij , if task i is assigned to machine j, then x ij =1, otherwise x ij =0; Before constructing the optimization model, the process includes: representing the task completion time of any machine by using the task configuration binary variable and the required processing time, which is expressed as: t j =∑ i∈N W i x ij +S j ; Among them, t j represents the task completion time of machine j.
4. The multi-machine multi-task configuration method according to claim 3, characterized in that: An optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraint conditions, including: S311 obtains that the preset configuration target is to minimize the completion time of all machine tasks; S321 constructs a variable u to represent the completion time of all machine tasks, and the objective function is expressed as: min u; S331 The constraint condition includes a first constraint condition and a second constraint condition, the first constraint condition being that the task completion time of all machines is not less than the task completion time of any machine, and the second constraint condition being that any task can only be configured to be executed on one of the machines; The first constraint formula of the first constraint condition is expressed as: The second constraint formula of the second constraint condition is expressed as:
5. The multi-machine multi-task configuration method according to claim 4, characterized in that: Forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model, comprising: S411, performing secondary unconstraintization on the constraint and multiplying the constraint by a penalty coefficient to form a penalty term, wherein the penalty term formed according to the first constraint formula is expressed as: λ∑ j∈M (u-∑ i∈N W i x ij -S j -γ j ) 2 ; The penalty term formed according to the second constraint is expressed as: λ∑ i∈N (∑ j∈M x ij -1) 2 ; S421, adding the penalty term to the objective function to form a first optimization model, the first optimization model is expressed as: Minutes u,x,γ u+λ∑ j∈M (u-∑ i∈N IN i x ij -S j -γ j ) 2 +λ∑ i∈N (∑ j∈M x ij -1) 2 ; Where λ represents the penalty coefficient, γ j Indicates t j The corresponding slack variables; S431. Convert the non-binary variables in the first optimization model into a combination of several auxiliary binary variables, so that the first optimization model is converted into the quadratic unconstrained binary optimization model.
6. The multi-machine multi-task configuration method according to claim 3, characterized in that: An optimization model is constructed according to a preset configuration target, wherein the optimization model includes an objective function and constraint conditions, including: S312 obtains the preset configuration target to minimize the variance of task completion time of each machine; The objective function in S322 is expressed as: S332 The constraint condition includes a second constraint condition, wherein the second constraint condition is that any task can only be configured to be executed on one of the machines; The second constraint formula of the second constraint condition is expressed as:
7. The multi-machine multi-task configuration method according to claim 6, characterized in that: Forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model, comprising: S412: perform secondary unconstraint on the constraint and multiply the constraint by a penalty coefficient to form a penalty term, wherein the penalty term formed according to the second constraint formula is expressed as: λ∑ i∈N (∑ j∈M x ij -1) 2 ; S422: adding the penalty term to the objective function to form a first optimization model, wherein the first optimization model is expressed as: Where λ represents the penalty coefficient, Indicates the task completion time evaluation value of each machine.
8. A multi-machine multi-task configuration device, characterized in that: include: An acquisition module is used to acquire a task set and a machine set, and acquire the required processing time corresponding to each task in the task set; A variable construction module, constructing a task configuration binary variable to indicate whether any of the tasks is configured to any machine; A model building module, building an optimization model according to a preset configuration target, wherein the optimization model includes an objective function and a constraint condition, wherein the constraint condition is expressed as a constraint formula by the required processing time and the task configuration binary variable; A penalty generation module, forming a penalty term according to the constraint formula, and adding the penalty term to the objective function to form a quadratic unconstrained binary optimization model; A solution module solves the quadratic unconstrained binary optimization model to determine the value of each of the task configuration binary variables, and determines the task configuration scheme according to the value of the task configuration binary variables.
9. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the multi-machine multi-task configuration method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the multi-machine multi-task configuration method as described in any one of claims 1-7 is implemented.
Citation Information
Cited By
Novel power distribution network large branch identification method and device based on whale swarm optimization algorithm
CN120546007A