Manufacturing execution system natural language interaction method and system based on large language model

Through the manufacturing execution system natural language interaction method based on large language models, eliminate semantic ambiguity and decompose tasks, the high cost and complexity problems of the MES system are solved, and efficient and reliable natural language interaction is achieved, suitable for complex industrial scenarios.

CN120336355APending Publication Date: 2025-07-18UNIV OF SCI & TECH BEIJING +1
View PDF 0 Cites 3 Cited by

Patent Information

Application Number
CN202510471332.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-15
Publication Date
2025-07-18

AI Technical Summary

Technical Problem

The interaction methods of traditional MES systems have high development and maintenance costs and complexity problems. The natural language interaction technology based on LLM is insufficient in controllability and reliability in MES systems, making it difficult to meet the needs of precise instructions and complex tasks.

Method used

The natural language interaction method of manufacturing execution system based on large language models is adopted, and semantic ambiguity is eliminated by requesting the rewrite module, multi-step dynamic operation planning and execution module perform task decomposition, and user-readable responses are generated, including entity standardization, database access, service calls and logical reasoning.

Benefits of technology

It enables users to complete complex manufacturing system operations through simple text input, reducing learning and operation complexity, improving interaction efficiency and system reliability, and reducing development and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336355A_ABST
    Figure CN120336355A_ABST
Patent Text Reader

Abstract

The invention provides a manufacturing execution system natural language interaction method and system based on a large language model, and relates to the technical field of intelligent manufacturing and industrial informatization. The method comprises the steps of obtaining a natural language request input by a user through a text interface, performing entity standardization processing on the natural language request through a request rewriting module based on a large language model, and eliminating semantic ambiguity to obtain a standardized request; performing task decomposition on the standardized request by adopting a multi-step dynamic operation planning and execution module to obtain an atomic operation chain; and dynamically executing each step of operation in the atomic operation chain, and generating a user readable response by using a large language model according to an execution result. Natural language interaction replaces a traditional graphical user interface, the system development and maintenance cost and the user learning complexity are remarkably reduced, and the operation efficiency and reliability of a manufacturing execution system are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of intelligent manufacturing and industrial informatization, and particularly to a natural language interaction method and system for a manufacturing execution system based on a large language model. Background Art

[0002] With the rapid development of global manufacturing, the manufacturing execution system has become an indispensable core component in modern manufacturing. The MES (Manufacturing Execution System) is mainly used for the management and optimization of the production process. By integrating functions such as production planning, scheduling, quality control, and equipment management, it realizes the comprehensive monitoring and management of the production process. However, traditional MES systems mainly rely on the GUI (Graphical User Interface) for operation, which has some limitations in practical applications.

[0003] Firstly, the development and maintenance costs of the GUI are relatively high. Due to the customization requirements of the MES system, the development of the GUI requires a large amount of programming work. And after the system is launched, users may put forward various new requirements, resulting in the need for the development team to continuously intervene and revise the software logic and data access interfaces. This high maintenance cost makes it difficult for many MES projects to continue running [B. W. Shaheen, I. Németh, Integration of maintenance management system functions with industry 4.0 technologies and features—a review, Processes 10 (11) (2022). doi:10.3390 / pr10112173.].

[0004] Secondly, the learning cost and operation complexity of the GUI are relatively high. New employees need to undergo systematic training to operate the MES system proficiently. And in the actual use process, due to the limitations of the GUI, users need to perform a large number of repetitive and cumbersome operations, which increases the workload of workers [Z. Li, G. Li, Z. Li, Application research of mes in intelligent manufacturing training factory, in: International Conference on Adaptive and Intelligent Systems, Springer, 2022, pp. 118–127.].

[0005] To address the above problems, in recent years, with the development of natural language processing technology, natural language interaction technology based on LLM (Large Language Model) has gradually been applied to the MES system. Through natural language interaction, users can interact with the MES system more intuitively and efficiently, thereby reducing the learning cost and operation complexity. For example, Mantravadi et al. [S. Mantravadi, A. D. Jansson, C. Møller, User-friendly mesinterfaces: Recommendations for an ai-based chatbot assistance in industry4.0 shop floors, in: Asian Conference on Intelligent Information and DatabaseSystems, Springer, 2020, pp. 189–201.] proposed an AI-based chatbot for production coordination and information extraction, demonstrating that MES users can obtain a more dynamic and free experience through an interactive chatbot. Colabianchi et al. [S. Colabianchi, A. Tedeschi, F. Costantino, Human-technologyintegration with industrial conversational agents: A conceptual architectureand a taxonomy for manufacturing, Journal of Industrial InformationIntegration 35 (2023) 100510.] proposed a conceptual architecture for industrial dialogue agents, demonstrating the application potential of LLM in manufacturing dialogue systems.

[0006] However, despite the broad application prospects of LLMs in the manufacturing industry, there are still some challenges in practical applications. For example, the flexibility of natural language often leads to ambiguity in user input, which conflicts with the need for precise instructions in the MES system. In addition, when dealing with complex tasks, LLMs need to perform a series of database operations and service calls, which poses higher requirements for the accuracy and reliability of the model [A. Yadav, A. Patel, M. Shah, A comprehensive review on resolving ambiguities in natural language processing, AI Open 2 (2021) 85–92.].

[0007] In summary, traditional MES systems have limitations in the interaction method, and natural language interaction technology based on LLMs provides new ideas for solving these problems. However, how to improve the controllability and reliability of LLMs in the MES system remains an urgent problem to be solved. The present invention aims to solve the above problems and improve the interaction efficiency and user experience of the MES system by proposing a new technical solution. Summary of the Invention

