A large-scale model-based decision analysis method for manufacturing product value chain

By generating and adjusting structured query statements and combining them with large models to generate natural language answers, the problem of insufficient professionalism in manufacturing decision analysis is solved, and the accuracy and efficiency of decision analysis are improved.

CN119513126BActive Publication Date: 2025-09-30SOUTHERN UNIVERSITY OF SCIENCE AND TECHNOLOGY
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411482227.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-10-23
Publication Date
2025-09-30
Estimated Expiration
2044-10-23

AI Technical Summary

Technical Problem

Traditional manufacturing decision-making methods rely on manual decision-making, which is inefficient, with frequent information omissions or errors. General large language models are not professional enough in specific industry applications and cannot meet industry needs.

Method used

By obtaining the question content and database table structure entered by the user, generating target prompt words and initial structured query statements, checking and adjusting the statement content, outputting the target structured query statement, obtaining the results from the product database and inputting them into the large model to generate natural language answers.

Benefits of technology

It improves the professionalism and accuracy of decision-making analysis in the manufacturing product value chain, meets the needs of specific industries, and reduces decision-making time and the difficulty of information screening.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119513126B_ABST
    Figure CN119513126B_ABST
Patent Text Reader

Abstract

This application relates to a method for manufacturing product value chain decision analysis based on a large model. The method includes: obtaining a question input by a user and a database table structure associated with the question; generating a target prompt word and an initial structured query statement corresponding to the target prompt word based on the question content, default prompt words, and the database table structure; outputting a target structured query statement in response to a check instruction for the initial structured query statement; obtaining a target query result from a preset product database by executing the target structured query statement; inputting the target prompt word and target query result into a large model; and outputting a natural language answer. The natural language answer is used for decision analysis of the manufacturing product value chain. The solution provided by this application can meet user needs while outputting professional natural language answers, thereby improving the performance of decision analysis of the manufacturing product value chain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of manufacturing data processing, and in particular to a manufacturing product value chain decision analysis method based on a large model. Background Art

[0002] In the decision-making process of modern enterprises, especially in the manufacturing industry, decision makers often face complex and changing market environments and user demands. When making decisions, they need to consult and integrate a large number of information sources, including product technology, market research results, industry regulations and policies, financial data, etc.

[0003] Traditional decision-making methods often rely on manual effort, requiring decision-makers to spend significant time collecting, organizing, and analyzing data. This is not only labor-intensive and time-consuming, resulting in low efficiency, but also prone to information omissions and errors, which can affect the accuracy and timeliness of decisions. Furthermore, as data volumes and information complexity increase, the limitations of traditional decision-making methods become increasingly pronounced.

[0004] Currently, big language models have been incorporated into relevant decision-making tools, leveraging their analytical capabilities to assist decision makers in accessing and analyzing information. However, the application of general basic big models in actual business needs has certain limitations, making it difficult to meet the needs of specific industries. At the same time, big language models are not professional enough and have low accuracy for specific industries. Summary of the Invention

[0005] This application provides a manufacturing product value chain decision analysis method based on a large model to solve or partially solve the problem of how to meet the user needs of a specific industry and improve the professionalism and accuracy of decision analysis.

[0006] In a first aspect, the present application provides a manufacturing product value chain decision analysis method based on a large model, comprising:

[0007] Obtain the question content input by the user and the database table structure associated with the question content;

[0008] Generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure;

[0009] In response to a check instruction for the initial structured query statement, output a target structured query statement;

[0010] Obtaining target query results from a preset product database by executing the target structured query statement;

[0011] The target prompt word and the target query result are input into a large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0012] In one embodiment, generating a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure includes:

[0013] Connecting the question content, the default prompt word, and the database table structure through a conjunction to generate a target prompt word;

[0014] The target prompt word is input into the large model to generate the initial structured query statement.

[0015] In one example, outputting a target structured query statement in response to a check instruction for the initial structured query statement includes:

[0016] In response to a check instruction for the initial structured query statement, check whether there is any abnormality in the statement content of the initial structured query statement;

[0017] Determining the abnormality type of the initial structured query statement in which the statement content is abnormal;

[0018] An adjustment operation corresponding to the exception type is performed on the initial structured query statement, and the target structured query statement is output.

[0019] In one example, in response to the check instruction for the initial structured query statement, checking whether the statement content of the initial structured query statement contains any anomalies includes:

[0020] In response to a check instruction for the initial structured query statement, calling a plurality of the large models to analyze whether the initial structured query statement correctly matches the question content;

[0021] If the initial structured query statement correctly matches the question content, then determining that there is no abnormality in the statement content of the initial structured query statement;

[0022] If the initial structured query statement does not match the question content correctly, it is determined that there is an abnormality in the statement content of the initial structured query statement.

[0023] In one example, the exception type includes a statement error type, and performing an adjustment operation corresponding to the exception type on the initial structured query statement to output the target structured query statement includes:

