Question processing method and device, equipment and storage medium

Through automatic modeling and code generation of pre-trained language processing models, the problem of manual problem processing in the prior art is solved, and efficient and accurate automatic problem handling is achieved.

CN119227983APending Publication Date: 2024-12-31BEIJING JINGDONG QIANSHITECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310786420.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-06-29
Publication Date
2024-12-31

AI Technical Summary

Technical Problem

The existing manual problem-solving methods are time-consuming and labor-intensive, which reduces the efficiency of problem-solving, and relies heavily on manual experience, which cannot effectively ensure the accuracy of problem-solving.

Method used

A language processing model based on sample data is adopted to model the pending target problem description information into operation optimization problems, and the object code information is generated. The problem is solved by running the target solution code and the solver is called to the solver to achieve automatic processing.

Benefits of technology

It improves the efficiency and accuracy of problem handling, reduces manual participation, and ensures automated solution to problems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119227983A_ABST
    Figure CN119227983A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a problem processing method and device, equipment and a storage medium. The method comprises the following steps: acquiring description information of a target problem to be processed; the target problem description information is input into a language processing model for operation planning optimization problem modeling and code generation, and the language processing model is obtained through training based on sample data in advance; determining a target solving code corresponding to the target problem based on target code information output by the language processing model; and calling the target solver to solve the target problem by running the target solving code to obtain target solution information of the target problem. Through the technical scheme of the embodiment of the invention, automatic problem processing can be realized, manual participation is not needed, the problem processing efficiency is improved, and meanwhile, the problem processing accuracy is also effectively ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to computer technology, and in particular to a problem handling method, apparatus, device and storage medium. Background Art

[0002] With the rapid development of automation technology, there is a need to optimize and solve business problems in more and more business scenarios. For example, in supply chain scenarios, it is necessary to solve resource scheduling problems, such as warehouse network planning problems, vehicle scheduling problems, replenishment allocation problems, etc., and use the available solutions to schedule resources to meet scheduling requirements and improve scheduling efficiency.

[0003] At present, experienced algorithm engineers usually manually model and solve the actual problems to be solved. However, in the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] The existing manual problem-solving method is time-consuming and labor-intensive, reduces the efficiency of problem-solving, and relies heavily on manual experience, which cannot effectively guarantee the accuracy of problem-solving. Summary of the invention

[0005] The embodiments of the present invention provide a problem handling method, apparatus, device and storage medium to realize automatic problem handling without human intervention, thereby improving the efficiency of problem handling and effectively ensuring the accuracy of problem handling.

[0006] In a first aspect, an embodiment of the present invention provides a problem handling method, including:

[0007] Obtain description information of the target problem to be processed;

[0008] Inputting the target problem description information into a language processing model to perform modeling and code generation for the operations optimization problem, wherein the language processing model is obtained by pre-training based on sample data;

[0009] Determining a target solution code corresponding to a target problem based on target code information output by the language processing model;

[0010] By running the target solving code, the target solver is called to solve the target problem and obtain the target solution information of the target problem.

[0011] In a second aspect, an embodiment of the present invention further provides a problem handling device, including:

[0012] A description information acquisition module is used to obtain description information of the target problem to be processed;

[0013] A description information input module, used to input the target problem description information into a language processing model to perform modeling and code generation for operations optimization problems, wherein the language processing model is obtained by pre-training based on sample data;

[0014] A solution code determination module, used to determine a target solution code corresponding to a target problem based on target code information output by the language processing model;

[0015] The solution code running module is used to call the target solver to solve the target problem by running the target solution code to obtain the target solution information of the target problem.

[0016] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:

[0017] one or more processors;

[0018] A memory for storing one or more programs;

[0019] When the one or more programs are executed by the one or more processors, the one or more processors implement the problem handling method provided by any embodiment of the present invention.

[0020] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a problem handling method as provided in any embodiment of the present invention.

[0021] One embodiment of the above invention has the following advantages or beneficial effects:

[0022] By pre-training based on sample data, a language processing model that can automatically model and generate code is obtained, thereby ensuring the accuracy of problem processing. The target problem description information to be processed is input into the pre-trained language processing model, which can model the input target problem description information as an operations optimization problem and generate target code information for solving the operations optimization problem. Based on the target code information output by the language processing model, the target solution code corresponding to the target problem is determined, and by running the target solution code, the target solver is called to solve the target problem and obtain the target solution information of the target problem, so that the problem can be automatically solved using the language processing model and the target solver, which improves the efficiency of problem processing and effectively ensures the accuracy of problem processing. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0024] Figure 1 is a flow chart of a problem handling method provided by an embodiment of the present invention;

[0025] Figure 2 is a flow chart of another problem handling method provided by an embodiment of the present invention;

[0026] Figure 3 It is an example of the architecture of a language processing model involved in one embodiment of the present invention;

[0027] Figure 4 is a flow chart of another problem handling method provided by an embodiment of the present invention;

[0028] Figure 5 is a structural schematic diagram of a problem handling device provided by an embodiment of the present invention;

[0029] Figure 6 It is a structural schematic diagram of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0030] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0031] Figure 1 This is a flowchart of a problem handling method provided by an embodiment of the present invention. This embodiment can be applied to the case where problems that need to be optimized and solved are handled, especially to the scenario where resource scheduling problems in the supply chain are solved and handled. The method can be executed by a problem handling device, which can be implemented by software and / or hardware and integrated into an electronic device. Figure 1 As shown, the method specifically comprises the following steps:

[0032] S110, obtaining description information of the target problem to be processed.

[0033] Among them, the target problem description information may be a target problem described in natural language. For example, the target problem description information may include constraint description information of the target problem and solution target description information. The target problem is an optimization problem that needs to be processed at present. For example, the target problem may be a resource scheduling problem, such as a warehouse network planning problem, a vehicle scheduling problem, a replenishment allocation problem, a loading planning problem, or a transportation planning problem. All of the above problems can be classified as operations optimization problems, so that they can be solved using operations research methods to obtain available solutions under constraints, that is, available strategies, and then scheduling based on the available strategies can improve scheduling efficiency and ensure scheduling accuracy. The target problem can be a random or common problem in a business scenario, or a simple or complex problem.

[0034] Specifically, when a user encounters a business problem that he wants to plan and solve in an actual business scenario, he can input the description information of the business problem, thereby obtaining the target problem description information input by the user.

[0035] S120, inputting the target problem description information into the language processing model to perform modeling and code generation for the operations research optimization problem.

[0036] Among them, the language processing model can be a deep learning model for processing problem description information to generate code information. For example, the language processing model can be a large language model (LLM). The large language model is a deep learning model trained using a large amount of text data. By fine-tuning the large language model, it can understand the meaning of the language text and generate matching code information. The language processing model in this embodiment is pre-trained based on sample data to ensure the accuracy of code generation. Operational optimization problems refer to problems that can be solved using operations research algorithms.

[0037] Specifically, the target problem description information is input into a pre-trained language processing model to perform modeling and code generation for operations optimization problems. Within the language processing model, the input target problem description information can be directly converted into target code information for solving operations optimization problems; or the operations optimization problem can be modeled based on the input target problem description information, and the input target problem description information can be converted into a modeled target mathematical expression, and then the target mathematical expression can be converted into target code information for solving operations optimization problems. The language processing model outputs the generated target code information. By using the language processing model, the target problem description information can be automatically converted into target code information for solving operations optimization problems, thereby improving the problem processing efficiency and ensuring the accuracy of problem solving.

[0038] S130. Determine a target solution code corresponding to the target problem based on the target code information output by the language processing model.

[0039] Among them, the target solution code refers to the code that can be directly executed and is used to call the solver to solve the target problem. The target code information output by the language processing model can be a complete target solution code or a partial solution code. The partial solution code refers to the code information in the code template that is related to the problem and needs to change dynamically. For example, if there is only one code template, the target code information can be the target template information corresponding to the code template. If there are multiple code targets, the target code information can select the target template information corresponding to the target code template. The specific meaning of the target code information can be set and selected based on business needs and scenarios.

[0040] Specifically, if the language processing model directly outputs a complete target solution code, that is, the target code information is the target solution code, then the target code information output by the language processing model can be directly used as the target solution code corresponding to the target problem.