[0008] To solve the technical problem of how to improve the controllability and reliability of LLMs in the MES system, an embodiment of the present invention provides a natural language interaction method and system for a manufacturing execution system based on a large language model. The technical solution is as follows:

[0009] On the one hand, a natural language interaction method for a manufacturing execution system based on a large language model is provided. This method is implemented by a natural language interaction device for a manufacturing execution system based on a large language model, and the method includes:

[0010] S1. Obtain a natural language request input by the user through a text interface, perform entity standardization processing on the natural language request through a request rewriting module based on a large language model, and eliminate semantic ambiguity to obtain a standardized request.

[0011] S2. Use a multi-step dynamic operation planning and execution module to decompose the standardized request to obtain an atomic operation chain.

[0012] S3. Dynamically execute each operation in the atomic operation chain, and use the large language model to generate a user-readable response according to the execution result.

[0013] Optionally, performing entity standardization processing on the natural language request through a request rewriting module based on a large language model in S1 and eliminating semantic ambiguity to obtain a standardized request includes:

[0014] S11. Construct an entity embedding vector database; among them, the entity embedding vector database includes standardized entities and the corresponding embedding representations of the standardized entities.

[0015] S12. Extract fuzzy entities in the natural language request through named entity recognition technology, and retrieve the standardized entities matching the fuzzy entities in the entity embedding vector database to obtain the retrieved standardized entities.

[0016] S13. Parse the natural language request to obtain the parsed entities.

[0017] S14. Match the retrieved standardized entities with the parsed entities to obtain the matched entities, and eliminate semantic ambiguities to obtain the standardized request.

[0018] Optionally, in S2, the standardized request is decomposed into an atomic operation chain by using a multi-step dynamic operation planning and execution module, including:

[0019] S21. Identify the type of the standardized request.

[0020] S22. Obtain the database table structure of the manufacturing execution system corresponding to the request type.

[0021] S23. Extract a small number of examples related to the current request type from the preset example library and embed the examples into the prompt.

[0022] S24. Generate an atomic operation chain through a large language model according to the standardized request, the database table structure, and the prompt.

[0023] Optionally, the atomic operations in the atomic operation chain include database access, service call, and logical reasoning.

[0024] For database access operations, they are generated and executed through Text2SQL technology.

[0025] For service call operations, call the pre-defined API service tools of the manufacturing execution system to execute.

[0026] For logical reasoning operations, execute based on the context intermediate results.

[0027] Optionally, the execution process of the atomic operation chain includes:

[0028] Before each operation is executed, the large language model extracts parameters from the previous operation results through a dynamic parameter retrieval mechanism to fill the placeholders of the current operation.

[0029] Perform syntax verification and business rule compliance verification on the generated SQL commands.

[0030] For an operation that fails to execute, trigger an error classification mechanism and automatically correct it or request the user to supplement information according to the error type.

[0031] Optionally, for each step in the dynamic execution of the atomic operation chain in S3, generate a user-readable response using a large language model based on the execution result, including:

[0032] For each step in the dynamic execution of the atomic operation chain, obtain the execution result of each step, and generate a natural language response using a large language model.

[0033] On the other hand, a natural language interaction system for a manufacturing execution system based on a large language model is provided. This system is applied to the natural language interaction method for a manufacturing execution system based on a large language model, and the system includes:

[0034] A request rewriting module, which is used to obtain the natural language request input by the user through the text interface, perform entity standardization processing on the natural language request, and eliminate semantic ambiguity to obtain a standardized request.

[0035] A multi-step dynamic operation planning and execution module, which is used to decompose the standardized request into tasks to obtain an atomic operation chain.

[0036] A response generation module, which is used to dynamically execute each step in the atomic operation chain and generate a user-readable response using a large language model based on the execution result.

[0037] Optionally, the request rewriting module is further used for:

[0038] S11. Construct an entity embedding vector database; wherein, the entity embedding vector database includes standardized entities and the corresponding embedding representations of the standardized entities.

[0039] S12. Extract fuzzy entities in the natural language request through named entity recognition technology, and retrieve the standardized entities matching the fuzzy entities in the entity embedding vector database to obtain the retrieved standardized entities.

[0040] S13. Parse the natural language request to obtain the parsed entities.

[0041] S14. Match the retrieved standardized entities with the parsed entities to obtain the matched entities, and eliminate semantic ambiguity to obtain a standardized request.

[0042] Optionally, the multi-step dynamic operation planning and execution module is further used for:

[0043] S21. Identify the type of the standardized request.

[0044] S22. Obtain the database table structure of the manufacturing execution system corresponding to the request type.

[0045] S23. Extract a small number of examples related to the current request type from the preset example library and embed the examples into the prompt.

[0046] S24. Generate an atomic operation chain through a large language model based on the standardized request, database table structure, and prompt.

[0047] Optionally, the atomic operations in the atomic operation chain include database access, service call, and logical reasoning.

[0048] For database access operations, generate and execute them through the Text2SQL technology.

[0049] For service call operations, call the pre-defined API service tools of the manufacturing execution system to execute.

[0050] For logical reasoning operations, execute them based on the context intermediate results.

[0051] Optionally, the execution process of the atomic operation chain includes:

[0052] Before each operation is executed, the large language model extracts parameters from the previous operation results through a dynamic parameter retrieval mechanism to fill the placeholders of the current operation.

[0053] Perform syntax verification and business rule compliance verification on the generated SQL commands.

[0054] For operations that fail to execute, trigger an error classification mechanism and automatically correct or request the user to supplement information according to the error type.