[0024] Determining the content to be corrected of the initial structured query statement;

[0025] Performing an error correction operation corresponding to the error type of the statement on the content to be corrected, generating and outputting the target structured query statement;

[0026] The error correction operation is used to modify the content to be corrected in the initial structured query statement so that the initial structured query statement correctly matches the question content.

[0027] In one example, in response to the check instruction for the initial structured query statement, checking whether the statement content of the initial structured query statement is abnormal includes:

[0028] In response to a check instruction for the initial structured query statement, calling a plurality of the large models to analyze whether the initial structured query statement needs to be optimized;

[0029] If the initial structured query statement does not need to be optimized, determining that there is no abnormality in the statement content of the initial structured query statement;

[0030] If the initial structured query statement needs to be optimized, it is determined that there is an abnormality in the statement content of the initial structured query statement.

[0031] In one example, the exception type includes a statement not optimized type, and performing an adjustment operation corresponding to the exception type on the initial structured query statement to output the target structured query statement includes:

[0032] Determining content to be optimized in the initial structured query statement;

[0033] Performing an optimization operation corresponding to the unoptimized type of the statement on the content to be optimized, generating and outputting the target structured query statement;

[0034] The optimization operation is used to optimize the content to be optimized in the initial structured query statement.

[0035] The second aspect of the present application provides a manufacturing product value chain decision analysis system based on a large model, comprising:

[0036] A question content acquisition module is used to obtain the question content input by the user and the database table structure associated with the question content;

[0037] A data generation module, configured to generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure;

[0038] A query statement checking module, configured to output a target structured query statement in response to a checking instruction for the initial structured query statement;

[0039] A query result acquisition module, configured to acquire a target query result from a preset product database by executing the target structured query statement;

[0040] The answer output module is used to input the target prompt word and the target query result into the large model and output a natural language answer, which is used for decision analysis of the manufacturing product value chain.

[0041] A third aspect of the present application provides an electronic device, including:

[0042] processor; and

[0043] The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method described above.

[0044] A fourth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor is caused to execute the method described above.

[0045] The technical solution provided by this application may have the following beneficial effects:

[0046] In an embodiment of the present application, the question content input by the user and the database table structure associated with the question content are obtained, and the target prompt word and the initial structured query statement corresponding to the target prompt word are generated according to the question content, the default prompt word and the database table structure. In response to the inspection instruction for the initial structured query statement, the target structured query statement is output, and by executing the target structured query statement, the target query result is obtained from the preset product database, the target prompt word and the target query result are input into the large model, and the natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0047] Compared with related technologies, the technical solution of the present application, on the one hand, generates targeted target prompt words by combining the question content, default prompt words and database table structure, assisting the large model to better understand user needs; on the other hand, by checking the initial structured query statement, it ensures the output of accurate target structured query statements, so as to accurately find the target query results that match the target structured query statement from the product database. After the target query results and target prompt words are input into the large model, professional natural language answers can be output, thereby achieving the goal of meeting user needs while improving the decision-making analysis performance of the manufacturing product value chain.

[0048] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail the exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.

[0050] Figure 1 This is a flow chart of a method for manufacturing product value chain decision analysis based on a large model, as shown in an embodiment of the present application;

[0051] Figure 2 This is a flowchart diagram of using a large model to build an automotive industry SQL assistant shown in an embodiment of the present application;

[0052] Figure 3 This is a flowchart of a manufacturing product value chain decision analysis method based on a large model, as shown in another embodiment of the present application;

[0053] Figure 4 This is a detailed diagram of the structural links of building an SQL assistant using a large model as shown in an embodiment of the present application;

[0054] Figure 5 This is a schematic diagram of a SQL error correction flow chart for building an SQL assistant using a large model, as shown in an embodiment of the present application;

[0055] Figure 6 This is a detailed diagram of SQL optimization using a large model to build an SQL assistant, as shown in an embodiment of the present application;

[0056] Figure 7 This is a schematic diagram of a decision analysis flow chart for the automotive manufacturing product value chain shown in an embodiment of the present application;

[0057] Figure 8 This is a structural diagram of a manufacturing product value chain decision analysis system based on a large model, as shown in an embodiment of the present application;

[0058] Figure 9 It is a structural diagram of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION

[0059] The following describes embodiments of the present application in more detail with reference to the accompanying drawings. Although the accompanying drawings illustrate embodiments of the present application, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. Rather, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.

[0060] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. As used in this application and the appended claims, the singular forms "a," "an," "the," and "the" are intended to include the plural forms, unless the context clearly indicates otherwise. It should also be understood that the term "and / or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