[0041] Exemplarily, S130 may include: obtaining target template information corresponding to a preset code template output by the language processing model; inputting the target template information into the preset code template to obtain a target solution code corresponding to the target problem.

[0042] The preset code template may be a pre-set unified code framework for solving problems using a preset solver. The preset solver may be a pre-selected solving tool for solving planning problems. For example, the solver may be a Gurobi optimizer. The target template information may refer to code information related to the problem information that needs to be filled in the preset code template.

[0043] Specifically, if the target code information output by the language processing model is the target template information corresponding to the preset code template, that is, the language processing model only focuses on the code information that changes dynamically and is related to the problem information, and does not focus on the fixed code information, then the output target template information can be filled into the preset code template, and the filled preset code template is used as the target solution code corresponding to the target problem. By generating only part of the solution code related to the problem information through the language processing model, the model structure can be simplified, thereby improving the code generation efficiency and further improving the problem solving efficiency.

[0044] Exemplarily, S140 may include: obtaining target template information and target code template identification information output by the language processing model; determining the target code template based on the target code template identification information; inputting the target template information into the target code template to obtain a target solution code corresponding to the target problem.

[0045] Among them, the target code template identification information can be information used to uniquely characterize the target code target so as to distinguish different code templates. The code template corresponds to the solver one by one. If there are multiple different solvers, a corresponding code template can be set for each solver. The target code template can be the code template that is currently most suitable for solving the target problem identified by the language processing model. The target template information can refer to the code information related to the problem information that needs to be filled in the target code template.

[0046] Specifically, if the target code information output by the language processing model is the target template information corresponding to the target code template, in addition, the language processing model will also output the target code template identification information corresponding to the target code template that best matches the target problem, then the target code template corresponding to the target code template identification information is first determined, and the output target template information is filled into the target code template, and the filled-in target code template is used as the target solution code corresponding to the target problem. The language processing model only generates partial solution codes related to the problem information, and can automatically identify the target code template that is currently most suitable for solving the target problem, so that the most suitable solver can be used to solve the target problem, further improving the accuracy of solving the target problem and the processing effect.

[0047] S140, by running the target solving code, calling the target solver to solve the target problem, and obtaining the target solution information of the target problem.

[0048] The target solution information may refer to a specific strategy for solving the target problem, such as a scheduling strategy for solving a resource scheduling problem.

[0049] Specifically, after obtaining the target solution code, the client can directly run the target solution code, thereby calling the corresponding target solver to solve the target problem and quickly obtain the target solution information of the target problem, thereby realizing automatic processing of the problem. The entire processing process does not require human participation, thereby improving the efficiency of problem processing.

[0050] The technical solution of this embodiment obtains a language processing model that can automatically model and generate code by pre-training based on sample data, thereby ensuring the accuracy of problem processing. The target problem description information to be processed is input into the language processing model obtained by pre-training. The language processing model can model the input target problem description information as an operations optimization problem and generate target code information for solving the operations optimization problem. Based on the target code information output by the language processing model, the target solution code corresponding to the target problem is determined, and by running the target solution code, the target solver is called to solve the target problem and obtain the target solution information of the target problem, so that the problem can be automatically solved using the language processing model and the target solver, which improves the efficiency of problem processing and effectively ensures the accuracy of problem processing.

[0051] Based on the above technical solution, the training process of the language processing model may include the following steps S101-S104:

[0052] S101. Obtain sample data, where the sample data includes: operations research corpus, sample problem description information, and sample code information corresponding to the sample problem.

[0053] The operations research corpus may include language texts and mathematical expression texts of operations research. For example, papers related to operations research may be used as operations research corpus for training from an academic database. Sample problem description information may be information about sample problems described in natural language. Sample code information may be code information for solving sample problems. Sample code information may be a complete sample solution code or a partial solution code in a code template related to the problem, which may be selected based on the output design of the language processing model.

[0054] S102: Obtain a pre-trained language model after pre-training.

[0055] Specifically, a large amount of general corpus can be used for model training so that the pre-trained language model obtained through pre-training has the ability to understand general language. You can also directly obtain trained open source pre-trained language models, such as the generative pre-trained model GPT (Generative Pre-Trained Transformer) series (such as GPT2, GPT-J), large language models Dolly or LLaMA, etc.