[0055] Optionally, the response generation module is further used for:

[0056] Dynamically execute each step of the atomic operation chain, obtain the execution results of each step of the operation, and use the large language model to generate a natural language response.

[0057] On the other hand, a natural language interaction device for a manufacturing execution system based on a large language model is provided. The natural language interaction device for a manufacturing execution system based on a large language model includes: a processor; a memory, and computer-readable instructions are stored on the memory. When the computer-readable instructions are executed by the processor, any one of the methods in the above-mentioned natural language interaction method for a manufacturing execution system based on a large language model is implemented.

[0058] On the other hand, a computer-readable storage medium is provided. At least one instruction is stored in the storage medium, and the at least one instruction is loaded and executed by a processor to implement any one of the methods in the above-mentioned natural language interaction method for a manufacturing execution system based on a large language model.

[0059] The beneficial effects brought by the technical solutions provided in the embodiments of the present invention at least include:

[0060] In the present invention, by applying LLM technology to MES operations, an innovative natural language interaction method is proposed. Users can complete complex manufacturing system operation tasks simply by text input, without interacting with the graphical interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0061] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required for the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.

[0062] Figure 1 is a flowchart of a natural language interaction method for a manufacturing execution system based on a large language model provided by an embodiment of the present invention;

[0063] Figure 2 is a schematic diagram of the overall process provided by an embodiment of the present invention;

[0064] Figure 3 is a schematic diagram of a request rewriting process provided by an embodiment of the present invention;

[0065] Figure 4 is Prompt - 1 provided by an embodiment of the present invention;

[0066] Figure 5 is a schematic diagram of a multi - step dynamic operation generation process provided by an embodiment of the present invention;

[0067] Figure 6 is Prompt - 2 provided by an embodiment of the present invention;

[0068] Figure 7 is Prompt - 3 provided by an embodiment of the present invention;

[0069] Figure 8 is a schematic diagram of the workflow of Dify deployment provided by an embodiment of the present invention;

[0070] Figure 9 is a tool set provided by an embodiment of the present invention;

[0071] Figure 10 is a block diagram of a natural language interaction system for a manufacturing execution system based on a large language model provided by an embodiment of the present invention;

[0072] Figure 11 is a comparison diagram between a traditional GUI and the framework of the present invention provided by an embodiment of the present invention;

[0073] Figure 12 It is a schematic structural diagram of a natural language interaction device for a manufacturing execution system based on a large language model provided by an embodiment of the present invention. Specific embodiments

[0074] Next, in conjunction with the accompanying drawings, the technical solutions in the present invention will be described.

[0075] In the embodiments of the present invention, words such as "exemplarily" and "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as an "example" in the present invention should not be construed as being more preferred or more advantageous than other embodiments or design solutions. Rather, the use of the word "example" is intended to present concepts in a specific manner. In addition, in the embodiments of the present invention, the meaning expressed by "and / or" can be both, or either one of the two.

[0076] In the embodiments of the present invention, "image" and "picture" can sometimes be used interchangeably. It should be noted that when the difference is not emphasized, the meanings they express are the same. "(of)", "corresponding", and "corresponding" can sometimes be used interchangeably. It should be noted that when the difference is not emphasized, the meanings they express are the same.

[0077] In the embodiments of the present invention, sometimes subscripts such as W1 may be written in a non-subscript form such as W1. When the difference is not emphasized, the meanings they express are the same.

[0078] To make the technical problems, technical solutions and advantages to be solved by the present invention clearer, the following will be described in detail in conjunction with the accompanying drawings and specific embodiments.

[0079] The embodiments of the present invention provide a natural language interaction method for a manufacturing execution system based on a large language model. This method can be implemented by a natural language interaction device for a manufacturing execution system based on a large language model. This natural language interaction device for a manufacturing execution system based on a large language model can be a terminal or a server. As Figure 1 shown in the flowchart of the natural language interaction method for a manufacturing execution system based on a large language model, the processing flow of this method can include the following steps:

[0080] S1. Obtain the natural language request input by the user through the text interface, perform entity standardization processing on the natural language request through the request rewriting module based on the large language model, and eliminate semantic ambiguity to obtain a standardized request.

[0081] Optionally, the entity standardization process for natural language requests by the request rewriting module based on the large language model in S1, and the elimination of semantic ambiguity to obtain a standardized request may include the following steps S11 - S14:

[0082] S11. Construct an entity embedding vector database to dynamically maintain the standardized entity information and its embedding representation in the manufacturing execution system.

[0083] S12. Extract the fuzzy entities in the natural language request through named entity recognition technology, and retrieve the standardized entities matching the fuzzy entities in the entity embedding vector database to obtain the retrieved standardized entities.

[0084] S13. Parse the natural language request to obtain the parsed entities.

[0085] S14. Match the retrieved standardized entities with the parsed entities to obtain the matched entities, eliminate semantic ambiguity, and generate an unambiguous standardized request.

[0086] In a feasible implementation manner, the main function of the present invention is to flexibly control the MES through natural language. The user puts forward requirements through text input, and the present invention can parse these requests and convert them into an executable operation sequence, and finally return a clear response result. The implementation of this process mainly consists of three main modules: Request Rewriting, Multi-step Dynamic Operations Planning and Execution, and Responses Generation. These modules work together to ensure the accuracy and efficiency of the whole process from user input to task execution and then to result feedback. The process schematic diagram of the present invention is as Figure 2 shown.

