Model generation method and related system

Through natural language model processing natural language descriptions of optimization problems, a mathematical model of DSL expression is generated, which solves the problems of inefficient mathematical modeling and poor generalization in the existing technology, and achieves efficient and accurate mathematical modeling.

WO2025067215A1PCT designated stage expired Publication Date: 2025-04-03HUAWEI CLOUD COMPUTING TECHNOLOGIES CO LTD

Patent Information

Application Number
PCT/CN2024/121022
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2024-04-03
Filing Date
2024-09-25
Publication Date
2025-04-03

AI Technical Summary

Technical Problem

The prior art relies heavily on user experience in the mathematical modeling process, resulting in inefficient and poor generalization, making it difficult to quickly build mathematical models suitable for calculation.

Method used

Provide a model generation method, which processes natural language descriptions of optimization problems through natural language models, generates mathematical models of domain-specific language (DSL) expressions, lowers the modeling threshold and improves efficiency.

Benefits of technology

It realizes the generation of accurate and reliable mathematical models at low cost and low labor costs, which improves the efficiency and generalization of mathematical modeling.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024121022_03042025_PF_FP_ABST
    Figure CN2024121022_03042025_PF_FP_ABST
Patent Text Reader

Abstract

A model generation method, comprising: acquiring a natural language description of an optimization problem; and on the basis of the natural language description, obtaining a mathematical model of the optimization problem, wherein the mathematical model is expressed by means of a domain specific language (DSL). In the present application, when modeling of an optimization problem is performed, a model of the optimization problem is constructed by means of a natural language description of the optimization problem, and the model is expressed by means of a DSL, wherein the DSL has the advantages that DSL description information is similar to a high-level language, the modeling threshold is lower, and the labeling costs of training samples are low, such that a conversion model, which has very high precision and is used for constructing a DSL model on the basis of the natural language description of the optimization problem, can be obtained by means of low-cost training; moreover, since the DSL model is better understood for users, the users can modify the DSL model in a reasoning process, so as to obtain a more accurate DSL model, which better meets requirements of the users themselves, such that the reliability and accuracy of a model generation result can be ensured while greatly reducing the labor costs and the requirements for the users.
Need to check novelty before this filing date? Find Prior Art

Description

A model generation method and related system

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office on September 28, 2023, with application number 202311278766.1 and application name “A decision optimization method, device and system”, all of which are incorporated by reference into this application, and claims priority to the Chinese patent application filed with the State Intellectual Property Office on April 3, 2024, with application number 202410404429.0 and application name “A model generation method and related system”, all of which are incorporated by reference into this application. Technical Field

[0002] The present application relates to the field of artificial intelligence (AI) technology, and in particular to a model generation method, system, computing device cluster, computer-readable storage medium, and computer program product. Background Art

[0003] Operations research primarily uses mathematical methods to study optimization approaches and solutions for various systems, providing decision makers with a basis for scientific decision-making. Mathematical programming is an important branch of operations research, and its main research goal is to find the optimal solution that can minimize or maximize a function in a given area. The application of mathematical programming is extremely common. Depending on the nature of the problem and the difference in the approach, mathematical programming can be divided into many different branches, such as linear programming, integer programming, nonlinear programming, combinatorial optimization, multi-objective programming, stochastic programming, dynamic programming, parametric programming, and other problems. Different mathematical programming methods can be applied to different scenarios. For example, linear programming can be applied to network flow optimization problems, and mixed integer programming can be applied to production scheduling, supply chain, production scheduling, factory site selection, and other problems.

[0004] Using operations research tools to solve practical application problems requires two key steps: mathematical modeling and problem solving. Mathematical modeling refers to abstracting decision-making optimization problems in production and life into a mathematical programming problem. Mathematical programming problems generally consist of three parts: decision variables, constraints, and objective functions. Decision variables represent the actual content of the decision, such as the quantity of a certain product produced and the manpower invested; constraints represent the resource constraints faced when making decisions, such as limited raw materials and funds; and objective functions are evaluation indicators of decision quality, such as maximizing profits and minimizing costs. Problem solving refers to selecting a specific solution to solve the mathematical programming problem and obtaining the optimal or feasible solution to the problem, that is, the values ​​of the decision variables that meet all constraints.

[0005] However, mathematical modeling currently relies heavily on user experience. For example, industry experts and operations research experts are often required to construct a suitable mathematical model. This significantly reduces the efficiency of mathematical modeling and its generalizability (meaning that only specific experts can perform mathematical modeling). Therefore, improving the efficiency of mathematical modeling is a technical problem that needs to be solved urgently.

[0006] Summary of the Invention

[0007] The present application provides a model generation method and also provides a problem-solving system, a computing device cluster, a computer-readable storage medium, and a computer program product corresponding to the above method.

[0008] In a first aspect, the present application provides a model generation method. The method can be executed by a model generation system. The model generation system is used to model the optimization problem and obtain a modeling result. The model generation system can be a software system, which can be deployed in a computing device cluster, for example, in a cloud computing cluster provided by a cloud service provider, or in an edge computing cluster. The computing device cluster executes the program code of the software system, thereby executing the model output method of the present application. The software system can also be integrated into software with an optimization problem solving function (or a model generation function), for example, it can be in the form of a functional module such as a plug-in in the software. Alternatively, the software system can be independent of the software with an optimization problem solving function (or a model generation function), and the software system calls the software with an optimization problem solving function (or a model generation function) to implement the optimization problem solving function. The software system can be deployed on a computing device, for example, on a terminal device such as a desktop computer, a laptop computer, a tablet computer, a smartphone (also referred to as a terminal). The computing device executes the program code of the software system, thereby executing the problem-solving method of the present application. In some possible implementations, the model generation system may also be a hardware system, such as a computing device cluster with optimization problem solving capabilities (or model generation capabilities). When the hardware system is running, the model generation method of the present application is executed.

[0009] Specifically, the model generation method includes: obtaining a natural language description of the optimization problem, the natural language description of the optimization problem is used to describe the problem of adjusting the value of the decision object to make the optimization target reach the expected value under given decision conditions; processing the natural language description of the optimization problem through a natural language model to obtain a mathematical model of the optimization problem, the mathematical model is expressed through a domain-specific language, and the mathematical model includes the decision variables, the constraints and the objective function of the optimization problem, wherein the decision object is a natural language description of the decision variable, the decision condition is a natural language description of the constraint, and the optimization target is a natural language description of the objective function; according to the mathematical model, a solution file is obtained, and the solution file is used to solve the optimization problem through a solver.

[0010] The solution file may be a file that can be directly understood by a subsequent solver, for example, it may be described in a language such as MPS.

[0011] A parsing tool capable of parsing DSL can be used to convert the mathematical model described by the DSL into a solution file (for example, a file described by MPS). For example, the interpretation engine of an existing modeling tool (capable of parsing DSL) can be used to directly convert the DSL into a standard model file MPS that the solver can understand. Optionally, a machine learning model can be used to convert the mathematical model described by the DSL into a solution file, for example, this can be achieved through a language model. During training, the machine learning model is equipped with the ability to parse the DSL through the construction of training samples and the model update process.

[0012] In this application, when modeling an optimization problem, a model (mathematical model) of the optimization problem is constructed using a natural language description of the optimization problem. The mathematical model is expressed in a domain-specific language (DSL). The advantages of DSL are: DSL description information is similar to that of a high-level language, the modeling threshold is low, and the annotation cost of training samples is low. Therefore, a highly accurate conversion model (for example, a language model) for constructing a DSL model based on the natural language description of the optimization problem can be trained at a low cost. Moreover, because the DSL model is easier for users to understand, users can modify the DSL model during the reasoning process to obtain a more accurate DSL model that better meets their own requirements. Therefore, the reliability and accuracy of the model generation results can be guaranteed while greatly reducing labor costs and user requirements.

[0013] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input mathematical model modification information, which can be a modification to the mathematical model. Specifically, the mathematical model modification information input by the user can be obtained, the model modification information indicating the modification to the mathematical model; based on the model modification information, at least one of the decision variables, constraints, and objective function of the mathematical model can be modified to obtain the modified mathematical model; and based on the modified mathematical model, a modified solution file can be obtained.