[0056] S103. Based on the operations research corpus, the pre-trained language model is tuned for the first time to obtain a tuned target language model.

[0057] Specifically, by using the operations research corpus, the pre-trained language model is tuned for the first time, so that the tuned target language model can have the ability to understand the language and mathematical expressions of operations research.

[0058] Exemplarily, S103 may include: performing sliding processing on the operations research corpus based on a sliding window of a preset length to obtain multiple groups of input and output text pairs; and performing a first tuning on the pre-trained language model based on the input and output text pairs to obtain a tuned target language model.

[0059] Specifically, the operations research corpus can be segmented into sentences, and a sliding window of a preset length N is slid in the multiple sentences after segmentation to obtain multiple groups of input-output text pairs. For example, the input text in the first group of input-output text pairs is: from the 1st sentence to the Nth sentence, and the output text is from the 2nd sentence to the N+1th sentence, and so on, and multiple groups of input-output text pairs can be generated. The input text in each group of input-output text pairs is used as input data, and the output text is used as training label data to perform the first tuning on the pre-trained language model. For example, the training error can be determined based on the text actually output by the pre-trained language model and the corresponding training label data, and the training error is back-propagated to the pre-trained language model, and the network parameters in the pre-trained language model are adjusted until the preset convergence conditions are met, such as when the number of iterations is equal to the preset number or the training error changes tend to be stable, it is determined that the first tuning is over, and the pre-trained language model at this time is used as the tuned target language model.

[0060] S104: Using the sample problem description information as input data and the sample code information corresponding to the sample problem as label data, the target language model is tuned for the second time to obtain a tuned language processing model.

[0061] Specifically, when the model directly converts the problem description information into the solution code, it is only necessary to learn the correspondence between the problem description information and the solution code, so that the sample problem description information can be directly used as input data, and the sample code information corresponding to the sample problem can be used as label data to perform a second tuning on the target language model, so that the tuned language processing model can accurately generate code information. For example, the training error can be determined based on the data actually output by the target language model and the corresponding training label data, and the training error can be back-propagated to the target language model, and the network parameters in the target language model can be adjusted until the preset convergence conditions are met, such as when the number of iterations is equal to the preset number or the training error changes tend to be stable, it is determined that the second tuning is completed, and the target language model at this time is used as the language processing model, thereby completing the training process of the language processing model.

[0062] It should be noted that training the target language model on a high-performance GPU (Graphics Processing Unit) can provide more computing power support, thereby improving the efficiency of model training.

[0063] Figure 2 This is a flow chart of another problem processing method provided by an embodiment of the present invention. In this embodiment, based on the above embodiment, the language processing model may include: a problem modeling sub-model and a code generation sub-model, and on this basis, the step of "inputting the target problem description information into the language processing model to perform modeling and code generation of the operations optimization problem" is optimized. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0064] See also Figure 2 Another problem solving method provided in this embodiment specifically includes the following steps:

[0065] S210: Obtain description information of the target problem to be processed.

[0066] S220: Input the target problem description information into the problem modeling sub-model in the language processing model to model the operations optimization problem, and obtain the target mathematical expression corresponding to the target problem.

[0067] The problem modeling sub-model is a deep learning model for abstractly modeling the problem description information into a mathematical form of operations research optimization problem. The target mathematical expression refers to the mathematical model obtained by modeling the target problem.

[0068] Specifically, see Figure 3 , the target problem description information is input into the problem modeling sub-model in the pre-trained language processing model, and the problem modeling sub-model converts the input target problem description information into a target mathematical expression that can be solved by the solver. The target mathematical expression can be output as model output information so that the user can know the target mathematical expression after modeling.

[0069] S230: Input the target mathematical expression into the code generation sub-model in the language processing model to generate a solution code, and obtain target code information corresponding to the target problem.

[0070] The code generation sub-model is a deep learning model used to generate code information that can solve mathematical expressions. The content of the target code information can be set and selected based on business needs. For example, the target code information can be a complete target solution code or a partial solution code, where the partial solution code refers to the code information in the code template that is related to the problem and needs to be dynamically changed.

