A task-solving method and apparatus

By selecting highly important constraints in a linear programming task for solution and using the results as initial values ​​to construct a sub-model, the problem of excessively long solution time in complex scheduling problems is solved, achieving a faster solution speed.

CN114237835BActive Publication Date: 2025-12-02HUAWEI TECH CO LTD

Patent Information

Application Number
CN202111166727.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-30
Publication Date
2025-12-02
Estimated Expiration
2041-09-30

AI Technical Summary

Technical Problem

As the complexity of scheduling problems increases, the number of planning constraints in linear programming tasks also increases, leading to excessively long solution times.

Method used

By acquiring the importance of the linear programming task, selecting some constraints for solution, and using the results as initial values, a sub-model is constructed. The second linear programming task is then constructed using importance sampling, thus shortening the solution time.

Benefits of technology

It improves the solution speed of linear programming tasks, reduces the number of iterations, and lowers the solution time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114237835B_ABST
    Figure CN114237835B_ABST
Patent Text Reader

Abstract

This application discloses a task-solving method, comprising: obtaining the importance of each first planning constraint among multiple first planning constraints in a first linear programming task, wherein the importance represents the contribution of the first planning constraint to reducing the solution time of the first linear programming task; sampling the multiple first planning constraints according to the importance to obtain a subset of the multiple first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints; constructing a second linear programming task based on the subset of the multiple first planning constraints; using a first solution result as the initial value of the first linear programming task, and solving the initialized first linear programming task. Since the importance represents the contribution of the first planning constraint to reducing the solution time of the first linear programming task, this application can make the solution of the sampled sub-model close to the optimal solution, thereby accelerating the solution process of the first linear programming task.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of scheduling, and more particularly to a task solving method and apparatus thereof. Background Technology

[0002] Scheduling is one of the most common problems in large-scale manufacturing, logistics, and production. Its meaning varies depending on the scenario. For example, logistics scheduling refers to the rational arrangement and dispatch of vehicles and personnel by logistics companies based on the weight, destination, specifications, and urgency of goods to be shipped. Production scheduling involves prioritizing tasks and matching them with machines (scheduling resources) based on the capacity and production needs of different machines on different production lines. Timetabling workers / flight attendants in large manufacturing plants / airports is also a scheduling problem, as its goal is to achieve optimal matching within different time periods based on the work characteristics and scenario requirements of workers / flight attendants. Therefore, the core is sorting and optimal allocation, regardless of whether the task involves people or goods. Generally, the goal of scheduling problems is to obtain the sorting corresponding to the minimum total working hours (makespan) given a number of tasks.

[0003] Many scheduling problems (such as production scheduling, line scheduling, and processing network layout) can be modeled as mathematical problems for solution, with linear programming (LP) being one of the most widely used modeling methods. A linear programming model can include an objective function and constraints. The objective function is a function designed based on the goal to be optimized and the variables affecting that goal. For example, in production scheduling problems, the overall goal is usually to find the best processing plan while satisfying all resource constraints, maximizing the demand fulfillment rate while minimizing overall costs (e.g., costs may include, but are not limited to, processing costs, inventory costs, and transportation costs). In this case, the objective function can represent maximizing the demand fulfillment rate and minimizing costs. Furthermore, constraints refer to other restrictions that must be satisfied during the process of solving the objective function.

[0004] However, as the complexity of the scenario increases, the number of planning constraints in linear programming tasks is usually large, and the solution time required to solve linear programming tasks is very long. Summary of the Invention

[0005] Firstly, this application provides a task-solving method, the method comprising:

[0006] Obtain a first linear programming task, which includes multiple first programming constraints;

[0007] In one possible implementation, the terminal device can transmit the first linear programming task as the model to be solved to the server, so that the server can obtain the first linear programming task. Alternatively, the terminal device can transmit the first linear programming task as prior information used to solve the model, that is, transmit at least one historical model, including the first linear programming task, to the server, so that the server can obtain at least one historical model, including the first linear programming task.

[0008] Typically, when there are many constraints in a linear programming task, the solution time is very long. Therefore, we can first select some constraints in the linear programming task and solve the problem based on these selected constraints. The solution results (the states of the solution variables in the selected constraints) are then assigned to the linear programming task, which is equivalent to using the solution results as the initial values ​​for the linear programming task. If the solution results of the selected constraints are basically consistent with (or very close to) the solution results after solving the linear programming task, the number of iterations required to solve the linear programming task is reduced, thus improving the solution speed of the linear programming task.

[0009] Therefore, before solving the first linear programming task, it is necessary to select a portion of the constraints to solve, and the solution obtained should be close to the solution of the first linear programming task.

[0010] In this embodiment, importance is used as the basis for selecting some constraints from multiple first programming constraints. Importance can indicate the degree of contribution to reducing the solution time of the first linear programming task. Specifically, indicating the degree of contribution to reducing the solution time of the first linear programming task can be understood as follows: when constructing a sub-model of the model to be solved (i.e., selecting a portion of the constraints from the model to be solved to construct the sub-model), when the solution of the sub-model is used as the initial value of the model to be solved, the sub-model includes the degree of contribution of the first linear programming task to reducing the solution time of the model to be solved.

[0011] Specifically, sampling multiple first planning constraints using importance as sampling probability can yield a subtask (second planning task). The planning constraints in this subtask are those that contribute significantly to reducing the solution time of the first linear programming task. Therefore, the solution obtained after solving the second planning task is basically consistent with (or described as very close to) the solution obtained after solving the second planning task. Here, "basically consistent" can be understood as the parameter values ​​of the solution variables in the same constraints being basically consistent.

[0012] In one possible implementation, this importance can be obtained based on prior information, which can be one or more models of the same type as the model to be solved (the first linear programming task). The term "of the same type" can be understood as the linear programming task having the same or similar constraint types and numbers. In other words, the first linear programming task and one or more models in the prior information have the same or similar constraint types and numbers.

[0013] When determining the importance of each constraint, we can directly solve each linear programming task in the prior information to obtain the solution time for each linear programming task (if the linear programming task has already been solved, the solution time can also be obtained directly). Then, we can extract and solve sub-models from one or more linear programming models in the prior information, initialize the linear programming model based on the solution results, and then solve the linear programming model again to obtain another solution time. By comparing the solution time of directly solving each linear programming task with the solution time of the linear programming task initialized based on the solution results of the sub-model, we can know the degree of contribution of the constraints in the sub-model to reducing the solution time of the linear programming task.

[0014] In order to quantify the importance mentioned above, each constraint of the model to be solved can be assigned a probability (which can be used to quantify the importance mentioned above). Based on the probability, the model to be solved is sampled to construct a sub-model. The probability is updated by comparing the solution time of directly solving each linear programming task with the solution time of the linear programming task initialized based on the solution results of the sub-model. After iterating a certain number of times, information on the importance of constraints in reducing the solution time of linear programming tasks can be obtained (the method of updating importance will be described in the candidate embodiments).

[0015] The planning constraints in the sub-models obtained based on the above importance sampling (such as the second linear programming task in the embodiments of this application) contribute significantly to reducing the solution time of the linear programming task. Therefore, the solution time of the first linear programming model after initialization based on the solution results of the second linear programming task can be greatly shortened.

[0016] Based on the importance, the plurality of first planning constraints are sampled to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints;

[0017] Construct a second linear programming task based on a subset of the multiple first programming constraints;

[0018] Solve the second linear programming task to obtain a first solution result; use the first solution result as the initial value of the first linear programming task, and solve the initialized first linear programming task to obtain a second solution result.

[0019] Optionally, the first solution result may include the parameter value (or parameter state) of at least one solution variable from a subset of multiple first planning constraints;

[0020] This application provides a task-solving method, comprising: obtaining a first linear programming task, the first linear programming task including a plurality of first programming constraints; obtaining the importance of each of the plurality of first programming constraints, the importance representing the degree to which the first programming constraint contributes to reducing the solution time of the first linear programming task; sampling the plurality of first programming constraints according to the importance to obtain a subset of the plurality of first programming constraints, wherein the importance is used to determine the sampling probability of the first programming constraints; constructing a second linear programming task based on the subset of the plurality of first programming constraints; using the first solution result as the initial value of the first linear programming task, and solving the initialized first linear programming task to obtain a second solution result. Through this method, on the one hand, key constraints in the first linear programming task are selected to construct a sub-model (second linear programming task), and then the solution of the sub-model is used to solve the first linear programming task, thereby accelerating the solution process. On the other hand, when constructing the sub-model, the first linear programming task is sampled based on importance. Since importance represents the contribution of the first programming constraint to reducing the solution time of the first linear programming task, the solution of the sampled sub-model is close to the optimal solution, thereby accelerating the solution process of the first linear programming task.

