Power equipment data analysis method, device and equipment based on multi-agent architecture
By adopting a multi-agent architecture in power equipment data analysis, and using the construction of censored agents and coding agents based on large language models, the problem that large language model generates code may misunderstand human intentions is solved, and more accurate and effective power equipment data analysis is achieved.
Patent Information
- Application Number
- CN202510032229.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-09
- Publication Date
- 2025-05-09
AI Technical Summary
In the prior art, the code generated by the large language model may lead to misunderstanding of human intentions due to insufficient context or vague expression, thereby generating codes that do not meet expectations, affecting the accuracy of power equipment data analysis.
A multi-agent architecture is adopted, including reviewing agents and coding agents, each agent is built on a large language model. By responding to analysis requests, the target analysis needs are determined, and the review agent is used to query matching frontal and negative cases from the case database, and these cases are used as inputs to the encoding agent to generate data analysis code corresponding to the target analysis needs.
By finding the positive and negative cases corresponding to the target analysis requirements, the coding agent can fully learn from historical cases when generating data analysis codes, improve the effectiveness and accuracy of the code, thereby ensuring the accuracy of the data analysis results of power equipment.
Smart Images

Figure CN119960732A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a method, device and equipment for analyzing power equipment data based on a multi-agent architecture. Background Art
[0002] As the scale and complexity of power systems continue to increase, the amount of data generated by power equipment is also growing dramatically. These data contain key information such as equipment operating status, performance parameters, fault records, etc., which are crucial for the safe, stable and efficient operation of power systems. In the current technical solutions, large language models are used to automatically generate code to analyze power equipment data. However, the above method may lead to misunderstanding of human intentions due to insufficient context or vague expression, thereby generating code that does not meet expectations. Therefore, how to improve the effectiveness of the code generated by the large language model and thus ensure the accuracy of the power equipment data analysis results has become a technical problem that needs to be solved urgently. Summary of the invention
[0003] The embodiments of the present application provide a method, apparatus and device for analyzing power equipment data based on a multi-agent architecture, which can improve the effectiveness of the code generated by the large language model to at least a certain extent, thereby ensuring the accuracy of the power equipment data analysis results.
[0004] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0005] According to one aspect of an embodiment of the present application, a method for analyzing power equipment data based on a multi-agent architecture is provided, wherein the multi-agent architecture includes a review agent and a coding agent, each of which is constructed based on a large language model;
[0006] The method comprises:
[0007] In response to an analysis request for power equipment data, determining a target analysis requirement;
[0008] Using the review agent to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements;
[0009] Taking the target analysis requirement, the positive case and the negative case as inputs of the coding agent, so that the coding agent outputs a data analysis code corresponding to the target analysis requirement;
[0010] The data analysis code is executed to perform data analysis on the power equipment data to be analyzed to obtain data analysis results.
[0011] According to one aspect of an embodiment of the present application, there is provided a power equipment data analysis device based on a multi-agent architecture, wherein the multi-agent architecture includes a review agent and a coding agent, each of which is constructed based on a large language model;
[0012] The device comprises:
[0013] A determination module, configured to determine a target analysis requirement in response to an analysis request for power equipment data;
[0014] A query module, used to use the review agent to query the positive cases and negative cases whose historical analysis requirements match the target analysis requirements from the case database;
[0015] A generating module, used for taking the target analysis requirement, the positive case and the negative case as inputs of the coding agent, so that the coding agent outputs a data analysis code corresponding to the target analysis requirement;
[0016] The processing module is used to execute the data analysis code to perform data analysis on the power equipment data to be analyzed and obtain data analysis results.
[0017] According to one aspect of an embodiment of the present application, a computer-readable medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the power equipment data analysis method based on a multi-agent architecture as described in the above embodiment is implemented.
[0018] According to one aspect of an embodiment of the present application, an electronic device is provided, comprising: one or more processors; a storage device for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the power equipment data analysis method based on a multi-agent architecture as described in the above embodiments.
[0019] According to one aspect of an embodiment of the present application, a computer program product or a computer program is provided, the computer program product or the computer program including computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the power equipment data analysis method based on a multi-agent architecture provided in the above embodiment.
[0020] In the technical solutions provided in some embodiments of the present application, the multi-agent architecture includes a review agent and a coding agent, each of which is constructed based on a large language model, and determines the target analysis requirements by responding to the analysis request for the power equipment data, and uses the review agent to query the positive cases and negative cases that match the historical analysis requirements with the target analysis requirements from the case database, and then uses the target analysis requirements, positive cases and negative cases as inputs of the coding agent, so that the coding agent outputs the data analysis code corresponding to the target analysis requirements, and then executes the data analysis code to perform data analysis on the power equipment data to be analyzed to obtain the data analysis results. In this way, by finding the positive cases and negative cases corresponding to the target analysis requirements, the coding agent can fully draw on historical cases when generating the data analysis code, thereby improving the effectiveness of the generated data analysis code and ensuring the accuracy of the analysis results of the power equipment data.
[0021] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present application, and together with the specification, are used to explain the principles of the present application. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. In the drawings:
[0023] Figure 1 A schematic diagram of a process of a power equipment data analysis method based on a multi-agent architecture according to an embodiment of the present application is shown;
[0024] Figure 2 A block diagram of a power equipment data analysis device based on a multi-agent architecture according to an embodiment of the present application is shown;
[0025] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown. DETAILED DESCRIPTION
[0026] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this application will be more comprehensive and complete and fully convey the concept of the example embodiments to those skilled in the art.
[0027] In addition, described feature, structure or characteristic can be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present application. However, those skilled in the art will appreciate that the technical scheme of the present application can be put into practice without one or more of the specific details, or other methods, components, devices, steps, etc. can be adopted. In other cases, known methods, devices, realizations or operations are not shown or described in detail to avoid blurring the various aspects of the application.
[0028] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0029] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0030] Figure 1 A flow chart of a method for analyzing power equipment data based on a multi-agent architecture according to an embodiment of the present application is shown.
[0031] The multi-agent architecture includes review agents and coding agents, each of which is built based on a large language model (such as GPT-4, etc.). Specifically, the review agent is used to retrieve successful code examples (i.e., "positive cases" described later) and failed code cases (i.e., "negative cases" described later) that are closest to user requirements from the case database before the coding agent generates data analysis code. The coding agent can use the power of the large language model, combined with user requirements, successful code examples, and failed code examples, to create code that can perform specific data analysis tasks.
[0032] It should be noted that the method can be applied to a terminal device or a server, and the terminal device may include but is not limited to one or more of a smart phone, a tablet computer, a portable computer, and a desktop computer; the server may be a physical server or a cloud server.
[0033] The implementation details of the technical solution of the embodiment of the present application are described in detail below:
[0034] like Figure 1As shown, the power equipment data method based on the multi-agent architecture includes at least steps S110 to S140, which are described in detail as follows (the method is described below by taking the application of the method to a terminal device as an example, hereinafter referred to as "terminal"):
[0035] In step S110 , in response to an analysis request for electric power equipment data, a target analysis requirement is determined.
[0036] The power equipment data may be data related to various heavy equipment in the power system, which may be used for monitoring, maintenance, fault diagnosis, performance optimization, etc. In one example, the power equipment data may include but is not limited to:
[0037] Condition monitoring data: such as real-time monitoring data of the operating status, temperature, pressure, vibration, etc. of power equipment;
[0038] Performance parameters: such as efficiency, output power, voltage, current and other electrical parameters of power equipment;
[0039] Fault records: such as fault events, fault types, fault time, maintenance records, etc. in the history of power equipment;
[0040] Maintenance logs: such as records of regular inspection, maintenance and replacement of parts of electrical equipment;
[0041] Environmental data: such as temperature, humidity, pollution level and other environmental factors of the operating environment of power equipment;
[0042] Operation log: For example, the operation history of power equipment, including the start and stop time, operator, operation type, etc.;
[0043] Energy consumption data: For example, energy consumption records of power equipment in different time periods can be used to analyze energy efficiency and energy saving potential;
[0044] Video and image data: including images of equipment appearance and operating status obtained through video surveillance or thermal imaging technologies;
[0045] Sensor data: includes data collected from various sensors, such as temperature sensors, pressure sensors, current sensors, etc.
[0046] Geographic information: such as the geographical location, layout and surrounding environment information of power equipment.
[0047] In this embodiment, the embodiment of the present application may provide an analysis demand input interface, in which the user may input his own question, for example, the user may input "Please analyze whether the core data of XXX converter transformer in November 2024 is normal" in the demand input interface. The demand input interface may generate a corresponding analysis request according to the received question, and the terminal may parse and respond to the analysis request, thereby determining the target analysis demand corresponding to the user, for example, the terminal may segment the question input by the user, thereby determining the keywords in the question as the user's analysis demand.
[0048] In step S120, the review agent is used to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements.
[0049] Among them, the positive case is the successful code case where the corresponding historical analysis requirements match the current target analysis requirements. Similarly, the negative case is the failed code case where the corresponding historical analysis requirements match the current target analysis requirements.
[0050] In this embodiment, after determining the target analysis requirements of the user, the terminal can call the review agent to query the pre-built case database to determine the corresponding positive cases and negative cases. In one example, the review agent can provide an API interface for the coding agent to call to obtain case data.
[0051] In one example, the terminal can associate the analysis requirements corresponding to each data analysis, the generated data analysis code, and the corresponding code execution results and store them in a pre-built case database, thereby gradually enriching the amount of data in the case database. In this way, the case database D can be represented by the following model: Among them, p i is the i-th analysis requirement, c i is the data analysis code corresponding to the i-th analysis requirement, e i is the execution result (i.e. success or failure) of the data analysis code corresponding to the ith analysis requirement, and M is the total number of analysis requirements so far.
[0052] In one embodiment of the present application, the review agent is used to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements, including:
[0053] The review agent respectively calculates the similarity between the target analysis requirement and the historical analysis requirements of each historical code case in the case database;
[0054] The review agent selects a first predetermined number of historical code cases with the highest similarity from historical code cases with successful execution results as positive cases; and selects a second predetermined number of historical code cases with the highest similarity from historical code cases with failed execution results as negative cases.
[0055] In this embodiment, when querying positive cases and negative cases, the review agent can compare the target analysis requirements with the historical analysis requirements corresponding to each historical code case, determine the similarity between the two (such as cosine similarity or vector space model, etc.), and then select a first predetermined number of historical code cases with the highest similarity from the historical code cases with successful execution results as positive cases, and select a second predetermined number of historical code cases with the highest similarity from the historical code cases with failed execution results as negative cases.
[0056] It should be noted that the first predetermined number and the second predetermined number can be predetermined by those skilled in the art based on prior experience, and the first predetermined number and the second predetermined number can be the same or different. For example, the first predetermined number and the second predetermined number can both be 3, or the first predetermined number can be 1 and the second predetermined number can be 3, etc. The above numbers are only illustrative examples and are not particularly limited thereto.
[0057] In one example, the review agent can determine the similarity between the target analysis requirement and the historical analysis requirement according to the following formula:
[0058]
[0059] Among them, p new Analyze the needs for the target, i is the i-th historical analysis requirement, Φ(p) is the function that maps text p to a high-dimensional vector space (such as word embedding, etc.), and |||| represents the Euclidean norm of the orientation vector, that is, the square root of the sum of the squares of each component in the vector.
[0060] After determining the similarity between the target analysis requirement and each historical analysis requirement, the review agent can select a corresponding number of positive cases and negative cases from the historical code cases with successful and failed execution results respectively according to the similarity.
[0061] In one example, the case database can be divided into a successful case library and a failed case library in advance, and the historical code cases can be stored in the corresponding case library according to the different execution results. In the subsequent query process, if a positive case needs to be found, the review agent can only query in the successful case library. If a negative case needs to be found, the review agent can only query in the failed case library, thereby improving the query speed.
[0062] Please continue to refer to Figure 1 In step S130, the target analysis requirements, the positive cases and the negative cases are taken as inputs of the coding agent so that the coding agent outputs data analysis codes corresponding to the target analysis requirements.
[0063] In this embodiment, after the review agent determines the corresponding positive cases and negative cases, the terminal can call the coding agent to construct prompt words according to the target analysis requirements, positive cases and negative cases according to a predetermined template as input for the coding agent. In this way, when the coding agent generates the corresponding data analysis code according to the target analysis requirements, it can refer to the positive cases and negative cases to avoid known errors, thereby improving the quality of the generated data analysis code and reducing grammatical and logical errors.
[0064] In step S140, the data analysis code is executed to perform data analysis on the power equipment data to be analyzed to obtain a data analysis result.
[0065] In this embodiment, after the coding agent outputs the corresponding data analysis code, the terminal can execute the data analysis code to perform data analysis on the corresponding power equipment data to be analyzed, thereby obtaining the corresponding data analysis results. For example, if the user asks "Please analyze whether the core data of the XXX converter transformer in November 2024 is normal", the core data of the XXX converter transformer in November 2024 is the power equipment data to be analyzed. The terminal can obtain the power equipment data to be analyzed and execute the corresponding data analysis code to obtain the corresponding data analysis results.
[0066] It should be noted that the data analysis results can be presented in the form of text, or in the form of text combined with charts or simply charts, and there is no special limitation on this.
[0067] In this way, the power equipment data analysis method based on a multi-agent architecture provided in the embodiment of the present application improves the accuracy of code generation and the effectiveness of code execution through the cooperation between the review agent and the coding agent, wherein the coding agent focuses on code generation and the review agent provides historical cases and quality control.
[0068] In some embodiments of the present application, the multi-agent architecture further includes an evaluation agent, and the number of the encoding agents is multiple;
[0069] The target analysis requirement, the positive case and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including:
[0070] Taking the target analysis requirements, the positive cases and the negative cases as inputs of each coding agent, so that each coding agent outputs a candidate data analysis code corresponding to the target analysis requirements;
[0071] Before executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes:
[0072] The evaluation agent is used to evaluate the plurality of candidate data analysis codes, and based on the evaluation result, a target data analysis code is determined from the plurality of candidate data analysis codes to perform data analysis.
[0073] In this embodiment, the multi-agent architecture also includes an evaluation agent that can evaluate the data analysis code generated by the encoding agent to determine the quality and effectiveness of the data analysis code.
[0074] In addition, the number of coding agents can be multiple, for example, three. The terminal can use the target analysis requirements, positive cases, and negative cases as inputs of each coding agent, so that each coding agent generates a data analysis code (i.e., candidate data analysis code) corresponding to the target analysis requirements. It should be noted that since the coding agents are all run independently, the generated data analysis codes may be the same or different.
[0075] The evaluation agent can evaluate the candidate data analysis codes generated by multiple coding agents to determine the quality and effectiveness of each candidate data analysis code, and then select a candidate data analysis code with the highest quality and effectiveness as the target data analysis code for subsequent data analysis, thereby further ensuring the accuracy of the power equipment data analysis results.
[0076] In one embodiment, the evaluation agent is used to evaluate a plurality of candidate data analysis codes, including:
[0077] The evaluation agent calculates the functional matching degree, grammatical correctness and professional specification compliance of each candidate data analysis code according to predetermined rules;
[0078] An evaluation score corresponding to each of the candidate data analysis codes is determined based on the functional matching degree, grammatical correctness and professional specification compliance corresponding to each of the candidate data analysis codes, and the evaluation score is used to indicate the quality of the candidate data analysis code.
[0079] In this embodiment, the evaluation agent can evaluate the candidate data analysis code from three aspects: functional matching, grammatical correctness, and professional specification compliance. Among them, functional matching refers to the matching degree between the code implementation and the user's analysis requirements; grammatical correctness can indicate whether the syntax of the data analysis code is correct; professional specification compliance can be used to indicate whether the data analysis code conforms to the domain expertise and specifications.
[0080] In this way, the evaluation agent can combine the above three indicators to determine the evaluation score corresponding to each candidate data analysis code. The evaluation score can be used to indicate the quality of the candidate data analysis code. That is, the higher the evaluation score, the higher the quality of the candidate data analysis code, and the higher the possibility of selecting it for power equipment data analysis.
[0081] In one example, the evaluation agent can determine the evaluation score of each candidate data analysis code according to the following formula:
[0082] E(c)=w1f match (c,p new )+w2f syntax (c)+w3f domain (c)
[0083] Among them, w1, w2, w3 are weights, and w1+w2+w3=1, f match (c,p new ) is the functional matching degree between the candidate data analysis code c and the target analysis requirement pnew, f syntax (c) is the grammatical correctness of the candidate data analysis code c, f domain (c) is the professional specification compliance of candidate data analysis code c.
[0084] In one example, functional matching can be calculated by determining the correspondence between the analysis requirements and the actual functions provided by the code, such as by checking whether the data analysis code implements all the functions described in the requirements document, etc. Syntactic correctness can be determined by statically analyzing the code to find any syntax errors or potential programming problems, such as type mismatches, undeclared variables, etc. Professional specification compliance can be determined by checking whether the data analysis code follows the expertise and specifications of a specific field, such as complying with HIPAA regulations in medical software development, or following specific algorithms and calculation formulas in engineering software, etc.
[0085] In this way, by selecting the code that best meets the target analysis requirements and has the highest quality from multiple candidate data analysis codes, misunderstandings of human intentions can be reduced and the accuracy of subsequent data analysis results can be ensured.
[0086] In some embodiments of the present application, after executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes:
[0087] The data analysis code and its corresponding execution results and target analysis requirements are associated and stored in the case database.
[0088] In this embodiment, after executing the data analysis code, the terminal can determine the execution result of the data analysis code, that is, success or failure. The terminal can associate the data analysis code, the target analysis requirement and the execution result, and store them in the case database for subsequent query.
[0089] In some embodiments of the present application, the target analysis requirement, the positive case, and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including:
[0090] The target analysis requirements, the positive cases, the negative cases and pre-collected professional knowledge are used as inputs of the coding agent so that the coding agent outputs data analysis codes corresponding to the target analysis requirements.
[0091] In this embodiment, in order to make up for the lack of professional knowledge in the large language model, when constructing the input of the coding agent, in addition to the target analysis requirements, positive cases and negative cases, professional knowledge K can also be added to the prompt words. domain , so that the coding agent can refer to this professional knowledge when generating code, ensuring that the generated data analysis code complies with professional standards.
[0092] In some embodiments of the present application, after executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes:
[0093] In response to an evaluation request for the data analysis result, displaying an evaluation editing interface, the evaluation editing interface including a plurality of evaluation editing options;
[0094] Each agent is optimized according to the evaluation editing information received by the evaluation editing interface.
[0095] In this embodiment, the present application also provides an evaluation editing interface, through which the user can evaluate the data analysis results after obtaining the data analysis results. Specifically, the user can generate a corresponding evaluation request by clicking a specific area on the terminal display interface (such as a "result evaluation" button, etc.). The terminal can display an evaluation editing interface in the display interface according to the evaluation request, wherein the evaluation editing interface may include several evaluation editing options, such as a text input option, an evaluation score input option, etc. The user can enter an evaluation description or score for the code execution result through the several evaluation editing options.
[0096] The terminal can optimize each agent (including the review agent, the coding agent, and the evaluation agent) according to the evaluation editing information collected by the evaluation editing interface, thereby improving the performance of each agent. For example, the terminal can regularly analyze the user's evaluation data and adjust the parameters of the review agent and the coding agent.
[0097] In addition, if the user scores the data analysis results, the terminal can also associate the scoring data with the corresponding case and store it in the case database for subsequent query.
[0098] In one example, the case database may include an analysis requirement table, a code example table, an error information table, and a user feedback table, wherein the analysis requirement table is used to store the user's analysis requirement description, the code example table is used to store the corresponding code example, including correct or incorrect data analysis code, the error information table is used to store error information when the code execution fails, and the user feedback table is used to store the user's rating and evaluation. After the above tables are established, the analysis requirements, code examples, error information, and user feedback can be associated through foreign keys or indexes to facilitate retrieval and analysis.
[0099] The following describes an apparatus embodiment of the present application, which can be used to execute the power equipment data analysis method based on a multi-agent architecture in the above-mentioned embodiment of the present application. For details not disclosed in the apparatus embodiment of the present application, please refer to the above-mentioned embodiment of the power equipment data analysis method based on a multi-agent architecture in the present application.
[0100] Figure 2 A block diagram of an electric power equipment data analysis device based on a multi-agent architecture according to an embodiment of the present application is shown.
[0101] Reference Figure 2 As shown, according to an embodiment of the present application, a power equipment data analysis device based on a multi-agent architecture includes a review agent and an encoding agent, and each agent is constructed based on a large language model;
[0102] The device comprises:
[0103] A determination module, configured to determine a target analysis requirement in response to an analysis request for power equipment data;
[0104] A query module, used to use the review agent to query the positive cases and negative cases whose historical analysis requirements match the target analysis requirements from the case database;
[0105] A generating module, used for taking the target analysis requirement, the positive case and the negative case as inputs of the coding agent, so that the coding agent outputs a data analysis code corresponding to the target analysis requirement;
[0106] The processing module is used to execute the data analysis code to perform data analysis on the power equipment data to be analyzed and obtain data analysis results.
[0107] In one embodiment, the review agent is used to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements, including:
[0108] The review agent respectively calculates the similarity between the target analysis requirement and the historical analysis requirements of each historical code case in the case database;
[0109] The review agent selects a first predetermined number of historical code cases with the highest similarity from historical code cases with successful execution results as positive cases; and selects a second predetermined number of historical code cases with the highest similarity from historical code cases with failed execution results as negative cases.
[0110] In one embodiment, the multi-agent architecture further includes an evaluation agent, and the number of the encoding agents is multiple;
[0111] The target analysis requirement, the positive case and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including:
[0112] Taking the target analysis requirements, the positive cases and the negative cases as inputs of each coding agent, so that each coding agent outputs a candidate data analysis code corresponding to the target analysis requirements;
[0113] Before executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the processing module is further used to:
[0114] The evaluation agent is used to evaluate the plurality of candidate data analysis codes, and based on the evaluation result, a target data analysis code is determined from the plurality of candidate data analysis codes to perform data analysis.
[0115] In one embodiment, the evaluation agent is used to evaluate a plurality of candidate data analysis codes, including:
[0116] The evaluation agent calculates the functional matching degree, grammatical correctness and professional specification compliance of each candidate data analysis code according to predetermined rules;
[0117] An evaluation score corresponding to each of the candidate data analysis codes is determined based on the functional matching degree, grammatical correctness and professional specification compliance corresponding to each of the candidate data analysis codes, and the evaluation score is used to indicate the quality of the candidate data analysis code.
[0118] In one embodiment, after executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the processing module is further used to:
[0119] The data analysis code and its corresponding execution results and target analysis requirements are associated and stored in the case database.
[0120] In one embodiment, the target analysis requirement, the positive case, and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including:
[0121] The target analysis requirements, the positive cases, the negative cases and pre-collected professional knowledge are used as inputs of the coding agent so that the coding agent outputs data analysis codes corresponding to the target analysis requirements.
[0122] In one embodiment, after executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the processing module is further used to:
[0123] In response to an evaluation request for the data analysis result, displaying an evaluation editing interface, the evaluation editing interface including a plurality of evaluation editing options;
[0124] Each agent is optimized according to the evaluation editing information received by the evaluation editing interface.
[0125] Figure 3 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present application is shown.
[0126] It should be noted that Figure 3The computer system of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0127] like Figure 3 As shown, the computer system includes a central processing unit (CPU) 301, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage part 308 to the random access memory (RAM) 303, such as executing the method described in the above embodiment. In RAM 303, various programs and data required for system operation are also stored. CPU 301, ROM 302 and RAM 303 are connected to each other through bus 304. Input / output (I / O) interface 305 is also connected to bus 304.
[0128] The following components are connected to the I / O interface 305: an input section 306 including a keyboard, a mouse, etc.; an output section 307 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 308 including a hard disk, etc.; and a communication section 309 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 309 performs communication processing via a network such as the Internet. A drive 310 is also connected to the I / O interface 305 as needed. A removable medium 311, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 310 as needed so that a computer program read therefrom is installed into the storage section 308 as needed.
[0129] In particular, according to an embodiment of the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present application includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a computer program for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication section 309, and / or installed from a removable medium 311. When the computer program is executed by a central processing unit (CPU) 301, various functions defined in the system of the present application are executed.
[0130] It should be noted that the computer-readable medium shown in the embodiment of the present application may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM), a flash memory, an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present application, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by an instruction execution system, device or device or used in combination with it. In the present application, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a computer-readable computer program is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.
[0131] The flowchart and block diagram in the accompanying drawings illustrate the possible architecture, functions and operations of the system, method and computer program product according to various embodiments of the present application. Wherein, each box in the flowchart or block diagram can represent a module, a program segment, or a part of the code, and the above-mentioned module, program segment, or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0132] The units involved in the embodiments described in this application may be implemented by software or hardware, and the units described may also be set in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0133] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the above embodiment.
[0134] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0135] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the implementation methods of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a touch terminal, or a network device, etc.) to execute the method according to the implementation methods of the present application.
[0136] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the embodiments disclosed herein. The present application is intended to cover any variations, uses or adaptations of the present application, which follow the general principles of the present application and include common knowledge or customary technical means in the art that are not disclosed in the present application.
[0137] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims.
Claims
1. A method for analyzing power equipment data based on a multi-agent architecture, characterized in that: The multi-agent architecture includes a review agent and an encoding agent, each of which is built based on a large language model; The method comprises: In response to an analysis request for power equipment data, determining a target analysis requirement; Using the review agent to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements; Taking the target analysis requirement, the positive case and the negative case as inputs of the coding agent, so that the coding agent outputs a data analysis code corresponding to the target analysis requirement; The data analysis code is executed to perform data analysis on the power equipment data to be analyzed to obtain data analysis results.
2. The method according to claim 1, characterized in that The review agent is used to query the case database for positive cases and negative cases whose historical analysis requirements match the target analysis requirements, including: The review agent respectively calculates the similarity between the target analysis requirement and the historical analysis requirements of each historical code case in the case database; The review agent selects a first predetermined number of historical code cases with the highest similarity from historical code cases with successful execution results as positive cases; and selects a second predetermined number of historical code cases with the highest similarity from historical code cases with failed execution results as negative cases.
3. The method according to claim 1, characterized in that: The multi-agent architecture also includes an evaluation agent, and the number of the encoding agents is multiple; The target analysis requirement, the positive case and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including: Taking the target analysis requirements, the positive cases and the negative cases as inputs of each coding agent, so that each coding agent outputs a candidate data analysis code corresponding to the target analysis requirements; Before executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes: The evaluation agent is used to evaluate the plurality of candidate data analysis codes, and based on the evaluation result, a target data analysis code is determined from the plurality of candidate data analysis codes to perform data analysis.
4. The method according to claim 3, characterized in that Using the evaluation agent to evaluate a plurality of the candidate data analysis codes includes: The evaluation agent calculates the functional matching degree, grammatical correctness and professional specification compliance of each candidate data analysis code according to predetermined rules; An evaluation score corresponding to each of the candidate data analysis codes is determined based on the functional matching degree, grammatical correctness and professional specification compliance corresponding to each of the candidate data analysis codes, and the evaluation score is used to indicate the quality of the candidate data analysis code.
5. The method according to claim 1, characterized in that: After executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes: The data analysis code and its corresponding execution results and target analysis requirements are associated and stored in the case database.
6. The method according to claim 1, characterized in that The target analysis requirement, the positive case and the negative case are used as inputs of the coding agent so that the coding agent outputs a data analysis code corresponding to the target analysis requirement, including: The target analysis requirements, the positive cases, the negative cases and pre-collected professional knowledge are used as inputs of the coding agent so that the coding agent outputs data analysis codes corresponding to the target analysis requirements.
7. The method according to claim 1, characterized in that After executing the data analysis code to perform data analysis on the power equipment data to be analyzed and obtaining the data analysis results, the method further includes: In response to an evaluation request for the data analysis result, displaying an evaluation editing interface, the evaluation editing interface including a plurality of evaluation editing options; Each agent is optimized according to the evaluation editing information received by the evaluation editing interface.
8. A power equipment data analysis device based on a multi-agent architecture, characterized in that: The multi-agent architecture includes a review agent and an encoding agent, each of which is built based on a large language model; The device comprises: A determination module, configured to determine a target analysis requirement in response to an analysis request for power equipment data; A query module, used to use the review agent to query the positive cases and negative cases whose historical analysis requirements match the target analysis requirements from the case database; A generating module, used for taking the target analysis requirement, the positive case and the negative case as inputs of the coding agent, so that the coding agent outputs a data analysis code corresponding to the target analysis requirement; The processing module is used to execute the data analysis code to perform data analysis on the power equipment data to be analyzed and obtain data analysis results.
9. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the power equipment data analysis method based on a multi-agent architecture as described in any one of claims 1 to 7 is implemented.
10. An electronic device, characterized in that: include: one or more processors; A storage device for storing one or more programs, which, when executed by the one or more processors, enables the one or more processors to implement the power equipment data analysis method based on a multi-agent architecture as described in any one of claims 1 to 7.
Citation Information
Cited By
Intelligent code change recognition system, method and device based on large language model and medium
CN120596354A