[0061] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0062] In modern business decision-making, especially in the manufacturing industry, decision-makers need to review and integrate a vast array of information sources, including product technology, market research results, industry regulations and policies, and financial data. Traditional decision-making methods often rely on significant manpower and time investment, requiring decision-makers to devote significant time to data collection, organization, and analysis. This is not only inefficient but also prone to information omissions or errors, compromising the accuracy and timeliness of decisions. Furthermore, as data volumes and information complexity increase, the limitations of traditional decision-making methods become increasingly pronounced.

[0063] The emergence of Large Language Models (LLMs) has brought about significant changes to the information retrieval process. LLMs make information retrieval more convenient and significantly improve decision-making efficiency. However, the current common basic LLMs have certain limitations in their application to actual business needs, primarily in the following aspects:

[0064] First, knowledge limitations: general large models lack in-depth knowledge of professional fields and are difficult to meet industry-specific needs.

[0065] Second, the hallucination problem: general large models may generate inaccurate or false information and lack professionalism.

[0066] Third, data security: data security cannot be effectively guaranteed.

[0067] In response to the above problems, an embodiment of the present application provides a manufacturing product value chain decision analysis method based on a large model, which can improve the decision analysis performance of the manufacturing product value chain while meeting user needs.

[0068] The technical solutions of the embodiments of the present application are described in detail below with reference to the accompanying drawings.

[0069] Figure 1 This is a flow chart of a method for analyzing manufacturing product value chain decisions based on a large model, as shown in the embodiment of this application. Figure 1 , applied to a product analysis system, the product analysis system being in communication with a product database, the method comprising at least the following steps:

[0070] In this application, a product analysis system refers to a manufacturing product analysis system based on a large model and SQL Agent (Structured Query Language Agent). It interacts with a SQL (Structured Query Language) database through SQL Agent to perform tasks related to the SQL database. By combining SQL Agent with a large language model, the obtained information is more professional rather than a general and messy group of information, and the speed of obtaining information in specific fields is faster, thereby improving the accuracy and efficiency of decision-making analysis of the manufacturing product value chain.

[0071] The product analysis system actually performs decision analysis based on RAG (Retrieval-Augmented Generation). It first retrieves information from professionally customized data sources such as databases, documents, APIs (Application Programming Interfaces), and adds it to the question as context. It then requires a large language model to reason based on the prompts and return answers that humans can understand.

[0072] As an example, the process run by a product analysis system can be simplified as database preparation, prompt construction, query conversion, database interaction, response generation, and result comparison.

[0073] Among them, database preparation requires setting up a database containing decision analysis related data. The database can be a product database, which may store production records, sales data, supply chain information, financial reports and other data.

[0074] Prompt construction requires formulating clear and concise prompts or queries that will be presented to the language model (LLM).

[0075] Query conversion requires LLM to convert user queries into SQL queries (database queries) generated in SQL format.

[0076] Database interaction requires executing SQL queries against the database to retrieve the requested information.

[0077] Response generation requires that the data retrieved from the database be used again as input to the LLM, which generates a response based on the enhanced input.

[0078] Result comparison requires comparing the generated SQL and query results with the preset results in the dataset to evaluate the model.

[0079] In this way, the system can understand questions asked by users in natural language and automatically generate corresponding SQL query statements, so that users can easily retrieve the required data without having to have an in-depth understanding of the database structure and SQL syntax, reducing the difficulty of retrieval.

[0080] In addition, the system presents query results to users in natural language format, which helps to improve user experience.

[0081] In the following, an example is given in which the product analysis system is a product analysis system for the automobile manufacturing industry and the product database is a database storing information related to the automobile manufacturing industry.

[0082] Step 101: Obtain the question content input by the user and the database table structure associated with the question content.

[0083] In an embodiment of the present application, the product analysis system can obtain the question content input by the user and the database table structure associated with the question content in real time.

[0084] Optionally, the user can input question content through a user device with a display. The input method includes but is not limited to manual text input or voice input in the user interface provided by the user device. The user device can be a smart device such as a smart phone, smart tablet, smart computer, etc.

[0085] For example, a user uses a computer to open the webpage or client of the product analysis system and enters the question "What is the revenue of Class A automobiles of Company X this year?" in the input box of the question interface. After receiving the question input by the user, the product analysis system can obtain the database table structure provided by the user, or extract the database table structure associated with the question content from the product database.

[0086] The database table structure refers to the organization and design of the tables in the database, and is presented in table creation statements. The database table structure generally includes table definition, field definition, primary key and index, table relationship and other contents.

[0087] For example, if the user enters the question "What is the company's revenue from Class A cars this year?", the product analysis system can automatically extract the database table structure "CREATE TABLE enterprise_sales(order_id INT PRIMARY KEY, product_name VARCHAR(100), ...)" associated with the question from the product database.

[0088] "CREATE TABLE" is a SQL statement used to define a new table. It mainly includes the table name (enterprise_sales) and the definition of each field in the table.

[0089] "order_id INT PRIMARY KEY" means defining a field named order_id with an integer (INT) data type and specifying it as the primary key (PRIMARY KEY) to ensure that each order has a unique number.