[0021] In one possible implementation, the first linear programming model can be the prior information used to update importance. In this case, the probability can be updated based on the comparison between the solution time of directly solving each linear programming task and the solution time of the linear programming task initialized based on the solution results of the sub-model. After a certain number of iterations, information that accurately describes the importance of constraints in reducing the solution time of linear programming tasks can be obtained.

[0022] Specifically, the first solution time for solving the second linear programming task and the second solution time for solving the initialized first linear programming task can be obtained. The sum of the first solution time and the third solution time can be used as the solution time of the linear programming task initialized based on the sub-model solution results. The first linear programming task is then solved to obtain the third solution time for solving the first linear programming task. The third solution time can be considered as the solution time for directly solving the first linear programming task. Based on the sum of the first solution time and the third solution time, the degree of reduction relative to the first solution time can be used to update the importance of each first programming constraint. The updated importance is positively correlated with the degree of reduction.

[0023] It should be understood that the time required to sample the second linear programming task can also be included as part of the solution time of the linear programming task after initialization based on the solution results of the sub-model. That is, the sampling time for sampling the multiple first programming constraints can be obtained, and the importance of each first programming constraint can be updated according to the sum of the first solution time, the third solution time and the sampling time, relative to the degree of reduction of the first solution time.

[0024] In one possible implementation, the method further includes: obtaining a third linear programming task, the third linear programming task including the plurality of second programming constraints, the plurality of second programming constraints and the plurality of first programming constraints having the same constraint type; obtaining the importance of each of the plurality of second programming constraints, wherein the updated importance of each first programming constraint is used as the importance of second programming constraints of the same constraint type; sampling the plurality of second programming constraints according to the importance of each second programming constraint to obtain a fourth linear programming task, wherein the importance of each second programming constraint is used to determine the sampling probability of the second programming constraints, the fourth linear programming task including some of the plurality of second programming constraints; solving the fourth linear programming task to obtain a third solution result; using the third solution result as the initial value of the third linear programming task, and solving the initialized third linear programming task to obtain a fourth solution result.

[0025] In one possible implementation, the second linear programming task includes M solution variables, and the first solution result includes the parameter values ​​of each solution variable;

[0026] Using the first solution result as the initial value for the first linear programming task includes:

[0027] The parameter values ​​of each solution variable in the first solution result are used as the parameter values ​​of the M solution variables in the first linear programming task.

[0028] In one possible implementation, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, and the first planning constraint is a constraint that the scheduling resources satisfy, wherein the scheduling resources are production lines, production equipment, or manufacturers.

[0029] In one possible implementation, after obtaining the second solution result, new constraints (such as a second planning constraint) may be added. This second planning constraint, which includes slack variables and their upper bounds, is added to the first linear programming task to obtain an updated first linear programming task, which is then solved. Specifically, this could involve setting a reasonable bound (numerical range) for the new variables (slack variables) involved in the newly added constraints based on their actual meaning, and modifying the initial state values ​​of these variables to align with their set bounds. This ensures that the initial solution is feasible for the newly added constraints, thereby accelerating the solution of the linear programming problem.

[0030] This application can pre-set the upper bound and initial state of newly added slack variables in continuous solution scenarios, thereby accelerating continuous solution.

[0031] This application embodiment also provides a system, which may include a terminal device and a server. The terminal device may send the model to be solved (a first linear programming task) and prior information including multiple historical models to the server. The server may calculate the importance of convergence based on the prior information including multiple historical models, sample the first linear programming task according to the importance, and execute steps 301 to 303 in the above embodiment to obtain a second solution result, and send the second solution result back to the terminal device.

[0032] In addition, the terminal device can send the model to be solved and prior information including multiple historical models (including the first linear programming task) to the server. The server can calculate the importance of convergence based on the prior information including multiple historical models (the calculation process can refer to the description of updating importance in the above embodiments), sample the model to be solved according to the importance, and solve the model to be solved.

[0033] Secondly, this application provides a task-solving apparatus, the apparatus comprising:

[0034] An acquisition module is used to acquire a first linear programming task, which includes multiple first programming constraints.

[0035] The importance of each of the plurality of first planning constraints is determined, whereby the importance represents the degree to which the first planning constraint contributes to reducing the solution time of the first linear programming task.

[0036] A sampling module is used to sample the plurality of first planning constraints according to the importance, so as to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints;

[0037] Construct a second linear programming task based on a subset of the multiple first programming constraints;

[0038] The solver module is used to solve the second linear programming task and obtain the first solution result;

[0039] The first solution result is used as the initial value of the first linear programming task, and the initialized first linear programming task is solved to obtain the second solution result.

[0040] In one possible implementation, both the first linear programming task and the second linear programming task include a planning objective.

[0041] In one possible implementation, the acquisition module is further configured to:

[0042] Obtain the first solution time for solving the second linear programming task, and the second solution time for solving the initialized first linear programming task;

[0043] The solution module is also used to solve the first linear programming task to obtain a third solution time for solving the first linear programming task.

[0044] The device further includes:

[0045] An importance update module is used to update the importance of each first planning constraint based on the sum of the first solution time and the third solution time, relative to the degree of reduction of the first solution time, wherein the updated importance is positively correlated with the degree of reduction.

[0046] In one possible implementation, the acquisition module is further configured to:

[0047] Obtain the sampling time for sampling the plurality of first planning constraints;

[0048] The importance update module is specifically used for:

[0049] The importance of each first planning constraint is updated based on the sum of the first solution time, the third solution time, and the sampling time, relative to the reduction in the first solution time.

[0050] In one possible implementation, the acquisition module is further configured to:

[0051] Obtain a third linear programming task, wherein the third linear programming task includes the plurality of second programming constraints, and the plurality of second programming constraints and the plurality of first programming constraints have the same constraint type;

[0052] Obtain the importance of each of the plurality of second planning constraints, wherein the updated importance of each first planning constraint is used as the importance of second planning constraints of the same constraint type;

[0053] The sampling module is also used for:

[0054] Based on the importance of each second planning constraint, the plurality of second planning constraints are sampled to obtain a fourth linear programming task, wherein the importance of each second planning constraint is used to determine the sampling probability of the second planning constraint, and the fourth linear programming task includes some of the second planning constraints among the plurality of second planning constraints;

[0055] The solution module is also used for:

[0056] Solving the fourth linear programming task yields the third solution result;

[0057] The third solution result is used as the initial value of the third linear programming task, and the initialized third linear programming task is solved to obtain the fourth solution result.

[0058] In one possible implementation, the second linear programming task includes M solution variables, and the first solution result includes the parameter values ​​of each solution variable;

[0059] The solution module is specifically used for:

[0060] The parameter values ​​of each solution variable in the first solution result are used as the parameter values ​​of the M solution variables in the first linear programming task.

[0061] In one possible implementation, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, and the first planning constraint is a constraint that the scheduling resources satisfy, wherein the scheduling resources are production lines, production equipment, or manufacturers.

[0062] In one possible implementation, the acquisition module is further configured to:

[0063] After obtaining the second solution result, the second planning constraint is obtained, which includes slack variables and the upper bound of the slack variables;

[0064] The solution module is further configured to add the second planning constraint to the first linear programming task to obtain an updated first linear programming task, and solve the updated first linear programming task.

[0065] Thirdly, embodiments of this application provide an apparatus including a memory, a processor, and a bus system, wherein the memory is used to store a program, and the processor is used to execute the program in the memory to perform the methods described in the first aspect and any optional method of the first aspect.

[0066] Fourthly, embodiments of the present invention also provide a system, the system including at least one processor, at least one memory, and at least one communication interface; the processor, memory, and communication interface are connected through a communication bus and complete communication with each other;

[0067] The memory stores the application code for executing the above scheme, and its execution is controlled by the processor. The processor executes the application code stored in the memory to obtain the task scheduling result; wherein the code stored in the memory can execute one of the task solving methods provided above.

