Equipment operation and maintenance agent implementation method based on small-parameter large language model

By constructing a knowledge base for equipment fault diagnosis and a small parameter large language model, the data security and privacy protection problems of large language models in the existing technology are solved, and efficient and accurate fault diagnosis and data privacy protection are achieved.

CN119903877APending Publication Date: 2025-04-29NOT NECESSARILY DATA TECH (BEIJING) CO LTD
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202411985504.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-29

AI Technical Summary

Technical Problem

The existing large language model has data security and privacy protection problems in device fault diagnosis, and the open source large language model for private deployment has limited capabilities, resulting in insufficient performance in performing Agent tasks.

Method used

The equipment operation and maintenance agent implementation method based on the small parameter and large language model is adopted. By constructing the dynamic equipment fault diagnosis knowledge base, setting up a data feature acquisition model, building an Agent Prompt template library, and Agent fine-tuning the small parameter and large language model, forming a fine-tuning small parameter and large language model for local deployment.

Benefits of technology

It realizes efficient equipment fault diagnosis while ensuring data privacy and security, improves the efficiency and accuracy of fault diagnosis, and meets the strict requirements for data privacy in the industrial field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119903877A_ABST
    Figure CN119903877A_ABST
Patent Text Reader

Abstract

The invention discloses an equipment operation and maintenance agent implementation method based on a small-parameter large language model, and the method comprises the steps: constructing an equipment fault diagnosis knowledge base, and providing a large-parameter-magnitude large language model capable of completing an Agent complex task; abnormal information of the historical data is collected and processed; analyzing abnormal information in the historical data, identifying and extracting trend characteristics of the measuring points; the method comprises the following steps: constructing an Agent Prompt template library, and generating a plurality of Agent Prompts; constructing an Agent fine tuning training data set based on a plurality of Agent Prompts; and performing Agent fine tuning on the small-parameter large-language model to form a fine-tuned small-parameter large-language model. A small-parameter large language model is deployed in a localized manner, so that the privacy and security of data are ensured; by migrating the Agent capability to the small-parameter large language model, a fault diagnosis task can be quickly processed in a localized environment, and the diagnosis efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a method for realizing an equipment operation and maintenance intelligent agent, and in particular to a method for realizing an equipment operation and maintenance intelligent agent based on a small-parameter large-language model. Background Art

[0002] Fault diagnosis of dynamic equipment is an important part of ensuring stable operation of equipment and extending its service life. By timely identifying and solving potential problems, downtime and maintenance costs can be effectively reduced. In recent years, artificial intelligence technology, especially large language models, has made certain application progress in the field of dynamic equipment fault diagnosis. However, there are still some challenges when it is specifically applied to dynamic equipment fault diagnosis.

[0003] At present, large language models have shown certain potential in equipment fault diagnosis. However, in many practical scenarios, due to the needs of data security and privacy protection, large model APIs cannot be used for online services. At the same time, the existing privately deployed open source large language models in the industrial field have limited capabilities, resulting in insufficient performance in executing agent tasks and low ability to handle fault diagnosis tasks. Summary of the invention

[0004] In order to solve the shortcomings of the above-mentioned technology, the present invention provides a method for realizing equipment operation and maintenance intelligent agent based on small parameters and large language model.

[0005] In order to solve the above technical problems, the technical solution adopted by the present invention is: a method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model, which specifically includes the following steps:

[0006] Step S1: construct a knowledge base for dynamic equipment fault diagnosis to store structured data and unstructured data; provide a large language model with a large parameter magnitude that can complete complex tasks of the Agent;

[0007] Step S2: Setting a data feature acquisition model to collect and process abnormal information of historical data from the dynamic equipment diagnosis story library; analyzing abnormal information in historical data to identify and extract trend features of measuring points, writing prompt words, and parsing trend features into json format;

[0008] Step S3: construct an Agent Prompt template library, select excellent templates as Agent Prompt templates, and there are several Agent Prompt templates; inject component content into each Agent Prompt template to generate several Agent Prompts;

[0009] Step S4: constructing an agent fine-tuning training data set for agent fine-tuning training based on a number of agent prompts;

[0010] Step S5: performing Agent fine-tuning on the small-parameter large language model Qwen-14B to form a fine-tuned small-parameter large language model;

[0011] Step S6: Locally deploy the fine-tuned small parameter large language model, evaluate the Agent effect, and select qualified Agents;

[0012] Step S7: Migrate the qualified Agent to the fine-tuned small parameter large language model and apply it in real time.

[0013] Furthermore, in step S1, a large language model with a large parameter scale capable of completing complex tasks of the Agent is provided, and an API key capable of providing the large language model GPT-4o service is obtained by registering on the large language model service website; the API interface is used to communicate with the large language model, so that the large language model can complete complex tasks of the Agent.

[0014] Furthermore, step S1 of constructing a knowledge base for fault diagnosis of a mobile device specifically includes the following steps:

[0015] Step S12-1: using a relational database to store and manage all structured data related to the mobile device; specifically including the following steps:

[0016] Step S12-11: Designing a database table structure in a relational database to ensure efficient storage and retrieval of data;

[0017] Step S12-12: Collect data from multiple data sources and automatically import them into a relational database in real time;

[0018] Step S12-13: Clean the data to remove errors and redundant information;

[0019] Step S12-14: Standardize the cleaned data to ensure consistency in data format and facilitate cross-system integration and analysis;

[0020] Step S12-2: Based on RAG technology, namely Retrieval Augmented Generation technology, unstructured knowledge is processed and utilized to enhance the capability and efficiency of fault diagnosis; specifically, the following steps are included: Step S12-21: Integrate multiple unstructured information sources to form an unstructured knowledge base;

[0021] Step S12-22: converting the unstructured text data in the unstructured database into a high-dimensional vector representation based on the pre-trained large language model GPT, that is, converting the unstructured documents and queries into high-dimensional vectors to facilitate similarity calculation;

[0022] Step S12-23: Use a vector database to store and manage the embedded vectors of unstructured documents, that is, the embedded vectors corresponding to the high-dimensional vectors in each unstructured document, so as to achieve fast retrieval and query of documents with the most similar vectors;