[0014] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input natural language modification information to modify the mathematical model by modifying the description of the optimization problem itself. The natural language modification information can be a modification of the natural language description of the optimization problem. Specifically, the natural language modification information input by the user can be obtained, the natural language modification information indicating the modification of the natural language description of the optimization problem; based on the natural language modification information, the text content of the natural language description of the optimization problem is modified to obtain a modified natural language description of the optimization problem; and based on the modified natural language description of the optimization problem, a modified solution file is re-obtained.

[0015] Through this approach, users can evaluate whether the generated DSL model meets business requirements. If the DSL model does not meet business needs, users can input modification information into the optimization problem solving system, eliminating the tedious process of manual modification and programming and improving operational efficiency. The system can respond in real time and generate new optimization results, allowing users to make real-time decisions in different scenarios and quickly adapt to changing needs and conditions.

[0016] In one possible implementation, the method further includes solving the optimization problem according to the solution file to obtain a solution result for the optimization problem. Because the DSL model is easier for users to understand, users can modify the DSL model during the reasoning process to obtain a more accurate DSL model that better meets their requirements. This ensures the reliability and accuracy of the optimization problem solution while significantly reducing labor costs and user requirements.

[0017] In one possible implementation, the method further includes:

[0018] A model processing platform is provided, which provides at least one of a problem input column, a model processing column and a result output column, wherein the problem input column is used to display the natural language description of the optimization problem input by the user, the model processing column is used to display the mathematical model, and the model processing column is also used to allow the user to input the natural language modification information, and the result output column is used to display the solution result of the optimization problem.

[0019] For example, in terms of the display position relationship, the question input column can be located above the model processing column, and the model processing column can be located above the result output column (the reason is that the information in the question input column is the information initially input by the user, and the information output by the model processing column and the received modification information are after the information input in the question input column. Therefore, displaying the question input column above the model processing column will be more in line with the user's usage habits). Alternatively, the question input column and the model processing column can be set adjacent to each other, and the result output column can be independently set in another area (for example, below or to the right) and farther away from the model processing column (the reason is that the question input column and the model processing column focus more on the input of information, and the result output column focuses more on the output of information. Displaying the two at a farther distance is more in line with the user's usage habits). This application does not limit the display position relationship between different columns.

[0020] In one possible implementation, the decision object in the problem input column and the decision variable in the model processing column are displayed using characters in the same format, or the decision condition in the problem input column and the constraint condition in the model processing column are displayed using characters in the same format, or the optimization objective in the problem input column and the objective function in the model processing column are displayed using characters in the same format.

[0021] For example, the same format may include, but is not limited to: using characters of the same color, the same size, the same font, or the same special effects (such as using the same color highlight) to display, etc., and the embodiments of the present application are not limited thereto.

[0022] In one possible implementation, the method further includes: after obtaining a solution to the optimization problem corresponding to the mathematical model based on the mathematical model, receiving modification information; obtaining a second model of the optimization problem based on the modification information, wherein the modification information indicates modifications to a natural language description of the optimization problem or the modified mathematical model, the second model being expressed in a domain-specific language (DSL); and obtaining a solution to the optimization problem corresponding to the second model based on the second model. After obtaining the solution, the user can readjust the natural language model or the DSL model based on the solution.

[0023] In one possible implementation, the natural language description of the optimization problem includes requirements for the solution result or solution process of the optimization problem. These requirements include at least one of a solution speed requirement, a solution accuracy requirement, and the need to quickly provide a feasible solution, and the mathematical model satisfies these requirements. Different requirements for the solution result or solution process of the optimization problem result in different generated DSL models. Therefore, "requirements for the solution result or solution process of the optimization problem" can be added to the natural language description of the optimization problem to ensure that the generated DSL meets the requirements indicated in the natural language description. When generating the DSL model using a language model, "requirements for the solution result or solution process of the optimization problem" can be included in a prompt to guide the language model to generate a DSL model that meets the requirements.

[0024] For example, DSL models can be modeled in a variety of different ways. DSL models also include multiple types of models. For example, taking the traveling salesman problem (TSP) as an example, there are two modeling methods: DFJ and MTZ. If the optimal solution needs to be found, DFJ is faster, but MTZ can quickly give a feasible solution.

[0025] In a possible implementation, before obtaining a solution to the optimization problem corresponding to the mathematical model based on the mathematical model, the method further includes: receiving a solution request for the optimization problem corresponding to the mathematical model.

[0026] In one possible implementation, obtaining the mathematical model of the optimization problem based on the natural language description includes: obtaining the mathematical model of the optimization problem based on a prompt constructed based on the natural language description; the prompt is used to input into a language model, and the prompt indicates to convert the natural language description into a model expressed in a domain-specific language (DSL).

[0027] It should be understood that the mathematical model in this application is different from the language model. The mathematical model is a modeling result for the optimization problem, while the language model is a machine learning model with learnable parameters.

[0028] In one possible implementation, when training a language model, a training sample including a prompt and a corresponding DSL model (the model serves as a label) may be constructed, wherein the prompt may instruct the language model to generate a DSL model based on an optimization problem described in natural language.

[0029] Obtaining the mathematical model of the optimization problem based on the natural language description includes: obtaining the mathematical model of the optimization problem through a language model based on the natural language description; or sending the natural language description to a cloud-side device and receiving the mathematical model of the optimization problem sent by the cloud-side device.

[0030] In one possible implementation, the method further includes: obtaining a third model of the optimization problem based on the mathematical model, wherein the third model is described by a standard model file. When solving the optimization problem, a solution to the optimization problem corresponding to the mathematical model can be obtained using a solver based on the third model of the optimization problem.

[0031] Among them, the standard model file can be described in a language that is lower than DSL and can be understood by the solver, such as MPS, NP or LP files. Among them, the MPS file is a file format ending with the suffix .mps. It is a standard format for expressing linear and integer programming problems. Many optimization solvers now support this format.

[0032] Afterwards, the DSL can be converted into a standard model file that can be understood by the solver (for example, through the interpretation engine of the modeling tool), thereby ensuring the reliability and accuracy of the solution results while greatly reducing labor costs and user requirements.

[0033] In a possible implementation, the solution result is expressed through a natural language description of the business domain where the optimization problem resides.

[0034] In one possible implementation, the solution results can be analyzed and interpreted, and the analysis results can be converted into natural language descriptions in the business context. For example, the variables in the solution results can be described in natural language. The above steps can be performed by a language model. In this way, the readability of the solution results can be improved.

[0035] In a second aspect, the present application provides a model generation apparatus, applied to a computing device or a computing device cluster, the apparatus comprising:

[0036] An interactive module is used to obtain a natural language description of the optimization problem, wherein the natural language description of the optimization problem is used to describe the problem of adjusting the value of the decision object so that the optimization goal reaches the expected value under given decision conditions;

[0037] A conversion module is used to process the natural language description of the optimization problem through a natural language model to obtain a mathematical model of the optimization problem, wherein the mathematical model is expressed in a domain-specific language and includes the decision variables, the constraints and the objective function of the optimization problem, wherein the decision object is a natural language description of the decision variables, the decision conditions are a natural language description of the constraints, and the optimization target is a natural language description of the objective function; based on the mathematical model, a solution file is obtained, and the solution file is used to solve the optimization problem through a solver.

[0038] In a possible implementation, the apparatus further includes:

[0039] A solution module is used to solve the optimization problem according to the solution file to obtain a solution result of the optimization problem.

[0040] In a possible implementation, the interaction module is further configured to:

[0041] Acquire natural language modification information input by a user, where the natural language modification information indicates a modification to the natural language description of the optimization problem;

[0042] The conversion module is further used to: modify the text content of the natural language description of the optimization problem according to the natural language modification information to obtain a modified natural language description of the optimization problem; and re-obtain a modified solution file based on the modified natural language description of the optimization problem.

[0043] In a possible implementation, the interaction module is further configured to:

[0044] Acquiring mathematical model modification information input by a user, wherein the model modification information indicates modification of the mathematical model;

[0045] The conversion module is further configured to modify at least one of the decision variables, constraints, and objective functions of the mathematical model according to the model modification information to obtain the modified mathematical model;

[0046] A modified solution file is obtained according to the modified mathematical model.

[0047] In a possible implementation, the interaction module is further configured to:

[0048] A model processing platform is provided, which provides at least one of a problem input column, a model processing column and a result output column, wherein the problem input column is used to display the natural language description of the optimization problem input by the user, the model processing column is used to display the mathematical model, and the model processing column is also used to allow the user to input the natural language modification information, and the result output column is used to display the solution result of the optimization problem.

[0049] In one possible implementation, the decision object in the problem input column and the decision variable in the model processing column are displayed using characters in the same format, or the decision condition in the problem input column and the constraint condition in the model processing column are displayed using characters in the same format, or the optimization objective in the problem input column and the objective function in the model processing column are displayed using characters in the same format.

[0050] In a possible implementation, the conversion module is specifically configured to:

[0051] A prompt for the optimization problem is constructed based on the natural language description of the optimization problem, wherein the prompt indicates that the natural language description is converted into a model expressed in a domain-specific language (DSL); the prompt is used to guide the natural language model to generate an output corresponding to the prompt; and the prompt is input into the natural language model to obtain a mathematical model of the optimization problem.

[0052] In a third aspect, the present application provides a computing device cluster. The computing device cluster includes at least one computing device, wherein the at least one computing device includes at least one processor and at least one memory. The at least one processor and the at least one memory communicate with each other. The at least one processor is configured to execute instructions stored in the at least one memory, so that the computing device or computing device cluster performs the method described in the first aspect or any implementation of the first aspect.

[0053] In a fourth aspect, the present application provides a computer-readable storage medium storing instructions, wherein the instructions instruct a computing device or a computing device cluster to execute the problem-solving method described in the first aspect or any implementation of the first aspect.

[0054] In a fifth aspect, the present application provides a computer program product comprising instructions, which, when executed on a computing device or a computing device cluster, enables the computing device or computing device cluster to execute the problem-solving method described in the first aspect or any one of the implementations of the first aspect.

[0055] Based on the implementation methods provided in the above aspects, this application can also be further combined to provide more implementation methods. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the technical methods of the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments.

[0057] FIG1 is a schematic diagram of an application architecture provided by an embodiment of the present application;

[0058] Figures 2 and 3 are schematic diagrams of a model training architecture provided in an embodiment of the present application;

[0059] Figures 4 and 5 are schematic diagrams of an application architecture provided in an embodiment of the present application;

[0060] FIG6 is a schematic diagram of a process of a model generation method provided in an embodiment of the present application;

[0061] 7A to 7E are schematic diagrams of pages provided in an embodiment of the present application;

[0062] 8 to 10 are schematic diagrams of an application architecture of a model generation method provided in an embodiment of the present application;

[0063] 11 to 14 are schematic diagrams of a model generation device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0064] Additionally, in the embodiments of this application, words such as "exemplary" and "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described in this application as "exemplary" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of the word "exemplary" is intended to present concepts in a concrete manner.

[0065] In the embodiments of the present application, “corresponding” and “relevant” may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0066] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0067] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0068] In this application, "at least one" means one or more, and "more" means 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 mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0069] First, some technical terms involved in the embodiments of this application are introduced.

[0070] 1. Operations Research and Optimization: Operations research primarily studies how humans utilize and manage various resources, while satisfying certain constraints, to maximize the benefits of limited resources and achieve overall optimality. In the present application, operations research and optimization problems may be referred to as optimization problems.

[0071] 2. Mathematical programming: Mathematical programming is a branch of mathematics that primarily aims to find the optimal solution that minimizes or maximizes a function within a given region. Mathematical programming can be divided into many different branches, including linear programming, integer programming, nonlinear programming, combinatorial optimization, multi-objective programming, stochastic programming, dynamic programming, and parametric programming.

[0072] 3. Mathematical programming solver: A software system that solves established linear, integer, mixed integer, and various nonlinear programming models.

[0073] 4. Mathematical modeling: The process of expressing a decision optimization problem as a mathematical programming model, including problem abstraction, identification of decision variables and constraints, expression using mathematical models, and generation of mathematical models.

[0074] 5. Mathematical modeling tools: Software systems that assist in building mathematical programming models and generate standardized mathematical programming model files. They usually also have the ability to call mathematical programming solvers to obtain solution results.

[0075] 6. Domain-Specific Language (DSL): A programming language specifically designed to solve problems in a specific domain. Compared to general-purpose programming languages ​​(such as Java and Python), DSLs focus more on the needs and semantics of a specific domain, providing a higher level of abstraction and expressiveness. DSLs can be categorized as internal DSLs and external DSLs. Internal DSLs are domain-specific syntax and libraries embedded in a general-purpose programming language, leveraging the general-purpose language's syntax and tools to implement domain-specific functionality. External DSLs are domain-specific languages ​​independent of the general-purpose programming language, with their own syntax and interpreter / compiler.

[0076] 7. Large language model (LLM): A large language model is a massive language model built using deep learning technology. It learns the patterns and probability distributions of language by training on large amounts of text data, such as internet articles, books, and news. Large language models can understand and generate natural language, possessing certain semantic understanding and language generation capabilities.

[0077] In the prior art, in the process of mathematical modeling and problem solving for optimization problems, when a production system needs to be optimized, experts in the industry (such as transportation, energy, industrial manufacturing, etc.) and experts in operations research can work together to understand and abstract the optimization problem, and to construct a corresponding mathematical optimization model. Then, the mathematical optimization model and the production data in the production system can be processed through modeling tools (mathematical programming modeling tools) to obtain an example of a mathematical optimization problem. Then, operations research experts can manually formulate a solution. Finally, the example of the mathematical optimization problem can be solved through the solution to obtain the required decision. It can be seen that the participation of industry experts and operations research experts is required in both the mathematical modeling and problem solving stages.

[0078] For mathematical modeling, the modeler needs to be familiar with the business context and understand the meaning and requirements of each decision factor. Furthermore, the modeler must possess a solid foundation in mathematical optimization and be able to convert the variables and constraints of different decision types into corresponding mathematical relationships, forming a complete mathematical programming problem. Furthermore, mathematical optimization models vary in quality: "good" models are easier to solve or less likely to cause numerical precision issues, while "bad" models are the opposite. The same problem often presents multiple equivalent modeling approaches, and modelers require extensive academic training to master the techniques of building "good" models.

[0079] In actual production, problem solving often involves complex, multi-stage decision-making optimization problems. A single standardized solver cannot meet these requirements, requiring users to develop customized algorithms and integrate them with existing problem-solving tools to create a complete solution. Developing a solution requires a deep understanding of the nature of the problem and mastery of the design and use of various solvers and algorithms. Therefore, this typically requires the expertise of a seasoned operations research expert.

[0080] It can be seen that both the mathematical modeling stage and the problem-solving stage are highly dependent on the user's experience.

[0081] In addition, during the solution process, the optimization problem to be solved can be solved through modeling tools. Users can check the mathematical model obtained by modeling to confirm whether it needs to be modified. However, on the one hand, the mathematical model obtained by existing modeling tools is described by a standard model file (MPS). However, the code in the MPS needs to be described accurately, so the training samples of the modeling tool itself need to be sufficient, which is difficult to meet in practice (because the standard labor cost is too high). On the other hand, the MPS file is difficult for users to understand, and requires a high level of ability from the user himself, which requires high labor costs.

[0082] In view of this, the present application provides a model generation method. The method can be executed by a model generation system. The model generation system is used to model the optimization problem and obtain a modeling result. The model generation system can be a software system, which can be deployed in a computing device cluster, for example, in a cloud computing cluster provided by a cloud service provider, or in an edge computing cluster. The computing device cluster executes the program code of the software system, thereby executing the model output method of the present application. The software system can also be integrated into software with an optimization problem solving function (or a model generation function), for example, it can be in the form of a functional module such as a plug-in in the software. Alternatively, the software system can also be independent of the software with the optimization problem solving function (or the model generation function), and the software system calls the software with the optimization problem solving function (or the model generation function) to implement the optimization problem solving function. The software system can be deployed on a computing device, for example, on a terminal device such as a desktop, laptop, tablet computer, or smartphone (also referred to as a terminal). The computing device executes the program code of the software system, thereby executing the problem solving method of the present application. In some possible implementations, the model generation system may also be a hardware system, such as a computing device cluster with optimization problem solving capabilities (or model generation capabilities). When the hardware system is running, the model generation method of the present application is executed.