[0068] A communication interface is used to communicate with other devices or communication networks to send the task solution results to the devices or communication networks.

[0069] Fifthly, embodiments of this application provide a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any of its optional methods.

[0070] In a sixth aspect, embodiments of this application provide a computer-readable storage medium storing one or more instructions that, when executed by one or more computers, cause the one or more computers to implement the second aspect described above and any of the alternative systems thereof.

[0071] In a seventh aspect, embodiments of this application provide a computer program that, when run on a computer, causes the computer to perform the methods described in the first aspect and any of its alternatives.

[0072] Eighthly, this application provides a chip system including a processor for supporting a terminal device or server in implementing the functions involved in the foregoing aspects, such as transmitting or processing data involved in the foregoing methods; or, information. In one possible design, the chip system further includes a memory for storing program instructions and data necessary for the terminal device or server. This chip system may be composed of chips or may include chips and other discrete devices.

[0073] This application provides a task-solving method, comprising: obtaining a first linear programming task, the first linear programming task including a plurality of first programming constraints; obtaining the importance of each of the plurality of first programming constraints, the importance representing the degree to which the first programming constraint contributes to reducing the solution time of the first linear programming task; sampling the plurality of first programming constraints according to the importance to obtain a subset of the plurality of first programming constraints, wherein the importance is used to determine the sampling probability of the first programming constraints; constructing a second linear programming task based on the subset of the plurality of first programming constraints; using the first solution result as the initial value of the first linear programming task, and solving the initialized first linear programming task to obtain a second solution result. Through this method, on the one hand, key constraints in the first linear programming task are selected to construct a sub-model (second linear programming task), and then the solution of the sub-model is used to solve the first linear programming task, thereby accelerating the solution process. On the other hand, when constructing the sub-model, the first linear programming task is sampled based on importance. Since importance represents the contribution of the first programming constraint to reducing the solution time of the first linear programming task, the solution of the sampled sub-model is close to the optimal solution, thereby accelerating the solution process of the first linear programming task. Attached Figure Description

[0074] Figure 1 This application provides a schematic diagram of an application architecture for an embodiment of the present application;

[0075] Figure 2 A schematic diagram of a server architecture provided for an embodiment of this application;

[0076] Figure 3 A flowchart illustrating a task-solving method provided in an embodiment of this application;

[0077] Figure 4 A flowchart illustrating a task-solving method provided in an embodiment of this application;

[0078] Figure 5 A schematic diagram of a production scheduling task provided in an embodiment of this application;

[0079] Figure 6This is a schematic diagram of the structure of a task solving device provided in this embodiment;

[0080] Figure 7 A schematic diagram of the structure of a terminal device provided in an embodiment of this application;

[0081] Figure 8 A schematic diagram of a server structure provided in an embodiment of this application;

[0082] Figure 9 This is a schematic diagram of a chip structure provided in an embodiment of this application. Detailed Implementation

[0083] The embodiments of the present invention will now be described with reference to the accompanying drawings. The terminology used in the embodiments section is for illustrative purposes only and is not intended to limit the scope of the invention.

[0084] The embodiments of this application will now be described with reference to the accompanying drawings. Those skilled in the art will recognize that, with technological advancements and the emergence of new scenarios, the technical solutions provided in the embodiments of this application are equally applicable to similar technical problems.

[0085] The terms "first," "second," etc., used in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such terms are interchangeable where appropriate; this is merely a way of distinguishing objects with the same attributes in the embodiments of this application. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, so that a process, method, system, product, or apparatus that comprises a series of elements is not necessarily limited to those elements, but may include other elements not explicitly listed or inherent to those processes, methods, products, or apparatuses.

[0086] The embodiments of this application can be applied to solving linear programming optimization problems in various scenarios (such as supply chain, cloud computing, scheduling, storage optimization, etc.), accelerating the efficiency of linear programming solvers in solving these problems.

[0087] Reference Figure 1 , Figure 1 The following is a schematic diagram of the application structure provided in the embodiments of this application. The task solving method provided in this application can be deployed as a solver on a cloud-side server. The terminal device can transmit the model to be solved (e.g., a linear programming task) to the cloud-side server. The cloud-side server can solve the model to be solved based on its own deployed solver and transmit the solution result to the terminal device.

[0088] For example, users can build a model to be solved based on their own business scenarios. During the solving process, they can pass some models of similar problems from the past to the server. The server can then call the solver to quickly output the optimal solution of the user-input model. Users can then use the platform's functions to generate data reports or process the solution themselves to obtain the desired results.

[0089] Reference Figure 2 , Figure 2 This is a schematic diagram of the server architecture provided in the embodiments of this application. Specifically, server 200 is implemented by one or more servers. Server 200 can vary significantly due to different configurations or performance, and may include one or more central processing units (CPUs) 22 (e.g., one or more processors) and memory 232, and one or more storage media 230 (e.g., one or more mass storage devices) for storing application programs 242 or data 244. The memory 232 and storage media 230 can be temporary or persistent storage. The program stored in storage media 230 may include one or more modules (not shown in the figure), each module may include a series of instruction operations on the server. Furthermore, the CPU 22 may be configured to communicate with storage media 230 and execute a series of instruction operations in storage media 230 on server 200.

[0090] Server 200 may also include one or more power supplies 222, one or more wired or wireless network interfaces 250, one or more input / output interfaces 258; or, one or more operating systems 241, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0091] In this embodiment of the application, the central processing unit 22 is used to execute the task solving method described in this embodiment of the application.

[0092] It should be understood that the task solving method provided in the embodiments of this application can also be deployed as a solver on the terminal device on the edge side, and this is not limited here.

[0093] The model to be solved in this application embodiment can be used to solve scheduling problems. Scheduling problems are among the most common problems in large-scale manufacturing / logistics / production processes, and scheduling always has different meanings in different scenarios. For example, logistics scheduling mainly refers to the reasonable arrangement and scheduling of vehicles and personnel by logistics companies in the logistics process based on the weight, destination, specifications, urgency level, etc. of the goods to be shipped.

[0094] In a production environment, scheduling involves prioritizing tasks and matching them with production equipment based on the capacity and production demands of different machines on different production lines. This means allocating multiple tasks to production equipment on various production lines.

[0095] For example, in a job-shop scheduling scenario, n jobs are processed on m machines. Each job has a specific processing technology, and the processing order and time for each process are given. The goal is to arrange the processing order of the jobs on each machine to optimize a certain performance indicator. It is not required that every job be processed on every single machine.

[0096] For example, in flow-shop scheduling scenarios, this type of scheduling problem requires that each task must be executed sequentially through each stage. It doesn't involve matching tasks to stages, but primarily determines the execution order of tasks. This prevents excessively long waiting times from affecting the overall completion time.

[0097] Slightly different from general cargo scheduling, timetabling of workers / flight attendants at airports / large manufacturing plants is also a type of scheduling problem. This is because the goal of this type of problem is to achieve optimal matching within different time periods based on the work characteristics of the workers / flight attendants and the needs of the scenario. Therefore, the core is sorting and optimal allocation, regardless of whether the "task" is people or goods. Generally speaking, the goal of scheduling problems is to obtain the sorting corresponding to the minimum total working time given the number of tasks.

[0098] Meanwhile, scheduling in computing is a method of allocating resources needed for work. Resources can refer to virtual computing resources, such as threads, processes, or data streams; or they can refer to hardware resources, such as processors, network connections, or expansion cards. The program that performs scheduling is called a scheduler. A typical implementation of a scheduler keeps all computing resources busy (in load balancing), allowing multiple users to efficiently share system resources simultaneously or achieve a specified quality of service.

[0099] Many scheduling problems (such as production scheduling, line scheduling, and processing network layout) can be modeled as mathematical problems for solution, and linear programming (LP) is one of the most widely used modeling methods. Currently, among the algorithms that linear programming solvers rely on, the simplex method is the most widely used algorithm and also the one that is most frequently optimized by various linear programming solvers.

[0100] For simplex algorithms, the algorithm typically first selects an initial feasible basic solution, then checks whether this solution has reached the optimal solution. Subsequently, it performs LU decomposition on the basis matrices to calculate their inverses; LU decomposition is performed only once every K iterations, with the remaining iterations using an incremental method to update the L and U matrices. Then, the algorithm selects the input and output variables according to heuristic rules to update the basic variables. This loop continues until the optimal solution is found, or an abnormal problem state is detected, at which point the algorithm terminates.

