Method and device for solving linear programming problem based on operation planning large model, equipment and storage medium
By combining large language models and linear planning solutions, automatically analyzes and builds a linear planning model, and standardized processing, solve the problem of modeling complexity of linear planning problems and difficulty in using non -professional users, and achieve efficient and reliable linear planning Solve the process.
Patent Information
- Application Number
- CN202411933764.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-01-24
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
When modeling linear planning problems in the prior art, the professional threshold is high, which is difficult for non-professional users to use. In addition, large models are prone to model construction errors due to semantic misunderstandings or lack of rigorous logic when automatically generating objective functions and constraints.
By combining large language models and linear planning solutions, obtain the natural language of the user input, determine whether it is a linear planning problem, automatically analyze and generate decision -making variables, constraint conditions and optimization goals, build a linear planning model, and conduct standardized processing to extract the model to extract the model Parameters, finally call the solution to solve and output results.
It significantly reduces the complexity of linear planning modeling and solution, enabling non -professional users to easily use this method to solve practical problems, and improve the reliability of linear planning problems in the process of solving.
Smart Images

Figure CN119358688A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of automatic solution of linear programming, and in particular to a method, device, equipment and storage medium for solving linear programming problems based on a large operations research model. Background Art
[0002] As an important mathematical optimization method, linear programming is widely used in production, logistics, finance and other fields, providing organizations and enterprises with key tools to achieve optimal decision-making under the constraints of limited resources. In production management, linear programming can effectively allocate raw materials, optimize product portfolios and arrange production plans, helping enterprises to maximize profits at the lowest cost. In the field of logistics, this method can optimize transportation routes and warehouse layouts, significantly reducing time and cost costs. The financial industry uses linear programming for asset allocation and risk management, helping investors find the best balance between returns and risks. By constructing mathematical models and using computers to quickly solve them, linear programming has become a core tool for solving complex decision-making problems.
[0003] However, the professional threshold for modeling linear programming problems is high, and there are great limitations for non-professional users. Although the existing large models have strong natural language processing capabilities, when the large models automatically generate objective functions and constraints, they are prone to model construction errors due to semantic misunderstandings or illogical logic.
[0004] In view of this, this application is filed. Summary of the invention
[0005] The present invention discloses a method, device, equipment and storage medium for solving linear programming problems based on a large operations research model, aiming to improve the reliability of linear programming problems in the solution process by combining a large language model and a solver.
[0006] The first embodiment of the present invention provides a method for solving a linear programming problem based on a large operations research model, comprising: Obtaining a natural language question input by a user, and determining whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes a production optimization problem, a transportation and logistics problem, a resource allocation problem, a portfolio optimization problem, and a supply chain management problem; When it is determined that the natural language problem is a linear programming problem, the natural language problem is automatically parsed to generate decision variables, constraints and optimization objectives, and a linear programming model is constructed according to the decision variables, the constraints and the optimization objectives; Performing a normalization operation on the linear programming model and extracting parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; The solver is called to solve the normalized linear programming model based on the parameters, and the solution results are integrated and outputted.
[0007] Preferably, the constraint condition is used to limit the value range of the decision variable; The optimization objective is used to construct an objective function, wherein the objective function is a linear combination of the decision variables.
[0008] Preferably, the parameters of the linear programming model after extraction and normalization include: inequality constraint coefficient matrix, inequality constraint constant vector, equality constraint coefficient matrix, equality constraint constant vector, objective function coefficient vector, variable lower bound and variable upper bound.
[0009] Preferably, the calling of the solver and solving the normalized linear programming model based on the parameters and integrating and outputting the solution results are specifically as follows: A linear programming algorithm is used to find a solution that satisfies the constraints in the solution space, and the decision variable values are iteratively adjusted until the objective function converges to the optimal solution. The calculation results are output, wherein the output includes the optimal solution of each decision variable, the value of the objective function under the optimal solution of each decision variable, and the number of iterations.
[0010] The second embodiment of the present invention provides a device for solving linear programming problems based on a large operations research model, comprising: A question input module is used to obtain a natural language question input by a user and determine whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes production optimization problems, transportation and logistics problems, resource allocation problems, portfolio optimization problems, and supply chain management problems; A model building module, for automatically parsing the natural language problem to generate decision variables, constraints and optimization objectives when it is determined that the natural language problem is a linear programming problem, and building a linear programming model according to the decision variables, the constraints and the optimization objectives; A normalization processing module, used for performing a normalization operation on the linear programming model and extracting parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; The solution module is used to call the solver, solve the normalized linear programming model based on the parameters, and integrate and output the solution results.
[0011] Preferably, the constraint condition is used to limit the value range of the decision variable; The optimization objective is used to construct an objective function, wherein the objective function is a linear combination of the decision variables.
[0012] Preferably, the parameters of the linear programming model after extraction and normalization include: inequality constraint coefficient matrix, inequality constraint constant vector, equality constraint coefficient matrix, equality constraint constant vector, objective function coefficient vector, variable lower bound and variable upper bound.
[0013] Preferably, the solution module is specifically used for: A linear programming algorithm is used to find a solution that satisfies the constraints in the solution space, and the decision variable values are iteratively adjusted until the objective function converges to the optimal solution. The calculation results are output, wherein the output includes the optimal solution of each decision variable, the value of the objective function under the optimal solution of each decision variable, and the number of iterations.
[0014] The third embodiment of the present invention provides a device for solving linear programming problems based on a large operations research model, including a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a method for solving linear programming problems based on a large operations research model as described in any one of the above.
[0015] The fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located, so as to implement a method for solving linear programming problems based on a large operations research model as described in any one of the above items.
[0016] Based on the method, device, equipment and storage medium for solving linear programming problems based on the operations research big model provided by the present invention, the user input is first obtained, and the big model is used to determine whether the user input is a linear programming problem; then, when it is determined that the user input is a linear programming problem, a linear programming model is constructed based on the user input; then, the linear programming model is normalized, and the parameters of the normalized linear programming model are extracted; finally, the solver is called, and the normalized linear programming model is solved based on the parameters, and the solution results are integrated and output. By combining natural language processing technology with a linear programming solver, the complexity of traditional linear programming modeling and solving is significantly reduced, so that non-professional users can easily use this method to solve practical problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 It is a flowchart of a method for solving a linear programming problem based on a large operations research model provided by the first embodiment of the present invention; Figure 2 It is a module schematic diagram of a device for solving linear programming problems based on a large operations research model provided by the second embodiment of the present invention. DETAILED DESCRIPTION
[0018] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0019] In order to better understand the technical solution of the present invention, the embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0020] It should be clear that the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0021] The terms used in the embodiments of the present invention are only for the purpose of describing specific embodiments, and are not intended to limit the present invention. The singular forms "a", "said" and "the" used in the embodiments of the present invention and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0022] It should be understood that the term "and / or" used in this article is only a description of the association relationship of associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0023] The word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrases "if it is determined" or "if (stated condition or event) is detected" may be interpreted as "when it is determined" or "in response to determining" or "when detecting (stated condition or event)" or "in response to detecting (stated condition or event)", depending on the context.
[0024] The "first\second" mentioned in the embodiments is only to distinguish similar objects, and does not represent a specific order for the objects. It is understandable that the "first\second" can be interchanged with the specific order or sequence where permitted. It should be understood that the objects distinguished by "first\second" can be interchanged where appropriate, so that the embodiments described herein can be implemented in an order other than those illustrated or described herein.
[0025] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0026] See also Figure 1 The present invention discloses a method, device, equipment and storage medium for solving linear programming problems based on a large operations research model, aiming to improve the reliability of linear programming problems in the solution process by combining a large language model and a solver.
[0027] The first embodiment of the present invention provides a method for solving a linear programming problem based on an operations research big model, which is executed by a device for solving a linear programming problem based on an operations research big model (hereinafter referred to as a solving device), and in particular, is executed by one or more processors in the solving device to implement at least the following steps: S101, obtaining a natural language question input by a user, and determining whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes a production optimization problem, a transportation and logistics problem, a resource allocation problem, a portfolio optimization problem, and a supply chain management problem; In this embodiment, the solving device can be a terminal with data processing capabilities such as a server, desktop computer, or laptop computer. The auxiliary device can be installed with a corresponding operating system and application software, and the functions required by this embodiment can be implemented through the combination of the operating system and application software.
[0028] It should be noted that in this embodiment, after obtaining user input, a pre-trained and fine-tuned large model is used to analyze the input. Users can express their questions in natural language, such as "how to allocate resources to maximize profits" or "optimize costs under constraints", and the large model can automatically extract key features from the input text. Through semantic parsing and context understanding, the large model first determines whether the input problem belongs to the category of operations optimization. If it is determined to belong to the field of operations optimization, it is further analyzed whether it meets the characteristics of linear programming problems.
[0029] Among them, the key feature of the linear programming problem is that the objective function and the constraints are both linear expressions. Further, in this embodiment, through the mathematical logic rules and training data embedded in the model, the optimization objectives, constraints, and decision variables that may be involved in the input text can be identified. For example, for the problem of "how to allocate budget to achieve maximum sales", the large model can identify "budget" as a constraint and "sales" as an optimization goal, and determine whether this can be expressed as a linear programming problem. In addition, in this embodiment, a redundant feature filtering mechanism is also introduced, which can eliminate irrelevant redundant information in the input text and ensure accurate grasp of the core of the problem.
[0030] Furthermore, the judgment process of the large model not only relies on its ability in natural language processing, but also combines specific domain knowledge. Through the optimization of model weights through deep learning, it has higher accuracy when processing professional terms and expressions involving linear programming. For example, for descriptions of the objective function that may be implied in the input text as "maximizing benefits" or "minimizing costs", the large model can make accurate inferences and confirm whether it can be converted into a linear programming expression in combination with pre-trained mathematical logic rules.
[0031] S102, when it is determined that the natural language problem is a linear programming problem, automatically parsing the natural language problem to generate decision variables, constraints and optimization objectives, and constructing a linear programming model according to the decision variables, the constraints and the optimization objectives; It should be noted that in the process of building a linear programming model, the core semantic information input by the user is first parsed to clarify the decision variables and their meanings that need to be optimized. Among them, the decision variables usually correspond to the quantities that need to be determined in the actual problem. For example, in the production planning problem, it may be the production quantity of different products; in the resource allocation problem, it may be the allocation of different resources. The large model automatically identifies these decision variables and gives them logical meaning through context understanding technology. At the same time, in order to ensure the actual feasibility of the variables, this embodiment further defines the value range of the decision variables based on the implicit or explicit constraint information in the user input. For example, for the description of "the budget shall not exceed 1 million yuan", the large model can extract "budget" as a constraint condition, limit the relevant variables not to exceed this value, and thus construct a constraint condition for standardizing the value range of the decision variable.
[0032] After determining the decision variables and constraints, the key lies in the automatic generation of the objective function, which is the core of the linear programming model and reflects the optimization direction of the problem. By semantically parsing the optimization goal input by the user, the large model can determine whether it is a maximization goal (such as "profit maximization") or a minimization goal (such as "cost minimization"). After determining the optimization goal, the extracted decision variables are used to construct the objective function in the form of a linear combination. For example, for the input of "minimizing raw material costs while meeting production requirements", the large model can associate "raw material costs" with the unit cost coefficient of the variable to generate a formalized objective function. This function can not only express the optimization requirements in the model, but also seamlessly connect with the parameter format of the subsequent solver.
[0033] S103, performing a normalization operation on the linear programming model and extracting parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; It should be noted that after the initial construction of the linear programming model is completed, the model will be normalized to unify the expression form and reduce error accumulation. In the normalization stage, the objective function is first unified, such as converting the maximization objective function into a minimization form by taking a negative number, and merging similar terms. This makes the objective function have a unified optimization direction in subsequent solutions and simplifies the calculation logic of the solver. At the same time, for constraints whose initial form is "≥", they will be converted into the standard form of "≤" by multiplying by -1, thereby ensuring the unified expression of all constraints. In addition, for equality constraints, their original form is directly retained and separated from inequality constraints to facilitate subsequent matrix decomposition and parameter extraction.
[0034] After normalization, the core parameters in the normalized model are systematically extracted to form a structured mathematical representation. First, the inequality constraint coefficient matrix is extracted, which records the coefficient information on the left side of each inequality in the form of a two-dimensional array, where the rows correspond to different inequality conditions and the columns correspond to different decision variables; at the same time, the constant values on the right side of the inequality are extracted to form an inequality constraint constant vector, which is used to clarify the boundaries of the inequality conditions. In the processing of equality constraints, the coefficient matrix on the left side of the equation and the constant vector on the right side are similarly extracted to construct an accurate description of the variable relationship.
[0035] In this embodiment, the objective function coefficient vector is generated by traversing the linear combination terms in the objective function, and the linear coefficient of each decision variable is recorded. In addition, this embodiment further extracts the upper and lower bounds of the variables, and through logical analysis of user input and actual problems, clarifies the value range of each decision variable, for example, the variable must be non-negative or limited to a specific interval. These upper and lower bound information is stored in the form of vectors to provide a complete constraint definition for the solver.
[0036] S104, calling a solver, and solving the normalized linear programming model based on the parameters, and integrating and outputting the solution results.
[0037] It should be noted that at the beginning of the solution, the linear programming solver constructs the solution space of the initial solution based on the objective function and constraints. The boundaries of the solution space are defined by the upper and lower bounds of the decision variables and the constraints. Based on the initial solution, the solver gradually optimizes the value of the objective function through a linear programming algorithm (such as the simplex method or the interior point method). In each iteration, the solver adjusts the value of the decision variable according to the impact of the current solution on the objective function, thereby moving in the optimal direction.
[0038] Specifically, the simplex method moves along the extreme points on the boundary of the solution space, looking for the direction of improvement of the objective function until it finds a point that satisfies all constraints and the objective function value cannot be further optimized, that is, the optimal solution. The interior point rule iterates within the solution space to approximate the optimal solution, which is more suitable for dealing with large-scale linear programming problems.
[0039] After the solution is completed, the solver will output a set of optimization results, including the optimal solution for each decision variable and the optimal value of the objective function calculated on this basis. For the optimal solution of the decision variables, the solver provides specific values for each variable, which represent the solution that makes the objective function optimal under the constraints. For example, in the resource allocation problem, the solver will clarify the best allocation plan for each type of resource to achieve the target optimization. In addition, the solver will also output the optimal value of the objective function, that is, the value of the objective function under the optimal solution condition. It provides users with a clear understanding of the realization of optimization goals, such as the lowest production cost or the maximum profit.
[0040] At the same time, the solver will also record and output the number of iterations, which is important for evaluating the efficiency and complexity of the solution process. Through the feedback of the number of iterations, users can intuitively understand the complexity of the solution process and the impact of the problem size on the algorithm performance. For example, for smaller problems, the number of iterations may be only in the single digit, while for complex large-scale linear programming problems, the number of iterations may reach hundreds.
[0041] The implementation process of this embodiment is explained with two simple examples: A company ships goods from two production locations A1 and A2 to three sales locations B1, B2, and B3. The output of each production location, the sales volume of each sales location, and the freight cost of each item in each sales location are as follows: the output of A1 is 200 pieces, and the output of A2 is 300 pieces; the freight costs from A1 to B1, B2, and B3 are 6, 4, and 6 per piece respectively; the freight costs from A2 to B1, B2, and B3 are 6, 5, and 5 per piece; a total of 150 pieces of A1 and A2 products are sold in B1; a total of 150 pieces of A and A2 products are sold in B2; a total of 200 pieces of A1 and A2 products are sold in B3. How should the goods be transported to minimize the total transportation cost? Large Model AGNET Answer: This is an integer programming problem.
[0042] 1. Modeling process of operations research optimization problem 1. Define variables , , : Transportation volume from production location A1 to sales locations B1, B2, B3 , , : Transportation volume from production location A2 to sales locations B1, B2, B3 2. Objective function 2.1: Objective function coefficients , , : 6, 4, 6 , , :6,5,5 2.2: Objective Function Formula
[0043] 3. Constraints Production restrictions for origin A1:
[0044] Production restrictions for origin A2:
[0045] Sales volume restrictions for sales location B1:
[0046] Sales volume restrictions for sales location B2:
[0047] Sales volume restrictions for sales location B3:
[0048] Non-negativity constraints: , where ( i = 1, 2 ) and ( j = 1, 2, 3 ) 2. Normalization Conversion 1. Define variables , , : Transportation volume from production location A1 to sales locations B1, B2, B3 , , : Transportation volume from production location A2 to sales locations B1, B2, B3 2. Objective Function
[0049] 3. Multivariable inequality constraints
[0050]
[0051] 4. Equality constraints
[0052]
[0053]
[0054] 5: Univariate variable constraint lower bound , where ( i = 1, 2 ) and ( j = 1, 2, 3 ) 3. JSON extraction {"A": [[1, 1, 1, 0, 0, 0],[0, 0, 0, 1, 1, 1]],"b": [200, 300],"Aeq":[[1, 0, 0, 1, 0, 0],[0, 1, 0, 0, 1, 0],[0, 0, 1, 0, 0, 1]],"beq": [150, 150,200],"f": [6, 4, 6, 6, 5, 5],"lb": [0, 0, 0, 0, 0, 0],"ub": []} 4. Solver Solution Process Is the variable an integer constraint: [true, true, true, true, true, true, true]{"exitflag": "OPTIMAL","x": [50.0,150.0,0.0,100.0,0.0,200.0],"fval": 2500.0,"output": {"message": "The optimal solution is found.","iterations": null}} According to the information provided, the optimal transportation plan is as follows: transport 50 pieces from the production location A1 to the sales location B1, transport 150 pieces from the production location A1 to the sales location B2, transport 0 pieces from the production location A1 to the sales location B3, transport 100 pieces from the production location A2 to the sales location B1, transport 0 pieces from the production location A2 to the sales location B2, and transport 200 pieces from the production location A2 to the sales location B3. The minimum total transportation cost is 2,500 yuan.
[0055] See also Figure 2 The second embodiment of the present invention provides a solution device for linear programming problems based on a large operations research model, comprising: The question input module 201 is used to obtain a natural language question input by a user, and determine whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes a production optimization problem, a transportation and logistics problem, a resource allocation problem, a portfolio optimization problem, and a supply chain management problem; A model building module 202 is used to automatically analyze the natural language problem to generate decision variables, constraints and optimization objectives when it is determined that the natural language problem is a linear programming problem, and to build a linear programming model according to the decision variables, the constraints and the optimization objectives; A normalization processing module 203 is used to perform a normalization operation on the linear programming model and extract the parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; The solution module 204 is used to call the solver, solve the normalized linear programming model based on the parameters, and integrate and output the solution results.
[0056] Preferably, the constraint condition is used to limit the value range of the decision variable; The optimization objective is used to construct an objective function, wherein the objective function is a linear combination of the decision variables.
[0057] Preferably, the parameters of the linear programming model after extraction and normalization include: inequality constraint coefficient matrix, inequality constraint constant vector, equality constraint coefficient matrix, equality constraint constant vector, objective function coefficient vector, variable lower bound and variable upper bound.
[0058] Preferably, the solution module is specifically used for: A linear programming algorithm is used to find a solution that satisfies the constraints in the solution space, and the decision variable values are iteratively adjusted until the objective function converges to the optimal solution. The calculation results are output, wherein the output includes the optimal solution of each decision variable, the value of the objective function under the optimal solution of each decision variable, and the number of iterations.
[0059] The third embodiment of the present invention provides a device for solving linear programming problems based on a large operations research model, including a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a method for solving linear programming problems based on a large operations research model as described in any one of the above.
[0060] The fourth embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program can be executed by a processor of a device where the computer-readable storage medium is located, so as to implement a method for solving linear programming problems based on a large operations research model as described in any one of the above items.
[0061] The method, device, equipment and storage medium for solving linear programming problems based on the operations research big model provided by the present invention first obtains user input and determines whether the user input is a linear programming problem through the big model; then, when it is determined that the user input is a linear programming problem, a linear programming model is constructed based on the user input; then, the linear programming model is normalized and the parameters of the normalized linear programming model are extracted; finally, a solver is called and the normalized linear programming model is solved based on the parameters, and the solution results are integrated and output. The reliability of the linear programming problem in the solution process is improved.
[0062] Exemplarily, the computer program described in the third embodiment and the fourth embodiment of the present invention can be divided into one or more modules, and the one or more modules are stored in the memory and executed by the processor to complete the present invention. The one or more modules can be a series of computer program instruction segments that can complete specific functions, and the instruction segments are used to describe the execution process of the computer program in the device for solving linear programming problems based on a large operations research model. For example, the device described in the second embodiment of the present invention.
[0063] The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of the method for solving linear programming problems based on a large operational model, and uses various interfaces and lines to connect the various parts of the method for solving linear programming problems based on a large operational model.
[0064] The memory can be used to store the computer program and / or module, and the processor realizes various functions of a method for solving linear programming problems based on a large operations research model by running or executing the computer program and / or module stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, an application required for at least one function (such as a sound playback function, a text conversion function, etc.), etc.; the data storage area can store data created according to the use of the mobile phone (such as audio data, text message data, etc.), etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0065] Wherein, if the implemented module 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 such an understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Wherein, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. It should be noted that the content contained in the computer-readable medium can be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0066] It should be noted that the device embodiments described above are merely schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. In addition, in the accompanying drawings of the device embodiments provided by the present invention, the connection relationship between the modules indicates that there is a communication connection between them, which may be specifically implemented as one or more communication buses or signal lines. A person of ordinary skill in the art may understand and implement it without paying any creative effort.
[0067] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A method for solving linear programming problems based on a large operations research model, characterized in that: include: Obtaining a natural language question input by a user, and determining whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes a production optimization problem, a transportation and logistics problem, a resource allocation problem, a portfolio optimization problem, and a supply chain management problem; When it is determined that the natural language problem is a linear programming problem, the natural language problem is automatically parsed to generate decision variables, constraints and optimization objectives, and a linear programming model is constructed according to the decision variables, the constraints and the optimization objectives; Performing a normalization operation on the linear programming model and extracting parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; The solver is called to solve the normalized linear programming model based on the parameters, and the solution results are integrated and outputted.
2. The method for solving linear programming problems based on a large operations research model according to claim 1, characterized in that: The constraint condition is used to limit the value range of the decision variable; The optimization objective is used to construct an objective function, wherein the objective function is a linear combination of the decision variables.
3. The method for solving linear programming problems based on a large operations research model according to claim 1, characterized in that: The parameters of the linear programming model after extraction and normalization include: an inequality constraint coefficient matrix, an inequality constraint constant vector, an equality constraint coefficient matrix, an equality constraint constant vector, an objective function coefficient vector, a variable lower bound, and a variable upper bound.
4. The method for solving linear programming problems based on a large operations research model according to claim 1, characterized in that: The calling solver solves the normalized linear programming model based on the parameters, and integrates and outputs the solution results, specifically: A linear programming algorithm is used to find a solution that satisfies the constraints in the solution space, and the decision variable values are iteratively adjusted until the objective function converges to the optimal solution. The calculation results are output, wherein the output includes the optimal solution of each decision variable, the value of the objective function under the optimal solution of each decision variable, and the number of iterations.
5. A device for solving linear programming problems based on a large operations research model, characterized in that: include: A question input module is used to obtain a natural language question input by a user and determine whether the natural language question is a linear programming problem through a large model, wherein the linear programming problem includes production optimization problems, transportation and logistics problems, resource allocation problems, portfolio optimization problems, and supply chain management problems; A model building module, for automatically parsing the natural language problem to generate decision variables, constraints and optimization objectives when it is determined that the natural language problem is a linear programming problem, and building a linear programming model according to the decision variables, the constraints and the optimization objectives; A normalization processing module, used for performing a normalization operation on the linear programming model and extracting parameters of the normalized linear programming model, wherein the normalization operation includes unifying the direction of the objective function; The solution module is used to call the solver, solve the normalized linear programming model based on the parameters, and integrate and output the solution results.
6. The device for solving linear programming problems based on a large operations research model according to claim 5, characterized in that: The constraint condition is used to limit the value range of the decision variable; The optimization objective is used to construct an objective function, wherein the objective function is a linear combination of the decision variables.
7. The device for solving linear programming problems based on a large operations research model according to claim 5, characterized in that: The parameters of the linear programming model after extraction and normalization include: an inequality constraint coefficient matrix, an inequality constraint constant vector, an equality constraint coefficient matrix, an equality constraint constant vector, an objective function coefficient vector, a variable lower bound, and a variable upper bound.
8. The device for solving linear programming problems based on a large operations research model according to claim 5, characterized in that: The solution module is specifically used for: A linear programming algorithm is used to find a solution that satisfies the constraints in the solution space, and the decision variable values are iteratively adjusted until the objective function converges to the optimal solution. The calculation results are output, wherein the output includes the optimal solution of each decision variable, the value of the objective function under the optimal solution of each decision variable, and the number of iterations.
9. A device for solving linear programming problems based on a large operations research model, characterized in that: It comprises a memory and a processor, wherein the memory stores a computer program, and the computer program can be executed by the processor to implement a method for solving linear programming problems based on a large operations research model as described in any one of claims 1 to 4.
10. A computer-readable storage medium, characterized in that: A computer program is stored, and the computer program can be executed by a processor of the device where the computer-readable storage medium is located to implement a method for solving linear programming problems based on a large operations research model as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Smooth scheduling method, device and equipment of power system and readable storage medium
CN117833235A
Large language model-based operation planning optimization method and device, medium and program product
CN118132708A
Mixed integer linear programming model solving method and related equipment
CN118897935A
Sparse class representation with linear programming
US20140172764A1
Mathematical model solving method and apparatus, and computing device and computing device cluster
WO2024007604A1
Cited By
Decision strategy determination method and device based on operational research decision large model, electronic equipment and storage medium
CN120124755A
Long-range planning method and system of open body environment fusion model and symbol solver
CN120996196A