[0090] "product_name VARCHAR(100)" means defining a field named product_name, the data type is a variable-length string (VARCHAR), the maximum length is 100 characters, and it is used to store the product name.

[0091] It is worth noting that the field content behind the database table structure corresponds to the question content. For example, the database table structure can define sales quantity, sales date, sales price and other content, and this application does not limit this.

[0092] Step 102: Generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure.

[0093] In the embodiment of the present application, the product analysis system can generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word and the database table structure.

[0094] Optionally, the default indicator word refers to a prompt word for the role played by the system-specified large model. The default prompt word is part of the initialization of the product analysis system. This part of the content is automatically assembled each time the user asks a question, and no additional operation is required by the user.

[0095] For example, when the product analysis system is initialized, the default prompt "You are a database expert in the automotive industry, and you will answer the user's questions. I will ask you questions..." is sent to the big model.

[0096] The target prompt word refers to a complete prompt word that combines the question content, the default prompt word, and the database table structure, and is used to instruct the large model to generate the corresponding SQL query statement.

[0097] The initial structured query statement refers to the SQL query statement automatically generated and output by the big model after the target prompt word is input into the big model, which is used to obtain query results from the product database.

[0098] Step 103: Output a target structured query statement in response to a check instruction for the initial structured query statement.

[0099] In the embodiment of the present application, after generating the initial structured query statement, the product analysis system may respond to a check instruction for the initial structured query statement so as to output an accurate target structured query statement.

[0100] Optionally, the target structured query statement refers to a query statement that has been checked. For example, the target structured query statement may be “SELECT SUM(production_cost) AS total_production_cost ...".

[0101] Step 104 : Obtain target query results from the product database by executing the target structured query statement.

[0102] In an embodiment of the present application, the product analysis system can execute a target structured query statement to obtain a target query result from a product database.

[0103] Optionally, the target query result refers to data that is strongly associated with the question content entered by the user. Assuming that the user asks about income, the target query result is the actual value of the income, such as "[(Decimal('1280000.00'))]", which means that the income is 1.28 million yuan.

[0104] In step 105, the target prompt word and the target query result are input into the large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0105] In an embodiment of the present application, the product analysis system can input the target prompt words and target query results into the big model together, and the big model combines the target prompt words and target query results to generate a natural language processed answer. The product analysis system can output the natural language answer to the user terminal and display it on the user interface.

[0106] Alternatively, a natural language answer refers to a large model that converts the target query results into user-friendly language. This is primarily used for decision analysis within the manufacturing product value chain. For example, a natural language answer might be "Company X's Class A vehicle revenue totaled 1.28 million yuan this year."

[0107] As an example, see Figure 2 , Figure 2 This is a flowchart diagram of using a large model to build an SQL assistant for the automotive industry shown in an embodiment of the present application. The product analysis system mentioned above can be a SQL assistant for the automotive industry. In the core process, first, complete prompt words are assembled. This step is completed through default prompt words, database table structure and user questions. Subsequently, the system inputs the prompt words into the large model, and the large model receives the complete prompt words (default prompt words + database table structure + user questions) and generates SQL query statements. After this, the SQL query statement is obtained, and the SQL query result is obtained using the SQL query statement. Finally, the system inputs the query result into the large model, and the large model combines the prompt words and query results, outputs the result after natural language processing, processes and formats the query results, and provides the final output to the user.

[0108] In addition to the core process, the system also includes three optional structures: structure linking, error correction, and optimization. In actual use, the optional structure can be selected according to user needs.

[0109] In an embodiment of the present application, it is applied to a product analysis system, which is communicatively connected to a product database to obtain the question content input by the user and the database table structure associated with the question content. According to the question content, the default prompt word and the database table structure, a target prompt word and an initial structured query statement corresponding to the target prompt word are generated. In response to an inspection instruction for the initial structured query statement, a target structured query statement is output. By executing the target structured query statement, a target query result is obtained from a preset product database. The target prompt word and the target query result are input into a large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0110] Compared with related technologies, the technical solution of the present application, on the one hand, generates targeted target prompt words by combining the question content, default prompt words and database table structure, assisting the large model to better understand user needs; on the other hand, by checking the initial structured query statement, it ensures the output of accurate target structured query statements, so as to accurately find the target query results that match the target structured query statement from the product database. After the target query results and target prompt words are input into the large model, professional natural language answers can be output, thereby achieving the goal of meeting user needs while improving the decision-making analysis performance of the manufacturing product value chain.

[0111] Figure 3 This is a flow chart of a manufacturing product value chain decision analysis method based on a large model, shown in another embodiment of the present application. Figure 3 relatively Figure 1 The technical solution of the embodiment of the present application is described in more detail. The method may include the following steps:

[0112] Step 301: Obtain the question content input by the user and the database table structure associated with the question content.