[0101] From the perspective of solver usage, there are two types: standard solvers and continuous solvers. A standard solver refers to a complete solution process performed without any prior knowledge. This involves pre-solving, solving, and post-processing steps. The standard process adds a pre-solving module before and a post-processing module before and after the Simplex algorithm. The pre-solving module simplifies the model; the degree of simplification varies depending on the model structure, typically reducing the model size (number of variables, number of constraints) by 30% to 70%. This allows Simplex to solve a relatively simple model, thus accelerating the solution process. The post-processing module maps the solution from the simplified model generated by the pre-solving module back to the original problem, ultimately obtaining the solution to the original model.

[0102] Continuous solving refers to a process where the model has already been solved once to obtain an optimal solution, and then the model is modified partially, such as by adding some variable constraints or changing the upper and lower bounds of existing variables, before solving it again. This process of resolving based on the previous optimal solution is called continuous solving.

[0103] However, the existing standard solution process described above does not utilize any prior knowledge to construct an initial feasible basis. Therefore, the constructed initial feasible basis is relatively simple, and the number of iterations required for the simplex algorithm iteratively starting from a simple feasible basis is too large, resulting in excessive time consumption. Furthermore, the adjustment of the initial variable state during continuous solution is too direct, causing the time spent finding the initial feasible basis solution during continuous solution to be very long. The task-solving method provided in this application can construct an initial feasible basis based on prior knowledge, which can reduce the solution time.

[0104] To make this application clearer, we will first give a brief introduction to some of the concepts and processes mentioned in this application.

[0105] Linear Programming (LP) is an important branch of operations research that has been studied early, developed rapidly, widely applied, and has mature methods. It is a mathematical method that assists people in scientific management. It studies the mathematical theory and methods for finding the extrema of a linear objective function under linear constraints.

[0106] Constraints are the numerical requirements imposed on decision variables in mathematical programming problems.

[0107] Basic Solution: Find a basis in the coefficient matrix of the constraint equation system, set the non-basic variables of this basis to zero, and then solve the m-variable linear equation system to obtain a unique solution. This solution is called the basic solution of the linear programming problem.

[0108] Basic Feasible Solution: A fundamental concept in linear programming, it is a basic solution that satisfies the non-negativity condition.

[0109] The simplex method is one of the most commonly used and efficient algorithms for solving linear programming problems. The basic idea of ​​the simplex method is to first find a vertex in the feasible region and determine whether it is optimal according to certain rules; if not, then move to another adjacent vertex and improve the objective function value; continue in this manner until an optimal solution is found.

[0110] The embodiments of this application are described below with reference to the accompanying drawings. The terminology used in the implementation section of this application is for explaining specific embodiments only and is not intended to limit the scope of this application. See also... Figure 3 , Figure 3 A task-solving method provided in this application embodiment includes:

[0111] 301. Obtain the first linear programming task, which includes multiple first programming constraints.

[0112] In one possible implementation, the entity executing step 301 can be a server. For example, the terminal device can transmit the first linear programming task as the model to be solved to the server, and then the server can obtain the first linear programming task. Alternatively, the terminal device can transmit the first linear programming task as prior information used when solving the model to be solved, that is, transmit at least one historical model, including the first linear programming task, to the server, and then the server can obtain at least one historical model, including the first linear programming task.

[0113] Typically, a linear programming model includes an objective function and constraints. The objective function is a function designed based on the objective to be optimized and the variables affecting that objective. For example, in the production scheduling problem, the overall goal is usually to find the best processing plan that maximizes the demand fulfillment rate while minimizing overall costs (e.g., costs may include, but are not limited to, processing costs, inventory costs, and transportation costs) while satisfying all resource constraints. In this case, the objective function can represent maximizing the demand fulfillment rate and minimizing costs. Constraints, on the other hand, refer to other restrictions that must be satisfied during the process of solving the objective function.

[0114] In one possible implementation, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, and the first planning constraint is a constraint that the scheduling resources satisfy, wherein the scheduling resources are production lines, production equipment, or manufacturers.

[0115] For example, in a product manufacturing scenario, the task to be scheduled can be a product to be produced; in a personnel scheduling scenario, the task to be scheduled can be a person to be produced, etc. The embodiments of this application are not limited to this.

[0116] In a product manufacturing scenario, each of the multiple schedulable resource groups can be a production line. For example, in a mobile phone manufacturing scenario, each of the multiple schedulable resource groups can be a production line for a mobile phone component, such as a battery production line, a casing production line, a chip production line, etc. Correspondingly, each schedulable resource group can include multiple schedulable resources, and each of the multiple schedulable resources is a production device in the production line. For example, a battery production line can include multiple battery production devices, and a casing production line can include multiple casing production devices. This is not a limitation.

[0117] In personnel scheduling scenarios, each of the multiple schedulable resource groups can be a time period. For example, in a personnel scheduling scenario, each of the multiple schedulable resource groups can be a day, such as Monday, Tuesday, Wednesday, or a certain day of some months. Correspondingly, each schedulable resource group can include multiple schedulable resources, and each schedulable resource in the multiple schedulable resources is a sub-time period in the time period. For example, a certain day can include multiple hours, multiple minutes, or other multiple sub-time periods, which is not limited here.

[0118] The first programming constraint may include the solution variables and the constraints that each solution variable needs to satisfy.

[0119] 302. Obtain the importance of each of the plurality of first planning constraints, wherein the importance represents the degree to which the first planning constraint contributes to reducing the solution time of the first linear programming task.

[0120] In one possible implementation, the first linear programming task can be used as the model to be solved. When solving the first linear programming task, the importance of each first programming constraint can be obtained first, whereby the importance represents the degree to which the first programming constraint contributes to reducing the solution time of the first linear programming task.

[0121] Typically, when there are many constraints in a linear programming task, the solution time is very long. Therefore, we can first select some constraints in the linear programming task and solve the problem based on these selected constraints. The solution results (the states of the solution variables in the selected constraints) are then assigned to the linear programming task, which is equivalent to using the solution results as the initial values ​​for the linear programming task. If the solution results of the selected constraints are basically consistent with (or very close to) the solution results after solving the linear programming task, the number of iterations required to solve the linear programming task is reduced, thus improving the solution speed of the linear programming task.

[0122] Therefore, before solving the first linear programming task, it is necessary to select a portion of the constraints to solve, and the solution obtained should be close to the solution of the first linear programming task.

[0123] In this embodiment, importance is used as the basis for selecting some constraints from multiple first programming constraints. Importance can indicate the degree of contribution to reducing the solution time of the first linear programming task. Specifically, indicating the degree of contribution to reducing the solution time of the first linear programming task can be understood as follows: when constructing a sub-model of the model to be solved (i.e., selecting a portion of the constraints from the model to be solved to construct the sub-model), when the solution of the sub-model is used as the initial value of the model to be solved, the sub-model includes the degree of contribution of the first linear programming task to reducing the solution time of the model to be solved.

[0124] Specifically, sampling multiple first planning constraints using importance as sampling probability can yield a subtask (second planning task). The planning constraints in this subtask are those that contribute significantly to reducing the solution time of the first linear programming task. Therefore, the solution obtained after solving the second planning task is basically consistent with (or described as very close to) the solution obtained after solving the second planning task. Here, "basically consistent" can be understood as the parameter values ​​of the solution variables in the same constraints being basically consistent.

[0125] In one possible implementation, this importance can be obtained based on prior information, which can be one or more models of the same type as the model to be solved (the first linear programming task). The term "of the same type" can be understood as the linear programming task having the same or similar constraint types and numbers. In other words, the first linear programming task and one or more models in the prior information have the same or similar constraint types and numbers.

[0126] When determining the importance of each constraint, we can directly solve each linear programming task in the prior information to obtain the solution time for each linear programming task (if the linear programming task has already been solved, the solution time can also be obtained directly). Then, we can extract and solve sub-models from one or more linear programming models in the prior information, initialize the linear programming model based on the solution results, and then solve the linear programming model again to obtain another solution time. By comparing the solution time of directly solving each linear programming task with the solution time of the linear programming task initialized based on the solution results of the sub-model, we can know the degree of contribution of the constraints in the sub-model to reducing the solution time of the linear programming task.

