Manufacturing industry product value chain decision analysis method based on large model
By generating and adjusting structured query statements and combining them with large models for manufacturing decision analysis, the problem of low efficiency in traditional decision-making methods has been solved, and the professionalism and accuracy have been improved.
Patent Information
- Application Number
- CN202411482227.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-23
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2044-10-23
AI Technical Summary
Traditional manufacturing decision-making relies on manual decision-making, which is inefficient and prone to information omissions or errors. General-purpose large language models lack professionalism in specific industry applications and are difficult to meet industry needs.
By acquiring user-input questions and database table structures, target prompts and initial structured query statements are generated. The statements are checked and adjusted, and professional natural language answers are output. These are then combined with a large model for decision analysis.
It improves the accuracy and efficiency of decision analysis in the manufacturing product value chain, meets the needs of specific industries, reduces information screening time, and ensures the accuracy and professionalism of information.
Smart Images

Figure CN119513126A_ABST
Abstract
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 modern enterprise decision-making process, especially in the manufacturing industry, decision makers are often faced with 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 usually rely on manual decision-making, and decision-makers need to spend a lot of time collecting, organizing and analyzing data. This not only consumes a lot of manpower and time, is inefficient, but also easily leads to information omissions or errors, thus affecting the accuracy and timeliness of decision-making. In addition, with the increase in data volume and the increase in information complexity, the limitations of traditional decision-making methods have become more and more obvious.
[0004] At present, big language models have been added to relevant decision-making methods, using the analytical capabilities of big language models to assist decision makers in reviewing 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] The present 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 needs of users in a specific industry and improve the professionalism and accuracy of decision analysis.
[0006] The first aspect of the present application provides a manufacturing product value chain decision analysis method based on a large model, comprising: Obtaining 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, output 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.
[0007] In one example, 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: The question content, the default prompt word and the database table structure are spliced together by connecting words to generate a target prompt word; The target prompt word is input into the large model to generate the initial structured query sentence.
[0008] In one example, in response to the inspection instruction for the initial structured query statement, outputting a target structured query statement includes: 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; Determine the abnormal type of the initial structured query statement in which the statement content is abnormal; An adjustment operation corresponding to the abnormal type is performed on the initial structured query statement, and the target structured query statement is output.
[0009] In one example, in response to the checking instruction for the initial structured query statement, checking whether the statement content of the initial structured query statement is abnormal includes: 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; 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, it is determined that there is an abnormality in the statement content of the initial structured query statement.
[0010] 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: 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.
[0011] In one example, in response to the checking instruction for the initial structured query statement, checking whether the statement content of the initial structured query statement is abnormal includes: 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, it is determined that there is an abnormality in the statement content of the initial structured query statement.
[0012] 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: Determining the content to be optimized of 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.
[0013] The second aspect of the present application provides a manufacturing product value chain decision analysis system based on a large model, comprising: A question content acquisition module is used to acquire the question content input by the user and the database table structure associated with the question content; A data generation module, 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; 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; A query result acquisition module, used 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, and the natural language answer is used for decision analysis of the manufacturing product value chain.
[0014] A third aspect of the present application provides an electronic device, including: Processor; and The memory stores executable codes thereon, and when the executable codes are executed by the processor, the processor is caused to execute the method as described above.
[0015] 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 as described above.
[0016] The technical solution provided by this application may have the following beneficial effects: 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, a target structured query statement is output, and 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.
[0017] Compared with the 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, so as to assist the large model to better understand user needs; on the other hand, it checks the initial structured query statement to ensure 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.
[0018] 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
[0019] 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.
[0020] Figure 1 It is a flowchart of a manufacturing product value chain decision analysis method based on a large model shown in an embodiment of the present application; Figure 2 It is a flowchart diagram of using a large model to build an automotive industry SQL assistant shown in an embodiment of the present application; Figure 3 It is a flowchart of a manufacturing product value chain decision analysis method based on a large model, shown in another embodiment of the present application; Figure 4It is a structural link detail diagram of building a SQL assistant using a large model as shown in an embodiment of the present application; Figure 5 It is a schematic diagram of a SQL error correction flow chart of building a SQL assistant using a large model, as shown in an embodiment of the present application; Figure 6 It is a detailed diagram of SQL optimization using a large model to build an SQL assistant shown in an embodiment of the present application; Figure 7 It is a schematic diagram of a decision analysis flow chart of the product value chain of the automobile manufacturing industry shown in an embodiment of the present application; Figure 8 It is a structural schematic diagram of a manufacturing product value chain decision analysis system based on a large model shown in an embodiment of the present application; Fig. 9 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0021] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, 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.
[0022] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "said" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0023] 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 the same type of information 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, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0024] In the decision-making process of modern enterprises, especially in the manufacturing industry, decision makers need to consult and integrate a large number of information sources, including product technology, market research results, industry regulations and policies, financial data, etc. Traditional decision-making methods usually rely on a lot of manpower and time investment, and decision makers need to spend a lot of time collecting, sorting and analyzing data. This is not only inefficient, but also prone to information omissions or errors, thus affecting the accuracy and timeliness of decision-making. In addition, with the increase in data volume and the increase in information complexity, the limitations of traditional decision-making methods have become more and more significant.
[0025] The emergence of Large Language Model (LLM) has brought great changes to the information retrieval process. By using large language models, information retrieval is more convenient and decision-making efficiency is significantly improved. However, the current general basic large models have certain limitations in the application of actual business needs, which are mainly reflected in the following aspects: First, knowledge limitations: general large models lack in-depth knowledge in professional fields and are difficult to meet industry-specific needs.
[0026] Second, the illusion problem: general large models may generate inaccurate or false information and lack professionalism.
[0027] Third, data security: data security cannot be effectively guaranteed.
[0028] 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.
[0029] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0030] Figure 1 This is a flowchart of a method for analyzing manufacturing product value chain decision based on a large model, as shown in an embodiment of the present application. Figure 1 , applied to a product analysis system, the product analysis system is connected to a product database for communication, the method comprising at least the following steps: In this application, the product analysis system refers to a manufacturing product analysis system based on a big model and SQL Agent (Structured Query Language Agent), which interacts with a SQL (Structured Query Language) database through SQL Agent to perform tasks related to the SQL database, and combines SQL Agent with a big language model to make the acquired information more professional rather than a general and messy group of information, and to obtain information in specific fields faster, thereby improving the accuracy and efficiency of decision-making analysis of the manufacturing product value chain.
[0031] 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 other data sources, adds it to the question as context, and then requires a large language model to reason based on prompts and return answers that humans can understand.
[0032] 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.
[0033] 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.
[0034] Prompt construction requires formulating clear and concise prompts or queries that will be presented to the language model (LLM).
[0035] Query conversion requires LLM to convert user queries into SQL queries (database queries) generated in SQL format.
[0036] Database interaction requires executing SQL queries against the database to retrieve the requested information.
[0037] Response generation requires that the data retrieved from the database is again used as input to the LLM, which generates responses based on the enhanced input.
[0038] Result comparison requires comparing the generated SQL and query results with the preset results in the dataset to evaluate the model.
[0039] In this way, the system can understand the 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, thus reducing the difficulty of retrieval.
[0040] In addition, the system presents query results to users in natural language format, which is conducive to improving user experience.
[0041] In the following, an example is given by taking the product analysis system as a product analysis system for the automobile manufacturing industry and the product database as a database storing information related to the automobile manufacturing industry.
[0042] Step 101: Obtain the question content input by the user and the database table structure associated with the question content.
[0043] In the 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.
[0044] 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.
[0045] For example, a user uses a computer to open a webpage or client of a product analysis system, and enters a question such as "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 entered 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 from the product database.
[0046] 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.
[0047] For example, if the user inputs 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.
[0048] Among them, "CREATE TABLE" is a statement in SQL used to define a new table, which mainly includes the name of the table (enterprise_sales) and the definition of each field in the table.
[0049] "order_id INT PRIMARY KEY" means defining a field called order_id, the data type is an integer (INT), and specifying it as the primary key (PRIMARY KEY), ensuring that each order has a unique number.
[0050] "product_name VARCHAR(100)" means defining a field called 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.
[0051] 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, etc. This application does not limit this.
[0052] 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.
[0053] 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.
[0054] 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.
[0055] For example, when the product analysis system is initialized, the default prompt "You are a database expert in the automotive industry, and you are going to answer the user's questions. I will ask you questions..." is sent to the big model.
[0056] The target prompt word refers to a complete prompt word that combines the question content, the default prompt word, and the database table structure, which is used to instruct the large model to generate the corresponding SQL query statement.
[0057] 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 the query results from the product database.
[0058] Step 103: In response to the check instruction for the initial structured query statement, a target structured query statement is output.
[0059] 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.
[0060] 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 ...".
[0061] Step 104, obtaining a target query result from the product database by executing the target structured query statement.
[0062] 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.
[0063] Optionally, the target query result refers to data that is strongly associated with the question content input 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.
[0064] Step 105, input the target prompt word and the target query result into the big model, output the natural language answer, and the natural language answer is used for decision analysis of the manufacturing product value chain.
[0065] In an embodiment of the present application, the product analysis system can input the target prompt words and the target query results into the big model together, and the big model combines the target prompt words and the 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.
[0066] Alternatively, the natural language answer refers to the conversion of the target query result into a language expression that is easy for users to understand by the large model, which is mainly used for decision analysis of the manufacturing product value chain. For example, the natural language answer can be "Company X's total revenue of Class A cars this year is 1.28 million yuan."
[0067] As an example, see Figure 2 , Figure 2It is a flowchart diagram of using a big model to build an SQL assistant for the automotive industry shown in an embodiment of the present application. The above-mentioned product analysis system can be a SQL assistant for the automotive industry. In the core process, first, assemble the complete prompt words. This step is completed through the default prompt words, database table structure and user questions. Subsequently, the system inputs the prompt words into the big model, and the big model receives the complete prompt words (default prompt words + database table structure + user questions) to generate a SQL query statement. After this, an SQL query statement is obtained, and the SQL query result is obtained using the SQL query statement. Finally, the system inputs the query results into the big model, the big model combines the prompt words and the query results, outputs the results after natural language processing, processes and formats the query results, and provides the final output to the user.
[0068] 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.
[0069] In an embodiment of the present application, it is applied to a product analysis system, which is connected to a product database for communication, obtains the question content input by the user and the database table structure associated with the question content, generates 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, outputs a target structured query statement in response to a check instruction for the initial structured query statement, obtains a target query result from a preset product database by executing the target structured query statement, inputs the target prompt word and the target query result into a large model, outputs a natural language answer, and uses the natural language answer for decision analysis of the manufacturing product value chain.
[0070] Compared with the 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, so as to assist the large model to better understand user needs; on the other hand, it checks the initial structured query statement to ensure 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.
[0071] Figure 3 It 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: Step 301: Obtain the question content input by the user and the database table structure associated with the question content.
[0072] In the embodiments 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 relevant tables in the database, such as listing all relevant 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 matched 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.
[0073] 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.
[0074] 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.
[0075] 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.
[0076] 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., so as to splice the question content, default prompt words and database table structure into coherent content.
[0077] 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 is abnormal.
[0078] In an embodiment of the present application, when receiving an 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.
[0079] 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.
[0080] 1) The initial structured query statement has incorrect content matching 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 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.
[0081] As an example, see Figure 5 , Figure 5 It is a schematic diagram of a SQL error correction flow chart of building a SQL assistant using a large model as shown in an embodiment of the present application.
[0082] 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.
[0083] If the SQL matches the query correctly, a "correct" result is returned and the SQL is formally entered into the database for query.
[0084] If the SQL does not match the question correctly, an "incorrect" result is returned. After multiple large models vote to determine whether the SQL statement needs to be modified, the modified SQL is returned for re-correction. After the correction is correct, the SQL is officially entered into the database for query.
[0085] Among them, the large model can be an open source model, which at least includes ChatGLM3 (Dialogue General Language Model), CodeQwen1.5 (Tongyi Qianwen), CodeLlama, etc.
[0086] 2) The content of the initial structured query statement is not optimized 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.
[0087] As an example, see Figure 6 , Figure 6This is a detailed diagram of SQL optimization using a large model to build a SQL assistant as shown in an embodiment of the present application.
[0088] 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 obtains correct results.
[0089] If the SQL does not need to be optimized, enter it directly into the database for query.
[0090] If SQL needs to be optimized, generate the optimized SQL query statement and enter it into the database for query.
[0091] Since the big models in the manufacturing product value chain are all trained and tested big models, they can automatically determine whether the SQL matches the question content correctly and whether the SQL needs to be optimized without human intervention.
[0092] Step 304: Determine the abnormal type of the initial structured query statement with abnormal statement content.
[0093] 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.
[0094] 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.
[0095] Step 305: perform an adjustment operation corresponding to the abnormal type on the initial structured query statement, and output a target structured query statement.
[0096] In an embodiment of the present application, the product analysis system may perform an adjustment operation corresponding to the abnormal type on the initial structured query statement and output a target structured query statement.
[0097] The adjustment operation includes an error correction operation corresponding to a statement error type and an optimization operation corresponding to a statement non-optimization type.
[0098] 1) Error correction operation 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.
[0099] 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.
[0100] As an example, suppose the question asked by the user is "What is the sales volume of the company's product ① this year?" After checking, it is found that the initial structured query statement generated by the large model does not correctly match the question asked by the user, and the content to be corrected is determined to be "product_type = product ②". The correction operation is performed on the content to be corrected, and it is modified to "product_type = product ①" to obtain the target structured query statement. The corrected target structured query statement can correctly match the question content entered by the user.
[0101] 2) Optimize operations 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.
[0102] The optimization operation is used to optimize the content to be optimized in the initial structured query statement.
[0103] As an example, if the initial structured query statement is too redundant, the redundant fields can be deleted. For example, if the two fields of cost and timestamp are originally output, the large model believes that timestamp has no relevance to user needs and can be deleted directly.
[0104] If the query time of the initial structured query statement is too long, the query time can be shortened by adjusting the fields, structure or index of the initial structured query statement.
[0105] 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.
[0106] For example, the query result obtained by 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 is added (SELECT SUM(production_cost) from enterprise_saleswhere...) to add the above values together and output [(Decimal('1280000.00'))], which is convenient for large model processing.
[0107] It should be noted that the error correction operation and the optimization operation are independent of each other, and the two operations can be performed separately or in combination.
[0108] Step 306, obtaining a target query result from the product database by executing the target structured query statement.
[0109] In an embodiment of the present application, the product analysis system obtains target query results from a product database by executing a target structured query statement.
[0110] Step 307, input the target prompt word and the target query result into the big model, output the natural language answer, and the natural language answer is used for decision analysis of the manufacturing product value chain.
[0111] In an embodiment of the present application, target prompt words and target query results are input into a large model, and the large model reorganizes the language to output natural language answers, thereby completing the decision analysis of the manufacturing product value chain.
[0112] 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.
[0113] 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, technical personnel in this field can make settings according to actual conditions, and the present application does not limit this.
[0114] In order to enable those skilled in the art to better understand the technical solution of the embodiment of the present invention, an example is given below, and reference is made to Figure 7 The decision analysis flow chart schematic diagram of the automobile manufacturing product value chain is shown to illustrate the embodiment of the present invention.
[0115] Assume that in the automotive manufacturing industry, the internal data analysis process of a company is very complicated and has a low degree of automation. Then the automotive manufacturing product value chain can use the automotive manufacturing product analysis system based on big models and SQL Agent to complete automated decision analysis. The decision analysis process includes at least the following steps: S71, user inputs colloquial data analysis questions related to the automotive manufacturing industry; S72, after the user inputs a spoken automobile manufacturing-related data analysis question, the question is converted into an SQL query statement after being processed by the big model; S73, multiple other large models check the correctness of the generated SQL query statement; S74, query more professional databases through SQL query statements; S75, after obtaining the query result, the large model is used again to organize the language, and the query result is returned to the user in a manner that is easy for the user to understand.
[0116] 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 a manufacturing product value chain.
[0117] 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.
[0118] 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.
[0119] Corresponding to the aforementioned application function implementation method embodiment, the present application also provides a manufacturing product value chain decision analysis system, electronic equipment and corresponding embodiments based on a large model.
[0120] Figure 8 This is a schematic 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: The question content acquisition module 801 is used to acquire the question content input by the user and the database table structure associated with the question content; 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; A query statement checking module 803, configured to output a target structured query statement in response to a checking instruction for the initial structured query statement; The query result acquisition module 804 is used to acquire the target query result from the preset product database by executing the target structured query statement; 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.
[0121] In an optional example of the present application, the data generation module 802 is used to: The question content, default prompt words and database table structure are spliced together through connecting words to generate target prompt words; Input the target prompt words into the large model to generate the initial structured query statement.
[0122] In an optional example of the present application, the query statement checking module 803 includes: An abnormality checking submodule is used to check whether there is an abnormality in the statement content of the initial structured query statement in response to the checking instruction for the initial structured query statement; The exception type determination submodule is used to determine the exception type of the initial structured query statement with an exception in the statement content; The query statement adjustment submodule is used to perform an adjustment operation corresponding to the abnormal type on the initial structured query statement and output a target structured query statement.
[0123] In an optional example of the present application, the abnormality checking submodule is used to: 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 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.
[0124] In an optional example of the present application, the exception type includes a statement error type, and the query statement adjustment submodule is used to: Determine the content to be corrected of the initial structured query statement; Performing an error correction operation corresponding to the statement error type on the error correction content, generating and outputting a 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.
[0125] In an optional example of the present application, the abnormality checking submodule is used to: In response to a check instruction for the initial structured query statement, calling a plurality of 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, 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.
[0126] 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: Determine the content to be optimized of the initial structured query statement; Perform optimization operations corresponding to the unoptimized statement type on the content to be optimized, and generate and output the target structured query statement; The optimization operation is used to optimize the content to be optimized in the initial structured query statement.
[0127] 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.
[0128] Fig. 9 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0129] See also Fig. 9 , the electronic device 900 includes a memory 910 and a processor 920 .
[0130] 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 the processor may be any conventional processor, etc.
[0131] The memory 910 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage devices. Among them, ROM can store static data or instructions required by the processor 920 or other modules of the computer. The permanent storage device may be a readable and writable storage device. The permanent storage device may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In some other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at runtime. In addition, the memory 910 may include any combination of computer-readable storage media, including various types of semiconductor storage chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 910 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a 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.
[0132] The memory 910 stores executable codes, and when the executable codes are processed by the processor 920 , the processor 920 can execute part or all of the methods described above.
[0133] 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.
[0134] 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.
[0135] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill 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 in that: The method comprises: Obtaining 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, output 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 The step of 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: The question content, the default prompt word and the database table structure are spliced together by connecting words to generate a target prompt word; The target prompt word is input into the large model to generate the initial structured query sentence.
3. The method according to claim 1, characterized in that The step of outputting a target structured query statement in response to the inspection instruction for the initial structured query statement comprises: 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; Determine the abnormal type of the initial structured query statement in which the statement content is abnormal; An adjustment operation corresponding to the abnormal type is performed on the initial structured query statement, and the target structured query statement is output.
4. The method according to claim 3, characterized in that The step of checking, in response to the checking instruction for the initial structured query statement, whether the statement content of the initial structured query statement is abnormal comprises: 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; 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, it is determined that there is an abnormality in the statement content of the initial structured query statement.
5. The method according to claim 4, characterized in that The exception type includes a statement error type, and the performing an adjustment operation corresponding to the exception type on the initial structured query statement to output the 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.
6. The method according to claim 3, characterized in that The step of checking whether the content of the initial structured query statement is abnormal in response to the checking instruction for the initial structured query statement includes: 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, it is determined that there is an abnormality in the statement content of the initial structured query statement.
7. The method according to claim 6, characterized in that The exception type includes a statement not optimized type, and the performing of an adjustment operation corresponding to the exception type on the initial structured query statement to output the target structured query statement includes: Determining the content to be optimized of 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.
8. A manufacturing product value chain decision analysis system based on a large model, characterized in that: include: A question content acquisition module is used to acquire the question content input by the user and the database table structure associated with the question content; A data generation module, 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; 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; A query result acquisition module, used 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, and the natural language answer is used for decision analysis of the manufacturing product value chain.
9. 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 7.
10. A computer-readable storage medium having executable codes 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 7.
Citation Information
Patent Citations
Database query method and device, electronic equipment and storage medium
CN118779315A
Query evaluation in natural language processing systems
US11972223B1
Cited By
Industrial chain analysis method, system and device, storage medium and program product
CN120216665A