[0087] Furthermore, the request rewriting module is used to process the fuzzy or non-standard information in the user input. This module uses a word embedding model to generate the embedding vector of the user request, and performs similarity matching through maintaining an entity embedding vector database. The fuzzy descriptions in the input text are identified and replaced according to the standard names registered in the vector database, and the request is rewritten into a standard format to ensure the accuracy of subsequent operations. In the similarity matching process, the system combines the zero-shot named entity recognition ability of the LLM to extract the entities in the request, and completes the rewriting through the retrieved standard entity information. This process relies on the real-time synchronization mechanism of the vector database. When the entity information in the database is updated, the synchronizer will trigger the insert, update or delete operations of the entity information in the vector database.

[0088] The working process of the request module is asFigure 3 As shown in Figure 3 , it is described as follows: Accept a request from the user through the HTTP interface and immediately start the processing flow. Call OpenAI's text-embedding-3-large model to convert the request text entered by the user into an embedding vector. This embedding vector is a mathematical representation of the request content and can capture its semantic features.

[0089] Then retrieve from the pre-maintained entity embedding vector database. This database stores standardized entity information, including but not limited to field names, table names, etc. in the MES. This entity information is saved in the form of embedding vectors, and the database will synchronize the updates of the MES database in real time to ensure data consistency. The system calculates the similarity between the embedding vector of the user request and all entity embedding vectors in the database to find the most similar standard entity. Utilize the zero-shot named entity recognition ability of the large language model, and the prompt words used are shown in Figure 4 .

[0090] Parse the user request to extract possible entity information. Match the extracted entities with the retrieved standard entities. If the match is successful, replace the fuzzy or non-standardized entities in the user request with the standard format. If the entity information provided by the user cannot match any entity in the database, no replacement operation is performed.

[0091] Finally, pass the request after entity replacement and description rewriting to the multi-step dynamic operation planning and execution module.

[0092] S2. Use the multi-step dynamic operation planning and execution module to decompose the standardized request to obtain an atomic operation chain.

[0093] In a feasible implementation, according to the predefined database schema and service tool set, use the large language model to decompose the user request into a sequence of atomic operation steps to be executed sequentially.

[0094] The tool description of the service call operation includes: tool name, function description, parameter list and parameter constraint conditions, and the tool call needs to follow the atomicity and transactionality requirements of the manufacturing execution system.

[0095] Optionally, the above step S2 may include the following steps S21 - S24:

[0096] S21. Identify the type of the standardized request.

[0097] S22. Obtain the database table structure of the manufacturing execution system corresponding to the request type.

[0098] S23. Extract a small number of examples related to the current request type from the preset example library and embed the examples into the prompt.

[0099] In a feasible implementation, the large language model integrates a production management specification knowledge base, and when generating the operation chain, operation chain generation examples are injected into the prompt words.

[0100] S24. Generate an atomic operation chain through the large language model according to the standardization request, database table structure, and prompt.

[0101] Optionally, the atomic operations in the atomic operation chain include database access, service call, and logical reasoning.

[0102] For database access operations, they are generated and executed through the Text2SQL technology.

[0103] For service call operations, call the pre-defined API service tools of the manufacturing execution system to execute.

[0104] For logical reasoning operations, execute based on the context intermediate results.

[0105] In a feasible implementation, there are steps of Chain-of-Thought for logical reasoning or mathematical calculation based on the context intermediate results.

[0106] Optionally, the execution process of the atomic operation chain includes:

[0107] Before each operation is executed, the large language model extracts parameters from the previous operation results through a dynamic parameter retrieval mechanism to fill the placeholders of the current operation.

[0108] Conduct syntax verification and business rule compliance verification on the generated SQL commands.

[0109] For operations that fail to execute, trigger an error classification mechanism and automatically correct according to the error type or request the user to supplement information.

[0110] In a feasible implementation, the multi-step dynamic operation planning and execution module serves as the core of the system and is responsible for decomposing complex user requests into a series of executable basic operations. These operations include SQL operations, tool calls, and thinking steps.

[0111] This module first uses a large language model based on GPT-4o to generate an operation plan according to the user request and the database table structure of the MES. The operation plan contains parameter placeholders, which are dynamically filled according to the context during execution.

[0112] During the execution process, the system processes each step in sequence: for SQL operations, the LLM is used to generate and execute the corresponding database queries; for tool calls, according to the service descriptions and parameter requirements provided by MES, the LangChain framework is coordinated for invocation; for thinking steps, the LLM is utilized for logical reasoning or mathematical calculations. The results of each operation are recorded in the context session to provide parameter support for subsequent steps.

[0113] The workflow of the multi-step dynamic operation planning and execution module is as Figure 5 shown and described as follows: After receiving the user request processed by the request rewriting module, the system first identifies the type of the user input request and analyzes it in combination with the relevant relational database table structures. The prompt words used are shown in Figure 6 . Where table_details is the table structure in the database and tool_details is the description of the tool set.

[0114] Next, the system extracts a small number of examples related to the current request type and scenario from the pre-prepared example library. By providing a small amount of reference information, it helps the LLM improve the accuracy and reliability of generating operation plans, optimize system performance, and reduce errors.

[0115] These examples are embedded in the prompt as a reference basis for the LLM to generate operation plans. After receiving the prompt containing the examples, the LLM analyzes the user request and decomposes it into a series of executable operation steps. During the decomposition process, the LLM refers to the embedded examples to understand the logical structure of the task and the execution order of the operations.

[0116] Subsequently, the LLM generates the corresponding operation plan, which contains specific steps such as SQL commands or tool calls. Before executing each step of the plan, the LLM summarizes the execution results of the previous steps by simulating the execution of python functions and replaces the parameters to be replaced in this step. The prompt words used are shown in Figure 7 .