[0113] In the examples of this application, refer to Figure 4 , Figure 4 This is a structural link detail diagram of using a large model to build an SQL assistant as shown in an embodiment of the present application. In the process of obtaining the database table structure, it is necessary to first list all related tables in the database, such as listing all related tables: "enterprise_sales", "enterprise_excomes", "enterprise_incomes", etc. Then obtain the question content entered by the user, such as "What is the company's revenue from Class A cars this year?" The large model can identify and link the database table structure to be used based on the user's question, and determine which tables will be used or which tables are more in line with the content of the user's question. For example, if "enterprise_incomes" is more consistent with "What is the company's revenue from Class A cars this year?", then "enterprise_incomes" will be used as the database table structure for this decision analysis.

[0114] Step 302: Generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure.

[0115] In an embodiment of the present application, the product analysis system can connect the question content, default prompt words and database table structure through connecting words to generate target prompt words, input the target prompt words into the big model, and generate an initial structured query statement.

[0116] Among them, the connecting words are mainly used to splice the question content, default prompt words and database table structure together, so that the question content, default prompt words and database table structure are input into the big model as a whole, guiding the big model to generate accurate query statements that meet user needs.

[0117] For example, connecting words may include: "Now I will provide you with the information structure of the database, which is...", "The content of the user's question is...", etc., thereby splicing the question content, default prompt words and database table structure into coherent content.

[0118] Step 303 : In response to the check instruction for the initial structured query statement, check whether the statement content of the initial structured query statement has any abnormality.

[0119] In an embodiment of the present application, upon receiving the initial structured query statement, the product analysis system may trigger a check instruction to check whether there is any abnormality in the statement content of the initial structured query statement.

[0120] There are at least two abnormal situations: the first abnormal situation is that the statement content of the initial structured query statement is incorrectly matched, and the second abnormal situation is that the statement content of the initial structured query statement is not optimized.

[0121] 1) The initial structured query statement contains incorrect content.

[0122] In response to a check instruction for the initial structured query statement, multiple large models are called to analyze whether the initial structured query statement correctly matches the question content. If the initial structured query statement correctly matches the question content, it is determined that there is no abnormality in the statement content of the initial structured query statement. If the initial structured query statement incorrectly matches the question content, it is determined that there is an abnormality in the statement content of the initial structured query statement.

[0123] As an example, see Figure 5 , Figure 5 This is a schematic diagram of a SQL error correction flow chart for building an SQL assistant using a large model, as shown in an embodiment of the present application.

[0124] During the error correction process, a large model is used to generate preliminary SQL query statements, and then multiple different large models are used to check whether the generated SQL correctly matches the user's question and vote to decide whether the SQL is correct.

[0125] If the SQL matches the query correctly, a "correct" result is returned and the SQL is formally entered into the database for query.

[0126] If the SQL statement does not match the question correctly, an "incorrect" result will be returned. After multiple large models vote to determine whether the SQL statement needs to be modified, the modified SQL statement will be returned for re-correction. After the correction is completed, the SQL statement will be officially entered into the database for query.

[0127] Among them, the large model can be an open source model, which at least includes ChatGLM3 (Conversational General Language Model), CodeQwen1.5 (Tongyi Qianwen), CodeLlama, etc.

[0128] 2) The initial structured query statement is not optimized

[0129] In response to a check instruction for an initial structured query statement, multiple large models are called to analyze whether the initial structured query statement needs to be optimized. If the initial structured query statement does not need to be optimized, it is determined that there is no abnormality in the statement content of the initial structured query statement. If the initial structured query statement needs to be optimized, it is determined that there is an abnormality in the statement content of the initial structured query statement.

[0130] As an example, see Figure 6 , Figure 6 This is a detailed diagram of SQL optimization using a large model to build an SQL assistant, as shown in an embodiment of the present application.

[0131] During the SQL optimization process, a large model is used to generate preliminary SQL query statements, and then multiple large models are used to check whether the generated SQL can be optimized to ensure that the query is more efficient and can obtain correct results.

[0132] If the SQL does not need to be optimized, enter it directly into the database for query.

[0133] If SQL needs to be optimized, generate the optimized SQL query statement and enter it into the database for query.

[0134] Since the large models in the manufacturing product value chain are all trained and tested large models, they can automatically determine whether the SQL correctly matches the question content and whether the SQL needs to be optimized without human intervention.

[0135] Step 304: Determine the abnormal type of the initial structured query statement with abnormal statement content.

[0136] In an embodiment of the present application, the product analysis system may further determine the abnormal type of the initial structured query statement having abnormal statement content.

[0137] The exception type refers to a category corresponding to an abnormal situation, which at least includes a statement error type and a statement non-optimization type.

[0138] Step 305 : performing an adjustment operation corresponding to the exception type on the initial structured query statement, and outputting a target structured query statement.