[0127] In order to quantify the importance mentioned above, each constraint of the model to be solved can be assigned a probability (which can be used to quantify the importance mentioned above). Based on the probability, the model to be solved is sampled to construct a sub-model. The probability is updated by comparing the solution time of directly solving each linear programming task with the solution time of the linear programming task initialized based on the solution results of the sub-model. After iterating a certain number of times, information on the importance of constraints in reducing the solution time of linear programming tasks can be obtained (the method of updating importance will be described in the candidate embodiments).

[0128] The planning constraints in the sub-models obtained based on the above importance sampling (such as the second linear programming task in the embodiments of this application) contribute significantly to reducing the solution time of the linear programming task. Therefore, the solution time of the first linear programming model after initialization based on the solution results of the second linear programming task can be greatly shortened.

[0129] It should be understood that the first linear programming model in the embodiments of this application can be the prior information used to calculate the importance of each first programming constraint. In this case, the importance of each first programming constraint among the plurality of first programming constraints obtained in step 302 can be the initial importance or the importance in the iterative process (not yet converged to meet the requirements).

[0130] It should be understood that the prior information used in calculating the importance of each first programming constraint may include multiple models, the first linear programming task may be one of multiple models, and the first linear programming task may be randomly selected from multiple models.

[0131] For example, we can obtain N historical models P that are homogeneous with the model to be solved, such as the same type of optimization problem at different points in the past. And these N models have a total of C types of constraints, each type of constraint represented by c. i Indicates; pre-solve each problem P i For i = 1, 2, ..., N, the time required to directly solve for them is... Let the importance of each type of constraint be . i = 1, 2, ..., C, and their initial values ​​are (Or set to other initial values); Select a model P i And sample the sub-model based on the probability of α. (Includes constraints) Solve this sub-model, then use the solution of the sub-model as the initial value of the original problem to solve the original problem, and record the total time (including the time to solve the sub-model) T. j ;renew For example, it can be updated based on the following formula:

[0132] Where ρ is the step size and g(·) is the probability update function, the above steps are repeated until the importance converges.

[0133] After obtaining the importance of each programming constraint, the importance of each first linear programming task can be obtained before solving the first linear programming task.

[0134] 303. Based on the importance, sample the plurality of first planning constraints to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints;

[0135] 304. Construct a second linear programming task based on a subset of the multiple first programming constraints;

[0136] In one possible implementation, the more important the first planning constraint, the more likely it is to be sampled as part of the second linear programming task. Therefore, the second linear programming task may include some of the first planning constraints among the plurality of first planning constraints.

[0137] In one possible implementation, the first linear programming model is the model to be solved or the prior information used to update importance. The importance of convergence can be used as the sampling probability of each constraint, and multiple first programming constraints are sampled to obtain the second linear programming task. The programming constraints in the sub-model obtained based on the above importance sampling (e.g., the second linear programming task in the embodiment of this application) contribute significantly to reducing the solution time of the linear programming task. Therefore, the solution time of the first linear programming model initialized based on the solution result of the second linear programming task can be greatly shortened.

[0138] 305. Solve the second linear programming task to obtain the first solution result.

[0139] In one possible implementation, the second linear programming task includes M solution variables, and the first solution result may include parameter values ​​for each solution variable, where the parameter values ​​can be the numerical values ​​of the optimal solution or the states of the solution variables. Specifically, when using the first solution result as the initial value for the first linear programming task, the parameter values ​​of each solution variable in the first solution result can be used as the parameter values ​​of the M solution variables in the first linear programming task. That is, the parameter values ​​of the solution variables in the first solution result are assigned to the first linear programming task, and the initial values ​​of the first planning constraints (excluding the planning constraints included in the second linear programming task) in the first linear programming task can be specified by the solver; this is not limited here.

[0140] 306. Use the first solution result as the initial value of the first linear programming task, and solve the initialized first linear programming task to obtain the second solution result.

[0141] In one possible implementation, the solver can read the first solution result into the first linear programming task, and then the solution variable v in the first linear programming task... i The initial state is assigned as s i The first linear programming task after initialization is solved to obtain the second solution result.

[0142] In one possible implementation, the first linear programming model can be the model to be solved, and the second solution result can be the solution result of the model to be solved. After obtaining the second solution result, the server can send the second solution result back to the terminal device.

[0143] In one possible implementation, after obtaining the second solution result, new constraints (such as second planning constraints) may be added. These second planning constraints include objective variables and slack variables. These constraints are then added to the first linear programming task to obtain an updated first linear programming task, which is then solved. In other words, a reasonable bound (numerical range) can be set for the new variables involved in the newly added constraints based on their actual meaning, and the initial state values ​​of these variables can be modified to align with the bound set in step one. This ensures that the initial solution is feasible for the newly added constraints, thereby accelerating the solution of the linear programming problem.

[0144] This application can pre-set the upper bound and initial state of newly added slack variables in continuous solution scenarios, thereby accelerating continuous solution.

[0145] In one possible implementation, the first linear programming model can be the prior information used to update importance. In this case, the probability can be updated based on the comparison between the solution time of directly solving each linear programming task and the solution time of the linear programming task initialized based on the solution results of the sub-model. After a certain number of iterations, information that accurately describes the importance of constraints in reducing the solution time of linear programming tasks can be obtained.

[0146] Specifically, the first solution time for solving the second linear programming task and the second solution time for solving the initialized first linear programming task can be obtained. The sum of the first solution time and the third solution time can be used as the solution time of the linear programming task initialized based on the sub-model solution results. The first linear programming task is then solved to obtain the third solution time for solving the first linear programming task. The third solution time can be considered as the solution time for directly solving the first linear programming task. Based on the sum of the first solution time and the third solution time, the degree of reduction relative to the first solution time can be used to update the importance of each first programming constraint. The updated importance is positively correlated with the degree of reduction.

[0147] It should be understood that the time required to sample the second linear programming task can also be included as part of the solution time of the linear programming task after initialization based on the solution results of the sub-model. That is, the sampling time for sampling the multiple first programming constraints can be obtained, and the importance of each first programming constraint can be updated according to the sum of the first solution time, the third solution time and the sampling time, relative to the degree of reduction of the first solution time.