[0117] After all steps in the plan are executed in sequence, the execution results of each step are summarized and passed to the response generation module.

[0118] S3. Dynamically execute each step in the atomic operation chain to obtain the execution results of each step, and use the large language model to generate a natural language response.

[0119] In a feasible implementation, the response generation module generates a text response based on the plan execution results and the user's original request, uses the GPT-4o model to generate a summary answer, and organizes the output in a human-friendly format (such as Markdown format), automatically organizing the structured data into tables or lists to ensure the readability of the results.

[0120] The present invention employs a variety of tools and methods to support the implementation of each module in the CWM system. It corely relies on GPT-4o as the basic large language model for request rewriting, operation planning, and response generation, with its temperature parameter set to 0 to reduce randomness during the generation process.

[0121] The vector database is used to store and retrieve entity embeddings, supporting efficient entity recognition and replacement in the request rewriting module. The LangChain framework is used to implement the LLM Agent, coordinating tool calls and operation execution to ensure that the system can flexibly call the services provided by MES. The Dify platform is used to build a graphical chat window, encapsulating the CWM core module into a tool and entering the workflow as shown in Figure 8 to provide a user-friendly interaction interface.

[0122] The present invention replaces the traditional Graphical User Interface (GUI) with natural language instructions to achieve efficient interaction between the user and MES, and is applicable to complex industrial scenarios such as garment manufacturing.

[0123] To clearly demonstrate the specific implementation of the CWM system, the present invention is based on a simulated garment manufacturing MES to describe the operation process of the system. This MES includes an associated database composed of 16 relational tables, covering typical manufacturing elements such as orders, products, materials, cutting tasks, and sewing tasks, and designs 55 manually written requests as a benchmark test set. In the specific implementation, the CWM system first initializes its operating environment, including loading the MES database schema, synchronizing entity information to the vector database, and configuring the large language model (based on GPT-4o, with the temperature set to 0 to reduce generation randomness). Subsequently, the system enters the standby state, ready to receive natural language requests input by the user. Once a request is received, the system processes it in sequence according to the following steps:

[0124] Request reception: The user inputs a natural language request through the text interface, and the system records it as the initial input.

[0125] Request rewriting: The Request Rewriting module preprocesses the input, identifying and standardizing entity information.

[0126] Operation planning and execution: The Multi-step Dynamic Operations Planning and Execution module analyzes the rewritten request, generates, and executes a series of operations.

[0127] Responses Generation module summarizes the execution results, generates the final response and returns it to the user.

[0128] To further clarify the working principle of the CWM system, the following will describe in detail around a specific user request: "List the raw materials and quantities used in the orders in June 2024, and organize them in the form of {raw material: quantity used}."

[0129] In this embodiment, according to the actual work flow information, a question set containing 55 questions is designed, and the LLM is used to assist manual verification to generate the correct answers (ground truth) as the evaluation basis for the subsequent large model answers. The system output is compared with the correct answers (ground truth) of the question set to verify the effectiveness of this method.

[0130] In this embodiment, it is assumed that the user inputs the following request through the text interface of the CWM system in July 2024: "List the raw materials and quantities used in the orders in June 2024, and organize them in the form of {raw material: quantity used}." The following is the complete execution process of the CWM system for processing this request.

[0131] After the user inputs the request in the chat window built based on Dify, the request will first enter the question classifier for intent recognition. If the user inputs content such as "Hello, Hi, Instructions for Use", at this time, a welcome message will be replied to guide the user to make a request. If the request given by the user contains queries, assignments, creations, calculations, statistics, etc. that require calling tools to answer, at this time, the user's question will enter the CWM core processing flow.

[0132] For this example question, after the Dify platform receives the user request, it is classified as a request that needs to interact with the CWM system through intent recognition, and then it is encapsulated into a standard API request and sent to the back-end service of the CWM system through the HTTP protocol. After the back-end service of the CWM system receives the user request sent by Dify, the processing process in the system is as follows:

[0133] Request Rewriting:

[0134] The natural language request input by the user may contain non-standard time expressions or ambiguous terms. The RequestRewriting module first preprocesses the request, and the specific steps are as follows:

[0135] Entity Recognition: The module utilizes the zero-shot named entity recognition ability of the LLM to identify the key entity "June 2024 order" in the request. By comparing with the time field format in the MES database, it is confirmed that "June 2024" corresponds to the date range "2024-06-01 to 2024-06-30" in the database.

[0136] Ambiguity Resolution: The module checks for any other possible ambiguities (such as whether "order" refers to a production order or a sales order) and infers it as a production order based on the context.

[0137] Request Rewriting: Based on the recognition results, the module rewrites the original request into a standardized form: "List the raw materials and quantities used in the orders created between 2024-06-01 and 2024-06-30, and organize them in the form of {raw material: quantity used}." The rewritten request eliminates potential ambiguities and provides clear instructions for subsequent operations.

[0138] Multi-step Dynamic Operations Planning and Execution:

[0139] This module receives the rewritten request, analyzes its complexity, and decomposes it into a series of executable basic operations. The basic operations include SQL queries, tool calls, and thinking steps. The following is the specific process of planning and execution:

[0140] 1) Retrieve the order IDs created in June 2024.

[0141] 2) Retrieve the product IDs and quantities related to these orders.

[0142] 3) Retrieve the in-process (WIP) material IDs and quantities required for each product.

[0143] 4) Retrieve the raw material IDs and quantities required for each WIP material.