[0083] In order to make the technical solution of the present application clearer and easier to understand, the system architecture of the present application is introduced below with reference to the accompanying drawings.

[0084] In an embodiment of the present application, in one possible implementation method, an AI basic development platform is deployed on a cloud management platform (also referred to as a cloud platform), and tenants can train the above-mentioned models on the AI ​​basic development platform.

[0085] Among them, the above-mentioned AI model can be a language model in the embodiment of the present application. The language model can be used to obtain a DSL model of the optimization problem based on the natural language description of the input optimization problem. The tenant can train to obtain a language model that meets the requirements.

[0086] It should be understood that the AI ​​Basic Development Platform is a platform-as-a-service (PaaS) cloud service within the cloud management platform. This software platform, leveraging the extensive infrastructure and software capabilities of public cloud service providers, assists tenants (also known as users, AI developers, etc.) in building, training, and deploying AI models, as well as developing and deploying AI applications. As shown in Figure 1, the interaction between tenants and the AI ​​Basic Development Platform primarily involves logging into the cloud platform through a client webpage, selecting and purchasing the AI ​​Basic Development Platform's cloud services, and then conducting full-process AI development based on the functionality provided by the AI ​​Basic Development Platform. When tenants develop and train their own AI models on the AI ​​Basic Development Platform, they do so using the infrastructure resources (primarily computing resources, such as central processing units (CPUs), graphics processing units (GPUs), and embedded neural network processors (NPUs)) in the cloud service provider's data center. Therefore, when purchasing and using the AI ​​Basic Development Platform, tenants primarily pay for the resources they use.

[0087] For ease of description, the following uses the training process of a feature extraction model on an AI basic development platform as an example to illustrate the model training process on the AI ​​basic development platform.

[0088] For example, when training a feature extraction model on an AI foundation development platform, distributed parallel training can be used to improve training efficiency. There are two types of distributed parallel training: data parallelism and model parallelism.

[0089] For example, as shown in Figure 2, data parallelism specifically refers to deploying the same feature extraction model to be trained on multiple nodes (for example, nodes 1, 2, 3, ..., N), and dividing the data set used for training into multiple data subsets and distributing them to each node. Each node independently uses the data in its corresponding data subset to train the feature extraction model in the node. During each training iteration, the gradient value calculated by each node can be synchronized to other nodes, so that each node can obtain the gradient mean of an iteration process. The gradient mean is the average value of the gradient of each node in the same iteration process. Each node can update the parameters of its own feature extraction model based on the gradient mean. This is equivalent to training the feature extraction model by aggregating mini-batch data from many nodes to form a large batch of data, so that the convergence speed of the feature extraction model will be faster, improving the efficiency of model training. Each node can be a GPU, a virtual machine instance, or a container instance.

[0090] For example, as shown in Figure 3, model parallelism (also known as network parallelism) specifically refers to splitting a feature extraction model into multiple sub-model parts, with different sub-model parts deployed on different nodes. During training, the sub-model parts on different nodes calculate the same data in a dataset according to the structural order of the model. During an iteration, the gradient value can be obtained through the calculation of the sub-model parts on different nodes. The parameters of each sub-model part can be updated by forward propagation or backpropagation based on the gradient value. After multiple iterations, when the training requirements are met, the sub-model parts on each node are reorganized according to the structure of the feature extraction model to obtain a trained feature extraction model. When the feature extraction model is large in scale, by splitting the feature extraction model for training, the computing power of multiple nodes can be combined to achieve the training of the feature extraction model. Optionally, if the trained feature extraction model can also be distributed according to the split structure, when the feature extraction model is used for reasoning, distributed reasoning is performed.

[0091] The AI ​​basic development platform can also deploy the aforementioned trained models (for example, language models) on nodes in a cloud environment or nodes in an edge environment. Among them, the nodes in the cloud environment can be virtual machine instances, container instances, physical servers, etc., and the nodes in the edge environment can be various edge devices. As shown in Figure 4, as an example, when the scale of the model is large, the model can be distributedly deployed on multiple nodes based on the idea of ​​model parallelism. As another example, the model can also be deployed independently on multiple nodes to support a larger amount of online service visits. As another example, the AI ​​basic development platform can also deploy AI applications to edge devices registered with the cloud platform according to the application requirements of the AI ​​model.

[0092] The deployed AI model can become an AI application or a component of an AI application. As shown in Figure 5, tenants can access AI applications online through a webpage or a client app. When an AI application is used, it can be invoked online to respond to the AI ​​model deployed in the edge or cloud environment. Thus, AI models developed and trained using the AI ​​Basic Development Platform can infer the requested data online and return the inference results.

[0093] Among them, the above-mentioned AI application can have the function of solving the optimization problem to be solved and obtaining the solution result.

[0094] To achieve the above functions, in addition to the trained language model, you can also deploy (online or locally) a converter and a solver. The converter can convert the DSL model obtained by the AI ​​model into MPS, and the solver can solve the MPS to obtain the solution result.

[0095] When the AI ​​model provides online reasoning services, the AI ​​basic development platform can continuously collect input and output data of the reasoning process, use the input and output data of the reasoning stage to continue to enrich the training data set, and continue to optimize the training AI model based on the data of the reasoning stage and the corresponding manually confirmed results.

[0096] It should be understood that in other cases, AI models developed and trained on the aforementioned AI foundation development platform may not be deployed online. Instead, tenants can download the trained AI models locally for free local deployment. For example, tenants can choose to save the trained AI models to OBS and then download them locally from OBS.

[0097] The problem-solving system in the embodiment of the present application may have the function of solving the optimization problem to be solved and obtaining a solution result.

[0098] In some examples, the above-mentioned optimization problem solving system can be deployed entirely in the cloud (cloud environment), entirely on the edge (edge ​​environment), or on the terminal. In other examples, the optimization problem solving system can also be deployed in different environments, for example, it can be deployed in the cloud and the edge in an edge-cloud collaborative manner.

[0099] The optimization problem solving system can be subdivided into conversion modules, language processing modules, conversion modules, solution modules, etc. according to different functions. It should be understood that the embodiment of the present application can refer to the language model module, conversion module, and solution module as processing modules, which can be split into more or merged into fewer modules in actual applications. The deployment of the optimization problem solving system can involve hardware devices in the cloud and hardware devices at the edge. The hardware devices in the cloud usually have rich computing power and huge storage capacity, for example, they can include servers and databases, and the hardware devices at the edge have certain reasoning capabilities and storage capabilities, for example, they can include industrial computers and artificial intelligence edge computing devices. In some possible implementations, the deployment of the optimization problem solving system also involves terminals, which can include mobile phones, self-driving cars, industrial quality inspection systems and other IoT devices.

[0100] The conversion module can obtain the natural language description of the optimization problem input by the user. For example, the conversion module can be deployed on the end-side, which can provide an interactive interface. The interactive interface can be a graphical user interface (GUI). The user can enter the natural language description of the optimization problem through the GUI. For example, the conversion module can be deployed on the cloud side or the edge side, and the conversion module can obtain the natural language description of the optimization problem transmitted by the end-side device.

[0101] In addition, the conversion module can also be based on the user's modification information of the subsequently obtained model (such as a DSL model) or the solution result.

[0102] The language model module can generate a DSL model based on the natural language description of the optimization problem by calling the language model. For example, the language model module can be deployed on the cloud side or the edge side. The language model module can generate a DSL model based on the natural language description of the optimization problem by calling the language model.

[0103] It should be understood that the DSL model can be presented on the client side so that the user can view and modify it.

[0104] In addition, the language model module can also obtain a modified DSL model by calling the language model based on the user's modification information.

[0105] The conversion module can convert the DSL model obtained by the language model module into MPS. For example, the conversion module can be deployed on the cloud side or the edge side. The conversion module can convert the DSL model obtained by the language model module into MPS through the interpretation engine of the modeling tool.

[0106] The solution module can generate a solution result based on the MPS obtained by the conversion module by calling the solver. For example, the solution module can be deployed on the cloud side or the edge side, and the solution module can generate a solution result based on the MPS obtained by the conversion module by calling the solver.

[0107] It should be understood that the solution results can be presented on the terminal side so that the user can view and modify them.

[0108] Based on the model generation system shown in Figures 1 and 5, the present application provides a model generation method. The problem-solving method of the present application is introduced below.