[0023] Step S12-24: Setting up and configuring the RAG framework, combining the vector database and the pre-trained large language model, to efficiently retrieve relevant information from unstructured documents and generate diagnostic suggestions;

[0024] Step S12-3: All structured knowledge and unstructured knowledge are stored in the same knowledge base, which is a dynamic equipment fault diagnosis knowledge base.

[0025] Furthermore, collecting and processing the abnormal information of historical data in step S2 specifically includes the following steps:

[0026] Step S21: Setting a data feature acquisition model to acquire historical data when the equipment is operating normally and historical data when the equipment is experiencing abnormal failures; identifying and extracting trend features of all measuring points from the historical data to obtain trend feature data;

[0027] The data feature collection model collects data features, specifically including the following steps:

[0028] Step S21-1: pre-processing historical data;

[0029] Step S21-2: setting a data feature collection algorithm in the historical data feature collection model to identify trend features of the measurement points;

[0030] Step S21-3: For the historical data identified as having trend characteristics, i.e., the trend characteristic data, joint grouping is performed according to the device and time information;

[0031] Step S21 - 4 : Save the grouped trend feature data into the feature information grouping database.

[0032] Step S22: parsing the trend feature data into json format as the input information of the Meta-Agent template library; specifically including the following steps:

[0033] Step S22-1: extracting information of each group of trend feature data from the feature information grouping database; the trend feature data information includes a group of measurement point trend features triggered by the same device at the same time point;

[0034] Step S22-2: Write a prompt word Prompt for analyzing trend features;

[0035] Step S22-3: embed the extracted trend feature data into the prompt word, and parse the trend feature into a fixed JSON format through a large language model;

[0036] Step S22-4: Add a note to the generated json file.

[0037] Furthermore, in step S3, several Agent Prompts are generated, which specifically includes the following steps:

[0038] Step S31: designing and writing a prompt word for calling the Meta-Agent template, namely, Meta-Agent Prompt according to actual needs;

[0039] Step S32: Meta-Agent Prompt generates different New Meta-Agent Prompt based on different seed queries; different New Meta-Agent Prompt generates multiple candidate Agent Prompts based on GPT-4o to form an Agent Prompt template library;

[0040] Step S33: selecting excellent templates from the Agent Prompt template library based on GPT-4o as Agent Prompt templates;

[0041] Step S34: inject the component content into the Agent Prompt template to generate several Agent Prompts.

[0042] Furthermore, in step S32, an Agent Prompt template library is constructed, which specifically includes the following steps:

[0043] Step S32-1: Collecting queries from actual equipment fault diagnosis services;

[0044] Step S32-2: Group similar queries into multiple sets; wherein, use GPT-4o to expand the queries;

[0045] Step S32-3: insert different query sets into Meta-Agent Prompt to form different NewMeta-Agent Prompt;

[0046] Step 32-4: Different New Meta-Agent Prompts generate multiple candidate Agent Prompt templates through GPT-4 technology; multiple candidate Agent Prompt templates constitute an Agent Prompt template library.

[0047] Furthermore, in step S33, selecting an excellent template as an Agent Prompt template specifically includes the following steps:

[0048] Step S33-1: Create a Prompt comparison group, that is, insert a group of identical queries into a verified benchmark Prompt template and a candidate Prompt template generated by Meta-Agent, respectively, to form a Prompt comparison group;

[0049] Step S33-2: Input the two prompts in the prompt comparison group into GPT-4o respectively to generate corresponding responses;

[0050] Step S33-3: Use GPT-4o to score the two responses in step S33-2 to obtain a baseline Prompt template instance score1 and a candidate Prompt template instance score2;

[0051] Step S33-4: Set a first threshold ∈1, and determine the relationship between score1, score2, and ∈1; if score2-score1>∈1, retain the candidate Prompt template instance; otherwise, delete the candidate Prompt template instance;

[0052] Step S33-5: Set a second threshold ∈2, and calculate the average score of all instances of the same candidate Prompt template to obtain the overall score average of the template; if average>∈2, retain the candidate Prompt template; otherwise, delete the candidate Prompt template and its candidate Prompt template instances.

[0053] Furthermore, in step S4, an Agent fine-tuning training data set is constructed, which specifically includes the following steps:

[0054] Step S41: each Agent Prompt in step S3 is used as the input part of the Agent fine-tuning training data set;

[0055] Step S42: Create a corresponding standard answer for each Agent Prompt in step S3, and each standard answer serves as an output part of the Agent fine-tuning training data set.

[0056] Furthermore, step S5 performs Agent fine-tuning on the small parameter large language model Qwen-14B, specifically including the following steps:

[0057] Step S51: several input parts and their corresponding output parts in the training data set in step S4 are combined to form several Agent fine-tuning instructions according to the Agent standard process, and until the next group of inputs includes the output of this group, an Agent fine-tuning instruction set is formed;

[0058] Step S52: fine-tune the small parameter large language model through the Agent fine-tuning instruction set.

[0059] Furthermore, in step S7, the small parameter large language model is applied in real time using a qualified agent, specifically including the following steps:

[0060] Step S72-1: collecting real-time data features through a data feature collection model;

[0061] Step S72-2: transmitting the real-time data features to the Agent based on the small parameter large language model Qwen-14B as input;

[0062] Step S72-3: Qwen-14B drives Agent to analyze the real-time data characteristics and identify potential abnormal measurement points to quickly discover abnormal situations;

[0063] Step S73-3: searching for a fault type that matches the abnormality in the dynamic equipment fault diagnosis knowledge base, and using experience knowledge to determine the cause and mode of the fault;

[0064] Step S73-4: According to the fault model, matching corresponding treatment measures in the dynamic equipment fault diagnosis knowledge base, the treatment measures include maintenance steps, adjustment suggestions and emergency treatment plans;

[0065] Step S73-5: Feedback and execute the fault mode and disposal measures; that is, feedback the fault mode and disposal measures to the operator or feedback the fault mode and disposal measures to the automation system and operate it to ensure that the fault is handled in a timely and effective manner.

