Multi-agent based device analysis method, system, device and storage medium
Through a multi-agent-based device analysis method and the use of the supervisor agent and task agent architecture, the problem of insufficient flexibility of the device analysis method in the existing technology is solved, and the expansion and efficient execution of device analysis tasks under user natural language interaction are achieved.
Patent Information
- Application Number
- CN202411157702.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-22
- Publication Date
- 2025-10-17
- Estimated Expiration
- 2044-08-22
AI Technical Summary
In the existing technology, the equipment analysis method cannot flexibly perform multi-task analysis and requires additional configuration or program changes to increase analysis indicators, which lacks flexibility.
A multi-agent-based equipment analysis method is adopted. The supervisor agent performs task planning on the user's question text, determines the target subtask and calls the application program interface of the task agent to generate equipment analysis results.
The flexibility of device analysis is achieved, and users can complete various device analysis tasks through natural language interaction. The supervisor agent-task agent architecture facilitates the expansion of analysis tasks.
Smart Images

Figure CN119226078B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a device analysis method and system based on multiple agents, a device, and a storage medium. BACKGROUND
[0002] In related technologies, when analyzing the performance or status of a computer, a server, or the like, a device index value is usually obtained by logging into the device, and then data analysis is performed based on the obtained index data by an automatic program to implement a corresponding analysis task. If a device analysis index or an analysis task needs to be added, a new program needs to be additionally configured and deployed or the program needs to be changed, and the device cannot be flexibly analyzed in multiple tasks. SUMMARY
[0003] The main purpose of the embodiments of the present application is to provide a device analysis method and system based on multiple agents, a device, and a storage medium, so as to improve the flexibility of device analysis.
[0004] To achieve the above purpose, one aspect of the embodiments of the present application provides a device analysis method based on multiple agents, comprising the following steps:
[0005] Obtaining a user question text;
[0006] Determining a target subtask and a task agent corresponding to the target subtask by a supervisor agent performing task planning on the user question text, wherein the supervisor agent is implemented based on a large language model;
[0007] Calling an application program interface of the task agent by the supervisor agent to execute the target subtask, and obtaining a task feedback;
[0008] Generating a device analysis result according to the task feedback.
[0009] In some embodiments, the step of determining a target subtask and a task agent corresponding to the target subtask by a supervisor agent performing task planning on the user question text comprises the following steps:
[0010] Extracting a keyword in the user question text;
[0011] Determining a corresponding prompt word template according to the keyword, and writing the keyword into a prompt word variable of the prompt word template to obtain a device task analysis instruction;
[0012] Determining a target subtask and a task agent corresponding to the target subtask according to the device task analysis instruction.
[0013] In some embodiments, the task planning of the user question text by the master agent to determine the target subtask and the task agent corresponding to the target subtask further comprises the following steps:
[0014] Determining the questioner identity in response to the user question text;
[0015] Determining the user authority description according to the questioner identity, and writing the user authority description into the authority variable of the prompt word template to obtain a device task analysis instruction.
[0016] In some embodiments, the determination of the target subtask and the task agent corresponding to the target subtask according to the device task analysis instruction comprises the following steps:
[0017] Determining the target analysis device, agent information and subtask requirement according to the device task analysis instruction;
[0018] Determining the query range and analysis range of the target analysis device according to the user authority description in the device task analysis instruction;
[0019] Determining the target subtask according to the agent information, the subtask requirement, the target analysis device and its query range and analysis range;
[0020] Determining the corresponding task agent according to the agent information in the target subtask.
[0021] In some embodiments, the task agent executes the target subtask by the following steps:
[0022] Determining the operation command according to the subtask requirement in the target subtask, the query range and analysis range of the target analysis device;
[0023] Determining whether the operation command includes sensitive operation according to the command level list by a sensitive instruction tool, and auditing the operation command when the operation command includes sensitive operation;
[0024] Selecting a database connection tool, a device information tool or a device interaction tool to process the task according to the operation command after the audit to complete the target subtask.
[0025] In some embodiments, the determination of whether the operation command includes sensitive operation according to the command level list comprises the following steps:
[0026] Determining the level of each operation type in the operation command according to the command level list;
[0027] Determining that the operation command includes sensitive operation when the level of the operation type is greater than a preset level.
[0028] In some embodiments, the auditing the operation command comprises the following steps:
[0029] The terminal displays the sensitive operation of the operation command and the query range and analysis range of the target analysis device to obtain an auditing instruction;
[0030] The operation command is operated according to the auditing instruction, so that the operation command passes the auditing, wherein the auditing instruction comprises at least one of deleting the sensitive operation or ignoring the sensitive operation.
[0031] To achieve the above object, another aspect of the embodiment of the present application proposes a device analysis system based on multiple agents, comprising:
[0032] A first module is configured to obtain a user question text;
[0033] A second module is configured to determine a target subtask and a task agent corresponding to the target subtask by task planning on the user question text through a supervisor agent, wherein the supervisor agent is implemented based on a large language model;
[0034] A third module is configured to call an application program interface of the task agent through the supervisor agent to execute the target subtask and obtain a task feedback;
[0035] A fourth module is configured to generate a device analysis result according to the task feedback.
[0036] To achieve the above object, another aspect of the embodiment of the present application proposes an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing the connection communication between the processor and the memory, and the program is executed by the processor to realize the method of the above-mentioned embodiments.
[0037] To achieve the above object, another aspect of the embodiment of the present application proposes a storage medium, which is a computer readable storage medium for computer readable storage, and the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to realize the method of the above-mentioned embodiments.
[0038] The multi-agent-based device analysis method, system, device, and storage medium proposed in this application first obtain a user question text regarding device analysis. Using the large language model of the supervisor agent, the user question text is task-decomposed and planned to determine the target subtask and the task agent corresponding to the target subtask. The supervisor agent then calls the application program interface of the task agent to execute the target subtask and obtain task feedback. The large language model generates device analysis results based on the task feedback and feeds them back to the user. This application uses multi-agent collaboration to complete various device analysis tasks. The supervisor agent-task agent architecture facilitates the expansion of device analysis tasks and flexibly handles user device analysis needs. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of a multi-agent-based device analysis method provided in an embodiment of the present application;
[0040] Figure 2 This is a schematic diagram of the supervisor agent-task agent architecture provided by an embodiment of the present application;
[0041] Figure 3 This is a schematic diagram of the application architecture of the multi-agent-based device analysis method provided in an embodiment of the present application;
[0042] Figure 4 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0044] It should be noted that although the system is divided into functional modules and the flowcharts illustrate a logical sequence, in some cases, the steps shown or described may be performed in a different order than the module division in the system or the order in the flowcharts. The terms "first," "second," and so on in the specification, claims, and drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence.
[0045] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing the embodiments of this application only and are not intended to limit this application.
[0046] First, let’s analyze some of the terms used in this application:
[0047] Artificial intelligence (AI): is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science, artificial intelligence attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a similar way to human intelligence, the research in this field includes robots, language recognition, image recognition, natural language processing and expert systems, etc. Artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also the theory, method, technology and application system of using digital computer or digital computer controlled machine to simulate, extend and expand human intelligence, perceive environment, acquire knowledge and use knowledge to obtain the best results.
[0048] Natural language processing (NLP): NLP uses computers to process, understand and use human language (such as Chinese, English, etc.), NLP is a branch of artificial intelligence and is an interdisciplinary subject of computer science and linguistics, and is also commonly known as computational linguistics. Natural language processing includes syntax analysis, semantic analysis, discourse understanding, etc. Natural language processing is commonly used in machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, and opinion mining, etc. Technical fields, it involves language processing related data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research and language computing related linguistic research, etc.
[0049] Large language model (LLM): refers to deep learning models trained using large amounts of text data, these models learn language patterns, grammar and semantics by processing massive amounts of text data, so they can understand and generate human language. They use deep neural networks, especially the Transformer architecture, to capture complex relationships and structures in language.
[0050] An agent is an intelligent entity that can perceive the environment, make decisions, and perform actions. Unlike traditional artificial intelligence, an agent has the ability to complete a given goal step by step through active thinking and calling tools. The interaction between the large model and the human is based on the prompt (command), and whether the user prompt is clear and explicit will affect the effect of the large model answer. In this process, the human initiates the question, and the large model is "passive" answer. The work of the agent only needs to give a goal, and can independently think and act for the goal. From the perspective of the large model, the agent is based on the semantic understanding and reasoning ability of the large model, so that the agent has the task planning ability when solving complex problems, and calls external tools to perform various tasks, and an agent that retains "memory" by using a vector database.
[0051] Device analysis needs to evaluate the device status from various indicators, so as to understand the performance of the system under different loads. For Linux and Windows operating systems, although the specific commands and tools may be different, the basic principles of analysis are similar. The current main device analysis method is to log in to the device to execute instructions to obtain characteristic index values such as CPU usage, memory usage, disk I / O, network traffic, etc., and then analyze, fault detection, and evaluate the current health status of the device according to the index values. In the related art, the device index values are obtained by logging into the device, which generally needs to be implemented by an automatic program. If additional analysis indicators (such as device state prediction, fault detection, etc.) need to be added, manual configuration or program changes are required, and the flexibility is general.
[0052] Therefore, based on this, the embodiments of the present application provide a device analysis method, system, device and storage medium based on multiple agents, which aims to improve the flexibility of device analysis.
[0053] The device analysis method, system, device and storage medium based on multiple agents provided by the embodiments of the present application are specifically explained by the following embodiments. First, the device analysis method based on multiple agents in the embodiments of the present application is described.
[0054] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Among them, artificial intelligence (Artificial Intelligence, AI) is to use digital computers or digital computer controlled machines to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. Theory, method, technology and application system.
[0055] The method for device analysis based on multiple agents provided by the embodiments of the present application relates to the technical field of artificial intelligence. The method for device analysis based on multiple agents provided by the embodiments of the present application can be applied to a terminal, can also be applied to a server end, and can also be software running in the terminal or the server end. In some embodiments, the terminal can be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.; the server end can be configured as a stand-alone physical server, can also be configured as a server cluster or a distributed system composed of multiple physical servers, and can also be configured as a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, and big data and artificial intelligence platforms; and the software can be an application for implementing the method for device analysis based on multiple agents, but is not limited to the above forms.
[0056] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in a distributed computing environment in which tasks are performed by remote processing devices connected by a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.
[0057] Figure 1 is an optional flowchart of the method for device analysis based on multiple agents provided by the embodiments of the present application, Figure 1 The method in the above can include but is not limited to including steps S101 to S104.
[0058] Step S101, obtaining a user question text;
[0059] Step S102, determining a target subtask and a task agent corresponding to the target subtask through task planning on the user question text by a supervisor agent, wherein the supervisor agent is implemented based on a large language model;
[0060] Step S103, calling an application program interface of the task agent through the supervisor agent to execute the target subtask, and obtaining a task feedback;
[0061] Step S104, generating a device analysis result according to the task feedback.
[0062] In steps S101 to S104, the embodiment of the present application first obtains a user question text regarding device analysis. The large language model of the supervisor agent decomposes and plans the user question text into tasks to determine the target subtask and the task agent corresponding to the target subtask. Furthermore, the supervisor agent calls the application program interface of the task agent to execute the target subtask and obtain task feedback. The large language model generates device analysis results based on the task feedback and feeds them back to the user. The embodiment of the present application uses multiple agents to complete various device analysis tasks. The supervisor agent-task agent architecture facilitates the expansion of device analysis tasks. Users can complete various device analysis tasks simply through natural language interaction.
[0063] In step S101 of some embodiments, a user can ask the large language model any question regarding device analysis through the front-end interactive interface. For example, the user-initiated question could be "Please analyze whether device xxx is currently faulty." After the backend receives the user's question text, it uses the large language model to perform subsequent task processing and provide the user with feedback on the fault analysis results for device xxx.
[0064] In step S102 of some embodiments, the backend uses the framework of supervisor agent-task agent to process the user's question text. Specifically, refer to Figure 2 The supervisor agent-task agent architecture employs a "divide and conquer" approach, creating a dedicated task agent for each task or domain, with a supervisor agent helping to delegate tasks. The supervisor agent, implemented based on a large language model, is responsible for receiving user input and, based on its understanding of the language, routing tasks to the appropriate task agent for processing. In some embodiments, the supervisor agent-task agent architecture can be built and developed using the open-source agent framework LangGraph.
[0065] The master agent understands the user question text by using a large language model, and decomposes the user question text into one or more target sub-tasks based on the task domain of each task agent. For example, each task agent includes a device index analysis agent, a fault analysis agent, and a device health analysis agent. The task domain of the device index analysis agent is to collect, process, and analyze performance index data of the device, monitor key performance indicators of the device, and analyze data by artificial intelligence algorithm to predict performance trends of the device; the task domain of the fault analysis agent is to identify and diagnose device faults, identify fault patterns and causes by analyzing device logs, index data, and historical fault cases, predict potential fault risks, provide fault diagnosis suggestions, and assist in developing fault handling solutions; the task domain of the device health analysis agent is to evaluate the overall health status of the device, considering multi-dimensional information such as device operation data, maintenance records, and environment logs, to evaluate the health status of the device, and to provide a device health report to reduce maintenance costs. It can be understood that the task domain of each task agent can be defined according to its function, and the function of the task agent can be freely developed according to the development needs, and the embodiments of the present application do not make specific limitations.
[0066] The master agent identifies keywords in the user question text by semantic understanding, matches the keywords with the task domains of each task agent, and extracts and plans one or more target sub-tasks from the user question text. For example, the user question text is "Please analyze the health status of a batch of devices to be analyzed, and predict the CPU occupancy rate trend in the future period", the master agent identifies the keywords in the user question text, and matches the task domains based on the keywords such as "health status", "prediction", and "CPU occupancy rate" (which belongs to device performance). It can be determined that there are two tasks of the task agent, which are "health analysis of the device to be analyzed" (corresponding to the device health analysis agent) and "prediction of the CPU occupancy rate of the device to be analyzed" (corresponding to the device index analysis agent).
[0067] In some embodiments, step S102 can include but is not limited to steps S201 to S203:
[0068] Step S201, extracting keywords in the user question text;
[0069] Step S202, determining the corresponding prompt word template according to the keywords, and writing the content in the user question text into the prompt word variable of the prompt word template to obtain a device task analysis instruction;
[0070] Step S203, determining the target sub-task and the task agent corresponding to the target sub-task according to the device task analysis instruction.
[0071] In this embodiment, the background system provides a prompt word management function for unified management of prompt words used by the intelligent agent, including but not limited to various prompt word templates, roles, prompt word categories, use scenarios, and specific prompt word content. The supervisor intelligent agent can extract the corresponding prompt word template content based on the corresponding scene of the keyword, combine the user question text to replace the variables in the template, and form the final prompt word to pass to the large language model for processing. For example, assuming that the user question text is "I want to understand the reason for the failure of device xxx", the supervisor intelligent agent matches the corresponding prompt word template for failure reason analysis based on the prompt word management function according to the keywords such as "failure" and "reason" in the text, for example, the prompt word template is "Please analyze the failure reason of [device address variable / device number variable], and provide the device monitoring data that caused the failure, and give the failure reason solution", and the "device xxx" content in the user question text is written into [device address variable / device number variable] to obtain the device task analysis instruction. By converting the user question text into a device task analysis instruction based on the prompt word, the supervisor intelligent agent can determine the target subtask based on the device task analysis instruction and issue the target subtask to the corresponding task intelligent agent, which can guide the large language model to provide answers that better meet the user's needs and improve the user's device analysis experience.
[0072] In some embodiments, step S102 can further include but is not limited to steps S301 to S302:
[0073] Step S301, determining the questioner identity in response to the user question text;
[0074] Step S302, determining the user authority description according to the questioner identity, and writing the user authority description into the authority variable of the prompt word template to obtain the device task analysis instruction.
[0075] In this embodiment, after the user logs in to the system, the user initiates a question to the large language model while carrying identity information. The background system determines the questioner identity in response to the user question text, queries the user authority description in the system according to the questioner identity, and writes the user authority description into the authority variable of the prompt word template to obtain the device task analysis instruction. This embodiment adds the user authority description in the device task analysis instruction in the form of a prompt word, which can limit the user's query data, analysis function, device operation, and other authorities in the subsequent task processing process, thereby improving the security of the system and device data.
[0076] In some embodiments, step S203 can include but is not limited to steps S401 to S404:
[0077] Step S401, determining the target analysis device, agent information and subtask demand according to the device task analysis instruction;
[0078] Step S402, determining the query range and analysis range of the target analysis device according to the user permission description in the device task analysis instruction;
[0079] Step S403, determining the target subtask according to the agent information, subtask demand, target analysis device and its query range and analysis range;
[0080] Step S404, determining the corresponding task agent according to the agent information in the target subtask.
[0081] In this embodiment, the device task analysis instruction is optimized from the user question text, and the device task analysis instruction is also a text input into a large language model. Generally, the device task analysis instruction contains information of the target analysis device, agent information and subtask demand. The target analysis device refers to the number or address information of the device to be analyzed. The agent information refers to the information related to the task agent that can realize the task demand in the device task analysis instruction, including but not limited to the name of the task agent, the calling interface, etc., such as the related information of the device index analysis agent. The subtask demand refers to the device analysis demand in the device task analysis instruction that belongs to a certain task agent, for example, the subtask demand includes monitoring the device performance index and predicting the performance trend, which are realized by the device index analysis agent.
[0082] In this embodiment, the device task analysis instruction also includes user permission description. The supervisor agent can determine the query range and analysis range of the target analysis device according to the user permission description, and then determine the target subtask according to the agent information, subtask demand, target analysis device and its query range and analysis range. The target subtask is the parameter input into the corresponding task agent.
[0083] In step S103 of some embodiments, the supervisor agent calls the application program interface of the task agent according to the agent information in the target subtask, and inputs the target subtask as the calling parameter into the task agent. The task agent can build corresponding functional modules based on a large language model. The functional modules can be implemented by using neural network algorithms, artificial intelligence algorithms or other algorithms that can realize corresponding functions, for example, the performance prediction module of the task agent can be implemented based on a long short-term memory network algorithm. The task agent selects the corresponding functional module to analyze the target analysis device according to the subtask demand, and controls the analysis process according to the query range and analysis range of the user, thereby improving the security of the device data. After the task agent completes the target subtask, the task feedback obtained is returned to the supervisor agent.
[0084] In some embodiments, the task agent in step S103 performs the target subtask by including but not limited to including steps S501 to S503:
[0085] Step S501, determining an operation command according to the subtask requirement in the target subtask, the query range and the analysis range of the target analysis device;
[0086] Step S502, determining whether the operation command includes a sensitive operation according to the command level list through a sensitive instruction tool, and when the operation command includes a sensitive operation, auditing the operation command;
[0087] Step S503, selecting to call a database connection tool, a device information tool or a device interaction tool to process the task according to the operation command after the auditing, so as to complete the target subtask.
[0088] In the embodiment, each task agent needs to interact with the physical world in the process of executing the target subtask, such as interacting with the device / database to obtain the data of the device / database, and therefore, the system in the embodiment can provide various tools in the form of tool API for the agent, for example, a calculator, a search tool, a code executor, a database query tool, etc., and the agent can interact with the physical world to solve actual problems. Please refer to Figure 2 The tool set of the system includes but is not limited to a sensitive instruction tool, a database connection tool, a device information tool and a device interaction tool, etc., the database connection tool is used to interact with the business database; the device information tool is used to obtain information including device IP, connection protocol, connection account and password, etc.; the device interaction tool is used to connect the device, execute the instruction and obtain the instruction execution result; and the sensitive instruction tool is used to check the sensitive operation in the instruction.
[0089] In the embodiment, when the agent interacts with the entity such as the device / database, the corresponding operation instruction such as a query instruction and a data writing instruction is generated, before executing the operation instruction, the sensitive instruction tool is used to determine whether the operation command includes a sensitive operation, when the operation command includes a sensitive operation, the operation command is audited, and then the database connection tool, the device information tool or the device interaction tool is selected to process the task according to the operation command after the auditing, so as to complete the target subtask.
[0090] In some embodiments, the step of determining whether the operation command includes a sensitive operation according to the command level list in step S502 includes but is not limited to including steps S601 to S602:
[0091] Step S601, determining the level of each operation type in the operation command according to the command level list;
[0092] Step S602: When the level of the operation type is greater than a preset level, it is determined that the operation command contains a sensitive operation.
[0093] In this embodiment, the sensitive instruction tool determines sensitive operations by obtaining a preset command level list. The command level list defines the levels of various operations, with higher levels indicating more sensitive or dangerous operations. The command level list is queried to determine the level of each operation type (such as device CPU query operations, device remote control operations, and device sensitive address block read operations) included in the operation command. If the level of the operation type is greater than the preset level, the operation command is determined to contain a sensitive operation.
[0094] In some embodiments, the step of reviewing the operation command in step S502 may include but is not limited to steps S701 to S702:
[0095] Step S701: Display the sensitive operations of the operation command and the query scope and analysis scope of the target analysis device on the audit terminal to obtain the audit instruction;
[0096] Step S702: operating the operation command according to the audit instruction so that the operation command passes the audit, wherein the audit instruction includes at least one of deleting the sensitive operation or ignoring the sensitive operation.
[0097] In this embodiment, when the operation command includes sensitive operations, the sensitive operations of the operation command and the query scope and analysis scope of the target analysis device can be further displayed on the core terminal, so that the relevant reviewers can refer to the query scope and analysis scope of the target analysis device by the questioner to delete the sensitive operations in the operation command or determine whether the sensitive operations can be executed (i.e., ignore the sensitive operations). After the reviewer inputs the review instructions on deleting or ignoring sensitive operations to the system, the system deletes the operation command after the sensitive operation based on the review instruction task or the original operation command passes the review, thereby continuing to execute the target subtask.
[0098] According to some embodiments of the present application, referring to Figure 3 , the application architecture of the multi-agent-based device analysis method of the embodiment of the present application is described. The layers of the application architecture are as follows from bottom to top:
[0099] Large language model (LLM) and operating environment: A large language model is required to support the operation of the intelligent agent. In this embodiment, a private large language model can be built separately on the GPU server.
[0100] Service application layer: includes assistant application and multi-agent application built based on supervisor agent; the assistant application is mainly responsible for accepting user input and calling the multi-agent application, and managing the basic information of the agent; the multi-agent application is a core module of the system, which is built based on a multi-agent architecture, and includes a plurality of task agents, the task agents are responsible for reasoning the input from the assistant application and outputting the reasoning result.
[0101] Run support layer: provides a communication channel of HTTP / DNS protocol between the front end and the back end.
[0102] Client: responsible for providing an interface for interaction with the user.
[0103] The construction process of the application architecture is as follows:
[0104] Deploy a private large language model (LLM): the large language model used in the present embodiment can be Qwen2-72B-Instruct, an open source large model of Tongyiqianwen. Qwen2 outperforms most open source models in a series of benchmark tests for language understanding, language generation, multilingual capabilities, coding, mathematics, reasoning, etc. Qwen2 increases the context length support, up to 128K tokens (Qwen2-72B-Instruct), and can handle a large amount of input. The GPU server computing power can be: minimum configuration: graphics card A800*4; recommended configuration: graphics card A800*8.
[0105] Build a service application layer (i.e. supervisor agent-task agent architecture): the service application layer in the present embodiment can be built using the open source LangGraph agent framework. LangGraph is a library for building stateful, multi-participant applications using LLM, which is used to create agents and multi-agent workflows. The multi-agent architecture used in the present embodiment has the following core advantages: cycle, controllability and persistence.
[0106] Cycle and branch: implement loops and conditions in the application.
[0107] Persistence: automatically save the state after each step in the graph. The execution of the graph can be paused and resumed at any time to support error recovery, manual intervention in the workflow, task backtracking, etc.
[0108] Manual intervention: interrupt the execution of the graph to approve or edit the next operation of the agent plan.
[0109] Streaming support: stream the output generated by each node (including token streaming).
[0110] Among them, the introduction of human intervention is to improve the controllability of the agent, limit the device query and analysis permission range from the source through the account permission binding method, emphasize those operations that need human intervention in the prompt word, and set up a list to classify different commands to prevent them from executing sensitive commands on the device privately.
[0111] Please refer to Figure 2 The supervisor agent-task agent architecture creates a special agent for each task or domain, and an agent supervisor helps to assign tasks. The agent supervisor is responsible for receiving user input and routing tasks to the corresponding agent for processing according to the understanding of the language. The relevant description of each agent has been described in the above embodiment, which will not be repeated here.
[0112] The multi-agent framework is equipped with system tool API, including sensitive instruction tool, database connection tool, device information tool and device interaction tool, etc. The tool-related description has been described in the above embodiment, which will not be repeated here.
[0113] Build assistant application: the assistant application can be developed using a web framework. The main function is to provide a user interface and has the ability to interact with the agent application. Specifically, the functions of the assistant application include but are not limited to assistant Q&A and agent management. Assistant Q&A is used to provide a page for natural language question and answer interaction for users. Agent management includes basic information management, interface management and prompt word management. Basic information management refers to managing the basic information of each agent, such as name, role, use scenario, etc. Interface management refers to managing the interface address and parameter description provided by the agent application, which is convenient for calling the capabilities on the agent side. Prompt word management refers to managing all prompt words of the agent application, including prompt word template, role, prompt word classification, use scenario and specific prompt word content. The supervisor agent can extract the corresponding prompt word template content according to the corresponding scenario, replace the variables in the template combined with the user's question, form the final prompt word and pass it to the large language model for processing.
[0114] The test process of the application architecture is as follows:
[0115] First, prepare the test machine, the device types include host, firewall, switch, router; the operating system mainly uses Linux and Windows.
[0116] Second, enter the device data, enter the device data into the database, including IP, device type, manufacturer, operating system, login protocol, connection port number and account password, etc.
[0117] Third, design test questions, you can design several common questions, as follows:
[0118] Indicator grabbing: such as querying the disk utilization of several devices in batches;
[0119] Device indicator trend analysis and prediction: such as analyzing and predicting the CPU utilization of a certain device, whether there is a possibility of exceeding the threshold recently;
[0120] Fault location: such as analyzing the problem when a server fails, whether there are other hidden dangers, etc.;
[0121] Device health analysis report: such as giving a server health analysis report, the report content is composed of several parts, and the flexibility of the intelligent agent can be tested by flexibly specifying the report format;
[0122] Other more comprehensive problems: In addition to manually designing problems, more problems can be generated by large language models for scenarios. For example, you can generate questions by directly asking the large language model, and the following is a question case:
[0123] You are a test engineer, and you need to test intelligent agent applications. Your task is to generate test questions about Linux and Windows system indicator queries (indicators include CPU usage, content usage, etc.), and the test device IP is x.x.x.x. Output in natural language. The question sample is "Check the CPU and memory utilization of 192.168.11.11". First, give 20 questions.
[0124] By letting the large model design test questions, the workload of manually designing test cases can be greatly reduced.
[0125] Fourth, after designing the problem, test the intelligent agent, and after testing, evaluate and optimize the intelligent agent application according to the specific test results.
[0126] The evaluation method can be through the assistant feedback function, which supports users to like or dislike the current question, and the assistant background automatically collects feedback results to evaluate whether to optimize the intelligent agent application according to the specific situation. In addition, it can also save the dialogue record and analyze the user's attention problem regularly to optimize the assistant and intelligent agent application.
[0127] Intelligent agent application optimization includes prompt optimization and tool optimization. Prompt optimization is to adjust the prompt to make the large language model output a specific format, such as outputting the process with the highest occupation when outputting CPU utilization; tool optimization can provide more perfect and rich tools for intelligent agents according to optimization needs, such as providing more rich report templates when generating health reports.
[0128] The device analysis assistant application of the embodiment has the following capabilities:
[0129] Flexible index grabbing: instructions can be given to the assistant through natural language, such as "help me check the current CPU and memory usage of several servers, and display them in descending order of usage rate". The assistant automatically retrieves relevant capabilities according to user needs.
[0130] Device index trend analysis and prediction: instructions can be given to the assistant through natural language, such as analyzing and predicting the CPU utilization of a certain device. The assistant automatically performs index grabbing and analysis, and makes data prediction.
[0131] Fault location: instructions can be given to the assistant through natural language, such as whether a certain server has high resource occupation, and what causes it. The assistant automatically retrieves relevant indicators that may cause the fault for analysis, positioning and giving preliminary processing suggestions.
[0132] Device health analysis report: instructions can be given to the assistant through natural language, such as giving a health analysis report of a certain server. The assistant automatically retrieves relevant indicators related to health for analysis, and makes an analysis report on the current health status of the device.
[0133] The embodiment also provides a device analysis system based on multiple agents, comprising:
[0134] A first module is configured to obtain user query text;
[0135] A second module is configured to determine target sub-tasks and task agents corresponding to the target sub-tasks through task planning of the user query text by a supervisor agent, wherein the supervisor agent is implemented based on a large language model;
[0136] A third module is configured to call application program interfaces of the task agents through the supervisor agent to execute the target sub-tasks and obtain task feedback;
[0137] A fourth module is configured to generate a device analysis result according to the task feedback.
[0138] It can be understood that the content in the above device analysis method based on multiple agents is applicable to the system embodiment, the system embodiment specifically realizes the same functions as the above device analysis method based on multiple agents, and achieves the same beneficial effects as the above device analysis method based on multiple agents.
[0139] The embodiment of the present application further provides an electronic device, which comprises a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for realizing connection communication between the processor and the memory, and the program is executed by the processor to realize the above-mentioned device analysis method based on multiple agents. The electronic device can be any intelligent terminal including a tablet computer, a vehicle-mounted computer and the like.
[0140] Please refer to Figure 4 , Figure 4 The hardware structure of the electronic device of another embodiment is illustrated, and the electronic device comprises:
[0141] The processor 401 can be implemented in the mode of a general CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, and is used to execute related programs to realize the technical solutions provided by the embodiments of the present application.
[0142] The memory 402 can be implemented in the mode of a ROM (Read Only Memory), a static storage device, a dynamic storage device or a RAM (Random Access Memory), etc. The memory 402 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present application are realized by software or firmware, the related program codes are stored in the memory 402 and are called and executed by the processor 401 to realize the device analysis method based on multiple agents of the embodiments of the present application.
[0143] The input / output interface 403 is used to realize information input and output.
[0144] The communication interface 404 is used to realize communication interaction between the device and other devices, and can realize communication through a wired mode (for example, a USB, a network cable, etc.) or a wireless mode (for example, a mobile network, a WI-FI, a Bluetooth, etc.).
[0145] The bus 405 is used to transmit information between various components (for example, the processor 401, the memory 402, the input / output interface 403 and the communication interface 404) of the device.
[0146] The processor 401, the memory 402, the input / output interface 403 and the communication interface 404 realize communication connection between each other in the device through the bus 405.
[0147] The embodiment of the present application further provides a storage medium, which is a computer readable storage medium, used for computer readable storage, and stores one or more programs, which can be executed by one or more processors to implement the above-mentioned device analysis method based on multiple agents.
[0148] The memory, as a non-transitory computer readable storage medium, can be used to store non-transitory software programs and non-transitory computer executable programs. In addition, the memory can include a high-speed random access memory, and can also include a non-transitory memory, such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some embodiments, the memory can optionally include a memory remotely arranged relative to the processor, and these remote memories can be connected to the processor through a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0149] The embodiments described in the embodiments of the present application are used to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application. Those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are also applicable to similar technical problems.
[0150] Those skilled in the art can understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and can include more or fewer steps than those shown in the figures, or combine certain steps, or different steps.
[0151] The system embodiments described above are only schematic, and the units described as separate components can or can not be physically separated, that is, can be located in one place, or can be distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the embodiments of the present application.
[0152] Those skilled in the art can understand that all or some steps in the above-mentioned method, the functions of the modules / units in the system and the device can be implemented as software, firmware, hardware and their appropriate combinations.
[0153] The terms "first", "second", "third", "fourth", and the like in the description and in the claims of this application, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the use of the terms so termed is interchangeable under appropriate circumstances such that the embodiments of the application described herein are, for example, capable of orderly or chronological mundane operation, reverse order operation, based on circuitry availability, based on stated preference or the like, and that "default" or other orderings are thus permissible. Further, the terms "comprise", "comprising", "include", "including", and the like, are specifically intended to be open-ended. That is, references to individual steps and the like do not suhstantially exclude the presence of two or more of a recited step or its integral sub-steps or additional steps whether or not readily ascertainable from the description or the like. Further, the words "a" or "an", as used herein in the disclosure and elsewhere, are used indiscriminately and are to be interpreted in the same way, i.e. as meaning "one or more".
[0154] It should be understood that, in this application, "at least one" means one or more, "multiple" means two or more. "And / or", used to describe the relationship between associated objects, means that there can be three relationships, for example, "A and / or B" can mean: only A, only B, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally represents an "or" relationship between the associated objects. "At least one of the following" or the like means any combination of these items, including single or multiple combinations. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.
[0155] In several embodiments provided in the present application, it should be understood that the disclosed system and method can be implemented in other ways. For example, the above-described system embodiments are only illustrative, for example, the division of the above-mentioned units is only a logical functional division, and actual implementation can have another division manner, for example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between the displayed or discussed each other can be through some interface, indirect coupling or communication connection between systems or units, which can be electrical, mechanical or other forms.
[0156] The units described above as separate components can or can not be physically separated, and the components shown as units can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the units can be selected according to actual needs to achieve the purpose of the embodiment.
[0157] In addition, each function unit in each embodiment of the present application can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of a software function unit.
[0158] When the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application, essentially or in part, or all or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes multiple instructions used to cause a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods in the embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and various other media that can store programs.
[0159] The preferred embodiments of the embodiments of the present application are described above with reference to the accompanying drawings, and are not intended to limit the scope of the embodiments of the present application. Any modifications, equivalent replacements and improvements made by those skilled in the art without departing from the scope and essence of the embodiments of the present application shall be within the scope of the embodiments of the present application.
Claims
1. A multi-agent based device analysis method, characterized in that: The following steps are involved: Get the user's question text; The supervisor agent extracts keywords from the user's question text and determines the identity of the questioner of the user's question text; determines a corresponding prompt word template based on the keywords, and writes the keywords into the prompt word variable of the prompt word template; determines a user authority description based on the questioner's identity, and writes the user authority description into the authority variable of the prompt word template to obtain a device task analysis instruction; determines a target subtask and a task agent corresponding to the target subtask based on the device task analysis instruction; wherein, the supervisor agent is implemented based on a large language model, and the target subtask represents agent information, subtask requirements, target analysis equipment and its query scope and analysis scope; each task agent corresponds to a task domain regarding the device analysis task, and the supervisor agent determines the corresponding task agent by matching text keywords with task domains; The supervisor agent calls the application program interface of the task agent to execute the target subtask and obtain task feedback; generating a device analysis result based on the task feedback; The task agent selects the corresponding functional module according to the subtask requirements to analyze the target analysis device, and performs authority control on the analysis process according to the query scope and the analysis scope; The task agent performs the target subtask by the following steps: Determine an operation command based on the subtask requirements in the target subtask, the query scope and analysis scope of the target analysis device; the operation command represents the interactive operation of the task agent on the device / database; Using a sensitive instruction tool, judging whether the operation command includes a sensitive operation according to a command level list, and if the operation command includes a sensitive operation, reviewing the operation command; According to the operation command that has passed the review, a database connection tool, a device information tool or a device interaction tool is selected to perform task processing to complete the target subtask.
2. The multi-agent-based device analysis method according to claim 1, characterized in that: The step of determining a target subtask and a task agent corresponding to the target subtask according to the device task analysis instruction includes the following steps: Determine target analysis equipment, agent information, and subtask requirements according to the equipment task analysis instruction; Determine the query scope and analysis scope of the target analysis device according to the user authority description in the device task analysis instruction; Determine a target subtask based on the agent information, the subtask requirements, the target analysis device and its query scope and analysis scope; Determine the corresponding task agent according to the agent information in the target subtask.
3. The multi-agent-based device analysis method according to claim 1, characterized in that: Determining whether the operation command includes a sensitive operation according to the command level list includes the following steps: Determining the level of each operation type in the operation command according to the command level list; When the level of the operation type is greater than a preset level, it is determined that the operation command contains a sensitive operation.
4. The multi-agent-based device analysis method according to claim 1, characterized in that: The review of the operation command includes the following steps: Displaying the sensitive operations of the operation command and the query scope and analysis scope of the target analysis device on the audit terminal to obtain the audit instruction; The operation command is operated according to the audit instruction so that the operation command passes the audit, wherein the audit instruction includes at least one of deleting sensitive operations or ignoring sensitive operations.
5. A multi-agent based equipment analysis system, characterized in that: include: The first module is used to obtain the user's question text; The second module extracts keywords from the user's question text and determines the identity of the questioner of the user's question text through the supervisor agent; Determine a corresponding prompt word template based on the keyword, and write the keyword into the prompt word variable of the prompt word template accordingly, and determine a user authority description based on the identity of the questioner, and write the user authority description into the authority variable of the prompt word template to obtain a device task analysis instruction; determine a target subtask and a task agent corresponding to the target subtask based on the device task analysis instruction; wherein, the supervisor agent is implemented based on a large language model, and the target subtask represents agent information, subtask requirements, target analysis equipment and its query scope and analysis scope; each task agent corresponds to a task domain regarding the device analysis task, and the supervisor agent determines the corresponding task agent by matching text keywords with task domains; The third module is configured to call the application program interface of the task agent through the supervisor agent to execute the target subtask and obtain task feedback; A fourth module is configured to generate a device analysis result based on the task feedback; The task agent selects the corresponding functional module according to the subtask requirements to analyze the target analysis device, and performs authority control on the analysis process according to the query scope and the analysis scope; The task agent performs the target subtask by the following steps: Determine an operation command based on the subtask requirements in the target subtask, the query scope and analysis scope of the target analysis device; the operation command represents the interactive operation of the task agent on the device / database; Using a sensitive instruction tool, judging whether the operation command includes a sensitive operation according to a command level list, and if the operation command includes a sensitive operation, reviewing the operation command; According to the operation command that has passed the review, a database connection tool, a device information tool or a device interaction tool is selected to perform task processing to complete the target subtask.
6. An electronic device, characterized in that: The electronic device includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing connection and communication between the processor and the memory. When the program is executed by the processor, the steps of the method described in any one of claims 1 to 4 are implemented.
7. A storage medium, wherein the storage medium is a computer-readable storage medium and is used for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any one of claims 1 to 4.
Citation Information
Patent Citations
Virtual expert analysis method and device based on big language model intention recognition
CN117931834A
Intelligent agent scheduling method, system and equipment based on large language model and medium
CN118132227A