[0144] 5) Calculate the total quantity used for each raw material.

[0145] 6) Organize the results in the form of {raw material: quantity used}.

[0146] During the operation planning process, a series of operation commands are pre-generated. For each step, if it is of the SQL type, the corresponding operation commands are generated. If it is of the tool type, the name of the tool to be called and the parameter names and parameter contents to be passed in are specified. In the scenario of this embodiment, there are 5 predefined tools including query order, assign task, query order raw materials, etc. For details, see Figure 9。If it is of the thought type, specify the reasoning goal. For commands that require the query or calculation results of previous steps, enclose them in angle brackets <> and list them as relevant parameters to be filled in.

[0147] Before each operation is executed, the system extracts parameters from the results of previous operations through a dynamic parameter retrieval mechanism to fill in the placeholders of the current operation. In step 2, <order_ids> will be replaced with the list of order IDs queried in step 1. At the same time, the system integrates a knowledge base of production management specifications to ensure that operations comply with business rules and transactional requirements. In the planned order, the modules execute operations one by one and dynamically adjust the parameters of subsequent operations based on the results of the previous step. The execution process is as follows:

[0148] 1) Step 1: Retrieve order IDs:

[0149] Execute the SQL query: SELECT id FROM orders WHERE created_at BETWEEN '2024-06-01' AND '2024-06-30';

[0150] In this embodiment, the return result of the database is the list of order IDs: [10, 11, 12].

[0151] 2) Step 2: Retrieve product information:

[0152] Execute the SQL query using the result of step 1: SELECT product_id, number FROM order_product WHERE order_id IN (10, 11, 12);

[0153] In this embodiment, the return result of the database is: Product ID 30 (quantity 150), Product ID 20 (quantity 100).

[0154] 3) Step 3: Retrieve WIP material information:

[0155] Call the tool tool_get_wip_materials with parameters {'product_id': 30} and {'product_id': 20} to obtain the WIP material requirements for each product. In this embodiment, the return result of this tool is:

[0156] Product ID 30: WIP material ID 2 (quantity 5).

[0157] Product ID 20: WIP material ID 10 (quantity 3).

[0158] 4) Step 4: Retrieve raw material information:

[0159] Call the tool tool_get_original_materials with parameters {'wip_id': 2} and {'wip_id': 10} to obtain the raw material requirements for WIP materials. In this embodiment, the return result of this tool is:

[0160] WIP material ID 2: Raw material ID 1 (quantity 0.4).

[0161] WIP material ID 10: Raw material ID 11 (quantity 0.5).

[0162] 5) Step 5: Calculate the total usage quantity:

[0163] Execute the thinking step to calculate the total raw material usage:

[0164] Raw material ID 1: 150 × 5 × 0.4 = 300.

[0165] Raw material ID 11: 100 × 3 × 0.5 = 150.

[0166] 6) Step 6: Organize the results:

[0167] Execute the thinking step to organize the calculation results into the specified format: {"Raw material ID 1": 300, "Raw material ID11": 150}

[0168] Responses Generation:

[0169] The Responses Generation module receives the output of Step 6 and generates a user-friendly response text. The specific process is as follows:

[0170] 1) Result summary: The module collects all intermediate results and confirms data integrity.

[0171] 2) Text generation: Use the LLM to generate a natural language response and present the structured data in the form of a Markdown table. The final response is as follows: The following are the raw materials and quantities used for the orders in June 2024:

[0172] | Raw material | Usage quantity |

[0173] |------------|----------|

[0174] | Raw material ID 1 | 300 |

[0175] | Raw material ID 11| 150 |

[0176] Represented in dictionary form as: {"Raw material ID 1": 300, "Raw material ID 11": 150}

[0177] 1) Response return: The system sends the above text back to the Dify workflow via the HTTP protocol and finally displays it to the user through the Dify chat interface to complete the request processing. The response seen by the user is as follows:

[0178] The following are the raw materials used and their quantities in all orders in June 2024:

[0179] - Raw material ID 1: 1777.5

[0180] - Raw material ID 11: 1876.5

[0181] - Raw material ID 3: 222

[0182] - Raw material ID 9: 90

[0183] - Raw material ID 13: 120

[0184] - Raw material ID 5: 855

[0185] In the embodiments of the present invention, by applying LLM technology to MES operations, an innovative natural language interaction method is proposed. Users can complete complex manufacturing system operation tasks through simple text input without interacting with the graphical interface.

[0186] Figure 10 It is a block diagram of a natural language interaction system for a manufacturing execution system based on a large language model shown according to an exemplary embodiment. This system is used for the natural language interaction method of a manufacturing execution system based on a large language model. Refer to Figure 10 , this system includes a request rewriting module 310, a multi-step dynamic operation planning and execution module 320, and a response generation module 330. Among them:

[0187] The request rewriting module 310 is used to obtain the natural language request input by the user through the text interface, perform entity standardization processing on the natural language request, and eliminate semantic ambiguity to obtain a standardized request.

[0188] The multi-step dynamic operation planning and execution module 320 is used to decompose the standardized request to obtain an atomic operation chain.

[0189] The response generation module 330 is used to dynamically execute each step in the atomic operation chain and generate a user-readable response using the large language model according to the execution result.

[0190] The present invention discloses a system called CWM (Chat with MES). By integrating large language model technology, this system constructs a MES operation interface based on natural language interaction, aiming to replace the traditional graphical user interface and provide users with a more natural and efficient operation method. The comparison between the present invention and the traditional GUI framework system is as follows Figure 11 as shown.