[0071] Specifically, see Figure 3, the target mathematical expression is input into the code generation sub-model in the pre-trained language processing model. The code generation sub-model converts the input target mathematical expression into target code information for calling the solver to solve the problem, and outputs the target code information.

[0072] S240. Determine a target solution code corresponding to the target problem based on the target code information output by the code generation sub-model.

[0073] Specifically, based on the target code information output by the code generation sub-model, a complete target solution code can be obtained, which is adapted to the format supported by the target solver. Therefore, by executing the target solution execution, the target solver can be called for solving, thereby realizing automatic solution of the problem.

[0074] S250, by running the target solving code, calling the target solver to solve the target problem, and obtaining the target solution information of the target problem.

[0075] The technical solution of this embodiment first uses the problem modeling sub-model to convert the input target problem description information into a solvable target mathematical expression, and then uses the code generation sub-model to convert the target mathematical expression into a solution code, thereby achieving a phased solution and further improving the accuracy of problem processing.

[0076] Based on the above technical solution, the training process of the language processing model may include the following steps S201-S204:

[0077] S201. Obtain sample data, where the sample data includes: operations research corpus, sample problem description information, sample mathematical expressions corresponding to the sample problems, and sample code information.

[0078] Among them, the operations research corpus may include language texts and mathematical expression texts of operations research, etc. For example, papers related to operations research can be used as operations research corpus for training from academic databases. Sample problem description information can be information about sample problems described in natural language. Sample mathematical expressions can be mathematical models that abstractly model sample problems. Sample code information can be code information for solving sample problems. Sample code information can be a complete sample solution code, or a partial solution code related to the problem in a code template, which can be selected based on the output design of the language processing model. Sample mathematical expressions and sample code information can be obtained from public papers, technical documents, and actual cases.

[0079] S202: Obtain a pre-trained language model after pre-training.

[0080] Specifically, a large amount of general corpus can be used for model training so that the pre-trained language model obtained through pre-training has the ability to understand general language. You can also directly obtain trained open source pre-trained language models, such as the generative pre-trained model GPT (Generative Pre-Trained Transformer) series (such as GPT2, GPT-J), large language models Dolly or LLaMA, etc.

[0081] S203. Based on the operations research corpus, the pre-trained language model is tuned for the first time to obtain a tuned target language model.

[0082] Specifically, by using the operations research corpus, the pre-trained language model is tuned for the first time, so that the tuned target language model can have the ability to understand the language and mathematical expressions of operations research.

[0083] Exemplarily, S203 may include: performing sliding processing on the operations research corpus based on a sliding window of a preset length to obtain multiple groups of input and output text pairs; and performing a first tuning on the pre-trained language model based on the input and output text pairs to obtain a tuned target language model.

[0084] Specifically, the operations research corpus can be segmented into sentences, and a sliding window of a preset length N is slid in the multiple sentences after segmentation to obtain multiple groups of input-output text pairs. For example, the input text in the first group of input-output text pairs is: from the 1st sentence to the Nth sentence, and the output text is from the 2nd sentence to the N+1th sentence, and so on, multiple groups of input-output text pairs can be generated. The input text in each group of input-output text pairs is used as input data, and the output text is used as training label data to perform the first tuning on the pre-trained language model, so that the tuned target language model can more accurately understand the language and mathematical expressions of operations research. For example, the training error can be determined based on the text actually output by the pre-trained language model and the corresponding training label data, and the training error is back-propagated to the pre-trained language model, and the network parameters in the pre-trained language model are adjusted until the preset convergence conditions are met, such as when the number of iterations is equal to the preset number or the training error changes tend to be stable, the first tuning is determined to be completed, and the pre-trained language model at this time is used as the target language model.

[0085] S204: Using the sample problem description information as input data, and the sample mathematical expression and sample code information corresponding to the sample problem as label data, perform a second optimization on the target language model to obtain a optimized language processing model.