[0109] Referring to the flowchart of the problem-solving method shown in FIG6 , the method can be executed by the model generation system. The method includes:

[0110] 601. Obtain a natural language description of the optimization problem, where the natural language description of the optimization problem is used to describe the problem of adjusting the value of the decision object under given decision conditions so that the optimization goal reaches an expected value.

[0111] In a possible implementation, a natural language description of the optimization problem input by the user may be obtained.

[0112] For example, a user may input a natural language description of an optimization problem on a terminal device, and then an interactive module of the terminal device may obtain the natural language description of the optimization problem input by the user.

[0113] The natural language description of an optimization problem can be a description of the optimization problem itself. This description is expressed through a description related to the actual business scenario. For example, an optimization problem can include variables (i.e., decision objects), an objective function (i.e., making the optimization objective reach an expected value), and constraints (i.e., decision conditions). The decision objects, decision conditions, and optimization objectives are all described in natural language rather than mathematical formulas. The decision objects are parameters or variables that can be adjusted or controlled in the optimization problem. Decision conditions restrict the value of the decision objects and typically describe the constraints of the optimization problem, such as production resource constraints. The optimization objective is the optimization goal that the user, as the decision maker, seeks. The natural language description of the optimization problem describes how, under given decision conditions, the optimization objective reaches its expected value by adjusting the value of the decision objects. The expected value can be a global extreme value, such as a global maximum or minimum, or a local extreme value, such as a local maximum or minimum. Preferably, the expected value defines key indicators such as cost, benefit, and efficiency, and is used to find the lowest-cost production solution. During the optimization process, the process of approaching the optimal solution by continuously adjusting variables is a continuous improvement of this expected value. In some embodiments provided in this application, the optimization problem may involve fields such as industrial production scheduling, logistics distribution, and resource scheduling.

[0114] For example, a natural language description of the optimization problem could be: "A restaurant is adding two new dishes to its menu, chicken and beef. Each chicken dish costs $5 to make, while each beef dish costs $8 to make. The restaurant has budgeted $300 for these ingredients, and the selling price of chicken is $12 and the selling price of beef is $18. In addition, each chicken dish requires 2 units of preparation time, while each beef dish requires 3 units of preparation time. The restaurant has 35 units of preparation time. How many chicken and beef dishes should the restaurant prepare to maximize profits? Build this model."

[0115] In this example, the decision objects are the quantity of chicken and beef to prepare, the decision conditions are that the total cost of beef and chicken should be within the budget, and the total preparation time of beef and chicken should be within the overall preparation time. The optimization objective is to maximize profit, which is the sum of the profits of all dishes, and profit is the selling price minus the cost of the dish. The above information about the decision objects, decision conditions, and optimization objectives is included in the semantics of the natural language description entered by the user.

[0116] In addition, in order to obtain a model of the optimization problem that better meets the user's requirements, the natural language description of the optimization problem can include, in addition to the description of the optimization problem itself, requirements for the solution results or solution process of the optimization problem. For example, the requirements include at least one of the requirements for solution speed, solution accuracy, and whether a feasible solution needs to be provided quickly.

[0117] In addition, in addition to directly entering a natural language description of the optimization problem in the problem input column 701, the terminal side can also pre-provide description templates for optimization problems in multiple fields, and users can directly make adaptive modifications to the templates. Referring to Figure 7B, Figure 7B is a schematic diagram of a page related to solving an optimization problem. Users can select a related optimization problem template in the problem template 702.

[0118] 602. Process the natural language description of the optimization problem using a natural language model to obtain a mathematical model of the optimization problem, wherein the mathematical model is expressed in a domain-specific language and includes the decision variables, the constraints, and the objective function of the optimization problem, wherein the decision object is a natural language description of the decision variables, the decision conditions are a natural language description of the constraints, and the optimization objective is a natural language description of the objective function. In this field, decision variables are typically represented by symbols (e.g., x, y, z), and constraints can be equations or inequalities, such as Ax≤b, where A is a coefficient matrix, x is a decision variable vector, and b is a constant vector. The objective function is typically represented by the symbol f(x), where x is a decision variable vector.

[0119] For example, as shown in FIG7C , the optimization problem of preparing dishes in the restaurant in step 601 can be transformed into:

[0120] Here, the decision variables are x and y, the constraints are 5x + 8y <= 300, 2x + 3y <= 35, x, y >= 0, x, y∈R, and the objective function is max 7x + 10y. The decision object is a natural language description of the decision variables, the decision condition is a natural language description of the constraints, and the optimization objective is a natural language description of the objective function. Specifically, x and y refer to the decision objects for the amount of chicken and beef prepared by the restaurant, respectively. 5x + 8y <= 300, 2x + 3y <= 35, x, y >= 0, and x, y∈R refer to the decision conditions that the total cost of beef and chicken should be within the budget and the total preparation time of beef and chicken should be within the overall preparation time. Max 7x + 10y refers to the optimization objective of maximizing profit.

[0121] In this application, when modeling an optimization problem, a model (mathematical model) of the optimization problem is constructed using a natural language description of the optimization problem. The mathematical model is expressed in a domain-specific language (DSL). The advantages of DSL are: DSL description information is similar to that of a high-level language, the modeling threshold is low, and the annotation cost of training samples is low. Therefore, a highly accurate conversion model (for example, a language model) for constructing a DSL model based on the natural language description of the optimization problem can be trained at a low cost. Moreover, because the DSL model is easier for users to understand, users can modify the DSL model during the reasoning process to obtain a more accurate DSL model that better meets their own requirements. Therefore, the reliability and accuracy of the model generation results can be guaranteed while greatly reducing labor costs and user requirements.

[0122] In the embodiment of the present application, the natural language description of the optimization problem is used to describe the problem of adjusting the value of the decision object to make the optimization target reach the expected value under given decision conditions, and the optimization problem described in the DSL language (that is, the mathematical model in the embodiment of the present application) may include the decision object (that is, the variable), may not include the definition of the variable (illustrated in Figure 7C), or may include the definition of the variable (illustrated in Figure 7D).

[0123] In one possible implementation, a mathematical model of the optimization problem can be obtained based on the natural language description through a machine learning model (for example, a language model, more specifically, a large language model (LLM)). The mathematical model is expressed in a domain-specific language (DSL).

[0124] In one possible implementation, a prompt can be constructed based on a natural language description and used as the input of a language model. Through training, the language model can be equipped with the ability to obtain a DSL model based on a natural language model of an optimization problem. In other words, the language model can be a language model for a vertical field. Furthermore, the language model can output a mathematical model of the optimization problem (expressed through a DSL), which can be a domain-specific mathematical optimization model (NLP2DSL).

[0125] The process of constructing the prompt can be completed on the client side, or the client side can send the natural language description to the cloud side, and the construction can be completed by the cloud side device.

[0126] In the embodiments of the present application, users describe optimization problems in natural language, and a language model is used to construct a mathematical model. This reduces the modeler's experience in mathematical optimization modeling, allowing users without mathematical optimization knowledge to complete mathematical optimization modeling. The resulting DSL model is similar to a high-level language, offering a low modeling threshold and low training sample annotation costs. Therefore, a highly accurate conversion model (e.g., a language model) can be trained at a low cost for constructing a DSL model based on the natural language description of the optimization problem. Furthermore, the DSL model is easier for users to understand.

[0127] In one possible implementation, the cloud-side device can obtain a mathematical model of the optimization problem based on the natural language description using a language model, and the cloud-side device can send the mathematical model of the optimization problem to the terminal-side device. In turn, the terminal device can present the mathematical model.

[0128] In a possible implementation, first modification information may be obtained, and a modified mathematical model may be obtained based on the first modification information, where the first modification information indicates a natural language description of the optimization problem or a modification of the mathematical model.

[0129] 603. Obtain a solution file based on the mathematical model, wherein the solution file is used to solve the optimization problem using a solver;

[0130] The solution file may be a file that can be directly understood by a subsequent solver, for example, it may be described in a language such as MPS.

[0131] A parsing tool capable of parsing DSL can be used to convert the mathematical model described by the DSL into a solution file (for example, a file described by MPS). For example, the interpretation engine of an existing modeling tool (capable of parsing DSL) can be used to directly convert the DSL into a standard model file MPS that the solver can understand. Optionally, a machine learning model can be used to convert the mathematical model described by the DSL into a solution file, for example, this can be achieved through a language model. During training, the machine learning model is equipped with the ability to parse the DSL through the construction of training samples and the model update process.