[0191] The CWM system can understand requests made by users in natural language and automatically execute corresponding database operations or service calls to complete MES-related tasks such as order management, production task allocation, and material inventory query. By innovatively combining natural language processing with MES operations, the present invention not only simplifies the interaction process between users and the system, reduces the complexity of learning and operation, but also significantly reduces the cost of developing and maintaining the GUI interface, providing an intelligent and efficient interaction method for the manufacturing industry, with broad application prospects and practical value.

[0192] In the embodiment of the present invention, by applying LLM technology to MES operations, an innovative natural language interaction method is proposed. Users can complete complex manufacturing system operation tasks through simple text input without interacting with the graphical interface.

[0193] Figure 12 is a schematic structural diagram of a natural language interaction device for a manufacturing execution system based on a large language model provided by an embodiment of the present invention, as Figure 12 shown. The natural language interaction device for a manufacturing execution system based on a large language model may include the above-mentioned Figure 10 natural language interaction system for a manufacturing execution system based on a large language model as shown. Optionally, the natural language interaction device 410 for a manufacturing execution system based on a large language model may include a first processor 2001.

[0194] Optionally, the natural language interaction device 410 for a manufacturing execution system based on a large language model may further include a memory 2002 and a transceiver 2003.

[0195] Among them, the first processor 2001 is connected to the memory 2002 and the transceiver 2003, such as through a communication bus.

[0196] Next, in combination with Figure 12 each component of the natural language interaction device 410 for a manufacturing execution system based on a large language model will be specifically introduced:

[0197] Among them, the first processor 2001 is the control center of the natural language interaction device 410 of the manufacturing execution system based on the large language model, which can be a single processor or a collective term for multiple processing elements. For example, the first processor 2001 is one or more central processing units (CPUs), or can be an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present invention, such as: one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs).

[0198] Optionally, the first processor 2001 can execute various functions of the natural language interaction device 410 of the manufacturing execution system based on the large language model by running or executing software programs stored in the memory 2002 and calling data stored in the memory 2002.

[0199] In a specific implementation, as an embodiment, the first processor 2001 can include one or more CPUs, such as Figure 12 the CPU0 and CPU1 shown in

[0200] In a specific implementation, as an embodiment, the natural language interaction device 410 of the manufacturing execution system based on the large language model can also include multiple processors, such as Figure 12 the first processor 2001 and the second processor 2004 shown in

[0201] Each of these processors can be a single-core processor (single-CPU) or a multi-core processor (multi-CPU). Here, the processor can refer to one or more devices, circuits, and / or processing cores for processing data (such as computer program instructions).

[0202] Optionally, the memory 2002 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or may also be an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media, or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory 2002 may be integrated with the first processor 2001 or may exist independently and be coupled to the first processor 2001 through an interface circuit ( Figure 12 not shown) of the natural language interaction device 410 of the manufacturing execution system based on the large language model. The embodiments of the present invention do not make specific limitations in this regard.

[0203] The transceiver 2003 is used to communicate with a network device or with a terminal device.

[0204] Optionally, the transceiver 2003 may include a receiver and a transmitter ( Figure 12 not shown separately). Among them, the receiver is used to implement the receiving function, and the transmitter is used to implement the transmitting function.

[0205] Optionally, the transceiver 2003 may be integrated with the first processor 2001 or may exist independently and be coupled to the first processor 2001 through an interface circuit ( Figure 12 not shown) of the natural language interaction device 410 of the manufacturing execution system based on the large language model. The embodiments of the present invention do not make specific limitations in this regard.

[0206] It should be noted that Figure 12 the structure of the natural language interaction device 410 of the manufacturing execution system based on the large language model shown in the figure does not constitute a limitation on the router. The actual knowledge structure recognition device may include more or fewer components than shown in the figure, or combine some components, or have different component arrangements.

[0207] In addition, the technical effects of the natural language interaction device 410 of the manufacturing execution system based on the large language model may refer to the technical effects of the natural language interaction method of the manufacturing execution system based on the large language model described in the above method embodiments, and will not be elaborated here.

[0208] It should be understood that the first processor 2001 in the embodiments of the present invention may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSPs), application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0209] It should also be understood that the memory in the embodiments of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM), which is used as an external cache. By way of example but not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDR SDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchlink dynamic random access memory (SLDRAM) and direct rambus random access memory (DR RAM).

[0210] The above embodiments can be implemented in whole or in part by software, hardware (such as circuits), firmware, or any other combination. When implemented using software, the above embodiments can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, the processes or functions described in the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (such as infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server or data center that contains one or more collections of available media. The available media can be magnetic media (such as floppy disks, hard disks, magnetic tapes), optical media (such as DVDs), or semiconductor media. The semiconductor media can be a solid-state drive.

[0211] It should be understood that the term "and / or" in this document is merely a description of the association relationship between associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist simultaneously, and B exists alone. Here, A and B can be singular or plural. Additionally, the character " / " in this document generally represents an "or" relationship between the associated objects before and after, but it may also represent an "and / or" relationship, which can be specifically understood by referring to the context before and after.

[0212] In the present invention, "at least one" means one or more, and "a plurality" means two or more. "At least one of the following" or its similar expressions refer to any combination of these items, including any combination of single items or plural items. For example, at least one of a, b, or c can represent: a, b, c, a - b, a - c, b - c, or a - b - c, where a, b, and c can be single or multiple.

[0213] It should be understood that in various embodiments of the present invention, the magnitudes of the sequence numbers of the above processes do not imply the order of execution. The order of execution of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

[0214] Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are executed in a hardware or software manner depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered to exceed the scope of the present invention.

[0215] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working processes of the above-described devices, apparatuses, and units can refer to the corresponding processes in the foregoing method embodiments, and will not be elaborated herein.

[0216] In several embodiments provided by the present invention, it should be understood that the disclosed devices, apparatuses, and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined or integrated into another device, or some features can be ignored or not executed. Another point is that the displayed or discussed couplings or direct couplings or communication connections to each other can be through some interfaces. The indirect couplings or communication connections of the devices or units can be in electrical, mechanical, or other forms.

[0217] The units described as separate components may or may not be physically separated. The components shown as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0218] In addition, the functional units in each embodiment of the present invention can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit.