[0086] Specifically, when the model first converts the problem description information into a mathematical expression and then converts the mathematical expression into a solution code, the model needs to learn the correspondence between the problem description information and the mathematical expression, as well as the correspondence between the mathematical expression and the solution code, so that the sample problem description information and the sample mathematical expression are used as an input-output pair, and the sample mathematical expression and the sample code information are used as an input-output pair, and the target language model is tuned for the second time, so that the tuned language processing model can accurately generate code information. For example, the training error can be determined based on the mathematical expression and code information actually output by the target language model and the sample mathematical expression and sample code information as training labels, and the training error is back-propagated to the target language model, and the network parameters in the target language model are adjusted until the preset convergence conditions are met, such as when the number of iterations is equal to the preset number or the training error changes tend to be stable, the second tuning is determined to be completed, and the target language model at this time is used as the language processing model, thereby completing the training process of the language processing model. Through one pre-training and two tunings, a language processing model that can accurately model and generate code can be obtained, thereby ensuring the accuracy of problem processing.

[0087] Figure 4 This is a flowchart of another problem handling method provided by an embodiment of the present invention. Based on the above embodiments, this embodiment describes in detail the implementation scenario of the problem handling process. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here.

[0088] See also Figure 4 Another problem solving method provided in this embodiment specifically includes the following steps:

[0089] S410: Obtain target problem description information input in the client.

[0090] Specifically, the user can input target problem description information described in natural language in the client.

[0091] S420, sending the target problem description information to the cloud, so that the cloud can solve the target problem based on the language processing model and the target solver, obtain the target mathematical expression and target solution information of the target problem and return them.

[0092] Specifically, the client uploads the target problem description information input by the user to the cloud via a wireless network. In the cloud, the uploaded target problem description information is input into the language processing model for modeling and code generation of operations research optimization problems. The language processing model can first convert the input target problem description information into a target mathematical expression, then convert the target mathematical expression into target code information, and output the target mathematical expression and target code information. Based on the target code information output by the language processing model, the target solution code corresponding to the target problem is determined, and by running the target solution code, the target solver is called to solve the target problem and obtain the target solution information of the target problem. The cloud then returns the obtained target mathematical expression and target solution information to the client.

[0093] It should be noted that calling the language processing model and the target solver in the cloud to solve the target problem can make full use of the cloud performance and meet the high computing power requirements, thereby further improving the problem processing speed.

[0094] S430: Obtain the target mathematical expression and target solution information returned by the cloud, and display the target mathematical expression and target solution information on the display interface of the client.

[0095] Specifically, the client can display the target mathematical expression and target solution information returned by the cloud on the display interface, so that the user can obtain the target solution information, and can also perform self-checking based on the displayed target mathematical expression to further meet user needs.

[0096] The technical solution of this embodiment can fully utilize the cloud performance and meet high computing power requirements by calling the language processing model and the target solver in the cloud to solve the target problem, thereby further improving the problem processing speed.

[0097] The following is an embodiment of the problem handling device provided in an embodiment of the present invention. The device and the problem handling methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the problem handling device, please refer to the embodiment of the above-mentioned problem handling method.

[0098] Figure 5 This is a schematic diagram of a problem processing device provided by an embodiment of the present invention. This embodiment is applicable to the case where problems that need to be optimized and solved are processed, especially to the scenario where resource scheduling problems in a supply chain are solved. Figure 5 As shown, the device specifically includes: a description information acquisition module 510, a description information input module 520, a solution code determination module 530 and a solution code execution module 540.

[0099] Among them, the description information acquisition module 510 is used to obtain the description information of the target problem to be processed; the description information input module 520 is used to input the target problem description information into the language processing model to perform modeling and code generation for the operations optimization problem, wherein the language processing model is pre-trained based on sample data; the solution code determination module 530 is used to determine the target solution code corresponding to the target problem based on the target code information output by the language processing model; the solution code running module 540 is used to call the target solver to solve the target problem by running the target solution code, and obtain the target solution information of the target problem.