[0139] In an embodiment of the present application, the product analysis system may perform an adjustment operation corresponding to the exception type on the initial structured query statement and output a target structured query statement.

[0140] The adjustment operations include error correction operations corresponding to statement error types and optimization operations corresponding to statement non-optimization types.

[0141] 1) Error correction operation

[0142] Determine the content to be corrected of the initial structured query statement, perform a correction operation corresponding to the statement error type on the content to be corrected, and generate and output a target structured query statement.

[0143] The error correction operation is used to modify the content to be corrected in the initial structured query statement so that the initial structured query statement correctly matches the question content.

[0144] As an example, suppose the question asked by the user is "What is the sales volume of the company's product ① this year?" After inspection, it is found that the initial structured query statement generated by the large model does not correctly match the question asked by the user. The content to be corrected is determined to be "product_type = product ②". The correction operation is performed on the content to be corrected and modified to "product_type = product ①". The target structured query statement is obtained. The corrected target structured query statement can correctly match the question content entered by the user.

[0145] 2) Optimize operations

[0146] Determine the content to be optimized of the initial structured query statement, perform optimization operations corresponding to the unoptimized type of the statement on the content to be optimized, and generate and output the target structured query statement.

[0147] The optimization operation is used to optimize the content to be optimized in the initial structured query statement.

[0148] As an example, if the initial structured query statement is too redundant, the redundant fields can be deleted. For example, if the cost and timestamp fields are originally output, the large model believes that the timestamp is not related to user needs and can be deleted directly.

[0149] If the query time of the initial structured query statement is too long, you can shorten the query time by adjusting the fields, structure, or index of the initial structured query statement.

[0150] In addition, if the query result of the initial structured query statement is relatively long, the query result can be shortened by adjusting the output function.

[0151] For example, the query result of executing the initial structured query statement is to list each individual cost (SELECT production_cost from enterprise_sales where...). When there is a lot of data, dozens of values ​​may be listed: [(Decimal('1280.00'), Decimal('1280.00'), Decimal('1280.00'), Decimal('1280.00'), Decimal('1280.00'), Decimal('1280.00'))] . After optimization, the SUM() function (SELECT SUM(production_cost) from enterprise_saleswhere...) is added to add these values ​​and output the combined value [(Decimal('1280000.00'))], which is convenient for processing large models.

[0152] It should be noted that the error correction operation and the optimization operation are independent of each other. The two operations can be performed separately or in combination.

[0153] Step 306: Obtain target query results from the product database by executing the target structured query statement.

[0154] In an embodiment of the present application, the product analysis system obtains target query results from the product database by executing a target structured query statement.

[0155] In step 307, the target prompt word and the target query result are input into the large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0156] In an embodiment of the present application, target prompt words and target query results are input into a large model, which reorganizes the language to output natural language answers, thereby completing decision analysis of the manufacturing product value chain.

[0157] Since the data in the product database is stored in a computer storage format, when the large model extracts or queries the corresponding answer from the product database, it is necessary to use natural language processing methods to combine the answer with the question content in order to output an easy-to-understand natural language answer to the user.

[0158] It should be noted that the embodiments of the present application include but are not limited to the above examples. It is understandable that under the guidance of the ideas of the embodiments of the present application, those skilled in the art can make settings according to actual conditions, and the present application does not impose any restrictions on this.

[0159] In order to enable those skilled in the art to better understand the technical solution of the embodiment of the present invention, the following example is given with reference to Figure 7 The decision analysis flow chart diagram of the automobile manufacturing product value chain is shown to illustrate the embodiment of the present invention.

[0160] Consider a company in the automotive manufacturing industry whose internal data analysis process is complex and has a low degree of automation. The automotive manufacturing product value chain can leverage an automotive manufacturing product analysis system based on big models and SQL Agent to automate decision analysis. The decision analysis process includes at least the following steps:

[0161] S71, a data analysis problem related to the automotive manufacturing industry with user input in spoken language;

[0162] S72, after the user inputs a spoken question about data analysis related to the automotive manufacturing industry, the question is processed by the large model and converted into an SQL query statement;

[0163] S73, multiple other large models check the correctness of the generated SQL query statement;

[0164] S74, query more specialized databases through SQL query statements;

[0165] S75, after obtaining the query result, the large model is used again to organize the language and return the query result to the user in a manner that is easy for the user to understand.

[0166] In an embodiment of the present application, the question content input by the user and the database table structure associated with the question content are obtained, and a target prompt word and an initial structured query statement corresponding to the target prompt word are generated according to the question content, the default prompt word and the database table structure. In response to a check instruction for the initial structured query statement, it is checked whether there is an abnormality in the statement content of the initial structured query statement, the abnormality type of the initial structured query statement with the abnormal statement content is determined, an adjustment operation corresponding to the abnormality type is performed on the initial structured query statement, and a target structured query statement is output. By executing the target structured query statement, a target query result is obtained from a product database, the target prompt word and the target query result are input into a large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