[0132] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input mathematical model modification information, which can be a modification to the mathematical model. Specifically, the mathematical model modification information input by the user can be obtained, the model modification information indicating the modification to the mathematical model; based on the model modification information, at least one of the decision variables, constraints, and objective function of the mathematical model can be modified to obtain the modified mathematical model; and based on the modified mathematical model, a modified solution file can be obtained.

[0133] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input natural language modification information to modify the mathematical model by modifying the description of the optimization problem itself. The natural language modification information can be a modification of the natural language description of the optimization problem. Specifically, the natural language modification information input by the user can be obtained, the natural language modification information indicating the modification of the natural language description of the optimization problem; based on the natural language modification information, the text content of the natural language description of the optimization problem is modified to obtain a modified natural language description of the optimization problem; and based on the modified natural language description of the optimization problem, a modified solution file is re-obtained.

[0134] Through this approach, users can evaluate whether the generated DSL model meets business requirements. If the DSL model does not meet business needs, users can input modification information into the optimization problem solving system, eliminating the tedious process of manual modification and programming and improving operational efficiency. The system can respond in real time and generate new optimization results, allowing users to make real-time decisions in different scenarios and quickly adapt to changing needs and conditions.

[0135] In one possible implementation, the method further includes:

[0136] A model processing platform is provided, which provides at least one of a problem input column, a model processing column and a result output column, wherein the problem input column is used to display the natural language description of the optimization problem input by the user, the model processing column is used to display the mathematical model, and the model processing column is also used to allow the user to input the natural language modification information, and the result output column is used to display the solution result of the optimization problem.

[0137] For example, in terms of the display position relationship, the question input column can be located above the model processing column, and the model processing column can be located above the result output column (the reason is that the information in the question input column is the information initially input by the user, and the information output by the model processing column and the received modification information are after the information input in the question input column. Therefore, displaying the question input column above the model processing column will be more in line with the user's usage habits). Alternatively, the question input column and the model processing column can be set adjacent to each other, while the result output column can be independently set in another area (for example, below or to the right) and farther away from the model processing column (the reason is that the question input column and the model processing column focus more on the input of information, and the result output column focuses more on the output of information. Displaying the two at a farther distance is more in line with the user's usage habits). This application does not limit the display position relationship between different columns.

[0138] In one possible implementation, the user can enter a natural language description of the optimization problem on a page related to solving the optimization problem. Referring to Figure 7A, Figure 7A is a schematic diagram of a page related to solving the optimization problem. The user can enter a natural language description of the optimization problem in the problem input column 701.

[0139] In one possible implementation, a mathematical model can be presented on a page. For example, referring to FIG7C , FIG7C is a schematic diagram of a page related to solving an optimization problem, wherein the model processing column 704 is a presentation area of ​​the mathematical model. In addition, referring to FIG7D , FIG7D is a schematic diagram of a page related to solving an optimization problem, wherein. The mathematical model can also be described as a description of a business scenario adapted to the optimization problem. For example, all variables therein can be represented by natural language descriptions, thereby further improving the readability of the model. Specifically, the description is:

[0140] variable:

[0141] x: continuous variable for the number of chicken dishes

[0142] y: continuous variable for the number of beef dishes

[0143] Objective function

[0144] Maximize Profit:

[0145] max7x+10y

[0146] constraint

[0147] Budget Constraint:

[0148] 5x+8y<=300

[0149] Time constraints:

[0150] 2x+3y<=35

[0151] Non-negativity constraints:

[0152] x,y>=0

[0153] Therefore, based on the DSL description of the mathematical model of the optimization problem in Figure 7C, x is indicated to represent the number of chicken dishes and, optionally, the type is indicated to be a continuous variable. The three constraints are also indicated as budget, time, and non-negativity. This further improves the readability of the model.

[0154] In one possible implementation, the decision object in the problem input column and the decision variable in the model processing column are displayed using characters in the same format, or the decision condition in the problem input column and the constraint condition in the model processing column are displayed using characters in the same format, or the optimization objective in the problem input column and the objective function in the model processing column are displayed using characters in the same format.

[0155] For example, the same format may include, but is not limited to: using characters of the same color, the same size, the same font, or the same special effects (such as using the same color highlight) to display, etc., and the embodiments of the present application are not limited thereto.

[0156] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input mathematical model modification information, which can be a modification to the mathematical model. Specifically, the mathematical model modification information input by the user can be obtained, the model modification information indicating the modification to the mathematical model; based on the model modification information, at least one of the decision variables, constraints, and objective function of the mathematical model can be modified to obtain the modified mathematical model; and based on the modified mathematical model, a modified solution file can be obtained.

[0157] In one possible implementation, after presenting the mathematical model, the user can evaluate whether the mathematical model meets business requirements and, if necessary, input natural language modification information to modify the mathematical model by modifying the description of the optimization problem itself. The natural language modification information can be a modification of the natural language description of the optimization problem. Specifically, the natural language modification information input by the user can be obtained, the natural language modification information indicating the modification of the natural language description of the optimization problem; based on the natural language modification information, the text content of the natural language description of the optimization problem is modified to obtain a modified natural language description of the optimization problem; and based on the modified natural language description of the optimization problem, a modified solution file is re-obtained.

[0158] Through this approach, users can evaluate whether the generated DSL model meets business requirements. If the DSL model does not meet business needs, users can input modification information into the optimization problem solving system, eliminating the tedious process of manual modification and programming and improving operational efficiency. The system can respond in real time and generate new optimization results, allowing users to make real-time decisions in different scenarios and quickly adapt to changing needs and conditions.

[0159] For example, referring to FIG. 7C , FIG. 7C is a schematic diagram of a page related to solving an optimization problem, wherein the user can input modification information in the input box, or directly modify the mathematical model in the model processing column 704 .

[0160] The terminal device can allow users to modify the mathematical model, that is, users can modify the DSL model to obtain a more accurate DSL model that better meets their own requirements. Afterwards, the DSL can be converted into a standard model file MPS that can be understood by the solver (for example, through the interpretation engine of the modeling tool, the MPS can be but is not limited to LP, NL, etc.) and solved. In this way, the reliability and accuracy of the solution results can be guaranteed while greatly reducing labor costs and user requirements.

[0161] Through this approach, users can evaluate whether the generated DSL model meets business requirements. If the DSL model does not meet business needs, users can input modification information into the optimization problem solving system. This eliminates the tedious process of manual modification and programming, improving operational efficiency. The system can respond in real time and generate new optimization results, enabling users to make real-time decisions in different scenarios and quickly adapt to changing needs and conditions.

[0162] In a possible implementation, a solution to the optimization problem corresponding to the mathematical model can be obtained based on the mathematical model.

[0163] If the mathematical model is modified, the solution to the optimization problem corresponding to the modified mathematical model can be obtained based on the modified mathematical model.

[0164] In one possible implementation, a third model for the optimization problem can be derived based on the modified mathematical model. The third model can be described using a standard model file (MPS). Based on the third model for the optimization problem, a solver can be used to obtain a solution to the optimization problem corresponding to the modified mathematical model. For example, the cloud-side device can use a mathematical modeling interpreter to convert the generated mathematical optimization model into a standard model file that can be understood by the solver.

[0165] For example, referring to FIG. 7E , FIG. 7E is a schematic diagram of a page related to solving an optimization problem, wherein the model processing column 705 is a presentation area of ​​the third model.

[0166] In one possible implementation, the solution results can be analyzed and interpreted, and the analysis results can be converted into natural language descriptions in the business context. For example, the variables in the solution results can be described in natural language. The above steps can be performed by a language model. In this way, the readability of the solution results can be improved.

[0167] In one possible implementation, the end-side device can present the solution result, and the user can evaluate the solution result to determine whether it meets the business requirements. When it is confirmed that the solution result does not meet the business requirements, the DSL model can be modified. Specifically, modification information can be received (that is, the modification information input by the user when confirming that the solution result does not meet the business requirements), and a second model of the optimization problem can be obtained based on the modification information; the modification information indicates the modification of the natural language description of the optimization problem or the modified mathematical model, and the cloud-side device can obtain the solution result of the optimization problem corresponding to the second model based on the second model.