[0100] The technical solution of this embodiment obtains a language processing model that can automatically model and generate code by pre-training based on sample data, thereby ensuring the accuracy of problem processing. The target problem description information to be processed is input into the language processing model obtained by pre-training. The language processing model can model the input target problem description information as an operations optimization problem and generate target code information for solving the operations optimization problem. Based on the target code information output by the language processing model, the target solution code corresponding to the target problem is determined, and by running the target solution code, the target solver is called to solve the target problem and obtain the target solution information of the target problem, so that the problem can be automatically solved using the language processing model and the target solver, which improves the efficiency of problem processing and effectively ensures the accuracy of problem processing.

[0101] Optionally, the language processing model includes: a problem modeling sub-model and a code generation sub-model;

[0102] The description information input module 520 is specifically used for:

[0103] Inputting the target problem description information into the problem modeling sub-model to model the operations optimization problem, and obtaining a target mathematical expression corresponding to the target problem;

[0104] The target mathematical expression is input into the code generation sub-model to generate a solution code, and the target code information corresponding to the target problem is obtained.

[0105] Optionally, the solution code determination module 530 is specifically configured to:

[0106] Obtain target template information corresponding to the preset code template output by the language processing model; input the target template information into the preset code template to obtain a target solution code corresponding to the target problem.

[0107] Optionally, the solution code determination module 530 is specifically configured to:

[0108] Obtain target template information and target code template identification information output by the language processing model; determine the target code template based on the target code template identification information, wherein the code template corresponds to the solver one-to-one; input the target template information into the target code template to obtain the target solution code corresponding to the target problem.

[0109] Optionally, the device further includes: a language processing model training module, including:

[0110] A sample data acquisition unit, used to acquire sample data, wherein the sample data includes: operations research corpus, sample problem description information, sample mathematical expressions corresponding to the sample problem, and sample code information;

[0111] A pre-training unit, used to obtain a pre-trained language model after pre-training;

[0112] A first tuning unit, configured to perform a first tuning on the pre-trained language model based on the operations research corpus to obtain a tuned target language model;

[0113] The second tuning unit is used to use the sample problem description information as input data, and the sample mathematical expression and sample code information corresponding to the sample problem as label data, to perform a second tuning on the target language model to obtain a tuned language processing model.

[0114] Optionally, the first tuning unit is specifically configured to:

[0115] Based on a sliding window of a preset length, the operations research corpus is subjected to sliding processing to obtain a plurality of groups of input-output text pairs; based on the input-output text pairs, the pre-trained language model is first tuned to obtain a tuned target language model.

[0116] Optionally, the description information acquisition module 510 is specifically used to:

[0117] Obtain target problem description information input in the client; send the target problem description information to the cloud, so that the cloud performs a solution process for the target problem based on the language processing model and the target solver, obtains a target mathematical expression and target solution information of the target problem, and returns them;

[0118] The device also includes:

[0119] The information display module is used to obtain the target mathematical expression and target solution information returned by the cloud, and display the target mathematical expression and the target solution information on the display interface of the client.

[0120] The problem handling device provided in the embodiment of the present invention can execute the problem handling method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the problem handling method.

[0121] It is worth noting that in the embodiment of the above-mentioned problem handling device, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.

[0122] Figure 6 A schematic diagram of the structure of an electronic device provided by an embodiment of the present invention. Figure 6 A block diagram of an exemplary electronic device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 6 The electronic device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0123] like Figure 6 As shown, the electronic device 12 is in the form of a general purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0124] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0125] The electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0126] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 6 not shown, usually called a "hard drive"). Although Figure 6Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0127] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0128] The electronic device 12 may also communicate with one or more external devices 14 (e.g., keyboards, pointing devices, displays 24, etc.), may communicate with one or more devices that enable a user to interact with the electronic device 12, and / or may communicate with any device that enables the electronic device 12 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 22. Furthermore, the electronic device 12 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 20. As shown, the network adapter 20 communicates with other modules of the electronic device 12 via a bus 18. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0129] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing a problem handling method provided by the embodiment of the present invention, the method comprising:

[0130] Obtain description information of the target problem to be processed;

[0131] Inputting the target problem description information into a language processing model to perform modeling and code generation for the operations optimization problem, wherein the language processing model is obtained by pre-training based on sample data;

[0132] Determining a target solution code corresponding to a target problem based on target code information output by the language processing model;

[0133] By running the target solving code, the target solver is called to solve the target problem and obtain the target solution information of the target problem.