[0167] This application can not only check the query statements to ensure correct and efficient query statements, which is conducive to extracting accurate target query results from the product database, but also use large models to automatically generate and output natural language answers that meet user needs, thereby improving the accuracy and efficiency of decision analysis.

[0168] Moreover, for the product value chain of the automotive manufacturing industry, decision-making often needs to rely on a large amount of professional information and data analysis. The technical solution of this application can reduce the time for information screening and information analysis, avoid the interference of redundant information and irrelevant data, ensure the accuracy and professionalism of information, and thus better support decision-making analysis in the manufacturing industry.

[0169] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a manufacturing product value chain decision analysis system based on a large model, an electronic device and corresponding embodiments.

[0170] Figure 8 This is a structural diagram of a manufacturing product value chain decision analysis system based on a large model shown in an embodiment of the present application. Figure 8 The system includes at least the following modules:

[0171] The question content acquisition module 801 is used to obtain the question content input by the user and the database table structure associated with the question content;

[0172] The data generation module 802 is used to generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure;

[0173] A query statement checking module 803 is configured to output a target structured query statement in response to a checking instruction for the initial structured query statement;

[0174] The query result acquisition module 804 is used to acquire target query results from a preset product database by executing a target structured query statement;

[0175] The answer output module 805 is used to input the target prompt words and target query results into the large model and output natural language answers. The natural language answers are used for decision analysis of the manufacturing product value chain.

[0176] In an optional example of the present application, the data generation module 802 is used to:

[0177] The question content, default prompt words and database table structure are spliced ​​together through connecting words to generate target prompt words;

[0178] Input the target prompt words into the large model to generate the initial structured query statement.

[0179] In an optional example of the present application, the query statement checking module 803 includes:

[0180] An abnormality checking submodule is used to check whether there is any abnormality in the statement content of the initial structured query statement in response to the checking instruction for the initial structured query statement;

[0181] An exception type determination submodule is used to determine the exception type of the initial structured query statement with an exception in the statement content;

[0182] The query statement adjustment submodule is used to perform an adjustment operation corresponding to the exception type on the initial structured query statement and output a target structured query statement.

[0183] In an optional example of the present application, the anomaly checking submodule is used to:

[0184] In response to a check instruction for the initial structured query statement, calling multiple large models to analyze whether the initial structured query statement correctly matches the question content;

[0185] If the initial structured query statement correctly matches the question content, it is determined that there is no abnormality in the statement content of the initial structured query statement;

[0186] If the initial structured query statement does not match the question content correctly, it is determined that there is an anomaly in the statement content of the initial structured query statement.

[0187] In an optional example of the present application, the exception type includes a statement error type, and the query statement adjustment submodule is configured to:

[0188] Determine the content to be corrected in the initial structured query statement;

[0189] Execute the correction operation corresponding to the statement error type on the error correction content, generate and output the target structured query statement;

[0190] The error correction operation is used to modify the content to be corrected in the initial structured query statement so that the initial structured query statement correctly matches the question content.

[0191] In an optional example of the present application, the anomaly checking submodule is used to:

[0192] In response to a check instruction for the initial structured query statement, calling multiple large models to analyze whether the initial structured query statement needs to be optimized;

[0193] If the initial structured query statement does not need to be optimized, it is determined that there is no abnormality in the statement content of the initial structured query statement;

[0194] If the initial structured query statement needs to be optimized, it is determined that there is an abnormality in the statement content of the initial structured query statement.

[0195] In an optional example of the present application, the exception type includes a statement not optimized type, and the query statement adjustment submodule is used to:

[0196] Determine the content to be optimized in the initial structured query statement;

[0197] Perform optimization operations corresponding to the unoptimized statement type on the content to be optimized, and generate and output the target structured query statement;

[0198] The optimization operation is used to optimize the content to be optimized in the initial structured query statement.

[0199] Regarding the system in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated again here.

[0200] Figure 9 It is a structural diagram of an electronic device shown in an embodiment of the present application.

[0201] See also Figure 9 , the electronic device 900 includes a memory 910 and a processor 920 .

[0202] The processor 920 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.