[0066] The present invention discloses a method for realizing equipment operation and maintenance intelligent agent based on small parameter large language model. The small parameter large language model Qwen-14B is locally deployed to ensure the privacy and security of data. There is no need to worry about data leakage, and fault diagnosis can be performed in a safe environment, which meets the strict requirements of the industrial field on data privacy. By migrating the Agent capability to the small parameter large language model Qwen-14B, fault diagnosis tasks can be quickly processed in a localized environment. Users use the optimized small parameter large language model to quickly identify problems and generate solutions, which saves analysis and diagnosis time and improves diagnosis efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1It is a flow chart of the present invention.

[0068] Figure 2 This is a flow chart of obtaining Agent capabilities in Embodiment 1 of the present invention.

[0069] Figure 3 This is a flow chart of Agent fine-tuning in Embodiment 1 of the present invention.

[0070] Figure 4 This is a real-time application flow chart in Embodiment 1 of the present invention. DETAILED DESCRIPTION

[0071] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0072] Embodiment 1:

[0073] like Figures 1 to 3 The method for realizing a device operation and maintenance intelligent agent based on a small parameter and large language model specifically includes the following steps:

[0074] Step S1: construct a knowledge base for dynamic equipment fault diagnosis to store structured data and unstructured data; provide a large language model with a large parameter magnitude that can complete complex tasks of the Agent;

[0075] Agent capabilities include fault query, fault handling measures matching, fault analysis report generation and email preparation;

[0076] Fault query is to retrieve the fault information corresponding to the abnormal features from the fault feature mapping table;

[0077] Fault handling measure matching is to retrieve the fault handling information corresponding to the abnormal features from RAG;

[0078] Generating a fault analysis report is to execute the comprehensive collection of information to generate a fault analysis report;

[0079] Preparing emails is to retrieve recipient information from the contact information table, connect to the mail server, and implement the email sending logic. The email sending logic includes setting the recipient, subject, and text.

[0080] In step S1, a large language model with a large parameter scale that can complete the Agent's complex tasks is provided. By registering on the large language model service website, an API key that can provide the large language model GPT-4o service is obtained; the API interface is used to communicate with the large language model so that the large language model can complete the Agent's complex tasks.

[0081] Large language model services include GPT-4; developers obtain a unique API key as the core credential for accessing and calling model services;

[0082] GPT-4 is a large-scale multimodal model that can accept image and text input and produce text output;

[0083] Agent intelligence is a computer program or system that can perceive the environment, make decisions and take actions to build a knowledge base for equipment fault diagnosis, which specifically includes the following steps:

[0084] Step S12-1: Use a relational database to store and manage all structured data related to the moving equipment. The relational database includes MySQL and PostgreSQL. The structured data includes historical operation data, measurement point information data, equipment attribute data, operation and maintenance record data, fault diagnosis basis and abnormal events. It provides a detailed record of equipment performance and historical behavior.

[0085] Step S12-11: Design a database table structure in a relational database to ensure efficient storage and retrieval of data; the database structure should support multi-dimensional query and analysis, and facilitate rapid acquisition of required data information;

[0086] Step S12-12: Collect data from multiple data sources and automatically import them into a relational database in real time; ensure the integrity and accuracy of the data to support subsequent analysis;

[0087] Step S12-13: Clean the data to remove errors and redundant information;

[0088] Step S12-14: Standardize the cleaned data to ensure consistency in data format and facilitate cross-system integration and analysis.

[0089] Step S12-2: Based on the RAG technology, i.e., Retrieval Augmented Generation technology, unstructured knowledge is processed and utilized to enhance the capability and efficiency of fault diagnosis; the RAG technology can extract useful information from unstructured data and generate diagnostic suggestions through a large language model;

[0090] Step S12-21: Integrate multiple unstructured information sources to form an unstructured knowledge base; the unstructured information sources include equipment operation and maintenance reports, operation and maintenance manuals, equipment failure reports, factory test reports, equipment operation and maintenance knowledge, principle knowledge and equipment public information obtained through web crawlers; it can provide rich background and detail support for fault diagnosis;

[0091] Step S12-22: converting the unstructured text data in the unstructured database into a high-dimensional vector representation based on the pre-trained large language model GPT, that is, converting the unstructured documents and queries into high-dimensional vectors to facilitate similarity calculation;

[0092] Step S12-23: Use a vector database to store and manage the embedded vectors of the unstructured documents, that is, the embedded vectors corresponding to the high-dimensional vectors in each unstructured document; the vector database includes Pinecone, Faiss or Weaviate, which can support efficient similarity search to achieve fast retrieval and query of documents with the most similar vectors;

[0093] Step S12-24: Set up and configure the RAG framework, combine the vector database and pre-trained large language model to efficiently retrieve relevant information from unstructured documents and generate diagnostic suggestions; set up RAG through external data of equipment operation and maintenance information and public related equipment knowledge

[0094] Step S12-3: All structured knowledge and unstructured knowledge are stored in the same knowledge base, which is a dynamic equipment fault diagnosis knowledge base.

[0095] Among them, the efficient index structure in the optimized vector database realizes the optimized information retrieval mechanism to quickly find the unstructured information related to specific fault diagnosis.

[0096] An integrated generation mechanism is provided to generate targeted diagnostic suggestions and reports based on the retrieved unstructured information.

[0097] At the same time, the unstructured knowledge base and vector database are updated regularly to ensure the timeliness and accuracy of their content and support dynamic fault diagnosis needs.

[0098] The mobile equipment fault diagnosis knowledge base can effectively integrate structured data and unstructured data, providing comprehensive and intelligent support for equipment management and fault diagnosis. It not only improves the accuracy and efficiency of diagnosis, but also lays the foundation for predictive maintenance of equipment.

[0099] Step S2: Setting the data feature acquisition model to collect and process the abnormal information of historical data from the dynamic equipment diagnosis story library, analyzing the abnormal information in the historical data to identify and extract the trend characteristics of the measuring points, writing the prompt word Prompt, and parsing the trend characteristics into json format;

[0100] Collecting abnormal information of historical data includes the following steps:

[0101] Step S21: Setting a data feature acquisition model to acquire historical data when the equipment is operating normally and historical data when the equipment is experiencing abnormal failures; identifying and extracting trend features of all measuring points from the historical data to obtain trend feature data;

[0102] The data feature collection model collects data features, specifically including the following steps:

[0103] Step S21-1: pre-process the historical data to ensure the integrity and consistency of the data;

[0104] Step S21-2: Setting a data feature collection algorithm in the historical data feature collection model to identify the trend features of the measuring points; the trend features include the rise of the measuring points, the fall of the measuring points, the stability of the measuring points and the fluctuation of the measuring points. The rising and falling trends of the measuring points are detected by moving average, linear regression or other statistical methods, and the stability and fluctuation of the measuring points are identified by calculating the standard deviation or other fluctuation indicators;

[0105] Step S21-3: For the historical data identified as having trend characteristics, i.e., trend characteristic data, joint grouping is performed according to the device and time information. The historical data with related measurement point characteristics can be aggregated together to form an overall view, and this grouping helps to identify the behavior pattern of a specific device in a specific time period.

[0106] Step S21 - 4 : Save the grouped trend feature data into the feature information grouping database.

[0107] The historical data feature acquisition model can identify and extract trend features of all measuring points from historical equipment operation data. By identifying trend features, it can conduct a more in-depth analysis of the measuring point behavior and provide a basis for subsequent diagnosis of whether the equipment is abnormal.

[0108] Step S22: Parse the trend feature data into json format as the input information for the Meta-Agent template library; in this embodiment, it includes input (Agent Prompt Step_1), input (Agent Prompt Step_n) and input (Agent Prompt Step_n-1);

[0109] Step S22-1: extracting information of each group of trend feature data from the feature information grouping database; the trend feature data information includes a group of measurement point trend features triggered by the same device at the same time point;

[0110] Step S22-2: Write a prompt word Prompt for analyzing trend features;

[0111] Step S22-3: embed the extracted trend feature data into the prompt word, and parse the trend feature into a fixed JSON format through a large language model;

[0112] The fixed json format after parsing is:

[0113]

[0114]

[0115] Step S22-4: Add a remark information to the generated json file; in this embodiment, the remark information is "Goal: Analyze the data characteristics of the device for signs of failure, diagnose its failure mode if there is, and provide corresponding disposal measures."

[0116] Step S3: construct an Agent Prompt template library, select excellent templates as Agent Prompt templates, and there are several Agent Prompt templates; inject component content into each Agent Prompt template to generate several Agent Prompts;

[0117] Generate several Agent Prompts, including the following steps:

[0118] Step S31: designing and writing a prompt word for calling the Meta-Agent template, namely, Meta-Agent Prompt according to actual needs;

[0119] The Meta-Agent Prompt written is:

[0120] "meta_agent_prompt="""

[0121] As an expert in designing meta prompts for Large Language Models (LLMs), you specialize in creating diverse prompts that are not just designed to elicit simple responses.

[0122] A. Your goal is to develop a prompt that assigns a specific personality to the LLM and encourages it to engage in complex tasks such as task planning, executing API calls, self-reflection, and iterative actions that are influenced by the results of these API interactions and continue until the task is fully completed. You should use "you" rather than "I" as the primary tone.

[0123] Your prompt must explicitly retain < <query>> and < <apis>> slots. Each slot should occupy a single line. If the API result is integrated into the prompt, the process is divided into two stages: the API call stage (called 'prompt-API') and the final summary stage (called 'prompt-response'). If the API result is integrated into the response, the process includes both the API interaction and the summary response (called 'prompt-react'). The prompt you develop must belong to one of these three categories: prompt-API, prompt-response, or prompt-react.

[0124] Your prompt might contain the following components:

[0125] <profile>Among the common queries you may be asked to: {{QUERIES}} Summarize the common characteristics of these queries and design a detailed persona or identity suitable for solving such a problem. <instruction>You must develop meaningful instructions to constrain or aid decision making. For example, "no user assistance required", "complete tasks intelligently and efficiently, and draw conclusions from own knowledge or historical memory", "have the ability to search the Internet and aggregate information", etc. Use your imagination to expand these guidelines.

[0126] <query>Add slots directly in your prompt< <query>>. The slot will be replaced by the actual user query. Do not provide a specific query.

[0127] <apis>Add slots directly in your prompt< <apis>>. The slots will be replaced by concrete APIs. These APIs contain the API name, API description, and parameters that can be used in real scenarios, one of which may be related to QUERY. Do not provide concrete APIs.

[0128] <format>You must include explicit directives in your prompts to restrict the output format and ensure that the output can be parsed. You must provide output formats for prompt-API and prompt-react, using placeholders instead of specific API names or parameters mentioned in the section.

[0129] For prompt-API, you must restrict the output to a fixed format and ensure that the output can be parsed. For example, you can output a fixed expression that selects a specific API, and then output another fixed expression that provides parameters, or output in JSON format. Please be creative and don't limit yourself to the above examples. You can also include other parameters to collect more information, such as understanding why this API call is necessary.

[0130] For prompt-react, multiple rounds of thinking, API calls, and API results should be performed to finally output the final answer.

[0131] Notice:

[0132] You are free to construct prompts, API descriptions, parameters, and queries in English or Chinese. The examples above are for reference only. Use your imagination and creativity to go beyond the given examples. You can replace any placeholders in the prompt, such as renaming "API" to "Command",

[0133] Rename "API call" to "Action", or rename "QUERY" to

[0134] "QUESTION". Avoid explicitly breaking prompts into parts, and use

[0135] <profile> 、 <apis>and other components, they should be implicitly integrated into the prompt. For the prompt API, LLM only needs to select an API from the available APIs to perform the next action based on the response prompt. You must mention this in the prompt

[0136] For fast responses, combine API results to output useful content for users.

[0137] Please generate a prompt of type {{PROMPT_TYPE}} directly using {{LANGUAGE}}. Do not include any explanation. """"

[0138] Step S32: Meta-Agent Prompt generates different New Meta-Agent Prompt based on different seed queries; different New Meta-Agent Prompt generates multiple candidate Agent Prompts based on GPT-4 to form an Agent Prompt template library;

[0139] The Agent Prompt template in the Agent Prompt template library is:

[0140] """"