[0134] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the problem handling method provided by any embodiment of the present invention.

[0135] This embodiment provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, the problem handling method steps provided in any embodiment of the present invention are implemented. The method includes:

[0136] Obtain description information of the target problem to be processed;

[0137] Inputting the target problem description information into a language processing model to perform modeling and code generation for the operations optimization problem, wherein the language processing model is obtained by pre-training based on sample data;

[0138] Determining a target solution code corresponding to a target problem based on target code information output by the language processing model;

[0139] By running the target solving code, the target solver is called to solve the target problem and obtain the target solution information of the target problem.

[0140] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0141] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0142] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0143] Computer program code for performing the operations of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0144] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0145] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A problem solving method, characterized in that: include: Obtain description information of the target problem to be processed; Inputting the target problem description information into a language processing model to perform modeling and code generation for the operations optimization problem, wherein the language processing model is obtained by pre-training based on sample data; Determining a target solution code corresponding to a target problem based on target code information output by the language processing model; By running the target solving code, the target solver is called to solve the target problem and obtain the target solution information of the target problem.

2. The method according to claim 1, characterized in that The language processing model includes: a problem modeling sub-model and a code generation sub-model; The step of inputting the target problem description information into a language processing model to perform modeling and code generation for the operations research optimization problem includes: Inputting the target problem description information into the problem modeling sub-model to model the operations optimization problem, and obtaining a target mathematical expression corresponding to the target problem; The target mathematical expression is input into the code generation sub-model to generate a solution code, and the target code information corresponding to the target problem is obtained.

3. The method according to claim 1, characterized in that The step of determining a target solution code corresponding to a target problem based on the target code information output by the language processing model includes: Obtaining target template information corresponding to a preset code template output by the language processing model; The target template information is input into a preset code template to obtain a target solution code corresponding to the target problem.

4. The method according to claim 1, characterized in that: The step of determining a target solution code corresponding to a target problem based on the target code information output by the language processing model includes: Acquire target template information and target code template identification information output by the language processing model; Determine a target code template based on the target code template identification information, wherein a code template corresponds to a solver one-to-one; The target template information is input into the target code template to obtain the target solution code corresponding to the target problem.

5. The method according to claim 1, characterized in that The training process of the language processing model includes: Acquire sample data, the sample data including: operations research corpus, sample problem description information, sample mathematical expressions corresponding to the sample problems, and sample code information; Get the pre-trained language model after pre-training; Based on the operations research corpus, the pre-trained language model is tuned for the first time to obtain a tuned target language model; The sample problem description information is used as input data, and the sample mathematical expression and sample code information corresponding to the sample problem are used as label data, and the target language model is tuned for the second time to obtain a tuned language processing model.

6. The method according to claim 5, characterized in that Based on the operations research corpus, the pre-trained language model is first tuned to obtain a tuned target language model, including: Based on a sliding window of a preset length, sliding processing is performed on the operations research corpus to obtain multiple groups of input and output text pairs; Based on the input and output text pairs, the pre-trained language model is tuned for the first time to obtain a tuned target language model.

7. The method according to any one of claims 1 to 6, characterized in that: The obtaining of target problem description information to be processed includes: Get the target problem description information entered in the client; Sending the target problem description information to the cloud, so that the cloud performs a solution process for the target problem based on the language processing model and the target solver, obtains a target mathematical expression and target solution information of the target problem and returns them; The method further comprises: The target mathematical expression and target solution information returned by the cloud are obtained, and the target mathematical expression and the target solution information are displayed on the display interface of the client.

8. A problem handling device, characterized in that: include: A description information acquisition module is used to obtain description information of the target problem to be processed; A description information input module, used to input the target problem description information into a language processing model to perform modeling and code generation for operations optimization problems, wherein the language processing model is obtained by pre-training based on sample data; A solution code determination module, used to determine a target solution code corresponding to a target problem based on target code information output by the language processing model; The solution code running module is used to call the target solver to solve the target problem by running the target solution code to obtain the target solution information of the target problem.

9. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the problem handling method as described in any one of claims 1-7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the problem handling method as described in any one of claims 1 to 7 is implemented.