[0148] For example, the time spent constructing the sub-model is denoted as T. a For this sub-model (containing (A total of K types of constraints) The linear programming solver is called to solve the problem, and the optimal solution S of the sub-model is obtained. The time taken to solve the problem is denoted as T. b Finally, the solution of the sub-model is used as the initial solution and substituted into the original model P. i In the middle, solve P again. i This step takes time T. c Finally, the total time obtained from this importance sampling solution is denoted as T. j =T a +T b +T c .

[0149] For example, this can be done for each type of constraint. The following formula can be used to update: ρ can be a pre-set hyperparameter.

[0150] The above-mentioned update of the importance of each first programming constraint based on the sum of the first solution time and the third solution time, relative to the degree of reduction of the first solution time, can be an iterative process of importance. The importance can be updated based on other prior information or by performing the above iterative process multiple times on the first linear programming model to obtain the convergent importance.

[0151] The server can solve the model based on the importance of convergence.

[0152] For example, if the model to be solved is a target linear programming task, the planning constraints in the target linear programming task can be sampled based on the importance after convergence to obtain a sub-model, and the sub-model can be solved. Then, the solution result is used as the initial value of the target linear programming task, and the target linear programming task is solved again to obtain the final solution result. The server can feed back the final solution result obtained above to the terminal device.

[0153] Taking the model to be solved as a third linear programming task as an example, the third linear programming task can be obtained. The third linear programming task includes the plurality of second programming constraints, and the plurality of second programming constraints and the plurality of first programming constraints have the same constraint type.

[0154] Obtain the importance of each of the plurality of second planning constraints, wherein the updated importance of each first planning constraint is used as the importance of second planning constraints of the same constraint type;

[0155] Based on the importance of each second programming constraint, the plurality of second programming constraints are sampled to obtain a fourth linear programming task, wherein the importance of each second programming constraint is used to determine the sampling probability of the second programming constraint, and the fourth linear programming task includes some of the second programming constraints among the plurality of second programming constraints; the fourth linear programming task is solved to obtain a third solution result; the third solution result is used as the initial value of the third linear programming task, and the initialized third linear programming task is solved to obtain a fourth solution result.

[0156] For example, taking the multi-factory scheduling problem as an example, the goal of the entire scheduling is usually to find the best processing plan while satisfying all resource constraints, so as to maximize the demand satisfaction rate and minimize the overall cost (processing cost, inventory cost, and transportation cost). Figure 5 This example illustrates a production scheduling scenario. Assume a customer orders 2000 PCs, 1000 desktops, and 800 laptops. Two factories can process these three types of products (maximum 1000 units per day). To process one PC, one desktop is required, and assembly into a PC can only be done at the first factory. The diagram shows an optimal scheduling plan: On the first day, process 1000 desktops at each factory and transport the desktops from the second factory to the first; on the second day, assemble the desktops from the first day into PCs at the first factory, then process another 1000 desktops at the second factory; on the third day, assemble 1000 PCs at the first factory using the desktops transported from the second factory on the first day, and finally process 800 laptops at the second factory. This satisfies all demands and minimizes total cost. Multi-factory scheduling is essentially an integer programming problem, but due to the high complexity of solving integer programming problems, it is difficult to find the optimal solution within a given time for such a large-scale model. Therefore, the usual approach is to relax the problem into a linear programming problem, and then use some approximation methods to adjust the real number solution obtained by solving the linear programming problem into an integer solution.

[0157] First, we collected production scheduling models from the past three months, forming a training dataset of approximately 90 models. Simultaneously, we addressed 18 types of constraints in the production scheduling problem, including inventory constraints, capacity constraints, pairing constraints, special control constraints, SR constraints, order demand deferral constraints, forecast demand deferral constraints, and maximum substitution constraints.

[0158] First, solve these 90 models using a linear programming solver and record the solution time. i = 1, ..., 90, initialize the importance probabilities of the constraints. Choose a model P i Then, a sub-model is sampled based on the current α. The sampling method is to randomly generate a random number r for each type of constraint, if These constraints and their corresponding variables are then incorporated into the sub-model, and the time spent constructing the sub-model is denoted as T. a For this sub-model (containing (A total of K types of constraints) The linear programming solver is called to solve the problem, and the optimal solution S of the sub-model is obtained. The time taken to solve the problem is denoted as T. b Finally, the solution of the sub-model is used as the initial solution and substituted into the original model P. i In the middle, solve P again. i This step takes time T. c Finally, the total time obtained from this importance sampling solution is denoted as T. j =T a +T b +T c T recorded in j Update the importance probability α. For each type of constraint in the sub-model. Execute the following update formula: Continue selecting and updating the model until a certain number of updates are performed to obtain a trained α. Given a production scheduling model at the latest moment, based on the α trained in historical data, first sample a sub-model, then solve this sub-model to obtain the solution S of the sub-model. Use S as the initial value and input it into the original model to solve the original model to obtain a real solution to this production scheduling problem.

[0159] For the minimum batch size constraint in the production scheduling problem, which means the daily processing volume is either 0 or greater than or equal to a certain constant C, since this constraint cannot be considered when building the linear programming model, a continuous solution method can be used here. A constraint of the following form can be added to the already solved model: x i +s j ≥C; where x i It is a variable s that is greater than 0, obtained from the previous standard solution. j This is a newly added slack variable. At the same time, s... j Add it to the objective function. Now solve the constrained model again, and the result is x. i The newly added slack variable s should be as large as possible, greater than or equal to C. j Set the UpperBounds variable j UB =C, and set status(s) before solving. j = atUpperBound. Solve the model with the initial state of the slack variables modified to obtain the solution. Following these steps, the production scheduling problem model can be solved.

[0160] Table 1 shows the improvement effect of the solution in the embodiments of this application. Compared with the direct solution, the solution method using the embodiments of this application has an average efficiency improvement of about 20%.

[0161] Table 1

[0162]

[0163] This application provides a task-solving method, comprising: obtaining a first linear programming task, the first linear programming task including a plurality of first programming constraints; obtaining the importance of each of the plurality of first programming constraints, the importance representing the degree to which the first programming constraint contributes to reducing the solution time of the first linear programming task; sampling the plurality of first programming constraints according to the importance to obtain a subset of the plurality of first programming constraints, wherein the importance is used to determine the sampling probability of the first programming constraints; constructing a second linear programming task based on the subset of the plurality of first programming constraints; using the first solution result as the initial value of the first linear programming task, and solving the initialized first linear programming task to obtain a second solution result. Through this method, on the one hand, key constraints in the first linear programming task are selected to construct a sub-model (second linear programming task), and then the solution of the sub-model is used to solve the first linear programming task, thereby accelerating the solution process. On the other hand, when constructing the sub-model, the first linear programming task is sampled based on importance. Since importance represents the contribution of the first programming constraint to reducing the solution time of the first linear programming task, the solution of the sampled sub-model is close to the optimal solution, thereby accelerating the solution process of the first linear programming task.

[0164] This application embodiment also provides a system, which may include a terminal device and a server. The terminal device may send the model to be solved (a first linear programming task) and prior information including multiple historical models to the server. The server may calculate the importance of convergence based on the prior information including multiple historical models, sample the first linear programming task according to the importance, and execute steps 301 to 303 in the above embodiment to obtain a second solution result, and send the second solution result back to the terminal device.

[0165] In addition, the terminal device can send the model to be solved and prior information including multiple historical models (including the first linear programming task) to the server. The server can calculate the importance of convergence based on the prior information including multiple historical models (the calculation process can refer to the description of updating importance in the above embodiments), sample the model to be solved according to the importance, and solve the model to be solved.

[0166] Reference Figure 6 , Figure 6 This is a schematic diagram of the structure of a task solving device provided in an embodiment of this application, such as... Figure 6 As shown, the device 600 may include:

[0167] The acquisition module 601 is used to acquire a first linear programming task, which includes multiple first programming constraints.

[0168] The importance of each of the plurality of first planning constraints is determined, whereby the importance represents the degree to which the first planning constraint contributes to reducing the solution time of the first linear programming task.

[0169] The specific description of the acquisition module 601 can be found in the descriptions of steps 301 and 302 in the above embodiments, and will not be repeated here.

[0170] The sampling module 602 is used to sample the plurality of first planning constraints according to the importance, so as to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints;

[0171] Construct a second linear programming task based on a subset of the multiple first programming constraints;

[0172] The specific description of the sampling module 602 can be found in the descriptions of steps 303 and 304 in the above embodiments, and will not be repeated here.

[0173] The solver module 603 is used to solve the second linear programming task and obtain the first solution result;

[0174] The first solution result is used as the initial value of the first linear programming task, and the initialized first linear programming task is solved to obtain the second solution result.

[0175] The specific description of the solution module 603 can be found in the descriptions of steps 305 and 306 in the above embodiments, and will not be repeated here.

[0176] In one possible implementation, both the first linear programming task and the second linear programming task include a planning objective.

[0177] In one possible implementation, the acquisition module is further configured to:

[0178] Obtain the first solution time for solving the second linear programming task, and the second solution time for solving the initialized first linear programming task;

[0179] The solution module is also used to solve the first linear programming task to obtain a third solution time for solving the first linear programming task.

[0180] The device further includes:

[0181] An importance update module is used to update the importance of each first planning constraint based on the sum of the first solution time and the third solution time, relative to the degree of reduction of the first solution time, wherein the updated importance is positively correlated with the degree of reduction.

[0182] In one possible implementation, the acquisition module is further configured to:

[0183] Obtain the sampling time for sampling the plurality of first planning constraints;

[0184] The importance update module is specifically used for:

[0185] The importance of each first planning constraint is updated based on the sum of the first solution time, the third solution time, and the sampling time, relative to the reduction in the first solution time.

[0186] In one possible implementation, the acquisition module is further configured to:

[0187] Obtain a third linear programming task, wherein the third linear programming task includes the plurality of second programming constraints, and the plurality of second programming constraints and the plurality of first programming constraints have the same constraint type;

[0188] Obtain the importance of each of the plurality of second planning constraints, wherein the updated importance of each first planning constraint is used as the importance of second planning constraints of the same constraint type;

[0189] The sampling module is also used for:

[0190] Based on the importance of each second planning constraint, the plurality of second planning constraints are sampled to obtain a fourth linear programming task, wherein the importance of each second planning constraint is used to determine the sampling probability of the second planning constraint, and the fourth linear programming task includes some of the second planning constraints among the plurality of second planning constraints;

[0191] The solution module is also used for:

[0192] Solving the fourth linear programming task yields the third solution result;

[0193] The third solution result is used as the initial value of the third linear programming task, and the initialized third linear programming task is solved to obtain the fourth solution result.

[0194] In one possible implementation, the second linear programming task includes M solution variables, and the first solution result includes the parameter values ​​of each solution variable;

[0195] The solution module is specifically used for:

[0196] The parameter values ​​of each solution variable in the first solution result are used as the parameter values ​​of the M solution variables in the first linear programming task.

[0197] In one possible implementation, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, and the first planning constraint is a constraint that the scheduling resources satisfy, wherein the scheduling resources are production lines, production equipment, or manufacturers.

[0198] In one possible implementation, the acquisition module is further configured to:

[0199] After obtaining the second solution result, the second planning constraint is obtained, which includes the objective solution variable and the slack variable;

[0200] The solution module is further configured to add the second planning constraint to the first linear programming task to obtain an updated first linear programming task, and solve the updated first linear programming task.

[0201] The following describes a terminal device provided in an embodiment of this application. Please refer to [link to relevant documentation]. Figure 7 , Figure 7 This is a schematic diagram of a terminal device provided in an embodiment of this application. The terminal device 700 can specifically be a mobile phone, tablet, laptop, smart wearable device, server, etc., and is not limited thereto. The terminal device 700 may be equipped with... Figure 6 The task solving apparatus described in the corresponding embodiment is used to implement Figure 6 This corresponds to the task-solving function in the embodiment. Specifically, the terminal device 700 includes: a receiver 701, a transmitter 702, a processor 703, and a memory 704 (wherein the terminal device 700 may have one or more processors 703). Figure 7 (Taking a processor as an example), the processor 703 may include an application processor 7031 and a communication processor 7032. In some embodiments of this application, the receiver 701, transmitter 702, processor 703, and memory 704 may be connected via a bus or other means.

[0202] Memory 704 may include read-only memory and random access memory, and provides instructions and data to processor 703. A portion of memory 704 may also include non-volatile random access memory (NVRAM). Memory 704 stores processor and operation instructions, executable modules, or data structures, or subsets thereof, or extended sets thereof, wherein the operation instructions may include various operation instructions for implementing various operations.

[0203] Processor 703 controls the operation of the terminal device. In specific applications, the various components of the terminal device are coupled together through a bus system, which may include not only the data bus but also power buses, control buses, and status signal buses. However, for clarity, all buses in the diagram are referred to as the bus system.

[0204] The methods disclosed in the embodiments of this application can be applied to processor 703, or implemented by processor 703. Processor 703 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 703 or by instructions in software form. Processor 703 can be a general-purpose processor, a digital signal processor (DSP), a microprocessor, or a microcontroller, and may further include an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. Processor 703 can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of this application can be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 704. The processor 703 reads the information from memory 704 and, in conjunction with its hardware, completes the steps related to the terminal device in the above method.

[0205] Receiver 701 can be used to receive input digital or character information, and to generate signal inputs related to the settings and function control of the terminal device. Transmitter 702 can be used to output digital or character information through the first interface; transmitter 702 can also be used to send instructions to the disk group through the first interface to modify the data in the disk group; transmitter 702 may also include a display device such as a display screen.

[0206] In one embodiment of this application, the processor 703 is used to execute the steps performed by the terminal device in the above embodiments.

[0207] This application also provides a server; please refer to [link / reference]. Figure 8 , Figure 8 This is a schematic diagram of a server structure provided in an embodiment of this application. Specifically, server 800 is implemented by one or more servers. Server 800 can vary significantly due to different configurations or performance. It may include one or more central processing units (CPUs) 88 (e.g., one or more processors) and memory 832, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 842 or data 844. The memory 832 and storage media 830 can be temporary or persistent storage. The program stored in storage media 830 may include one or more modules (not shown in the diagram), each module may include a series of instruction operations on the server. Furthermore, the CPU 88 may be configured to communicate with storage media 830 and execute the series of instruction operations in storage media 830 on server 800.

[0208] Server 800 may also include one or more power supplies 826, one or more wired or wireless network interfaces 850, one or more input / output interfaces 858; or one or more operating systems 841, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0209] In this embodiment, the central processing unit 88 is used to execute steps related to the task solving method described in the above embodiments.

[0210] This application also provides a computer program product that, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.

[0211] This application also provides a computer-readable storage medium storing a program for signal processing, which, when run on a computer, causes the computer to perform steps as performed by the aforementioned terminal device, or causes the computer to perform steps as performed by the aforementioned server.

[0212] The terminal device, server, or terminal device provided in this application embodiment can specifically be a chip. The chip includes a processing unit and a communication unit. The processing unit can be, for example, a processor, and the communication unit can be, for example, an input / output interface, pins, or circuits. The processing unit can execute computer execution instructions stored in the storage unit to cause the chip in the terminal device to execute the data processing method described in the above embodiments, or to cause the chip in the server to execute the data processing method described in the above embodiments. Optionally, the storage unit is a storage unit within the chip, such as a register or cache. The storage unit can also be a storage unit located outside the chip in the wireless access device, such as a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, such as random access memory (RAM).

[0213] For details, please refer to Figure 9 , Figure 9 This is a schematic diagram of a chip provided in an embodiment of this application. The chip can be represented as a neural network processor (NPU) 900. The NPU 900 is mounted as a coprocessor on the host CPU, and tasks are assigned by the host CPU. The core of the NPU is the arithmetic circuit 903, which is controlled by a controller 904 to extract matrix data from the memory and perform multiplication operations.

[0214] In some implementations, the arithmetic circuit 903 internally includes multiple processing engines (PEs). In some implementations, the arithmetic circuit 903 is a two-dimensional pulsating array. The arithmetic circuit 903 can also be a one-dimensional pulsating array or other electronic circuits capable of performing mathematical operations such as multiplication and addition. In some implementations, the arithmetic circuit 903 is a general-purpose matrix processor.

[0215] For example, suppose we have an input matrix A, a weight matrix B, and an output matrix C. The arithmetic circuit retrieves the corresponding data of matrix B from the weight memory 902 and caches it in each PE of the arithmetic circuit. The arithmetic circuit retrieves the data of matrix A from the input memory 901 and performs matrix operations with matrix B. The partial result or the final result of the obtained matrix is ​​stored in the accumulator 908.

[0216] Unified memory 906 is used to store input and output data. Weight data is directly transferred to weight memory 902 via Direct Memory Access Controller (DMAC) 905. Input data is also transferred to unified memory 906 via DMAC.

[0217] BIU stands for Bus Interface Unit 910, which is used for interaction between the AXI bus and the DMAC and the Instruction Fetch Buffer (IFB) 909.

[0218] The Bus Interface Unit (BIU) 910 is used by the instruction fetch memory 909 to fetch instructions from external memory, and also by the memory access controller 905 to fetch the original data of the input matrix A or the weight matrix B from external memory.

[0219] The DMAC is mainly used to move input data from external memory DDR to unified memory 906, or to weight data to weight memory 902, or to input data to input memory 901.

[0220] The vector computation unit 907 includes multiple processing units that further process the output of the computation circuit 903 when needed, such as vector multiplication, vector addition, exponential operations, logarithmic operations, size comparisons, etc. It is mainly used for computation in non-convolutional / fully connected layers of neural networks, such as Batch Normalization, pixel-level summation, and upsampling of feature planes.

[0221] In some implementations, the vector computation unit 907 can store the processed output vector in the unified memory 906. For example, the vector computation unit 907 can apply a linear function, or a nonlinear function, to the output of the computation circuit 903, such as performing linear interpolation on the feature planes extracted by the convolutional layer, or, for example, accumulating a vector of values ​​to generate activation values. In some implementations, the vector computation unit 907 generates normalized values, pixel-level summed values, or both. In some implementations, the processed output vector can be used as an activation input to the computation circuit 903, for example, for use in subsequent layers of the neural network.

[0222] The instruction fetch buffer 909 connected to the controller 904 is used to store the instructions used by the controller 904;

[0223] Unified memory 906, input memory 901, weighted memory 902, and instruction fetch memory 909 are all on-chip memories. External memory is proprietary to this NPU hardware architecture.

[0224] The processor mentioned above can be a general-purpose central processing unit, a microprocessor, an ASIC, or one or more integrated circuits used to control the execution of the above program.

[0225] It should also be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. In addition, in the device embodiment drawings provided in this application, the connection relationship between modules indicates that they have a communication connection, which can be implemented as one or more communication buses or signal lines.

[0226] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware, or it can be implemented by special-purpose hardware including application-specific integrated circuits, special-purpose CPUs, special-purpose memory, special-purpose components, etc. Generally, any function performed by a computer program can be easily implemented by corresponding hardware, and the specific hardware structure used to implement the same function can also be diverse, such as analog circuits, digital circuits, or special-purpose circuits. However, for this application, software program implementation is more often the preferred implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a readable storage medium, such as a computer floppy disk, USB flash drive, mobile hard disk, ROM, RAM, magnetic disk, or optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0227] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product.