[0203] Memory 910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. ROM may store static data or instructions required by processor 920 or other computer modules. Permanent storage may be a readable and writable storage device. Permanent storage may be a non-volatile storage device that retains stored instructions and data even when the computer is powered off. In some embodiments, the permanent storage device utilizes a mass storage device (e.g., a magnetic or optical disk, flash memory). In other embodiments, the permanent storage device may be a removable storage device (e.g., a floppy disk, optical drive). System memory may be a readable and writable storage device or a volatile readable and writable storage device, such as dynamic random access memory (DRAM). System memory may store some or all instructions and data required by the processor during operation. Furthermore, memory 910 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (e.g., DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), as well as magnetic disks and / or optical disks. In some embodiments, the memory 910 may include a readable and / or writable removable storage device, such as a compact disc (CD), a read-only digital versatile disc (e.g., DVD-ROM, double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (e.g., SD card, mini SD card, Micro-SD card, etc.), a magnetic floppy disk, etc. Computer-readable storage media do not include carrier waves and transient electronic signals transmitted wirelessly or wired.

[0204] The memory 910 stores executable codes. When the executable codes are processed by the processor 920 , the processor 920 may execute part or all of the above-mentioned methods.

[0205] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.

[0206] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.

[0207] The embodiments of the present application have been described above. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is selected to best explain the principles of the embodiments, their practical applications, or improvements to the technology in the market, or to enable other persons skilled in the art to understand the embodiments disclosed herein.

Claims

1. A manufacturing product value chain decision analysis method based on a large model, characterized by: The method comprises: Obtain the question content input by the user and the database table structure associated with the question content; Generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure; In response to a check instruction for the initial structured query statement, multiple large models are called to analyze whether the initial structured query statement correctly matches the question content; if the initial structured query statement correctly matches the question content, it is determined that there is no anomaly in the statement content of the initial structured query statement; if the initial structured query statement incorrectly matches the question content, it is determined that there is an anomaly in the statement content of the initial structured query statement; In response to a check instruction for the initial structured query statement, calling a plurality of the large models to analyze whether the initial structured query statement needs to be optimized; if the initial structured query statement does not need to be optimized, determining that there is no abnormality in the statement content of the initial structured query statement; if the initial structured query statement needs to be optimized, determining that there is an abnormality in the statement content of the initial structured query statement; Determining the abnormality type of the initial structured query statement in which the statement content is abnormal; Performing an adjustment operation corresponding to the exception type on the initial structured query statement, and outputting a target structured query statement; Obtaining target query results from a preset product database by executing the target structured query statement; The target prompt word and the target query result are input into a large model, and a natural language answer is output. The natural language answer is used for decision analysis of the manufacturing product value chain.

2. The method according to claim 1, characterized in that Generating a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure includes: Connecting the question content, the default prompt word, and the database table structure through a conjunction to generate a target prompt word; The target prompt word is input into the large model to generate the initial structured query statement.

3. The method according to claim 1, characterized in that The exception type includes a statement error type, and performing an adjustment operation corresponding to the exception type on the initial structured query statement to output a target structured query statement includes: Determining the content to be corrected of the initial structured query statement; Performing an error correction operation corresponding to the error type of the statement on the content to be corrected, generating and outputting the target structured query statement; The error correction operation is used to modify the content to be corrected in the initial structured query statement so that the initial structured query statement correctly matches the question content.

4. The method according to claim 1, wherein The exception type includes an unoptimized statement type, and performing an adjustment operation corresponding to the exception type on the initial structured query statement to output a target structured query statement includes: Determining content to be optimized in the initial structured query statement; Performing an optimization operation corresponding to the unoptimized type of the statement on the content to be optimized, generating and outputting the target structured query statement; The optimization operation is used to optimize the content to be optimized in the initial structured query statement.

5. A manufacturing product value chain decision analysis system based on a large model, characterized by: include: A question content acquisition module is used to obtain the question content input by the user and the database table structure associated with the question content; A data generation module, configured to generate a target prompt word and an initial structured query statement corresponding to the target prompt word according to the question content, the default prompt word, and the database table structure; a query statement checking module, configured to, in response to a checking instruction for the initial structured query statement, call a plurality of large models to analyze whether the initial structured query statement correctly matches the question content; If the initial structured query statement correctly matches the question content, then determining that there is no abnormality in the statement content of the initial structured query statement; If the initial structured query statement does not match the question content correctly, determining that there is an anomaly in the statement content of the initial structured query statement; In response to a check instruction for the initial structured query statement, calling a plurality of the large models to analyze whether the initial structured query statement needs to be optimized; If the initial structured query statement does not need to be optimized, determining that there is no abnormality in the statement content of the initial structured query statement; If the initial structured query statement needs to be optimized, determining that there is an abnormality in the statement content of the initial structured query statement; Determining the abnormality type of the initial structured query statement in which the statement content is abnormal; Performing an adjustment operation corresponding to the exception type on the initial structured query statement, and outputting a target structured query statement; A query result acquisition module, configured to acquire a target query result from a preset product database by executing the target structured query statement; The answer output module is used to input the target prompt word and the target query result into the large model and output a natural language answer, which is used for decision analysis of the manufacturing product value chain.

6. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored thereon, which, when executed by the processor, causes the processor to execute the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having executable code stored thereon, which, when executed by a processor of an electronic device, causes the processor to execute the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Database query method and device, electronic equipment and storage medium

    CN118779315A

  • Query evaluation in natural language processing systems

    US11972223B1