[0219] When the above-mentioned functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical discs.

[0220] As described above, the above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art within the technical scope disclosed by the present invention can easily think of changes or substitutions, which should all be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A natural language interaction method for a manufacturing execution system based on a large language model, characterized in that, The method includes: S1. Obtain the natural language request input by the user through the text interface, perform entity standardization processing on the natural language request through a request rewriting module based on a large language model, and eliminate semantic ambiguity to obtain a standardized request; S2. Use a multi-step dynamic operation planning and execution module to decompose the standardized request to obtain an atomic operation chain; S3. Dynamically execute each operation in the atomic operation chain, and use the large language model to generate a user-readable response according to the execution result.

2. The natural language interaction method of the manufacturing execution system based on the large language model according to claim 1, characterized in that The entity standardization processing of the natural language request through the request rewriting module based on the large language model in S1 and the elimination of semantic ambiguity to obtain a standardized request include: S11. Construct an entity embedding vector database; wherein, the entity embedding vector database includes standardized entities and the corresponding embedding representations of the standardized entities; S12. Extract fuzzy entities in the natural language request through named entity recognition technology, and retrieve the standardized entities matching the fuzzy entities in the entity embedding vector database to obtain the retrieved standardized entities; S13. Parse the natural language request to obtain the parsed entities; S14. Match the retrieved standardized entities with the parsed entities to obtain the matched entities, and eliminate semantic ambiguity to obtain a standardized request.

3. The natural language interaction method of the manufacturing execution system based on the large language model according to claim 1, wherein, The decomposition of the standardized request through the multi-step dynamic operation planning and execution module in S2 to obtain an atomic operation chain includes: S21. Identify the type of the standardized request; S22. Obtain the database table structure of the manufacturing execution system corresponding to the request type; S23. Extract a small number of examples related to the current request type from a preset example library and embed the examples into the prompt; S24. Generate an atomic operation chain through the large language model according to the standardized request, the database table structure, and the prompt.

4. The natural language interaction method of the manufacturing execution system based on the large language model according to claim 1, characterized in that, The atomic operations in the atomic operation chain include database access, service call, and logical reasoning; For database access operations, generate and execute through Text2SQL technology; For service call operations, call the pre-defined API service tools of the manufacturing execution system to execute; For logical reasoning operations, execute based on the context intermediate results.

5. The natural language interaction method of the manufacturing execution system based on the large language model according to claim 1, characterized in that, The execution process of the atomic operation chain includes: Before each operation is executed, the large language model extracts parameters from the previous operation results through a dynamic parameter retrieval mechanism to fill the placeholders of the current operation; Perform syntax verification and business rule compliance verification on the generated SQL commands; For operations that fail to execute, trigger an error classification mechanism and automatically correct according to the error type or request the user to supplement information.

6. The natural language interaction method of the manufacturing execution system based on the large language model according to claim 1, characterized in that, The dynamic execution of each operation in the atomic operation chain in S3 and the generation of a user-readable response using the large language model according to the execution result include: Dynamically execute each operation in the atomic operation chain to obtain the execution result of each operation, and use the large language model to generate a natural language response.

7. A natural language interaction system for a manufacturing execution system based on a large language model, the natural language interaction system for the manufacturing execution system based on a large language model is used to implement the natural language interaction method for the manufacturing execution system based on a large language model according to any one of claims 1-6, characterized in that, The system includes: A request rewriting module for obtaining the natural language request input by the user through the text interface, performing entity standardization processing on the natural language request, and eliminating semantic ambiguity to obtain a standardized request; A multi-step dynamic operation planning and execution module for decomposing a standardized request into an atomic operation chain; A response generation module for dynamically executing each operation in the atomic operation chain and generating a user-readable response using a large language model based on the execution results.

8. The natural language interaction system of the manufacturing execution system based on the large language model according to claim 7, wherein, The method of using the multi-step dynamic operation planning and execution module to decompose a standardized request into an atomic operation chain includes: S21. Identify the type of the standardized request; S22. Obtain the database table structure of the manufacturing execution system corresponding to the request type; S23. Extract a small number of examples related to the current request type from a preset example library and embed the examples into the prompt; S24. Generate an atomic operation chain through a large language model based on the standardized request, the database table structure, and the prompt.

9. A natural language interaction device for a manufacturing execution system based on a large language model, characterized in that, The natural language interaction device of the manufacturing execution system based on a large language model includes: A processor; A memory, on which computer-readable instructions are stored, and when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 6 is implemented.

10. A computer-readable storage medium, characterized in that, Program code is stored in the computer-readable storage medium, and the program code can be called by the processor to execute the method described in any one of claims 1 to 6.

Citation Information

Cited By

  • Code generation method and device based on large model, medium and equipment

    CN120540644A

  • Digital twinborn irrigation area intelligent interaction method, device and system based on large language model

    CN120746758A

  • A digital twin irrigation district intelligent interaction method, device and system based on a large language model

    CN120746758B