[0228] The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that a computer can store or a data storage device such as a server or data center that integrates one or more available media. The available medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid-state disk (SSD)).

Claims

1. A task-solving method, characterized in that, The method includes: Obtain a first linear programming task, the first linear programming task includes multiple first programming constraints, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, the first programming constraints are constraints that the scheduling resources satisfy, and the scheduling resources are product production lines, product production equipment or product manufacturers; The importance of each of the plurality of first planning constraints is determined, whereby the importance represents the degree to which the first planning constraint contributes to reducing the solution time of the first linear programming task. Based on the importance, the plurality of first planning constraints are sampled to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints; Construct a second linear programming task based on a subset of the multiple first programming constraints; Solve the second linear programming task to obtain the first solution result; The first solution result is used as the initial value of the first linear programming task, and the initialized first linear programming task is solved to obtain the second solution result.

2. The method according to claim 1, characterized in that, Both the first linear programming task and the second linear programming task include a planning objective.

3. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the first solution time for solving the second linear programming task, and the second solution time for solving the initialized first linear programming task; Solve the first linear programming task to obtain the third solution time for solving the first linear programming task; Based on the sum of the first solution time and the third solution time, the importance of each first planning constraint is updated relative to the degree of reduction in the first solution time, wherein the updated importance is positively correlated with the degree of reduction.

