Execution information generation method, electronic equipment, storage medium and chip system
The optimized preprocessing unit sequence is generated through machine learning, which solves the time delay problem caused by the full traversal strategy in existing solvers, and improves the solution efficiency and response speed.
Patent Information
- Application Number
- CN202310583839.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-22
- Publication Date
- 2024-11-22
AI Technical Summary
The existing solvers adopt a full traversal strategy in the preprocessing stage, resulting in invalid but time-consuming preprocessing units that delay the solution time and reduce the response speed.
Through machine learning, determine the transfer probability matrix of the target model, generate an optimized sequence of preprocessing units, reduce the execution of invalid preprocessing units, and improve the solution efficiency.
It effectively reduces the time consumption of the preprocessing stage and improves the response speed and solution efficiency of the solver.
Smart Images

Figure CN119003958A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an execution information generation method, electronic device, storage medium and chip system. Background Art
[0002] Many practical problems faced in real application scenarios, such as production scheduling, can be handled using planning models such as linear programming. For example, the production plan of the supply chain needs to meet the goals of maximizing factory demand and minimizing total cost, while meeting the constraints specified by the actual business scenario. The complex relationship between production variables, goals and constraints can be summarized as a linear programming model. By solving the linear programming model, production strategy information can be obtained, and then the production plan can be reasonably arranged to make the output more matched with demand, improve production efficiency, and avoid ineffective operations.
[0003] Solver is one of the tools for solving linear programming models. At present, some solvers use a full-traversal strategy as the execution process strategy in the preprocessing stage. For example, an open source solver will execute each preprocessing unit sequentially, and the number of rounds executed for each preprocessing unit is fixed. In actual applications, different application scenarios and different problems require different preprocessing units to be executed. This full-traversal strategy will result in the execution of some invalid but very time-consuming preprocessing units, delaying the solution time and reducing the solver's response speed. Summary of the invention
[0004] The present application provides an execution information generation method, electronic device, storage medium and chip system, which reduces the execution of invalid preprocessing units by optimizing the execution order of preprocessing units, saves the time consumed in the preprocessing stage, and thus improves the solution efficiency of the solver.
[0005] In the first aspect, the technical solution of the present application provides a method for generating execution information in the preprocessing stage of a solver, wherein the preprocessing includes executing N preprocessing units to simplify a target model, where N is an integer greater than 1, and the target model is constructed based on the problem to be solved in the application scenario, and the solver is used to solve the simplified target model; the method specifically includes: determining the transition probability matrix corresponding to the target model through machine learning; the elements in the transition probability matrix represent the probability that one of the multiple units transfers to the next unit; the multiple units include N preprocessing units; based on the transition probability matrix, a preprocessing unit sequence is generated; the preprocessing unit sequence is used to limit the execution order of at least one preprocessing unit. In this way, a corresponding preprocessing unit sequence is generated according to the transition probability matrix to obtain an optimized sequence, and the model simplification is performed according to the preprocessing sequence, which can reduce the execution of invalid preprocessing units, reduce the time consumed by the preprocessing process, improve the solution efficiency, and thus speed up the speed at which the solver responds to actual problems.
[0006] As a possible implementation method, determining the transition probability matrix corresponding to the target model includes: constructing a first bipartite graph corresponding to the target model; obtaining a first eigenvector based on the first bipartite graph; inputting the first eigenvector into a first neural network; and generating a first transition probability matrix based on the output of the first neural network. By constructing a bipartite graph of the target model and obtaining an eigenvector based on the bipartite graph, the relationship between each node in the target model can be extracted in the form of a bipartite graph structure and reflected in the eigenvector, thereby realizing the connection between the planning problem and the neural network.
[0007] As a possible implementation, the multiple units include 1 empty unit and N preprocessing units; based on the transition probability matrix, a preprocessing unit sequence is generated, including: selecting the first unit according to the N+1 probability values corresponding to the empty unit in the transition probability matrix; wherein the N+1 probability values corresponding to the empty unit are the probability values of the empty unit transferring to 1 empty unit and N preprocessing units respectively; when the first unit is an empty unit, an empty sequence is generated; when the first unit is a non-empty unit, selecting the i+1th unit according to the probability values of the N+1 elements corresponding to the ith unit; wherein the probability values of the N+1 elements corresponding to the ith unit are the probability values of the ith unit transferring to 1 empty unit and N preprocessing units respectively, 1≤i≤N; when the i+1th unit is an empty unit, stopping the sequence generation, and taking the sequence composed of the first i units as the preprocessing unit sequence. This implementation provides a feasible logical mechanism for generating a sequence based on a transition probability matrix. The empty unit is used as an end identifier. After its introduction, the neural network can learn the transfer relationship between each preprocessing unit and the end identifier, so that when there is no need to execute subsequent preprocessing units, the execution can be stopped in time, saving time.
[0008] As a possible implementation method, the i+1th unit is selected according to the probability value of the N+1 elements corresponding to the i-th unit, including: based on probability sampling, generating the i-th random probability value corresponding to the i-th unit; dividing [0, 1] into multiple intervals corresponding to the N+1 elements; determining the interval to which the i-th random probability value belongs as the sampling interval, and selecting the next unit pointed to by the element corresponding to the sampling interval as the i+1th unit. The selection method based on probability sampling can give each preprocessing unit an equal chance of being selected, and then in the training stage, it can fully learn based on the feedback brought by various sequences to avoid underfitting.
[0009] As a possible implementation, after generating the preprocessing unit sequence, the method further includes: when the currently generated preprocessing unit sequence is a non-empty sequence, executing the corresponding preprocessing units in sequence according to the execution order defined by the preprocessing unit sequence to simplify the target model. In this implementation, after providing the preprocessing unit sequence, a simplification service is also provided to meet the diverse needs of users.
[0010] As a possible implementation, after simplifying the target model, the method further includes: obtaining a second bipartite graph corresponding to the simplified target model; performing graph embedding through a graph neural network based on the simplified second bipartite graph to obtain a second eigenvector; inputting the second eigenvector into the first neural network; generating a second transition probability matrix based on the output of the first neural network; generating a second preprocessing unit sequence based on the second transition probability matrix; the second preprocessing unit sequence is used to limit the execution order of the preprocessing units in the second round of model simplification. The output of the preprocessing unit sequence is at least one round, and the output of multiple rounds of sequences can perform multiple rounds of simplification on the target model, and the simplification effect is more sufficient.
[0011] As a possible implementation, the method includes a training phase and an application phase; in the training phase, after obtaining the bipartite graph corresponding to the simplified target model, the method further includes: determining a first value according to the degree of simplification of the second bipartite graph compared to the first bipartite graph; determining the value of the first reward function according to the first value; back-propagating the value of the first reward function to the first neural network, and updating the parameters in the first neural network. The first reward function is equivalent to the feedback of the environment to the simplification action, through which the first neural network can determine the direction of parameter adjustment and then adjust the parameters.
[0012] As a possible implementation, after generating the preprocessing unit sequence, the method further includes: when the preprocessing unit sequence is an empty sequence, stopping the model simplification, and using a solver to solve the simplified target model. Providing a solution service can meet the user's solution needs.
[0013] As a possible implementation, in the training phase, after using the solver to solve the simplified target model, the method further includes: determining a second value according to the efficiency of the solver to solve the simplified target model; determining the value of the second reward function according to the second value; back-propagating the value of the second reward function to the first neural network, and updating the parameters in the first neural network. The second reward function is equivalent to the feedback of the environment for the entire solution action (including preprocessing), through which the first neural network can determine the direction of parameter adjustment and then adjust the parameters.
[0014] As a possible implementation, the first neural network includes an input layer, an output layer and at least two hidden layers.
[0015] As a possible implementation, the first neural network includes at least one of a multi-layer perceptron MLP, a fully connected neural network FCNN, a feed-forward neural network FNN, and a back propagation BP neural network. This implementation provides a practical specific network structure of the first neural network.
[0016] As a possible implementation method, machine learning includes reinforcement learning; the first neural network is deployed in the intelligent agent of reinforcement learning. The inventor found in the research process that the basic network architecture based on reinforcement learning to solve the MP problem has better actual training effect than other machine learning technologies. For specific effects, please refer to the specific implementation method of the specification.
[0017] As a possible implementation method, in the training phase of reinforcement learning, the deep reinforcement learning PPO algorithm is used for the training of the first neural network. The PPO algorithm training mechanism has better training effect than a single value mechanism or strategy mechanism.
[0018] In a second aspect, the technical solution of the present application also provides an electronic device for sending data through a data transmission interface, the electronic device comprising: one or more processors; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, which, when executed by the electronic device, enable the electronic device to execute a method as described in any one of the above-mentioned first aspects.
[0019] In a third aspect, the technical solution of the present application further provides a storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of the above-mentioned first aspects.
[0020] In a fourth aspect, the technical solution of the present application also provides a chip system, comprising: a communication interface for inputting and / or outputting data; a processor for executing a computer executable program so that a device equipped with the chip system executes a method as described in any one of the above-mentioned first aspects.
[0021] The execution information generation method, electronic device, storage medium and chip system provided in the embodiments of the present application use machine learning to obtain a transition probability matrix that can achieve good model simplification effect and / or solution efficiency for different models, and then generate a corresponding preprocessing unit sequence based on the transition probability matrix to obtain an optimized sequence. Model simplification is performed according to the pre-sequence, which can reduce the execution of invalid preprocessing units. Compared with the fixed execution order and number of execution rounds in the full traversal strategy, the solution proposed in the present application can further reduce the consumed time and improve the solution efficiency while ensuring the model simplification effect, thereby accelerating the speed at which the solver responds to actual problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is an example diagram of the LP solver solution process;
[0023] Figure 2 It is the presolve execution process in the solver in the related technology;
[0024] Figure 3 is an example diagram of a preprocessing process using a heuristic preprocessing operator selection based on expert experience in the related art;
[0025] Figure 4 is an example diagram of the system architecture of the method proposed in the embodiment of the present application;
[0026] Figure 5 It is a flowchart of the method proposed in the embodiment of the present application;
[0027] Figure 6 is an example diagram of determining a preprocessing unit sequence based on probability sampling in the method provided in an embodiment of the present application;
[0028] Figure 7 It is a bipartite graph of relations between Presolve operators of the open source solver Clp;
[0029] Figure 8 is an example diagram of the process of the method provided in the embodiment of the present application in the training stage;
[0030] Fig. 9 This is an example flow chart of the method provided in the embodiment of the present application in the deployment stage;
[0031] Fig.10 It is an example flow chart of the method provided in the embodiment of the present application integrating the training phase and the deployment phase;
[0032] Fig.11 This is an example of the Presolve operator transition probability matrix in the embodiment of the present application;
[0033] Fig.12 An example diagram for determining a sequence of preprocessing units based on a transition probability matrix;
[0034] Fig.13 An example diagram of a network architecture for reinforcement learning. DETAILED DESCRIPTION
[0035] In order to make the purpose, technical solution and advantages of the present application clearer, the technical solution of the present application will be clearly and completely described below in combination with the specific embodiments of the present application and the corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.
[0036] The terms used in the implementation section of this application are only used to explain the specific embodiments of this application and are not intended to limit this application.
[0037] The execution information generation method, electronic device, storage medium and chip system provided in the embodiments of the present application can be applied to multiple application scenarios in multiple technical fields such as industrial production, logistics planning, supply chain, medical care and cloud services. For example, they can be used to solve many practical problems such as supply chain production planning, capacity simulation, facility site selection with capacity constraints, and shipping inventory routing.
[0038] Engineering optimization problems are faced in various production operation scenarios. Various decision-making activities may involve resource allocation issues, which often require seeking engineering planning solutions with the greatest resource utilization efficiency or the lowest total cost under predetermined goals. Mathematical programming (MP) aims to solve the problem of maximizing or minimizing a certain goal under certain resource and condition constraints. MP is a tool for dealing with problems such as engineering optimization. It is a model constructed based on the complex relationship between variables, constraints and goals in actual application scenarios.
[0039] MP can be divided into many different branches, such as linear programming, nonlinear programming, multi-objective programming, dynamic programming, parameter programming, combinatorial optimization and mixed integer programming, stochastic programming, fuzzy programming, etc.
[0040] Among them, Linear programming (LP): When the constraints and objectives are linear relationships and all variables are continuous, the MP model is a linear programming LP model.
[0041] Mixed integer programming (MIP): When the constraints and objectives are linear and some variables have integer restrictions, the MP model is considered to be a mixed integer programming MIP model.
[0042] Linear programming is an important branch of optimization problems. Many practical problems faced in operational research can be solved using linear programming. For example, the production planning (or production scheduling) problem of the supply chain needs to meet the goals of maximizing factory demand and minimizing total cost, while meeting the hard and soft constraints specified by the actual business scenario. The model constructed based on these requirements of the production scheduling plan can be simplified into the following linear programming problem:
[0043] min c T x; Ax=b; x≥0.
[0044] Among them, x is the variable, A is the constraint matrix, b is the vector corresponding to the size of the number of constraints, and c is the vector corresponding to the size of the number of variables.
[0045] Linear programming has a wide range of applications in real production scenarios. For example, in the case of supply chain scheduling, in order to ensure timely delivery of customer needs, product manufacturers need to make reasonable decisions on the production plans of their internal products. Therefore, the scheduling problem is in the middle of Huawei's supply chain and at the end of the planning domain. On the one hand, it needs to connect and coordinate the uncertainties of various upstream plans, and on the other hand, it needs to take into account the limitations of downstream manufacturing and logistics, which plays a vital role.
[0046] Some manufacturing companies produce a variety of products in their pan-network (B-end) product lines, and the assembly relationships between the products are highly coupled, so that decisions for all items and all factories must be made jointly. The actual problem is usually a very large-scale multi-objective optimization problem, which aims to formulate production, transportation, delivery and other planning instructions within a period of time to achieve management indicators such as optimized demand delivery, cost, information technology outsourcing (Information Technology Outsourcing, ITO), production balance, and plan stability. During this period, the production rules, production capacity limits, raw material sets, and item substitutions of each factory and production line need to be considered. It can be seen that the production scheduling problem considers many constraints, and is therefore generally considered to be a typical large-scale linear programming problem.
[0047] In recent years, with the rapid increase in the complexity and scale of actual business scenarios, MP problems in some industries have become very large and complex, which has put forward new requirements for the tools used to solve the problems.
[0048] For example, the MP problem in the industry has the following difficulties:
[0049] 1) Large scale, often the scale of variables and constraints exceeds the order of millions, or even reaches the order of tens of millions.
[0050] 2) Time is short, often requiring output solutions within minutes.
[0051] 3) Fast changes. Not only the input data changes quickly, but also the iteration frequency of the model is high.
[0052] Generally speaking, it is generally believed that scale is one of the most basic difficulties in this technical field, because as the scale increases, it will increase the difficulty of solving other bottlenecks. Under this technical trend, new requirements are put forward for the solving performance of the solver.
[0053] Solver is a software package for solving MP problems. Solver is an information tool used to find the optimal solution among feasible solutions. It usually faces complex business scenarios with huge data volumes and many constraints. At present, solvers are mainly divided into two categories: commercial solvers and open source solvers.
[0054] LP solver is a software package for solving LP problems. MIP solver is a software package for solving MIP problems.
[0055] In addition to being directly modeled as LP problems (i.e., LP models), various problems in real application scenarios may also be built into other MP problems (i.e., MP models), such as MIP problems (MIP models). MIP problems can be relaxed into a series of LP problems for solution through techniques such as branch and bound. In a general solution process for MIP problems, the solution of LP problems is a crucial part of the overall solution of MIP. In addition, in addition to MIP problems, many optimization problem algorithms can be decomposed into a series of LP sub-problems and then solved one by one. Therefore, in a large number of real scenarios modeled as MP models, the solution of LP problems is an indispensable part.
[0056] Since the LP solver is an integral part of the MIP solver, commercial solvers are usually released as LP / MIP solvers. Generally speaking, in the embodiments of the present application, when the MIP solver is mentioned, unless otherwise specified, it can be understood that the MIP solver includes the LP solver.
[0057] From the perspective of the MIP solver itself, it has the following characteristics:
[0058] There are many open source software in the field of MIP solvers. The solving performance of open source software is unstable and there is a certain gap with some commercial solvers. In addition, open source solvers are sometimes difficult to adapt to MIP problems in real scenarios. Taking the common supply chain scheduling problem as an example, the average solving time of a native open source solver is more than 4 times that of a commercial solver.
[0059] In addition, the traditional test environment of the solver comes from public benchmark data, which is very different from the real production data. Benchmark problems have fewer variables and constraints, and are relatively easy to solve. In real industrial data, the model often has tens of millions of variables and constraints, and the constraint matrix is low-rank and ill-conditioned (mathematically unstable), which increases the difficulty of solving. Therefore, methods that can improve the performance of the solver are very necessary. If the complex original model can be effectively simplified, the number of variables and constraints can be reduced, and the complexity of the solution can be reduced, it will have a certain positive impact on improving the solver's solution performance.
[0060] For example, a known solver mentions Presolve and adding specific types of constraints. The current specific types of constraints will be directly recognized by the solver and can help improve the efficiency of the pre-solve module. Its essence is that the user identifies specific types of constraints and variables based on the characteristics of the model, reducing the complexity of solver identification. In addition, other solvers have also added the function of automatic parameter adjustment and put it in the scaling module. This module is considered to be part of the preprocessing, and its main function is parameter normalization.
[0061] It can be seen that to deal with the scale problem of the MP model, a feasible technical means is to preprocess the model to be solved. The role of preprocessing is to simplify the model and then solve it to reduce the complexity of the solution.
[0062] Taking the LP solver as an example, the LP solver usually integrates both the simplex method and the interior point method to solve problems in different scenarios. LP problems in real scenarios are usually large in scale and contain a large number of redundant variables and constraints. Simplifying the model through the Presolve module can effectively and significantly improve the efficiency of the simplex method or interior point method. Therefore, the Presolve module is an indispensable part of the solver.
[0063] See also Figure 1 , the solution process of preprocessing the LP solver may involve the following modules:
[0064] Preprocessing module (Presolve): The Presolve module is added before solving. Its main function is to simplify the model, such as performing variable simplification and constraint simplification, and returning an equivalent (or approximately equivalent within a given threshold) model that is more friendly to solving. The simplified model is the presolved model. Solving based on the presolved model can reduce the complexity of the solution.
[0065] Post-processing (Postsolve): After the solver obtains the solution of the presolved model, the solution of the presolved model needs to be restored to the solution of the original model through the Postsolve module.
[0066] Clean Up: If the presolved model is not completely equivalent to the original model, that is, the solution restored by the Postsolve module has not yet reached the optimal solution of the original model, the Clean Up module is required to perform additional iterative solutions to obtain the optimal solution of the original problem.
[0067] like Figure 1 As shown in the figure, the general solution process of the LP solver is:
[0068] The original problem (original model M) is simplified through the Presolve module, and the simplified model M' is the presolved model; then the solution phase is entered to obtain the optimal solution x' of the presolved model. After that, the optimal solution of the presolved model is converted into an optimal solution or approximate solution of the original problem through the Postsolve module. If the converted solution is not the optimal solution of the original problem, the Clean Up module is used to perform additional iterations to obtain the optimal solution of the original problem.
[0069] It should be noted that many commercial MIP solvers will perform product updates on the MIP Presolve module. The MIP Presolve module generally refers to the preprocessing operations performed before the MIP problem solves a series of LP problems. The preprocessing operator of this module generally takes into account the property that the variables are integers. In order to distinguish this module from the Presolve module in the LP solver, in the embodiment of the present application, the MIP Presolve module is referred to as the Node Presolve module. The NodePresolve module is generally used to reduce the scale of the problem, increase the number of initial root node integer variables, and identify, convert and process specific constraints, thereby reducing the algorithm complexity of subsequent branches. The preprocessing at this stage permanently changes the problem, that is, all LP subproblem solutions in the MIP solver are operated based on the model after processing at this stage.
[0070] The execution information generation method provided in most embodiments of the present application can be applied to the Presolve module (i.e. Figure 1 The Presolve module shown in FIG. 1 is equivalent to a technical improvement of the Presolve module. However, it is not excluded that the method can also be applied to other modules such as Node Presolve, and other embodiments can be obtained adaptively. The following is an exemplary description of the application to the Presolve module in the LP solver.
[0071] In commercial solvers or efficient open source LP solvers, the Presolve module is indispensable. It consists of many specific operators (units). Usually, the processing of the Presolve module adopts a common process, which performs different operator operations in sequence. The execution process can be summarized as follows: Figure 2 shown.
[0072] Specifically, after inputting the problem to be solved (i.e., the original unsimplified model), the Presolve module first executes some simple Presolve operators to simplify redundant variables and constraints, and then iterates some Presolve operators in a certain number of rounds and order.
[0073] For example, the Presolve module of an LP solver implements the following two functions:
[0074] 1. Delete redundant constraints and variables in the model, and tighten the upper and lower bounds of constraints and variables.
[0075] 2. If the model being solved has no feasible solution or the solution is unbounded, preprocessing can make a judgment in advance in some scenarios.
[0076] In some embodiments, the method proposed in the embodiments of the present application focuses on improving the preprocessing function 1. Therefore, it can be understood as studying how to select a combination process of preprocessing operators based on a scenario where the model has a feasible solution and the solution is bounded, so as to efficiently and effectively delete redundant constraints and variables of the model, and tighten the upper and lower bounds of the constraints and variables, thereby speeding up the solution process and reducing the overall time required.
[0077] Taking Clp (Coin-or linear programming) as an example, Clp is an open source linear programming solver. The execution of the preprocessing operator (i.e., Presolve operator) in its Presolve module is implemented through corresponding codes, and the order and number of rounds are relatively fixed. The specific operations of multiple Presolve operators in Clp are shown in Table 1.1 below:
[0078]
[0079] Table 1.1
[0080] Table 1.1 shows a total of 15 preprocessing operators. "make fixed", "test redundant", "dupcol", "twoxtwo" ... "duprow3" are the names of the preprocessing operators, and "Index" represents the index of each preprocessing operator. Short description briefly describes the operation performed by the corresponding preprocessing operator. Executing these preprocessing operators can simplify the variables and constraints in the model.
[0081] Taking the "make fixed" operator as an example, the operation it performs is: if the upper and lower bounds of the variables in the solved model are numerically equal, then these variables are fixed and the columns containing the changed values are deleted according to the fixed values.
[0082] It should be noted that in the embodiments of the present application, an operator is a computing unit, and therefore, the operator can also be referred to as a "unit". The Presolve operator is an operator used to simplify the model in the Presolve module. For example, the above Table 1.1 shows 15 different preprocessing operators, namely "make fixed", "testredundant", ... "duprow3". The preprocessing operator can also be referred to as a preprocessing unit.
[0083] During the research, the inventors found that commercial solvers or efficient open source solvers have the following characteristics in terms of the execution strategy of the Presolve module:
[0084] At present, the execution process strategy of the Presolve module of most solvers is the full traversal strategy. Different solvers will adopt different processing methods to speed up, and these processing methods also have their own problems:
[0085] Open source solvers: Generally, each operator is executed sequentially, and the number of rounds for each operator is fixed;
[0086] Commercial solver: Given default parameters or a manual parameter setting interface, sales staff can set parameters based on experience and execute various preprocessing operators according to relevant parameters;
[0087] Advanced methods for commercial solvers: different operators are combined based on heuristic methods, for example, see Figure 3 In the process shown, when selecting the preprocessing operator, the heuristic selection is mainly based on expert experience. In this way, the heuristic method is fixed and black-box, leaving only the interface for opening or closing the heuristic merging, which relies on manual experience and its reliability needs to be studied.
[0088] The inventors have found in their research that different problems require different Presolve operators, and the full traversal strategy commonly used in related technologies will result in the execution of some invalid but very time-consuming Presolve operators. This will extend the calculation time occupied by the preprocessing stage, slow down the solution speed, and affect the solution efficiency.
[0089] In addition, different Presolve operators influence each other, and the presolved models obtained according to different Presolve operator orders are very likely to be different, that is, due to the mutual influence between operators, the execution order of operators and the number of execution rounds of each operator may affect the degree of simplification of the model. Therefore, the above traditional execution strategies in a fixed order or heuristics may not achieve the most effective model simplification model, and the model simplification effect still has room for further improvement.
[0090] Therefore, how to better configure the execution process of different Presolve operators to complete the model simplification of the LP problem, on the one hand to improve the effectiveness of simplification, and / or, on the other hand to reduce the time consumption of the Presolve module, thereby improving the full-process solution performance of the LP problem, is a problem that needs to be solved in this technical field.
[0091] In view of this, an embodiment of the present application proposes a method for generating execution information in the solver preprocessing stage to solve the above-mentioned problem.
[0092] This method proposes a method that uses a neural network to learn the transition probability matrix from one Presolve operator to the next Presolve operator, and then generates an adaptive Presolve operator sequence based on the probability matrix, thereby replacing the traditional Presolve operator sequence with a fixed order and number of rounds.
[0093] For example, the method provided in the embodiment of the present application can be based on Figure 4 The system architecture shown is implemented.
[0094] The system architecture can be divided into a server and a client (user side). The server includes a first server for providing MP solver solution services, a second server for providing preprocessing services, an operations optimization platform for providing AI services, and a storage system for providing storage services.
[0095] Users can upload batch model data through terminal devices, and the server side can perform reinforcement learning model training on the batch model data together with the historical models stored in the operations optimization platform. After the data uploaded by the user is desensitized, it is stored on the operations optimization platform together with the model and solution result files used by the solver solution service in the first server, and managed by the operations optimization platform. In one embodiment, the storage system can be used as an auxiliary storage system of the operations optimization platform, and the entire system architecture can be deployed on the operations optimization platform, which provides data storage and management services.
[0096] Specifically, on the user side, the user uploads data of the actual problem to be solved in the application scenario through the terminal device. This part of data is also the data used to build the target model to be solved. The target model can be one of the MP models, such as the LP model.
[0097] In some embodiments, the construction of the target model can be performed in the terminal device on the user side, so the data uploaded by the user through the terminal device can be the constructed target model. In other embodiments, the construction of the target model is performed in the first server, the user uploads the data, and the first server constructs the corresponding target model according to the data uploaded by the user.
[0098] The first server is provided with a solver for solving the target model, and is used to provide a solving service. The solver is a software package for solving the target model, and the solver solves the target model after simplifying the target model. The second server is used to provide a preprocessing operator sequence. Before solving, the first server accesses the second server to obtain the preprocessing operator sequence.
[0099] In some embodiments, the method provided by the present application combines multiple machine learning techniques such as reinforcement learning, multi-layer perceptron (fully connected neural network), graph neural network, etc., and adopts a dynamic, multi-step cycle approach to train and predict the neural network during the training phase and application deployment phase. Therefore, the preprocessing service provided by the second server is a dynamic, multi-step preprocessing service based on probability graphs and suitable for solvers.
[0100] In some embodiments, the core process of the execution information generation method provided in the embodiments of the present application can be implemented based on the second server. The second server can be provided with a configuration management module and a training and deployment engine, wherein the training and deployment engine is used to train a neural network using the model uploaded by the user and the historical model as a training data set, and use the trained neural network to predict the transition probability matrix, and output a preprocessing operator sequence based on the transition probability matrix through probability sampling.
[0101] The configuration management module is used to provide an interface for adjusting various parameters of the training and deployment engines to make the training process more controllable.
[0102] The second server returns the preprocessing operator sequence (ie, the preprocessing unit sequence) to the first server, and the first server simplifies the target model according to the preprocessing operator sequence and solves the simplified model.
[0103] When the first server and the second server are in operation, the AI services provided in the operations optimization platform can be called, and various data generated by the first server, the second server and the operations optimization platform during operation can be stored in the storage system.
[0104] The first server and the second server may be implemented based on different independent servers or different server clusters. In other embodiments, the first server and the second server may be integrated into the same server or the same server cluster.
[0105] The operations optimization platform is a comprehensive platform that provides AI-related services. For example, the operations optimization platform can be ModelArts, which is a one-stop AI platform for developers. It provides massive data preprocessing and interactive intelligent annotation, large-scale distributed training, automated model generation, and on-demand deployment of end-edge-cloud models for machine learning and deep learning, assisting users in creating and deploying models and managing the full-cycle AI workflow.
[0106] The storage system may be a large-scale distributed storage system. Exemplarily, the storage system may be a storage system that provides an object storage service (OBS), which can be used by users to store data of any type and size.
[0107] The execution information generation method proposed in the embodiment of the present application effectively utilizes the mutual influence relationship between the Presolve operator and the Presolve operator, thereby providing an effective and efficient Presolve execution process, and the process is mainly divided into two parts: constructing a Presolve transition probability matrix and constructing a Presolve operator sequence based on the Presolve transition probability matrix.
[0108] In some embodiments, the method proposed in the embodiments of the present application can be applied to the Presolve module, which is equivalent to obtaining an improved Presolve module. The improved Presolve module can be used to replace the Presolve module in the existing LP solver to achieve more effective and efficient model simplification.
[0109] Specifically, see Figure 5 As shown, the execution information generation method proposed in the embodiment of the present application may include the following steps:
[0110] 501, determining a transition probability matrix corresponding to the target model through machine learning;
[0111] 502, generating a preprocessing unit sequence based on the transition probability matrix.
[0112] Before executing step 501, it is necessary to determine the target model. The target model is the original planning model to be simplified and constructed according to the problem to be solved in the application scenario. The target model can be any one of the MP models, such as the LP model, the MIP model, etc. The target model can be a historical model or a newly created model that has never been solved.
[0113] After determining the target model, it is necessary to construct a bipartite graph (also called a factor graph, bipartite graph) corresponding to the target model, and then generate feature vectors of each node based on the bipartite graph through representation learning.
[0114] In some embodiments, representation learning may specifically be based on a bipartite graph, performing graph embedding through a graph neural network to obtain a feature vector.
[0115] The feature vector is then input into the first neural network, and the first neural network outputs a transfer probability matrix.
[0116] The transition probability matrix is composed of multiple elements, each of which represents the probability of transferring from one unit to the next unit. That is, an element in the transition probability matrix represents the probability of executing the next unit after the current unit is executed. A unit is any one of the multiple units, and the multiple units include N preprocessing units.
[0117] A preprocessing unit can also be called a preprocessing operator or a Presolve operator. One unit is one operator. Multiple units are multiple operators. A preprocessing unit sequence, i.e. a Presolve operator sequence, is used to define the execution order of at least one preprocessing unit (Presolve operator).
[0118] The number of preprocessing units is N, that is, the Presolve module includes N preprocessing operators. The preprocessing process is to execute multiple preprocessing units in sequence according to the execution sequence of the preprocessing unit sequence, so as to simplify the target model. N is an integer greater than 1.
[0119] After determining the transition probability matrix, in some embodiments, probability sampling can be used to generate a corresponding preprocessing unit sequence according to the transition probability matrix. The probability sampling method can be simple random sampling, systematic sampling, stratified sampling, etc.
[0120] Specifically, in some embodiments, an empty operator (empty cell) is introduced, the above-mentioned multiple cells include 1 empty cell and N pre-processing cells, and the transition probability matrix includes N+1 elements corresponding to the empty cell, which represent the probability values of the empty cell being transferred to 1 empty cell and N pre-processing cells respectively. In the transition probability matrix, the probability values of the N+1 elements corresponding to the i-th cell are the probability values of the i-th cell being transferred to 1 empty cell and N pre-processing cells respectively, 1≤i≤N.
[0121] In this case, step 502 may specifically include the following operations:
[0122] According to the N+1 probability values corresponding to the empty cells in the transition probability matrix, the first cell is selected; when the first cell is an empty cell, an empty sequence is generated; when the first cell is a non-empty cell, the i+1th cell is selected according to the probability values of the N+1 elements corresponding to the i-th cell; when the i+1th cell is an empty cell, sequence generation is stopped and the sequence composed of the first i cells is used as the preprocessing cell sequence.
[0123] Among them, according to the probability value of the N+1 elements corresponding to the ith unit, the i+1th unit is selected, and the i-th random probability value corresponding to the i-th unit can be generated based on probability sampling; then [0, 1] is divided into multiple intervals corresponding to the N+1 elements; according to the interval in which the i-th random probability value falls is defined as the sampling interval, the next unit pointed to by the element corresponding to the sampling interval is selected as the i+1th unit.
[0124] For example, suppose N is 2, and the ith cell corresponds to 3 elements, P i 0 , P i 1 and P i 2 , the probability values are 0.1, 0.3 and 0.6 respectively, which means that the probability of the i-th unit transferring to the empty unit is 0.1, the probability of transferring to the first unit is 0.3, and the probability of transferring to the second unit is 0.6. Figure 6 As shown, these three elements divide [0,1] into three intervals, namely [0,0.1) [0.1,0.4) [0.4,1). Then, using simple random sampling, a probability value is randomly generated. Assuming that the randomly generated probability value is 0.7, the interval where 0.7 falls is [0.4,1), then this interval is the sampling interval, and the corresponding element is P i 2 , P i 2 The next unit pointed to is the second unit, and the second unit is the i+1th unit. Figure 6 The three elements shown are only for illustrative purposes. In actual application scenarios, the number of elements may reach dozens, hundreds, or even thousands.
[0125] It should be noted that Figure 5 In the process shown in , operations such as constructing a target model, simplifying, and solving are only for auxiliary explanation and are not essential technical features of the method provided in the embodiment of the present application. Figure 4 It can be seen from the system architecture shown that step 501 and step 502 can be implemented based on an independent execution entity (i.e., the second server), and operations such as model simplification and solution may not be performed in the execution entity, so simplification and solution operations are not necessary technical features. In other words, the method composed of step 501 and step 502 can be provided to users as an independent service or in the form of an independent product.
[0126] For example, the method provided in the embodiment of the present application can be transformed into an online service, which receives data provided by the user, outputs a preprocessing unit sequence based on the method provided in the embodiment of the present application, and provides feedback to the user. That is, the method can be a software product that provides a preprocessing unit sequence, is compatible with commercial solvers or open source solvers, and solves user needs by collaborating with commercial solvers or open source solvers.
[0127] In some embodiments, after the preprocessing unit sequence is generated, when the currently generated preprocessing unit sequence is a non-empty sequence, the corresponding preprocessing units are executed in sequence according to the execution order defined by the preprocessing unit sequence to simplify the target model.
[0128] During the training phase, Figure 5 As shown, after simplifying the target model, the function value of the first reward function is calculated according to the degree of simplification, and back-propagated to the first neural network to update the parameters of the first neural network according to the value of the first reward function.
[0129] In order to avoid confusion and to provide a clear description, in the embodiment of the present application, the reward function corresponding to the simplification operation is defined as the first reward function; the reward function corresponding to the solution operation is defined as the second reward function.
[0130] Specifically, the first reward function is determined according to the degree of change of the bipartite graph of the target model before and after simplification. After performing a round of simplification on the target model, the bipartite graph corresponding to the simplified target model is reconstructed. In order to prevent confusion, the bipartite graph after performing a round of simplification is defined as the second bipartite graph, and the bipartite graph before simplification is defined as the first bipartite graph. The first value is determined according to the degree of simplification of the second bipartite graph compared with the first bipartite graph.
[0131] The first value is a quantitative value indicating the degree of simplification. For example, the first value may be the ratio, difference, etc. between the number of edges and nodes in the second bipartite graph and the number of edges and nodes in the first bipartite graph, or the proportion of the number of deleted nodes and edges to the original total number of edges and nodes, etc. The first value is an independent variable of the first reward function.
[0132] Exemplarily, in a feasible solution, the first reward function may be the difference between the model scale (e.g., the number of non-zero elements in the constraint matrix) before and after the simplification operation. That is, the first value may be the difference between the model scale (e.g., the number of non-zero elements in the constraint matrix) before and after the simplification operation, and the first reward function is equal to the first value.
[0133] It should be noted that after the first round of model simplification is executed, if the preprocessing unit sequence generated in the first round is not empty, then the next round of simplification operation will be repeated based on the current simplified model.
[0134] For example, the second round of operations is as follows:
[0135] Obtain a second bipartite graph corresponding to the simplified target model; perform graph embedding through a graph neural network based on the simplified second bipartite graph to obtain a second eigenvector; input the second eigenvector into the first neural network; generate a second transfer probability matrix based on the output of the first neural network; generate a second preprocessing unit sequence based on the second transfer probability matrix; the second preprocessing unit sequence is used to limit the execution order of the preprocessing units in the second round of model simplification.
[0136] To avoid confusion, the eigenvector, transfer probability matrix, and preprocessing unit sequence in the first round of operation are defined as the first eigenvector, the first transfer probability matrix, and the first preprocessing unit sequence, respectively. Correspondingly, the corresponding definitions in the second round of operation are defined as the second eigenvector, the second transfer probability matrix, and so on.
[0137] The above is only an explanation of the first two rounds of operations. In the actual operation process, at least one round of model simplification operations can be performed. In each round of operation, based on the bipartite graph of the current model (which may be the model after the previous round of simplification), the feature vector is extracted and input into the first neural network, and then a new preprocessing unit sequence is generated according to the output transition probability matrix, and a new round of simplification operations is performed according to the new preprocessing unit sequence, and the first reward function value of this round is fed back to the first neural network to update the parameters. In this way, the loop is executed in multiple steps until the generated preprocessing unit sequence is an empty sequence, and the model simplification is stopped. Then enter the solution link, and use the solver to solve the simplified target model.
[0138] It should be noted that the method provided in the embodiment of the present application involves multiple neural networks, among which the first neural network specifically refers to a neural network that takes a feature vector as input and directly or indirectly outputs a transfer probability matrix.
[0139] In some embodiments, the first neural network includes an input layer, an output layer, and at least two hidden layers.
[0140] The first neural network can be a multilayer perceptron (MLP), a fully connected neural network (FCNN), a feedforward neural network (FNN), or a back propagation (BP) neural network. The definitions of MLP, FCNN, FNN, and BP neural networks may overlap, for example, the first neural network may be both MLP and FCNN.
[0141] Updating the parameters of the first neural network may be updating connection weights and biases.
[0142] As mentioned above, when the generated preprocessing unit is an empty sequence, the solution phase is entered. In some embodiments, in the training phase, after the simplified target model is solved by the solver, the second value is determined according to the solution efficiency of the solver for solving the simplified target model. The second value is a quantitative value representing the solution efficiency. For example, the solution efficiency can be directly expressed by the solution time. The second value can be a value obtained based on the solution time, for example, it can be the value of the solution time or the ratio of a predetermined constant to the solution time.
[0143] The second value is an independent variable of the second reward function, and the value of the second reward function can be calculated according to the second value. The value of the second reward function is back-propagated to the first neural network to update the parameters in the first neural network.
[0144] Exemplarily, in a feasible solution, the second reward function may be the total time used to solve the problem (target model), where the total time is the sum of the time used for each simplification step plus the time required for solving the problem after simplification. That is, the second value is the total time for solving the problem, and the second reward function is equal to the second value.
[0145] It should be noted that the back propagation of the first reward function value and the back propagation of the second reward function value are in an and / or relationship, that is, only one of them can be executed, or both can be executed.
[0146] In some embodiments, the value of the first reward function may be fed back to the first neural network only after the model simplification is performed, without feeding back the value of the second reward function to the first neural network. In this embodiment, the first neural network is trained only according to the degree of model simplification. Then, the neural network obtained under this training method, based on the sequence of preprocessing units generated by it, will at least achieve positive effects in terms of the degree of model simplification.
[0147] In another embodiment, only the value of the second reward function may be back-propagated to the first neural network, without feeding back the value of the first reward function to the first neural network. This training method aims to improve the efficiency of solving problems, and the solving performance will be significantly improved;
[0148] In another embodiment, both the value of the first reward function and the value of the second reward function may be fed back. With this training method, both the model simplification effect and the solution performance are improved.
[0149] The method provided in the embodiment of the present application aims to continuously learn the potential impact of the execution order of preprocessing operators on the model simplification effect and / or model solution efficiency through machine learning, such as through a neural network, and obtain an optimized execution order that can obtain a better model simplification effect and / or solution efficiency through training. The execution order is determined based on a transition probability matrix, and the transition probability matrix is obtained through machine learning.
[0150] The effect of the execution order of preprocessing operators on the simplification effect or solution efficiency can also be understood from another perspective as the influence of the mutual influence and relationship between preprocessing operators on the simplification effect or solution efficiency.
[0151] For example, taking the LP solver as an example, the relationship between the various Presolve operators in the LP solver is different and can be summarized into the following two categories:
[0152] After a Presolve operator is executed, if the model is effectively simplified, the effectiveness of some Presolve operators may be stimulated. The degree of stimulation of these Presolve operators that may be stimulated may also vary, and some stimulated Presolve operators can simplify the model more effectively.
[0153] After a Presolve operator is executed, no matter whether the model is effectively simplified or not, the validity of some Presolve operators can never be activated. These Presolve operators that cannot be activated are placed behind the Presolve operator, which cannot simplify the model but will consume time.
[0154] The solution provided in the embodiment of the present application effectively utilizes the mutual influence relationship between Presolve operators, thereby improving the processing performance of the Presolve module.
[0155] Specifically, taking the open source solver Clp as an example, this LP solver contains the 15 Presolve operators listed in Table 1.1. The relationship between these Presolve operators can be expressed as Figure 7 The bipartite graph representation of .
[0156] The two subsets in the bipartite graph are the effects set and the activation conditions set:
[0157] In the effects collection, the effects of each Presolve operator on the model are divided into the following three categories:
[0158] a) Reduce constraints: Operator operations remove constraints. For example, the operators with indexes 1, 3, 4, 5, 6, 7, and 14 in Table 1.1 can be classified as reduce constraints.
[0159] b) Fix variables: Operator operations will fix variables and delete columns. For example, the operators with index 0, 2, 8, 10, 11, and 12 in Table 1.1 can be classified as fix variables.
[0160] c) Tight bounds: Operator operations tighten the upper and lower bounds. For example, the two operators with index 9 and 13 in Table 1.1 can be classified as tight bounds.
[0161] In the activation conditions set, the activation conditions for each Presolve operator execution are divided into the following four categories:
[0162] a) Bounds comparison: Operator activation requires comparison of upper and lower bounds; for example, the operators with index 0, 1, 6, 9, and 12 in Table 1.1 can be classified as bounds comparison.
[0163] b) Column coefficients: Operator activation is related to the coefficients of the columns; for example, the two operators with index 2 and 8 in Table 1.1 can be divided into column coefficients.
[0164] c) row coefficients: Operator activation is related to the coefficients of the row; for example, the three operators with index 4, 5, and 14 in Table 1.1 can be divided into row coefficients.
[0165] d) Non-zero entries: Operator activation is related to the number of non-zero entries in the row and column. For example, the five operators with indexes 3, 7, 10, 11, and 13 in Table 1.1 can be classified as non-zero entries.
[0166] exist Figure 7 In the graph, if there is an edge connecting the classes in the effects set and the classes in the activation conditions set, it means that the operation of the operators in the effects class will activate the operators in the connected activation conditions class. Therefore, the bipartite graph reflects the mutual influence relationship between the various Presolve operators:
[0167] If there is no edge between the effects class and the activation conditions class, the Presolve operator in the effects class can never activate the Presolve operator of the connected activation conditions class, so the transition probability is 0;
[0168] If there is an edge between the effects class and the activation conditions class, the Presolve operator in the effects class may activate a Presolve operator in the connected activation conditions class. Therefore, the embodiment of the present application proposes to use machine learning to learn the transition probability, thereby reflecting the degree of such activation.
[0169] like Figures 8 to 10 As shown, exemplarily, the execution information generation method provided in the embodiment of the present application can be divided into two stages: an offline training stage and an online deployment stage.
[0170] In the offline training phase, it is responsible for offline training of the neural network. In the online deployment phase, it is responsible for using the trained neural network to predict the transition probability matrix of the Presolve operator and deploy it in the solver for use.
[0171] First, combine Figure 8 As shown, the operation logic of the training phase is briefly explained first:
[0172] In the offline training phase, a dynamic multi-step sequence generation method is used, as follows:
[0173] Select the historical model Hi.
[0174] The transition probability matrix P is generated by the first neural network, thereby generating the Presolve operator sequence S. If S is an empty sequence, the Presolve module is terminated and the solution module is entered. After the solution is completed, the reward function (second reward function) corresponding to the model solution efficiency is returned to update the model parameters of the first neural network.
[0175] If S is a non-empty sequence, the Presolve module is entered to simplify the model, and the model Hi is updated to the simplified model Hi'. At the same time, the reward function (first reward function) corresponding to the degree of model simplification is returned, thereby updating the model parameters of the first neural network.
[0176] The process of outputting the transition probability matrix, generating the preprocessing unit sequence, and simplifying the model is repeated in a loop until the generated sequence is an empty sequence, the Presolve module terminates, and the solution module is entered.
[0177] Next, combine Fig. 9 As shown in the figure, the operation logic of the deployment phase (application or testing phase) is briefly explained:
[0178] Assume that the target model to be solved is M.
[0179] Generate the transition probability matrix P through the first neural network, and then generate the Presolve operator sequence S. If S is an empty sequence, terminate the Presolve module and enter the solution module; if S is a non-empty sequence, enter the Presolve module to simplify the model. Update the model M' to the simplified model.
[0180] The process of outputting the transition probability matrix, generating the preprocessing unit sequence, and simplifying the model is repeated in a loop until the generated sequence is an empty sequence, the Presolve module terminates, and the solution module is entered.
[0181] Combine the following Fig.10 , integrating the training phase and the deployment phase, and giving a specific implementation example to elaborate on the corresponding process. Taking the LP solver as an example, the specific process can be as follows:
[0182] During the offline training phase:
[0183] T1, collect historical LP model files and construct training data sets.
[0184] For example, a historical model Hi is selected as a model used in the training phase, and a corresponding training data set is constructed. The model used in the training phase may be a historical model.
[0185] The process of constructing a training data set includes constructing a bipartite graph corresponding to the target model, and then obtaining a feature vector of the target model in the current state according to the bipartite graph, and the feature vector can be directly input into the first neural network. Exemplarily, constructing a bipartite graph corresponding to the target model, and then obtaining a feature vector of the target model in the current state according to the bipartite graph, can specifically include the following process:
[0186] First, the simplified linear programming problem at the current time point (the simplified LP model) is extracted, and the linear programming problem is equivalently represented using a bipartite graph.
[0187] The nodes on one side of the bipartite graph are the constraints (rows) of the linear programming, and the nodes on the other side are the variables (columns) of the linear programming. The characteristics of the constraint nodes include the upper and lower bounds of the constraints; the characteristics of the variable nodes include the upper and lower bounds of the variables, as well as the weight of the variable in the objective function of the linear programming. The edge connecting the constraint node and the variable node represents that the value of the constraint matrix of the linear programming problem in this row and column is non-zero, and the weight on the edge represents the specific value of the constraint matrix in this row and column.
[0188] Then, various structural features of the bipartite graph are counted and converted into feature vectors. Exemplarily, in one embodiment, 18 structural features of the bipartite graph are counted (see Table 1.2 below), and Table 1.2 shows the 18 bipartite graph structural features used by the Presolve module. Using these specific structural features, after normalization, a vector of fixed length is formed as the state vector (i.e., feature vector) of the LP model at that moment.
[0189]
[0190] Table 1.2
[0191] T2, passes the feature vector to the first neural network and outputs the transfer probability matrix.
[0192] The input of the first neural network is a feature vector, but the output of the first neural network may not be in matrix form. Therefore, it is necessary to construct a transfer probability matrix based on the output data, that is, to organize the output data, filter the row data or column data of the matrix, and then form a corresponding matrix.
[0193] T3, through probability sampling, generates a preprocessing unit sequence (Presolve operator sequence) according to the transition probability matrix.
[0194] In some embodiments, the preprocessing unit sequence can be composed of index values of multiple Presolve operators to be executed. Taking the multiple Presolve operators shown in Table 1.1 as an example, the preprocessing unit sequence is (3, 5, 8, 9, 13), which means that the five preprocessing operators named "twoxtwo", "gubrow", "tighten action", "remove dual" and "slack singleton" are executed in sequence.
[0195] T4, the LP solver executes each preprocessing unit (Presolve operator) in sequence according to the preprocessing unit sequence to simplify the model.
[0196] After the model is simplified, the first reward function of the degree of model simplification is calculated and fed back to the first neural network.
[0197] It should be noted that, in some embodiments, each time a preprocessing unit sequence is generated, that is, after a round of model simplification is completed, the value of the first reward function is calculated once and fed back to the first neural network to update its parameters;
[0198] In another embodiment, after executing multiple rounds of model simplification, that is, when the generated preprocessing unit sequence is an empty sequence, the value of the first reward function of the model simplification is calculated and fed back to the first neural network.
[0199] The first neural network updates its own model parameters according to the value of the first reward function, for example, updating the edge coefficients and biases of the edges connecting neurons.
[0200] T5, the above step 4) is repeated in a loop until the generated preprocessing unit sequence is an empty sequence.
[0201] After a round of model simplification, the bipartite graph is regenerated based on the simplified model, and the eigenvectors of its various nodes are obtained and passed to the first neural network again to generate a new transition probability matrix distribution, thereby generating a new Presolve operator sequence (i.e., preprocessing unit sequence); the LP solver simplifies the model again according to the new Presolve operator sequence, and calculates the first reward function for feedback, or, after all preprocessing operator sequences are executed, calculates the first reward function and feeds back.
[0202] In the figure, the historical model Hi is simplified to obtain the model Hi'. After the simplification process is completed, the LP solver stops the preprocessing module and enters the subsequent solution module to calculate the second reward function of the model solution efficiency and feed it back to the neural network for training. That is, the Presolved model of Hi is solved and the value of its second reward function is evaluated.
[0203] Online deployment phase (application or testing phase):
[0204] A1, deploy the first trained neural network online;
[0205] A2, after the target model is input into the solver, the solver generates the problem to be solved, that is, the feature vector corresponding to the target model, and passes it to the trained first neural network to generate a transition probability matrix;
[0206] A3, based on the transition probability matrix, generate the Presolve operator sequence;
[0207] A4, the LP solver simplifies the model according to the Presolve operator sequence.
[0208] A5, based on the simplified model, generates its corresponding feature vector, passes it to the trained first neural network again, generates a new transition probability matrix, and thus generates a new Presolve operator sequence; the LP solver simplifies the model again based on the new Presolve operator sequence.
[0209] A6, repeat the above steps A4-A5 until the generated Presolve operator sequence is an empty sequence. The LP solver stops the preprocessing module and enters the subsequent solution module to obtain the optimal solution of the model.
[0210] It should be noted that the numbers before the above steps, such as T1-T5, A1-A6, etc., are only for the convenience of distinguishing different steps to make the logic clearer, and these step numbers are not used as a limitation on the execution sequence of the steps.
[0211] Several specific embodiments are listed below to illustrate all or part of the solutions provided in the embodiments of the present application.
[0212] In one embodiment, the number of Presolve units owned by the LP solver is set to A, that is, N=A, and these operators are marked as {1, 2, ..., A} in a certain order.
[0213] It should be noted that different solvers may have different types and numbers of Presolve operators. The above Table 1.1 is only an example. The value of A depends on the actual number of Presolve operators in the solver.
[0214] Empty cells are introduced and marked as 0. When the Presolve sequence selects an empty operator, the sequence generation is stopped. It should be noted that, in this embodiment, the preprocessing unit sequence does not include empty cells.
[0215] Exemplarily, in this embodiment, the transition probability matrix between the constructed Preosolve operators can be as follows: Fig.11 As shown. Among them, the element P in the matrix j i Represents the transition probability from Presolve operator j to Presolve operator i, that is, after executing Presolve operator j, the probability that the next operator to be executed is Presolve operator i.
[0216] It is worth noting that P0 i represents the probability that operator i is the starting operator (the first operator) of the sequence, and P j 0 Represents the probability that the Presolve operator j is the sequence termination operator (the last operator).
[0217] Next, based on Fig.11 The transition probability matrix shown in Figure 2 constructs the Presolve operator sequence, as Fig.12 As shown:
[0218] First, according to the probability distribution (P0 0 , P0 1 , ..., P0 A ) Generate the starting operator:
[0219] If the starting operator is 0, it is an empty sequence, the Presolve module terminates, and enters the solution module; if the generated starting operator is not 0, the generated starting operator is set to i1.
[0220] Then, according to the probability distribution Generate the second operator:
[0221] If the generated operator is 0, stop generating the sequence and enter the Presolve module with the current sequence {i1} to simplify the model; if the generated operator is not 0, set the generated operator to i2.
[0222] More generally, suppose that the sequence {i1, i2, ..., i j}, according to the probability distribution Generate the j+1th operator: If the generated operator is 0, stop generating the sequence and continue with the current sequence {i1, i2, ..., i j} Enter the Presolve module to simplify the model; if the generated operator is not 0, set the generated operator to i j+1 , and loop to generate the next operator until the generated operator is 0, and stop generating the sequence.
[0223] It should be noted that what is generated in the sequence are the names, indexes or IDs of the operators, not the operators themselves. j} j etc. all represent the ID or index of the operator. During execution, the solver will search for the corresponding operator based on the index or name in the sequence and perform the specific operation of the operator.
[0224] It should be noted that the dynamic multi-step operator sequence generation method is adopted in both the training state and the deployment state. Among them, in the preprocessing module, model simplification is performed dynamically in multiple rounds, that is, a preprocessing operator sequence is generated in one round, model simplification is performed once, and then the next round of sequence is generated, and the next round of model simplification is performed. In this way, multiple steps are dynamically simplified step by step, and the number of Presolve operators executed in each round is dynamically adjusted. This mechanism avoids the disadvantages of time-consuming training and deployment caused by executing only one Presolve operator in each round, and avoids the disadvantage of insufficient model simplification caused by generating a Presolve sequence solution through a neural network at one time.
[0225] The embodiments of the present application propose an LP solver Presolve framework for dynamic multi-step operator sequence generation based on probability graphs. Exemplarily, in some embodiments, the solver Presolve framework can be deployed in a neural network architecture for reinforcement learning.
[0226] However, it should be noted that the application to reinforcement learning is only an exemplary description, and does not exclude the method proposed in the embodiment of the present application (LP solver Presolve framework for dynamic multi-step operator sequence generation based on probability graph), which can also be applied to other network architectures. Therefore, regardless of the basic network architecture or the specific reinforcement learning strategy adopted, the generation of Presolve operators based on the distribution of the Presolve operator transition probability matrix or the dynamic multi-step generation of Presolve sequences are all within the scope of protection of this application.
[0227] The following is an example of reinforcement learning:
[0228] See also Fig.13 As shown in the figure, the reinforcement learning framework is divided into three parts: LP Solver, Presolve Agent, and PPOTrainer. Among them, the first neural network is deployed in the Presolve Agent, and the above method can be implemented based on the Presolve Agent.
[0229] LP Solver: Linear programming solver, used to read the linear programming model, select the presolve operator according to the action passed by the Presolve Agent, and perform the solution operation;
[0230] Presolve Agent: Preprocessing agent, used to obtain the current state from LP Solver, then transform the feature vector based on the current state, pass it into the first neural network, output the probability transfer matrix of the presolve operator, and then extract the presolve operator sequence to be executed next and pass it to LP Solver. At the same time, Presolve Agent will also obtain the reward after the last action is executed from LPSolver, thus forming a <state, action, reward> sequence, which is used to update the parameters of the first neural network later.
[0231] Exemplarily, the first neural network may be Fig.13 The MLP actor shown in .
[0232] PPO Trainer: Use the Proximal Policy Optimization (PPO) algorithm to update the neural network parameters based on the <state, action, reward> sequence collected by the Presolve Agent. The PPO algorithm is also called Proximal Policy Optimization (PPO).
[0233] These three modules work together to train the first neural network that meets the expected requirements based on the input model set.
[0234] It should be noted that the bipartite graph in part a) of the Presolve Agent represents a bipartite graph. The bipartite graph here is not the relationship bipartite graph between the preprocessing operators, but the bipartite graph corresponding to the target model. The bipartite graph is converted from the probability graph of the target model. Part a) performs the representation learning process, extracts features based on the bipartite graph corresponding to the target model, and obtains the feature vector of each node, where f1, f2, ... f N is the feature vector.
[0235] exist Fig.13 In the Tx|L≤Ax≤U,l≤x≤u} is the linear programming model (target model), input is input, presolve is preprocessing, LP solve is LP solving, output is output, continue means continue, routine means routine, execute means execution, and record data means record data. bipartite graph is a bipartite graph, feature vector means feature vector, action means action, extract features means extract features, MLPactor is a multi-layer perceptron (first neural network), inference probabilities means reference probability, that is, transition probability matrix;
[0236] probabilities P represents probability P, actions a represents action a. clipped ratios represents clipping ratios, advantages represents the update amplitude in the gradient direction, entropies represents entropy, MLP critic represents multi-layer perceptron evaluation network, evaluation represents evaluation network, α and θ in Jv(α) and Jπ(θ) represent parameters to be updated, update represents update, and backpropagation is backpropagation.
[0237] Based on the reinforcement learning framework, the specific implementation process may include:
[0238] The solver collects data problem instances and stores them in an instance set; trains the first neural network and deploys the trained first neural network online.
[0239] After the deployment of the Presolve module is completed online, graph embedding representation extraction is performed: the solver generates a graph-based problem description and uses a graph neural network to extract the graph embedding representation.
[0240] Then, the Presolve module executes: outputting the transition probability matrix through the first neural network (MLP actor) to obtain the Presolve operator sequence for model simplification. If the model is effectively simplified, the simplified model is re-input into the neural network loop for model simplification until the Presolve operator sequence obtained by inference is empty and the model cannot be simplified.
[0241] Enter the solution phase and complete the solution. After the solution, complete the feasibility judgment and check the solution quality from multiple dimensions.
[0242] In summary, the embodiment of the present application proposes a solver preprocessing framework based on a probability graph, each time selecting the next execution operator according to the last executed preprocessing operator and the probability transfer matrix between operators, and setting a virtual operator as the stop condition of preprocessing. The Presolve framework does not need to set any hyperparameters related to the sequence and the number of rounds, and effectively utilizes the relationship between the Presolve operators that influence each other. At the same time, it can be separated from the neural network for lightweight deployment.
[0243] In addition, this preprocessing mechanism adopts a dynamic multi-step operator sequence generation method. Each time the neural network outputs the operator probability transfer distribution according to the current model, it samples a preprocessing operator sequence for execution. In this way, the purpose of reducing the number of interactions with the neural network (reducing network overhead) is achieved, while ensuring the effectiveness and efficiency of the Presolve module deletion.
[0244] The present application also provides an electronic device, which may include: a processor; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions. When the instructions are executed, the electronic device may perform a method as described in any one of the above embodiments.
[0245] An embodiment of the present application further provides a storage medium, comprising computer instructions, which, when executed on an electronic device, enables the electronic device to execute a method as described in any one of the above embodiments.
[0246] An embodiment of the present application also provides a chip system, including: a communication interface for inputting and / or outputting data; a processor for executing a computer executable program so that a device equipped with the chip system executes a method as described in any one of the above embodiments.
[0247] The following is a description of the technical effects that can be achieved by the solution provided in the embodiments of the present application by combining several practical application scenario examples:
[0248] Application scenario 1: Multi-factory production scheduling problem
[0249] The production scheduling problem is one of the core issues in the field of supply chain management. The following data comes from real industrial scenarios of enterprises. From the perspective of model building, the production scheduling problem is a typical large-scale, multi-objective, sparsely constrained, and multi-variable allocation problem. The input of this problem is the user's order demand and existing processing resources, such as raw materials, production capacity, etc. The output is a processing production plan arranged according to the order demand, such as processing volume, transportation volume, delivery volume, etc. The expected output result is to minimize processing costs, processing time, and maximize order fulfillment rate, that is, to deliver customer needs on time and in quantity. And all constraints need to be met, for example, the material assembly relationship needs to be met.
[0250] Technical effect comparison:
[0251]
[0252] Table 2.1
[0253] Please refer to Table 2.1, which shows the solution provided by the embodiment of the present application, which cooperates with the self-developed solver (such as Tianchou solver) to serve the supply chain in the real industrial scenario to solve the online effect of multi-factory production scheduling problem:
[0254] Multi-factory production scheduling engine-small: When the Presolve method based on expert experience (i.e., the default strategy in Table 2.1) is used for solving, the average solution time for the production scheduling problem of the entire data set is 5.45 seconds (i.e., end-to-end time); while using the solution provided by the embodiment of the present application (i.e., Online Presolve in Table 2.1) for solving, the average solution time for the entire data set is reduced to 3.24 seconds, saving 40% of the time and greatly improving the solution efficiency. Among them, small represents a small-scale production scheduling engine.
[0255] Multi-factory production scheduling engine-medium (testing generalization): The neural network (first neural network) trained using the multi-factory production scheduling engine-small data set was deployed on the multi-factory production scheduling engine-medium, and a generalization test was performed. The test results show that when the preprocessing method based on expert experience (i.e., the default strategy in Table 2.1) is used for solving, the average solution time for the production scheduling problem of the entire data set is 36.4 seconds (end-to-end time); after using the solution provided in the embodiment of the present application, the average solver of the entire data set is reduced to 25.9 seconds, achieving a 29% optimization.
[0256] In order to verify the universality of the method of the embodiment of the present application, the same comparative test was continued on the open source solver Clp. Please refer to Table 2.2, which shows the experimental results of the solution provided by the embodiment of the present application, in conjunction with the open source solver Clp, on a multi-factory production scheduling problem dataset. It can be observed that it has similar results to the performance on the self-developed solver.
[0257]
[0258] Table 2.2
[0259] By observing Tables 2.1 and 2.2, it can be found that the solution provided by the embodiments of the present application has great benefits whether on the Tianchou solver or on the open source Clp solver.
[0260] After implementing the technical solution of the embodiment of the present application, the Presolve time is reduced and the LP solution time is increased. This is because the default strategy deletes more rows and columns than the solution of the present application (Online Presolve), so the time spent on LP solution is reduced, but the deleted rows and columns require more Presolve operators to operate, which greatly increases the Presolve and corresponding Postsolve time. Although the LP solution time is extended, the end-to-end time is reduced by a greater margin. For example, in the case of multi-factory production scheduling engine-medium, the end-to-end time using the default strategy is 51.17s, while the end-to-end time using Online Presolve is 40.27s, a reduction of 10.9s. This shows that the solution provided by the embodiment of the present application effectively balances the time of the Presolve module and the LP solution time affected by the Presolve model, thereby improving end-to-end efficiency.
[0261] Application scenario 2: Bidirectional capacity simulation problem
[0262] The capacity simulation problem is another core problem in the field of supply chain management. This embodiment comes from the real industrial scenario of the enterprise. This type of problem is mainly oriented to the planning domain. When forming a demand plan, the planning domain often requires a longer cycle to facilitate resource preparation. However, the plans required to guide actual operations are generally at a daily granularity. For example, the procurement plan requires decisions on when to purchase what components and how many pieces. For example, the processing plan requires decisions on when to produce what single board and how many pieces in what factory and production line? And so on. This type of problem is to establish a planning model to solve these needs, so as to match the supply capacity according to the needs output by the planning department.
[0263]
[0264]
[0265] Table 3.1
[0266] Table 3.1 shows the solution provided in the embodiment of the present application, which cooperates with the Tianchou solver to serve the online effect of the supply chain bidirectional capacity simulation in the real industrial scenario:
[0267] Bidirectional capacity simulation-small: When the Presolve method based on expert experience is used for solving (i.e., the default strategy in Table 3.1), the average solution time for the entire data set is 20.80 seconds; while using the solution provided in the embodiment of the present application (i.e., Online Presolve in Table 3.1) for solving, the average solver time for the entire data set is reduced to 14.17 seconds, achieving an optimization of 47.27%.
[0268] Bidirectional Capacity Simulation-Medium (testing generalization): The neural network trained using the Bidirectional Capacity Simulation-Small dataset was deployed on Bidirectional Capacity Simulation-Medium for generalization testing. When the Presolve method based on expert experience was used for solving, the average solution time for the production scheduling problem of the entire dataset was 51.73 seconds; and using the solution provided in the embodiment of the present application, the average solver time for the entire dataset was reduced to 37.24 seconds, achieving an optimization of 28.0%.
[0269] In order to verify the universality of the method of the embodiment of the present application, the test was also conducted on the open source solver Clp. Refer to Table 3.2, which shows the experimental effect of the solution provided by the embodiment of the present application deployed on the open source solver Clp on the two-way capacity simulation problem data set. It can be observed that it has similar results to the performance on the Tianchou solver.
[0270]
[0271] Table 3.2
[0272] By observing Tables 3.1 and 3.2, it can be found that whether on the Tianchou solver or the open source Clp solver, the solution proposed in the embodiment of the present application reduces the Presolve time and LP solution time, indicating that the agent has learned to implement a more effective preprocessing strategy in less time. The solution proposed in the embodiment of the present application improves the Presolve efficiency per unit time on this data set, achieves better preprocessing effects in less time, and improves end-to-end efficiency.
[0273] Application scenario 3: Facility location problem with capacity constraints
[0274] The facility location problem with capacity constraints is a class of optimization problems that are widely found in industrial production and involve selecting the best locations for facilities while taking into account their ability to meet customer demand. The instance generation of this problem is from an open source generation code, and the goal is to minimize the total cost of setting up and operating a facility, as well as the transportation cost of supplying goods from the facility to customers.
[0275]
[0276] Table 4.1
[0277] Table 4.1 shows the solution proposed in the embodiment of this application, and the online effect of the Tianchou solver on the facility location problem with capacity constraints:
[0278] Facility location problem - small: When the Presolve method based on expert experience (i.e., the default strategy in Table 4.1) is used for solving, the average solution time for the entire data set is 27.98 seconds; while using the solution provided in the application embodiment (i.e., Online Presolve in Table 4.1), the average solver time for the entire data set is reduced to 25.64 seconds, achieving an optimization of 8.3%.
[0279] Facility location problem-large (test generalization): The neural network trained using the facility location problem-small dataset was deployed on the facility location problem-medium to test generalization. When the Presolve method based on expert experience (i.e., the default strategy) was used for solving, the average solution time for the production scheduling problem of the entire dataset was 79.03 seconds; after using the method proposed in the embodiment of the present application, the average solver of the entire dataset was reduced to 68.77 seconds, achieving a 13% optimization.
[0280]
[0281] Table 4.2
[0282] Similarly, in order to verify the effectiveness of the method of the embodiment of the present application, a test was conducted on the open source solver Clp. Refer to Table 4.2, which shows the experimental results of the solution proposed in the embodiment of the present application, deployed on the open source solver Clp, on the facility location problem data set with capacity constraints. From Table 4.2, it can be seen that it has similar results to the performance on the Tianchou solver.
[0283] Observing Tables 4.1 and 4.2, it can be found that whether on the Tianchou solver or the open source Clp solver, the solution provided by the embodiment of the present application turns off the Presolve function on this data set, indicating that the agent has learned that Presolve will not achieve a positive effect on this data set, that is, in this application scenario, turning off the preprocessing module is more conducive to improving the model's solution efficiency. This may be because when generating the preprocessing unit sequence, the sequence generated in the first round is an empty sequence, that is, the agent has learned that it does not need to execute any preprocessing operator. This greatly saves the time taken by Presolve, thereby improving end-to-end efficiency.
[0284] Application scenario 4: Ocean freight inventory routing problem
[0285] The Maritime Inventory Routing Problem (MIRP) plays an indispensable role in global bulk cargo transportation. The open source website (MIRLLIB) contains a large number of complex maritime transportation planning problems, providing a publicly available test problem instance library for the deterministic single-product maritime inventory routing problem, involving inventory tracking at each port.
[0286]
[0287] Table 5.1
[0288] Table 5.1 shows the solution provided by the embodiment of the present application, and the online effect of the Tianchou solver on the shipping inventory routing problem:
[0289] When the Presolve method based on expert experience (i.e., the default strategy in Table 5.1) is used for solving, the average solution time for the entire data set is 115.79 seconds; while when the method provided in the embodiment of the present application is used for solving (Online Presolve in Table 5.1), the average solver time for the entire data set is reduced to 96.98 seconds, achieving an optimization of 16.3%.
[0290]
[0291]
[0292] Table 5.2
[0293] The test was also conducted on the open source solver Clp. See Table 5.2, which shows the experimental results of the solution proposed in the embodiment of the present application, deployed on the open source solver Clp, on the marine inventory path problem dataset. It can be observed that it has similar results to the performance on the Tianchou solver.
[0294] By observing Tables 5.1 and 5.2, it can be found that whether on the Tianchou solver or on the open source Clp solver, the solution proposed in the embodiment of the present application turns off the Presolve function on this data set, indicating that the intelligent agent understands that Presolve will not achieve good results on this data set, thereby improving end-to-end efficiency.
[0295] Application scenario 5: Multi-product network flow problem
[0296] The multi-commodity network flow problem is a complex planning problem that involves determining the optimal flow of multiple commodities through a network of interconnected nodes and arcs. In this problem, each commodity has a specific origin, destination, and volume that needs to be transported from the origin to the destination through the network. The goal of the multi-commodity network flow problem is to minimize the total transportation cost of all commodities subject to various constraints, such as flow conservation, arc capacity limits, and other operational constraints. This problem has many practical applications, such as in transportation, communications, and supply chain management.
[0297]
[0298] Table 6.1
[0299] Table 6.1 shows the solution proposed in the embodiment of this application, and the online effect of the Tianchou solver on the multi-commodity network flow problem:
[0300] Multi-commodity network flow problem - small: When the Presolve method based on expert experience (i.e., the default strategy in Table 6.1) is used for solving, the average solution time for the entire data set is 2.24 seconds; while using the solution proposed in the embodiment of the present application (Online Presolve in Table 6.1) for solving, the average solver time for the entire data set is reduced to 1.36 seconds, achieving an optimization of 39.45%.
[0301] Multi-commodity network flow problem-large (testing generalization): At the same time, the neural network trained using the multi-commodity network flow problem-small dataset was deployed on the multi-commodity network flow problem-medium for generalization testing. When the Presolve method based on expert experience was used for solving, the average solution time for the production scheduling problem of the entire dataset was 5.71 seconds; while using the solution proposed in the embodiment of the present application, the average solver of the entire dataset was reduced to 3.28 seconds, achieving an optimization of 42.54%.
[0302]
[0303] Table 6.2
[0304] The test was also conducted on the open source solver Clp. See Table 6.2, which shows the experimental results of the solution proposed in the embodiment of the present application, deployed on the open source solver Clp, on the multi-commodity network flow problem dataset. It can be observed that it has similar results to the performance on the Tianchou solver.
[0305] By observing Tables 6.1 and 6.2, it can be found that whether on the Tianchou solver or on the open source Clp solver, the solution proposed in the embodiment of the present application uses very little Presolve time on the data set to achieve a Presolve effect that is almost consistent with the default rule, thereby improving the Presolve efficiency and ultimately improving the end-to-end solution efficiency.
[0306] Through the above five types of application scenario examples, it can be found that the embodiments of the present application are not limited to a certain application scenario such as production scheduling, but have a certain universality, and can achieve positive technical effects in a variety of practical application scenarios, such as reducing Presolve time, reducing end-to-end time, and improving solution efficiency. As long as the applied scenario requires MP problems (such as LP problems) to be solved, the solutions proposed in the embodiments of the present application can be applied.
[0307] It should be noted that the solution provided in the embodiments of the present application includes any one or more of the execution information generation method, electronic device, storage medium and chip system, or may also be other forms of software products, hardware products or virtual service products obtained based on the technical concept of the method described in the specification of this application.
[0308] In the description of the device in the embodiment of the present application, various modules for implementing the method flow functions are constructed in the device. The division of modules is merely a division of logical functions. When implementing the embodiment of the present application, the functions of each module can be implemented in the same or multiple software and / or hardware.
[0309] Specifically, each functional module can be fully or partially integrated into one physical entity during actual implementation, or can be physically separated. And these modules can all be implemented in the form of software calling through processing elements; or all can be implemented in the form of hardware; or some modules can be implemented in the form of software calling through processing elements, and some modules can be implemented in the form of hardware. For example, the detection module can be a separately established processing element, or it can be integrated in a chip of an electronic device. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in a processor element or instructions in the form of software.
[0310] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASIC), or one or more digital signal processors (DSP), or one or more field programmable gate arrays (FPGA), etc. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).
[0311] An embodiment of the present application further provides an electronic device.
[0312] Fig.11 Shown is a schematic structural diagram of an electronic device according to an embodiment of the present application.
[0313] The electronic device 1100 includes a memory 1110 for storing computer program instructions and a processor 1120 for executing the program instructions, wherein when the computer program instructions are executed by the processor, the electronic device is triggered to execute the method steps of the embodiment of the present application.
[0314] Specifically, in one embodiment of the present application, the above-mentioned one or more computer programs are stored in the above-mentioned memory, and the above-mentioned one or more computer programs include instructions. When the above-mentioned instructions are executed by the above-mentioned device, the above-mentioned device executes the method steps described in the embodiment of the present application.
[0315] Specifically, in one embodiment of the present application, the processor of the electronic device may be a SOC device on a chip, which may include a central processing unit (CPU), and may further include other types of processors. Specifically, in one embodiment of the present application, the processor of the electronic device may be a PWM control chip.
[0316] Specifically, in an embodiment of the present application, the processor involved may include, for example, a CPU, a DSP, a microcontroller or a digital signal processor, and may also include a GPU, an embedded neural network processor (Neural-network Process Units, NPU) and an image signal processor (Image Signal Processing, ISP). The processor may also include necessary hardware accelerators or logic processing hardware circuits, such as ASICs, or one or more integrated circuits for controlling the execution of the program of the technical solution of the present application. In addition, the processor may have the function of operating one or more software programs, and the software programs may be stored in a storage medium.
[0317] Specifically, in one embodiment of the present application, the memory of the electronic device may be a read-only memory (ROM), other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), a magnetic disk storage medium or other magnetic storage devices, or may be any computer-readable medium that can be used to carry or store desired program codes in the form of instructions or data structures and can be accessed by a computer.
[0318] Specifically, in an embodiment of the present application, the processor and the memory can be combined into a processing device, more commonly, they are independent components, and the processor is used to execute the program code stored in the memory to implement the method described in the embodiment of the present application. In specific implementation, the memory can also be integrated into the processor, or independent of the processor.
[0319] Furthermore, the devices, apparatuses, and modules described in the embodiments of the present application may be implemented by computer chips or entities, or by products having certain functions.
[0320] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, devices, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media containing computer-usable program code.
[0321] In the several embodiments provided in the present application, if any function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application.
[0322] Specifically, in one embodiment of the present application, a computer-readable storage medium is further provided, in which a computer program is stored. When the computer program is run on a computer, the computer executes the method provided in the embodiment of the present application.
[0323] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is run on a computer, the computer executes the method provided by the embodiment of the present application.
[0324] The embodiments described in this application are described with reference to the flowcharts and / or block diagrams of the methods, devices (apparatus), and computer program products according to the embodiments of the application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0325] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0326] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0327] It should also be noted that in the embodiments of the present application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent the existence of A alone, the existence of A and B at the same time, and the existence of B alone. Among them, A and B can be singular or plural. The character " / " generally indicates that the previous and subsequent associated objects are in an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b and c can be represented by: a, b, c, a and b, a and c, b and c, or a and b and c, where a, b, c can be single or multiple.
[0328] In the embodiments of the present application, the terms "include", "comprises" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of further restrictions, an element defined by the sentence "includes a ..." does not exclude the presence of other identical elements in the process, method, commodity or device including the element.
[0329] The present application may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0330] Each embodiment in this application is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0331] Those skilled in the art will appreciate that the various units and algorithm steps described in the embodiments of the present application can be implemented by a combination of electronic hardware, computer software, and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0332] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices, apparatuses and units can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0333] The above is only a specific implementation of the present application. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. The protection scope of the present application should be based on the protection scope of the claims.
Claims
1. The execution information generation method in the solver preprocessing stage is characterized by: The preprocessing includes executing N preprocessing units to simplify the target model, where N is an integer greater than 1, the target model is constructed based on the problem to be solved in the application scenario, and the solver is used to solve the simplified target model; The method comprises: Determine a transition probability matrix corresponding to the target model through machine learning; the elements in the transition probability matrix represent the probability of one unit among multiple units transferring to the next unit; the multiple units include the N preprocessing units; Based on the transition probability matrix, a preprocessing unit sequence is generated; the preprocessing unit sequence is used to define the execution order of at least one preprocessing unit.
2. The method according to claim 1, characterized in that The step of determining a transition probability matrix corresponding to the target model includes: Constructing a first bipartite graph corresponding to the target model; According to the first bipartite graph, obtaining a first eigenvector; Inputting the first feature vector into a first neural network; A first transition probability matrix is generated according to the output of the first neural network.
3. The method according to claim 1, characterized in that The plurality of units include 1 empty unit and the N pre-processing units; The step of generating a preprocessing unit sequence based on the transition probability matrix comprises: Selecting a first unit according to the N+1 probability values corresponding to the empty unit in the transfer probability matrix; wherein the N+1 probability values corresponding to the empty unit are probability values of the empty unit being transferred to the 1 empty unit and the N preprocessing units respectively; When the first unit is an empty unit, an empty sequence is generated; When the first unit is a non-empty unit, the i+1th unit is selected according to the probability value of the N+1 elements corresponding to the i-th unit; wherein the probability value of the N+1 elements corresponding to the i-th unit is the probability value of the i-th unit being transferred to the 1 empty unit and the N preprocessing units, respectively, 1≤i≤N; When the i+1th unit is an empty unit, the sequence generation stops and the sequence consisting of the first i units is used as the preprocessing unit sequence.
4. The method according to claim 3, characterized in that The selecting the i+1th unit according to the probability values of the N+1 elements corresponding to the i-th unit includes: Based on probability sampling, generate the i-th random probability value corresponding to the i-th unit; Divide [0, 1] into multiple intervals corresponding to the N+1 elements; The interval to which the i-th random probability value belongs is determined as a sampling interval, and the next unit pointed to by the element corresponding to the sampling interval is selected as the i+1-th unit.
5. The method according to any one of claims 1 to 4, characterized in that After generating the preprocessing unit sequence, the method further includes: When the currently generated preprocessing unit sequence is a non-empty sequence, the corresponding preprocessing units are executed in sequence according to the execution order defined by the preprocessing unit sequence to simplify the target model.
6. The method according to claim 5, characterized in that DD230701I After simplifying the target model, the method further includes: Obtain a second bipartite graph corresponding to the simplified target model; According to the simplified second bipartite graph, graph embedding is performed through a graph neural network to obtain a second eigenvector; Inputting the second feature vector into the first neural network; Generate a second transition probability matrix according to the output of the first neural network; Based on the second transition probability matrix, a second preprocessing unit sequence is generated; the second preprocessing unit sequence is used to limit the execution order of the preprocessing units in the second round of model simplification.
7. The method according to claim 6, characterized in that The method comprises a training phase and an application phase; In the training phase, after obtaining the bipartite graph corresponding to the simplified target model, the method further includes: determining a first value according to a degree of simplification of the second bipartite graph compared to the first bipartite graph; Determining a value of a first reward function according to the first value; Back-propagating the value of the first reward function to the first neural network, and updating the parameters of the first neural network.
8. The method according to claim 7, characterized in that After generating the preprocessing unit sequence, the method further includes: When the preprocessing unit sequence is an empty sequence, the model simplification is stopped, and the simplified target model is solved by using the solver.
9. The method according to claim 8, characterized in that In the training phase, after using the solver to solve the simplified target model, the method further includes: determining a second value according to a solution efficiency of the solver for solving the simplified target model; Determining a value of a second reward function based on the second value; The value of the second reward function is back-propagated to the first neural network to update the parameters of the first neural network.
10. The method according to any one of claims 1 to 4 and 6 to 9, characterized in that: The first neural network includes an input layer, an output layer and at least two hidden layers.
11. The method according to claim 10, characterized in that The first neural network includes at least one of a multi-layer perceptron MLP, a fully connected neural network FCNN, a feed-forward neural network FNN, and a back-propagation BP neural network.
12. The method according to any one of claims 1 to 4 and 6 to 9, characterized in that: The machine learning includes reinforcement learning; The first neural network is deployed in the reinforcement learning agent.
13. The method according to claim 12, characterized in that During the training phase of the reinforcement learning, a deep reinforcement learning PPO algorithm is used for training the first neural network.
14. An electronic device, characterized in that: The electronic device comprises: One or more processors; a memory; at least one application; and one or more computer programs, wherein the one or more computer programs are stored in the memory, and the one or more computer programs include instructions, when the instructions are executed by the electronic device, the electronic device performs any one of claims 1-13 DD230701I The method described in item.
15. A storage medium, characterized in that: The method comprises computer instructions, which, when executed on an electronic device, cause the electronic device to execute the method as claimed in any one of claims 1 to 13.
16. A chip system, characterized in that: include: A communication interface for inputting and / or outputting data; A processor, configured to execute a computer executable program so that a device equipped with the chip system executes a method as described in any one of claims 1 to 13.