[0168] Taking the language model as an example, referring to Figure 8, Figure 8 is a schematic diagram of an application framework of the present application, in which the natural language description of the optimization problem input by the user can be used to obtain a DSL model through a language model (for example, the NLP2DSL module shown in Figure 8), and the converter in the solver engine (for example, the DSL2MPS module shown in Figure 8) is used to obtain a model (MPS) that can be parsed by the solver. The solver in the solver engine (for example, the OPT-Solver module shown in Figure 8) is used to obtain a solution result (for example, the optimal solution SOL of the model shown in Figure 8), and the language model (for example, the SOL2NLP module shown in Figure 8) is used to obtain a natural language description of the solution result in the context and present it to the user.

[0169] Taking the language model as an example, FIG9 is a schematic diagram of an application framework of the present application. Compared with FIG8 , FIG9 shows more details of the processing process of FIG8 . Specifically, the following steps may be included:

[0170] 1. Users describe their business requirements in natural language and generate a general problem description that includes decision optimization objectives, constraints, and other elements;

[0171] 2. Convert natural language into language related to mathematical modeling;

[0172] 3. The user evaluates whether the generated model described in a mathematical modeling language (DSL) meets the business requirements;

[0173] 4. The DSL model does not meet business requirements, and the user wants the system to send instructions to fine-tune the model;

[0174] 5. The DSL model meets business requirements and generates standard mathematical model files;

[0175] 6. Input the standard mathematical model file into the mathematical optimization solver and perform the solution;

[0176] 7. Obtain the solution results and analyze and interpret them, converting the analysis results into natural language descriptions in the business context;

[0177] 8. Convert the analytical conclusions of the results into business decision-making plans;

[0178] 9. Users evaluate whether the decision-making plan meets business requirements;

[0179] 10. The decision-making plan does not meet the requirements, and the user issues a command to the system to adjust the model;

[0180] 11. The decision plan meets the requirements and the decision optimization process ends.

[0181] Referring to FIG. 10 , FIG. 10 is a schematic diagram of an application framework of the present application, which shows a schematic diagram of the deployment of the modules in FIG. 8 and FIG. 9 , including:

[0182] User Interface: This interface provides an intuitive and user-friendly way to operate the system. Users can interact with the system through various controls and operations, such as entering text, selecting options, dragging elements, clicking buttons, and obtaining evaluation results.

[0183] Service Call Management Layer - Workflow Orchestration Engine: Automates the management and coordination of decision-making and optimization of business processes. It combines different tasks and activities into a complete workflow and automatically triggers and executes tasks based on user instructions and conditions.

[0184] General language model, including:

[0185] NLP2DSL: Converts natural language into mathematical modeling languages, such as AMPL, ZIMPL, Pyomo, and other modeling languages ​​and solver instructions;

[0186] SOL2NLP: Converts solution results into descriptions with practical business meaning;

[0187] Solving engine, including:

[0188] DSL2MPS: Calls the domain language parsing tool to parse the mathematical modeling language and generate a standard mathematical model file;

[0189] Low-code platform: helps developers quickly call mathematical optimization solutions and generate solutions. It provides a series of visual components and predefined modules to achieve functions such as automatic code generation, system integration and docking, and visual debugging.

[0190] Optimization solver: reads standard mathematical model files, solves the corresponding mathematical optimization problem and generates the optimal solution that meets the constraints or a satisfactory solution that meets user requirements.

[0191] The problem-solving method provided by the embodiment of the present application is described in detail above in conjunction with Figures 1 to 10 . The embodiment of the device of the present application will be described in detail below in conjunction with Figures 11 to 13 . It should be understood that the description of the method embodiment corresponds to the description of the device embodiment. Therefore, for portions not described in detail, reference can be made to the preceding method embodiment.

[0192] Based on the aforementioned problem-solving method, the present application further provides a model generation device. As shown in FIG11 , the problem-solving device 1100 includes:

[0193] Interaction module 1101 is used to obtain a natural language description of an optimization problem, where the natural language description of the optimization problem is used to describe the problem of adjusting the value of a decision object so that the optimization goal reaches an expected value under given decision conditions;

[0194] The conversion module 1102 is used to process the natural language description of the optimization problem through a natural language model to obtain a mathematical model of the optimization problem, wherein the mathematical model is expressed through a domain-specific language, and the mathematical model includes the decision variables, the constraints and the objective function of the optimization problem, wherein the decision object is a natural language description of the decision variables, the decision conditions are a natural language description of the constraints, and the optimization target is a natural language description of the objective function; according to the mathematical model, a solution file is obtained, and the solution file is used to solve the optimization problem through a solver.

[0195] Exemplarily, the conversion modules 1101 and 1102 may be implemented by hardware or software.

[0196] When implemented by software, the interaction module 1101 and the conversion module 1101 can be applications running on a computing device (such as a server). For example, the conversion module 1101 can be a computing engine running on a computing device. The application can be provided to users in the form of a virtualized service. Virtualization services can include virtual machine (VM) services, bare metal server (BMS) services, and container services. Among them, the VM service can be a service that uses virtualization technology to virtualize a virtual machine (VM) resource pool on multiple physical hosts (such as computing devices) to provide VMs for users to use on demand. The BMS service is a service that virtualizes a BMS resource pool on multiple physical hosts to provide BMS for users to use on demand. The container service is a service that virtualizes a container resource pool on multiple physical hosts to provide containers for users to use on demand. A VM is a simulated virtual computer, that is, a logical computer. BMS is a high-performance computing service that is elastically scalable and has computing performance that is no different from that of a traditional physical machine and has the characteristics of secure physical isolation. Containers are a kernel virtualization technology that provides lightweight virtualization to isolate user spaces, processes, and resources. It should be understood that the VM service, BMS service, and container service mentioned above are merely examples. In actual applications, virtualization services can also be other lightweight or heavyweight virtualization services, which are not specifically limited here.

[0197] When implemented via hardware, interaction module 1101 and conversion module 1102 can be implemented via transceiver modules, such as transceivers. Conversion module 1102 can include at least one computing device, such as a server. Alternatively, conversion module 1102 can be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD can be a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0198] In a possible implementation, the apparatus further includes:

[0199] The solution module 1103 is used to solve the optimization problem according to the solution file to obtain a solution result of the optimization problem.

[0200] The conversion module 1102 may be the DSL2MPS module, the NLP2DSL module or the SOL2NLP module in FIG. 10 .

[0201] The solving module 1103 may be the optimization solver module in FIG10 .

[0202] This application also provides a computing device 1200. As shown in Figure 12, computing device 1200 includes a bus 1203, a processor 1204, a memory 1206, and a communication interface 1208. Processor 1204, memory 1206, and communication interface 1208 communicate with each other via bus 1203. Computing device 1200 can be a server or a terminal device. It should be understood that this application does not limit the number of processors and memories in computing device 1200.

[0203] Bus 1203 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG12 shows a single line, but this does not imply a single bus or type of bus. Bus 1203 may include a path for transmitting information between various components of computing device 1200 (e.g., memory 1206, processor 1204, and communication interface 1208).

[0204] The processor 1204 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0205] The memory 1206 may include a volatile memory, such as a random access memory (RAM). The memory 1206 may also include a non-volatile memory, such as a read-only memory (ROM), a flash memory, a hard disk drive (HDD), or a solid state drive (SSD). The memory 1206 stores executable program code, and the processor 1204 executes the executable program code to implement the aforementioned problem-solving method. Specifically, the memory 1206 stores instructions for the optimization problem-solving system to execute the problem-solving method.

[0206] The communication interface 1208 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the computing device 1200 and other devices or a communication network.

[0207] Embodiments of the present application also provide a computing device cluster. The computing device cluster includes at least one computing device. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone.

[0208] As shown in Figure 13, the computing device cluster includes at least one computing device 1200. The memory 1206 of one or more computing devices 1200 in the computing device cluster may store instructions of the same optimization problem solving system for executing the problem solving method.

[0209] In some possible implementations, one or more computing devices 1200 in the computing device cluster may also be used to execute some of the instructions of the optimization problem-solving system for executing the problem-solving method. In other words, a combination of one or more computing devices 1200 may jointly execute the instructions of the optimization problem-solving system for executing the problem-solving method.