4. The method according to claim 3, characterized in that, The method further includes: obtaining the sampling time for sampling the plurality of first planning constraints; The step of updating the importance of each first planning constraint based on the sum of the first solution time and the third solution time, relative to the reduction in the first solution time, includes: Based on the sum of the first solution time, the third solution time, and the sampling time, the importance of each first planning constraint is updated relative to the reduction in the first solution time, so as to obtain the updated importance of each first planning constraint.

5. The method according to claim 4, characterized in that, The method further includes: Obtain a third linear programming task, wherein the third linear programming task includes multiple second programming constraints, and the multiple second programming constraints and the multiple first programming constraints have the same constraint type; Obtain the importance of each of the plurality of second planning constraints, wherein the updated importance of each first planning constraint is used as the importance of second planning constraints of the same constraint type; Based on the importance of each second planning constraint, the plurality of second planning constraints are sampled to obtain a fourth linear programming task, wherein the importance of each second planning constraint is used to determine the sampling probability of the second planning constraint, and the fourth linear programming task includes some of the second planning constraints among the plurality of second planning constraints; Solving the fourth linear programming task yields the third solution result; The third solution result is used as the initial value of the third linear programming task, and the initialized third linear programming task is solved to obtain the fourth solution result.

6. The method according to any one of claims 1 to 2, characterized in that, The second linear programming task includes M solution variables, and the first solution result includes the parameter values ​​of each solution variable; Using the first solution result as the initial value for the first linear programming task includes: The parameter values ​​of each solution variable in the first solution result are used as the parameter values ​​of the M solution variables in the first linear programming task.

7. The method according to any one of claims 1 to 2, characterized in that, After obtaining the second solution result, the method further includes: Obtain the second planning constraint, which includes slack variables and an upper bound for the slack variables; The second planning constraint is added to the first linear programming task to obtain an updated first linear programming task, and the updated first linear programming task is solved.

8. A task-solving apparatus, characterized in that, The device includes: The acquisition module is used to acquire a first linear programming task, the first linear programming task includes multiple first planning constraints, the first linear programming task is used to allocate scheduling resources for at least one task to be scheduled, the first planning constraints are constraints satisfied by the scheduling resources, and the scheduling resources are product production lines, product production equipment or product manufacturers; The importance of each of the plurality of first planning constraints is determined, whereby the importance represents the degree to which the first planning constraint contributes to reducing the solution time of the first linear programming task. A sampling module is used to sample the plurality of first planning constraints according to the importance to obtain a subset of the plurality of first planning constraints, wherein the importance is used to determine the sampling probability of the first planning constraints; Construct a second linear programming task based on a subset of the multiple first programming constraints; The solver module is used to solve the second linear programming task and obtain the first solution result; The first solution result is used as the initial value of the first linear programming task, and the initialized first linear programming task is solved to obtain the second solution result.

9. The apparatus according to claim 8, characterized in that, Both the first linear programming task and the second linear programming task include a planning objective.

10. The apparatus according to claim 8 or 9, characterized in that, The acquisition module is also used for: Obtain the first solution time for solving the second linear programming task, and the second solution time for solving the initialized first linear programming task; The solution module is also used to solve the first linear programming task to obtain a third solution time for solving the first linear programming task. The device further includes: An importance update module is used to update the importance of each first planning constraint based on the sum of the first solution time and the third solution time, relative to the degree of reduction of the first solution time, wherein the updated importance is positively correlated with the degree of reduction.

11. The apparatus according to claim 10, characterized in that, The acquisition module is also used for: Obtain the sampling time for sampling the plurality of first planning constraints; The importance update module is specifically used for: The importance of each first planning constraint is updated based on the sum of the first solution time, the third solution time, and the sampling time, relative to the reduction in the first solution time.

12. The apparatus according to claim 11, characterized in that, The acquisition module is also used for: Obtain a third linear programming task, wherein the third linear programming task includes multiple second programming constraints, and the multiple second programming constraints and the multiple first programming constraints have the same constraint type; Obtain the importance of each of the plurality of second planning constraints, wherein the updated importance of each first planning constraint is used as the importance of second planning constraints of the same constraint type; The sampling module is also used for: Based on the importance of each second planning constraint, the plurality of second planning constraints are sampled to obtain a fourth linear programming task, wherein the importance of each second planning constraint is used to determine the sampling probability of the second planning constraint, and the fourth linear programming task includes some of the second planning constraints among the plurality of second planning constraints; The solution module is also used for: Solving the fourth linear programming task yields the third solution result; The third solution result is used as the initial value of the third linear programming task, and the initialized third linear programming task is solved to obtain the fourth solution result.

13. The apparatus according to any one of claims 8 to 9, characterized in that, The second linear programming task includes M solution variables, and the first solution result includes the parameter values ​​of each solution variable; The solution module is specifically used for: The parameter values ​​of each solution variable in the first solution result are used as the parameter values ​​of the M solution variables in the first linear programming task.

14. The apparatus according to any one of claims 8 to 9, characterized in that, The acquisition module is also used for: After obtaining the second solution result, the second planning constraint is obtained, which includes slack variables and the upper bound of the slack variables; The solution module is further configured to add the second planning constraint to the first linear programming task to obtain an updated first linear programming task, and solve the updated first linear programming task.

15. A computer storage medium, characterized in that, The computer storage medium stores one or more instructions, which, when executed by one or more computers, cause the one or more computers to perform the operation of the method according to any one of claims 1-7.

16. A computer program product, characterized in that, Includes computer-readable instructions that, when executed on a computer device, cause the computer device to perform the method as described in any one of claims 1 to 7.

17. A task-solving system, comprising at least one processor, at least one memory, and at least one communication interface; wherein the processor, the memory, and the communication interface are connected via a communication bus and communicate with each other. The at least one memory is used to store code; The at least one processor is used to execute the code to perform the task solving method as described in any one of claims 1-7 to obtain a solution result; The at least one communication interface is used to communicate with a device or communication network to send the solution result to the device or communication network.

Citation Information

Patent Citations

  • Multi-dimensional constraint wind power plant current collection line automatic planning method

    CN110334391A

  • Multi-threaded constraint satisfaction solver

    US20190050225A1

Cited By

  • Job solving method and apparatus

    WO2023051505A1