[0141] You are an equipment diagnostics expert, focusing on analyzing equipment data features to identify fault signs and provide diagnosis and disposal suggestions. You will obtain necessary data and information by calling specific APIs in order to make accurate analysis and judgments. Your task is to complete the task intelligently and efficiently, and draw conclusions from your own knowledge or historical memory. No user assistance is required.

[0142] constraint:

[0143] Constraints: <instruction>>

[0144] User query:

[0145] GOAL:< <query>>

[0146] Based on the query, select the most appropriate API to call. The following APIs are available:

[0147] Commands: <apis>>

[0148] Completed tasks:

[0149] Completed tasks:<<COMPLETED_TASKS> >

[0150] Historical session records:

[0151] Conversation history:<CONVERSATION_HISTORY> >

[0152] knowledge base:

[0153] Knowledge: <knowledge>>

[0154] And provide the information required by the user based on the returned results. Please use the following format for output:

[0155] Select the API name:<API_NAME>

[0156] Parameters used: <parameter name 1>:<parameter value 1>,<parameter name 2>:<parameter value 2>,...Reason for calling this API: <Reason for calling this API>

[0157] Please ensure that the output is clearly formatted and can be parsed.

[0158] """"

[0159] Building the Agent Prompt template library includes the following steps:

[0160] Step S32-1: Collecting queries from actual equipment fault diagnosis services;

[0161] Step S32-2: Group similar queries into multiple sets; wherein, use GPT-4o to expand the queries;

[0162] Step S32-3: insert different query sets into Meta-Agent Prompt to form different NewMeta-Agent Prompt;

[0163] Step 32-4: Different New Meta-Agent Prompts generate multiple candidate Agent Prompt templates through GPT-4o technology; multiple candidate Agent Prompt templates constitute an Agent Prompt template library.

[0164] Each Agent Prompt template in the Agent Prompt template library includes a toolset and a goal; it also includes roles, instructions, memories, completed tasks, conversation history, knowledge, output formats, and other necessary information. The toolset includes a database search tool and an email preparation tool;

[0165] The toolset will list the tools or functions that the Agent can use, which need to be configured according to specific business needs;

[0166] The goal will determine the core task or goal of the agent, helping it focus on the ultimate goal;

[0167] The persona will determine the agent's identity, background, and personality traits, helping to maintain consistency and personalization when responding;

[0168] Instructions can provide clear operational instructions to guide the agent on how to perform tasks. Instructions will clearly define the agent's behavioral norms in a specific situation.

[0169] Completed tasks refer to the task information that records the completed tasks of the called tools, including the task name, tool name, tool parameters and returned results;

[0170] The conversation history is to keep the conversation record between the user and the Agent system;

[0171] Knowledge is the knowledge resources needed for business storage for reference, including documents uploaded by users and personalized knowledge. In the process of Agent multi-round interaction, knowledge, dialogue and completed task history are stored and included in Prompt as a reference after retrieval and screening. The underlying layer uses vector database for information storage, and retrieval combines ES and embedding technology for double recall.

[0172] The output format specifies the format and style of the output generated by the Agent, ensuring that the answer conforms to the expected structure and expression;

[0173] Other necessary information is to add relevant common information to the prompt words according to the needs of the business scenario. Common information includes current time, location and IP address.

[0174] Step S33: Based on OpenAI GPT-4o, excellent templates are selected from the Agent Prompt template library as Agent Prompt templates; ensuring that the automatically generated Agent Prompt templates are of high quality, all Agent Prompt templates in the Agent Prompt template library are screened, and templates that lack key information or have obvious defects are deleted. The effects of other templates are verified through actual data to ensure the reliability and effectiveness of high-quality Agent Prompt templates in practical applications; GPT-4o includes the ability to generate templates and the ability to use GPT-4o to screen fine-tune data.

[0175] Selecting excellent templates as Agent Prompt templates includes the following steps:

[0176] Step S33-1: Create a Prompt comparison group, that is, insert a group of identical queries into a verified benchmark Prompt template and a candidate Prompt template generated by Meta-Agent, respectively, to form a Prompt comparison group;

[0177] Step S33-2: Input the two prompts in the prompt comparison group into GPT-4o respectively to generate corresponding responses;

[0178] Step S33-3: Use GPT-4o to score the two responses in step S33-2 to obtain a baseline Prompt template instance score1 and a candidate Prompt template instance score2;

[0179] Step S33-4: Set a first threshold ∈1, and determine the relationship between score1, score2, and ∈1; if score2-score1>∈1, retain the candidate Prompt template instance; otherwise, delete the candidate Prompt template instance;

[0180] Step S33-5: Set a second threshold ∈2, and calculate the average score of all instances of the same candidate Prompt template to obtain the overall score average of the template; if average>∈2, retain the candidate Prompt template; otherwise, delete the candidate Prompt template and its candidate Prompt template instances.

[0181] Step S34: inject the component content into the Agent Prompt template to obtain a number of Agent Prompts.

[0182] In this embodiment, the Agent Prompt is:

[0183]

[0184] 1. Your knowledge base covers a wide range of industrial equipment and their common failure modes;

[0185] 2. You need to complete the task independently without user intervention;

[0186] 3. Improve problem-solving efficiency and avoid ineffective or repetitive task planning;

[0187] 4. You should always remain objective and give priority to executing orders when your self-assessment is uncertain;

[0188] 5. Be good at using conversation history and information about completed tasks to optimize current problem solutions;

[0189] 6. If the currently available information is not sufficient to solve the problem, a new task needs to be planned.

[0190] Commands:

[0191] 1.db_description: read the first three rows of data of all tables in the database, analyze the table structure, and give the table information description. Parameter: (db_inf: string)

[0192] 2.db_search: Use the specified query to determine the name of the table to be searched. Parameters: (query: string)

[0193] 3.key_information: parse the specified query content and obtain key concepts. Parameters:

[0194] (query:string)

[0195] 4.fault_tab_search: retrieves the specified key concept in the specified table and obtains the fault mode.

[0196] Parameters: (tab_name: string, device_name: string,

[0197] device_model:string,time:string,data_trend:string)

[0198] 5.analyze_fault_measure: Use the specified fault information to retrieve the knowledge base to determine the treatment measures. (device model: string, fault: string)

[0199] 6.task_complete: Indicates that the task is complete and no further functionality is required.

[0200] GOAL: "Analyze the data characteristics of the equipment to see if there are any signs of failure. If so, diagnose its failure mode and provide corresponding treatment measures"

[0201] Completed tasks:

[0202] {

[0203] "task_name":"Analyze whether the device data characteristics are abnormal. If abnormal, list the fault symptoms and give the corresponding fault mode",

[0204]

[0205]

[0206] Step S4: constructing an agent fine-tuning training data set for agent fine-tuning training based on a number of agent prompts;

[0207] Constructing the Agent fine-tuning training dataset includes the following steps:

[0208] Step S41: each Agent Prompt in step S3 is used as the input part of the Agent fine-tuning training data set;

[0209] Step S42: creating a corresponding standard answer for each Agent Prompt in step S3, i.e., the output part of the Agent fine-tuning training data set;

[0210] Among them, creating corresponding standard answers based on the large language model at the GPT-4o level and using manual correction or screening can not only improve efficiency and reduce costs, but also ensure the quality of the data.

[0211] The Agent fine-tuning training set contains input and output;

[0212] The input is the Agent Prompt, which includes the output of the previous task. In this embodiment,

[0213]

[0214]

[0215]

[0216] Step S5: Perform Agent fine-tuning on the small-parameter large language model Qenw-14B to form a fine-tuned small-parameter large language model;

[0217] The small-parameter and large-language model Qenw-14B takes a leading position among open-source models of the same parameter level. It has good language understanding and generation capabilities, can efficiently handle complex reasoning tasks, and provides a basis for fine-tuning the Agent. It also has good documentation resources, which is convenient for reference and problem solving during the fine-tuning process.

[0218] Fine-tune the agent for the small parameter large language model Qenw-14B, which includes the following steps:

[0219] Step S51: several input parts and their corresponding output parts in the training data set in step S4 are combined to form several Agent fine-tuning instructions according to the Agent standard process, and until the next group of inputs includes the output of this group, an Agent fine-tuning instruction set is formed;

[0220] This embodiment includes input (Agent Prompt) (ID_1) Output (Response),

[0221] input(Agent Prompt)(ID_2)Output(Response)...,

[0222] input(Agent Prompt)(ID_n)Output(Response);

[0223] Step S52: fine-tune the small parameter large language model, i.e., the small parameter LLM, through the Agent fine-tuning instruction set.

[0224] Among them, Agent fine-tuning requires full parameter training.

[0225] Step S6: Locally deploy the fine-tuned small-parameter large language model, i.e., the fine-tuned small-parameter LLM, and evaluate the Agent to select qualified Agents;

[0226] The methods of effect evaluation include automatic evaluation and manual evaluation.

[0227] Automatic evaluation, including the following steps:

[0228] Step S61: Construct an evaluation benchmark by using GPT-4 combined with manual correction;

[0229] Step S62: randomly selecting part of the data from the training data set;

[0230] Step S63: Compare the Agent output result with the reference answer in the evaluation benchmark and calculate the score;

[0231] Step S64: Set a third threshold ∈3; if the score is greater than ∈3, the Agent is a qualified Agent.

[0232] Manual evaluation divides the evaluation criteria into five levels, where 1 is severely incorrect, 2 is incorrect, 3 is fair, 4 is correct, and 5 is completely correct. Answers with a score of 4 or 5 are considered to be usable or qualified agents; if any illegal content is encountered, it will be directly judged as 0 points.

[0233] Step S7: Migrate the qualified Agent to the fine-tuned small parameter large language model and apply it in real time;

[0234] The migration process of qualified agents includes the transfer of databases and knowledge bases from the development and testing environment to the production environment, including the backup, transfer, and recovery of training data, ensuring that necessary information is retained and operates normally in the new environment;

[0235] Step S71-1: Migrate the relational database, vector database and dynamic equipment fault diagnosis knowledge base to the production environment;

[0236] Step S71-2: Migrate the Agent and its related tool set to the application server for installation and configuration; the Agent related tool set includes Agent related software, Agent related scripts, Agent related configuration files and Agent related dependencies;

[0237] Step S71-3: The fine-tuned large language model with small parameters is privately deployed to the application server to ensure its compatibility and stability with the existing system;

[0238] Step S71-4: Perform system testing on the migration and deployment process to ensure that there are no functional problems or performance degradation issues in actual applications; system testing includes testing the integrity of the database, the accuracy of the knowledge base, the functionality of the Agent, and the responsiveness and accuracy of the small parameter large language model Qwen-14B.

[0239] Comprehensive migration and deployment enable it to run smoothly in the new application server environment and provide efficient and reliable services.

[0240] After being fine-tuned with data and agent tasks in the field of dynamic equipment operation and maintenance, the small-parameter, large-language model Qwen-14B, as the base model of the agent, can understand complex data patterns and provide high-precision analysis and decision-making through the agent driven by Qwen-14B.

[0241] Embodiment 2:

[0242] like Figure 4 As shown, the small parameter large language model uses a qualified agent for real-time application, which specifically includes the following steps:

[0243] Step S72-1: collect real-time data features through the data feature collection model; real-time data feature collection is to process dynamically changing data streams, requiring the system to have efficient computing capabilities and fast response capabilities to capture data changes in a timely manner; it is used in online monitoring, real-time decision-making and instant response to maintain agility and adaptability;

[0244] Step S72-2: The real-time data features are transmitted to the Agent based on the small parameter large language model Qwen-14B as input; in this embodiment, input (Agent Prompt) is transmitted to the Agent

[0245] Step S72-3: Qwen-14B drives Agent to analyze the real-time data characteristics and identify potential abnormal measurement points to quickly discover abnormal situations;

[0246] Step S73-3: outputting the fault diagnosis knowledge base of the moving equipment to find the fault type that matches the abnormality, and using the experience knowledge to determine the fault cause and fault mode, i.e., the equipment diagnosis information;

[0247] Step S73-4: outputting corresponding treatment measures, i.e., treatment information, matched in the moving equipment fault diagnosis knowledge base according to the fault model, wherein the treatment measures include maintenance steps, adjustment suggestions, and emergency treatment plans;

[0248] Step S73-5: Feedback and execute the fault mode and disposal measures; that is, feedback the fault mode and disposal measures to the operator or feedback the fault mode and disposal measures to the automation system and operate it to ensure that the fault is handled in a timely and effective manner.

[0249] By migrating the Agent capabilities of GPT-4o to the small-parameter large-language model Qwen-14B, the present invention can quickly process fault diagnosis tasks in a localized environment; users can use the optimized small-parameter large-language model to quickly identify problems and generate solutions, saving analysis and diagnosis time and improving diagnosis efficiency; by optimizing the small-parameter large-language model, the present invention can significantly reduce the consumption of computing resources while maintaining high performance, so that it can still operate efficiently in an environment with limited resources, thereby improving the overall operation and maintenance capabilities.

[0250] This invention migrates the Agent capabilities in GPT-4o to the small parameter large language model Qwen-14B, which can achieve localized deployment. Many industrial environments require private deployment to protect sensitive data, or cannot use online large model APIs due to network restrictions. By migrating Agent capabilities to Qwen-14B, the needs of these environments can be met; localized deployment ensures the privacy and security of data, and users do not need to worry about data leakage. Fault diagnosis can be performed in a safe environment, which meets the strict requirements of the industrial field for data privacy.

[0251] The entire dynamic equipment fault diagnosis process is integrated into the Agent, so that operation and maintenance personnel can identify and handle faults without professional knowledge. This integrated diagnostic capability not only improves work efficiency, but also provides convenience and consistency for equipment operation and maintenance.

[0252] The present invention makes the fault diagnosis process of dynamic equipment more efficient and convenient. Users do not need to repeatedly adjust inputs to obtain accurate diagnostic results due to insufficient large language model capabilities, thus avoiding the risk of errors caused by inconsistent inputs. Moreover, when the large model with small parameters that has been fine-tuned and optimized in the local environment is processing specific tasks, users can operate according to standard procedures, quickly identify and solve dynamic equipment fault problems, and reduce the possibility of errors. The Agent capabilities based on the optimization of Qwen-14B are applied to dynamic equipment fault diagnosis; the intelligent diagnosis function of the Agent intelligent body, as an advanced knowledge carrier, can help the personnel of the operation and maintenance team quickly master fault diagnosis knowledge and skills; through interaction with the Agent, understand the best practices, and apply this knowledge in actual operations, thereby supporting knowledge inheritance and training; not only significantly improves the efficiency of fault diagnosis, but also provides a more reliable tool for non-professionals.

[0253] In summary, the second embodiment in this specification focuses on the differences from the first embodiment, and the same or similar parts between the first embodiment and other embodiments can be referenced to each other.

[0254] The above implementation modes are not limitations of the present invention, and the present invention is not limited to the above examples. Changes, modifications, additions or substitutions made by technicians in this technical field within the scope of the technical solution of the present invention also belong to the protection scope of the present invention.< / knowledge> < / apis> < / query> < / instruction> < / apis> < / profile> < / format> < / apis> < / apis> < / query> < / query> < / instruction> < / profile> < / apis> < / query>

Claims

1. A method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model, characterized in that: The specific steps include: Step S1: construct a knowledge base for dynamic equipment fault diagnosis to store structured data and unstructured data; provide a large language model with a large parameter magnitude that can complete complex tasks of the Agent; Step S2: Setting a data feature acquisition model to collect and process abnormal information of historical data from the dynamic equipment diagnosis story library; analyzing abnormal information in historical data to identify and extract trend features of measuring points, writing prompt words, and parsing trend features into json format; Step S3: construct an Agent Prompt template library, select excellent templates as Agent Prompt templates, and there are several Agent Prompt templates; inject component content into each Agent Prompt template to generate several Agent Prompts; Step S4: constructing an agent fine-tuning training data set for agent fine-tuning training based on a number of agent prompts; Step S5: performing Agent fine-tuning on the small-parameter large language model Qwen-14B to form a fine-tuned small-parameter large language model; Step S6: Locally deploy the fine-tuned small parameter large language model, evaluate the Agent effect, and select qualified Agents; Step S7: Migrate the qualified Agent to the fine-tuned small parameter large language model and apply it in real time.

2. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: In the step S1, a large language model with a large parameter scale capable of completing complex tasks of the Agent is provided, and an API key capable of providing the large language model GPT-4o service is obtained by registering on the large language model service website; and the large language model is communicated with through the API interface, so that the large language model can complete the complex tasks of the Agent.

3. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 2 is characterized in that: The step S1 of constructing a knowledge base for fault diagnosis of mobile devices specifically includes the following steps: Step S12-1: using a relational database to store and manage all structured data related to the mobile device; specifically including the following steps: Step S12-11: Designing a database table structure in a relational database to ensure efficient storage and retrieval of data; Step S12-12: Collect data from multiple data sources and automatically import them into a relational database in real time; Step S12-13: Clean the data to remove errors and redundant information; Step S12-14: Standardize the cleaned data to ensure consistency in data format and facilitate cross-system integration and analysis; Step S12-2: Based on RAG technology, namely Retrieval Augmented Generation technology, unstructured knowledge is processed and utilized to enhance the capability and efficiency of fault diagnosis; specifically, the following steps are included: Step S12-21: Integrate multiple unstructured information sources to form an unstructured knowledge base; Step S12-22: converting the unstructured text data in the unstructured database into a high-dimensional vector representation based on the pre-trained large language model GPT, that is, converting the unstructured documents and queries into high-dimensional vectors to facilitate similarity calculation; Step S12-23: Use a vector database to store and manage the embedded vectors of unstructured documents, that is, the embedded vectors corresponding to the high-dimensional vectors in each unstructured document, so as to achieve fast retrieval and query of documents with the most similar vectors; Step S12-24: Setting up and configuring the RAG framework, combining the vector database and the pre-trained large language model, to efficiently retrieve relevant information from unstructured documents and generate diagnostic suggestions; Step S12-3: All structured knowledge and unstructured knowledge are stored in the same knowledge base, which is a dynamic equipment fault diagnosis knowledge base.

4. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: The step S2 collects and processes the abnormal information of historical data, specifically including the following steps: Step S21: Setting a data feature acquisition model to acquire historical data when the equipment is operating normally and historical data when the equipment is experiencing abnormal failures; identifying and extracting trend features of all measuring points from the historical data to obtain trend feature data; The data feature collection model collects data features, specifically including the following steps: Step S21-1: pre-processing historical data; Step S21-2: setting a data feature collection algorithm in the historical data feature collection model to identify trend features of the measurement points; Step S21-3: For the historical data identified as having trend characteristics, i.e., the trend characteristic data, joint grouping is performed according to the device and time information; Step S21-4: saving the grouped trend feature data into a feature information grouping database; Step S22: parsing the trend feature data into json format as the input information of the Meta-Agent template library; specifically including the following steps: Step S22-1: extracting information of each group of trend feature data from the feature information grouping database; the trend feature data information includes a group of measurement point trend features triggered by the same device at the same time point; Step S22-2: Write a prompt word Prompt for analyzing trend features; Step S22-3: embed the extracted trend feature data into the prompt word, and parse the trend feature into a fixed JSON format through a large language model; Step S22-4: Add a note to the generated json file.

5. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: In step S3, a plurality of Agent Prompts are generated, which specifically includes the following steps: Step S31: design and write a prompt word Meta-AgentPrompt for calling the Meta-Agent template according to actual needs; Step S32: Meta-Agent Prompt generates different New Meta-Agent Prompt based on different seed queries; different New Meta-Agent Prompt generates multiple candidate Agent Prompts based on GPT-4o to form an Agent Prompt template library; Step S33: selecting excellent templates from the Agent Prompt template library based on GPT-4o as Agent Prompt templates; Step S34: inject the component content into the Agent Prompt template to generate several Agent Prompts.

6. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 5 is characterized in that: The Agent Prompt template library is constructed in step S32, which specifically includes the following steps: Step S32-1: Collecting queries from actual equipment fault diagnosis services; Step S32-2: Group similar queries into multiple sets; wherein, use GPT-4o to expand the queries; Step S32-3: insert different query sets into Meta-Agent Prompt to form different New Meta-Agent Prompts; Step 32-4: Different New Meta-Agent Prompts generate multiple candidate Agent Prompt templates through GPT-4o technology; multiple candidate Agent Prompt templates constitute an Agent Prompt template library.

7. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 5 is characterized in that: The step S33 of selecting an excellent template as an Agent Prompt template specifically includes the following steps: Step S33-1: Create a Prompt comparison group, that is, insert a group of identical queries into a verified benchmark Prompt template and a candidate Prompt template generated by Meta-Agent, respectively, to form a Prompt comparison group; Step S33-2: Input the two prompts in the prompt comparison group into GPT-4o respectively to generate corresponding responses; Step S33-3: Use GPT-4o to score the two responses in step S33-2 to obtain a baseline Prompt template instance score1 and a candidate Prompt template instance score2; Step S33-4: Set a first threshold ∈1, and determine the relationship between score1, score2, and ∈1; if score2-score1>∈1, retain the candidate Prompt template instance; otherwise, delete the candidate Prompt template instance; Step S33-5: Set a second threshold ∈2, and calculate the average score of all instances of the same candidate Prompt template to obtain the overall score average of the template; if average>∈2, retain the candidate Prompt template; otherwise, delete the candidate Prompt template and its candidate Prompt template instances.

8. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: The step S4 constructs an Agent fine-tuning training data set, which specifically includes the following steps: Step S41: each Agent Prompt in step S3 is used as the input part of the Agent fine-tuning training data set; Step S42: Create a corresponding standard answer for each Agent Prompt in step S3, and each standard answer serves as an output part of the Agent fine-tuning training data set.

9. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: The step S5 performs Agent fine-tuning on the small-parameter large language model Qwen-14B, specifically comprising the following steps: Step S51: several input parts and their corresponding output parts in the training data set in step S4 are combined to form several Agent fine-tuning instructions according to the Agent standard process, and until the next group of inputs includes the output of this group, an Agent fine-tuning instruction set is formed; Step S52: fine-tune the small parameter large language model through the Agent fine-tuning instruction set.

10. The method for realizing equipment operation and maintenance intelligent agent based on small parameter and large language model according to claim 1 is characterized in that: In step S7, the small parameter large language model is applied in real time using a qualified agent, which specifically includes the following steps: Step S72-1: collecting real-time data features through a data feature collection model; Step S72-2: transmitting the real-time data features to the Agent based on the small parameter large language model Qwen-14B as input; Step S72-3: Qwen-14B drives Agent to analyze the real-time data characteristics and identify potential abnormal measurement points to quickly discover abnormal situations; Step S73-3: searching for a fault type that matches the abnormality in the dynamic equipment fault diagnosis knowledge base, and using experience knowledge to determine the cause and mode of the fault; Step S73-4: According to the fault model, matching corresponding treatment measures in the dynamic equipment fault diagnosis knowledge base, the treatment measures include maintenance steps, adjustment suggestions and emergency treatment plans; Step S73-5: Feedback and execute the fault mode and disposal measures; that is, feedback the fault mode and disposal measures to the operator or feedback the fault mode and disposal measures to the automation system and operate it to ensure that the fault is handled in a timely and effective manner.

Citation Information

Cited By

  • Financial text logicality evaluation method and system based on AI Agent

    CN120542431A

  • Marine engine operation and maintenance method, system and terminal based on vibration signal and LLM

    CN120907844A

  • Library migration recommendation method based on retrieval enhancement generation

    CN120950480A

  • Dynamic intention distillation retrieval method and equipment for operation and maintenance data and medium

    CN121071106A