[0210] It should be noted that the memories 1206 in different computing devices 1200 in the computing device cluster may store different instructions for executing partial functions of the optimization problem solving system.

[0211] In some possible implementations, one or more computing devices in a computing device cluster may be connected via a network. The network may be a wide area network (WAN) or a local area network (LAN), etc. FIG14 shows a possible implementation. As shown in FIG14 , two computing devices 140A and 140B are connected via a network. Specifically, the connection to the network is made via a communication interface in each computing device. In this type of possible implementation, the memory 116 in the computing device 140A may store instructions for executing the functions of the interface module. At the same time, the memory 116 in the computing device 140B may store instructions for executing the functions of the processing module. Alternatively, the memory 116 in the computing device 140A may store instructions for executing part of the functions of the processing module. At the same time, the memory 116 in the computing device 140B may store instructions for executing another part of the functions of the processing module.

[0212] It should be understood that the functionality of computing device 140A shown in Figure 14 may also be performed by multiple computing devices. Similarly, the functionality of computing device 140B may also be performed by multiple computing devices.

[0213] The present application also provides another computing device cluster. The connection relationship between the computing devices in this computing device cluster can be similar to the connection relationship between the computing device clusters in Figures 13 and 14. However, the memory 116 in one or more computing devices in this computing device cluster can store the same instructions for executing the template generation method.

[0214] In some possible implementations, the memory 116 of one or more computing devices in the computing device cluster may also store partial instructions for executing the template generation method. In other words, the combination of one or more computing devices can jointly execute instructions for executing the template generation method.

[0215] It should be noted that the memory 116 in different computing devices in the computing device cluster can store different instructions for executing part of the functions of the template generation method. In other words, the instructions stored in the memory 116 in different computing devices can implement the functions of one or more modules in the interface module and the processing module.

[0216] The embodiment of the present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center containing one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the above-mentioned application to the optimization problem-solving system for executing the problem-solving method, the training sample generation method, and the model training method.

[0217] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the aforementioned problem-solving method, training sample generation method, and model training method.

[0218] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the protection scope of the technical solutions of the various embodiments of the present invention.

Claims

1. A mathematical model generation method, characterized in that: Applied to a computing device or a computing device cluster, the method comprises: Obtaining a natural language description of the optimization problem, where the natural language description of the optimization problem is used to describe the problem of adjusting the value of the decision object under given decision conditions so that the optimization target reaches an expected value; Processing the natural language description of the optimization problem through a natural language model to obtain a mathematical model of the optimization problem, wherein the mathematical model is expressed through a domain-specific language and includes decision variables, constraints and an objective function of the optimization problem, wherein the decision object is a natural language description of the decision variable, the decision condition is a natural language description of the constraint, and the optimization target is a natural language description of the objective function; A solution file is obtained according to the mathematical model, and the solution file is used to solve the optimization problem through a solver.

2. The method according to claim 1, characterized in that: The method further comprises: The optimization problem is solved according to the solution file to obtain a solution result of the optimization problem.

3. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquire natural language modification information input by a user, wherein the natural language modification information indicates modification of the natural language description of the optimization problem; Modify the text content of the natural language description of the optimization problem according to the natural language modification information to obtain a modified natural language description of the optimization problem; According to the modified natural language description of the optimization problem, a modified solution file is obtained again.

4. The method according to claim 1 or 2, characterized in that: The method further comprises: Acquiring mathematical model modification information input by a user, wherein the model modification information indicates modification of the mathematical model; Modify at least one of the decision variables, constraint conditions and objective function of the mathematical model according to the model modification information to obtain the modified mathematical model; A modified solution file is obtained according to the modified mathematical model.

5. The method according to any one of claims 1 to 4, characterized in that: The method further comprises: A model processing platform is provided, which provides at least one of a problem input column, a model processing column and a result output column, wherein the problem input column is used to display the natural language description of the optimization problem input by the user, the model processing column is used to display the mathematical model, the model processing column is also used to allow the user to input the natural language modification information, and the result output column is used to display the solution result of the optimization problem.

6. The method according to claim 5, characterized in that The decision object in the problem input column and the decision variable in the model processing column are displayed using characters in the same format, or the decision condition in the problem input column and the constraint condition in the model processing column are displayed using characters in the same format, or the optimization goal in the problem input column and the objective function in the model processing column are displayed using characters in the same format.

7. The method according to any one of claims 1 to 6, characterized in that: The natural language description of the optimization problem includes requirements for the solution result or solution process of the optimization problem, and the requirements include: requirements for solution speed, requirements for solution accuracy, and whether it is necessary to quickly provide a feasible solution. The mathematical model meets the requirements.

8. The method according to any one of claims 1 to 7, characterized in that: The step of processing the natural language description of the optimization problem by using a natural language model to obtain a mathematical model of the optimization problem includes: A prompt for the optimization problem is constructed based on the natural language description of the optimization problem, wherein the prompt indicates that the natural language description is converted into a model expressed in a domain-specific language DSL; the prompt is used to guide the natural language model to generate a model that is consistent with the The corresponding output of Prompt; The Prompt is input into the natural language model to obtain a mathematical model of the optimization problem.

9. A model generation device, characterized in that: Applied to a computing device or a computing device cluster, the apparatus comprises: An interactive module, used to obtain a natural language description of an optimization problem, wherein the natural language description of the optimization problem is used to describe the problem of adjusting the value of a decision object under given decision conditions so that the optimization target reaches an expected value; A conversion module, used for processing the natural language description of the optimization problem through a natural language model to obtain a mathematical model of the optimization problem, wherein the mathematical model is expressed through a domain-specific language, and the mathematical model includes decision variables, constraints and objective function of the optimization problem, wherein the decision object is a natural language description of the decision variable, the decision condition is a natural language description of the constraint, and the optimization target is a natural language description of the objective function; A solution file is obtained according to the mathematical model, and the solution file is used to solve the optimization problem through a solver.

10. The device according to claim 9, characterized in that The device also includes: A solution module is used to solve the optimization problem according to the solution file to obtain a solution result of the optimization problem.

11. The device according to claim 9 or 10, characterized in that The interaction module is further used for: Acquire natural language modification information input by a user, wherein the natural language modification information indicates modification of the natural language description of the optimization problem; The conversion module is also used to: modify the text content of the natural language description of the optimization problem according to the natural language modification information to obtain a modified natural language description of the optimization problem; and re-obtain a modified solution file according to the modified natural language description of the optimization problem.

12. The device according to claim 9 or 10, characterized in that The interaction module is further used for: Acquiring mathematical model modification information input by a user, wherein the model modification information indicates modification of the mathematical model; The conversion module is further used to: modify at least one of the decision variables, constraint conditions and objective function of the mathematical model according to the model modification information to obtain the modified mathematical model; A modified solution file is obtained according to the modified mathematical model.

13. The device according to any one of claims 9 to 12, characterized in that: The interaction module is further used for: A model processing platform is provided, which provides at least one of a problem input column, a model processing column and a result output column, wherein the problem input column is used to display the natural language description of the optimization problem input by the user, the model processing column is used to display the mathematical model, the model processing column is also used to allow the user to input the natural language modification information, and the result output column is used to display the solution result of the optimization problem.

14. A computing device cluster, characterized in that: The computing device cluster includes at least one computing device, and the at least one computing device includes at least one processor and at least one memory, wherein the at least one memory stores computer-readable instructions; the at least one processor executes the computer-readable instructions so that the computing device cluster executes the method as described in any one of claims 1 to 8.

15. A computer-readable storage medium, characterized in that: The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 8.

16. A computer program product, characterized in that The method comprises computer-readable instructions; the computer-readable instructions are used to implement the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Information processing method and device, electronic equipment and storage medium

    CN113535931A

  • Intelligent question and answer reasoning method and system based on natural language entity relationship

    CN113779211A

  • Business logic code-free development method based on natural language understanding and conversion

    CN113791791A

  • Method and system for automatically formulating optimization problem using machine learning

    WO2023134676A1

Cited By

  • SQL generation implementation method, device and equipment based on DSL conversion engine

    CN120277085A

  • End-side collaborative lightweight voice interaction large model optimization method and system

    CN121148381A