A data intelligence-assisted analysis method, system, device and medium
By building an API repository and vector database, and combining a large language model and the BM25 algorithm, we have achieved efficient, flexible and accurate analysis of power grid equipment data, solving the problems of low efficiency and poor accuracy in existing technologies, and simplifying the operation process for business personnel.
Patent Information
- Application Number
- CN202510463354.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-14
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2045-04-14
AI Technical Summary
Existing data analysis methods for power grid equipment are inefficient, unable to handle massive amounts of data, produce inaccurate results, fail to uncover deeper information, and require highly skilled personnel, are complex to operate, and are difficult to adapt to the dynamic changes in the power grid equipment field.
We construct an API repository and API vector database, perform intelligent assisted analysis through semantic retrieval and large language models, recall input parameter enumeration values using the BM25 algorithm, encode APIs using a context-separated interactive fusion API retrieval algorithm, generate final conclusions, and visualize them.
It improves the efficiency and accuracy of data analysis, reduces the technical requirements for business personnel, enhances flexibility and readability, and can handle complex power grid equipment data query needs.
Smart Images

Figure CN120407603B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of power technology and relates to a data intelligent auxiliary analysis method, system, device and medium. Background Technology
[0002] In the management and operation of power grid equipment, personnel face massive amounts of power data and complex equipment operating conditions. Analyzing this data efficiently and accurately has become a significant challenge. Existing data analysis methods often have many shortcomings, severely restricting the decision-making efficiency and analytical capabilities of power grid equipment managers.
[0003] Traditional methods, such as manually organizing data and using tools like Excel for simple analysis, are not only inefficient but also unable to handle massive amounts of power grid equipment data. This often leads to inaccurate analysis results and makes it difficult to extract deeper information from the data. In equipment management, simple data statistics and visualization cannot effectively support critical tasks such as fault prediction and operational optimization.
[0004] SQL Queries: While SQL queries play a role in power grid equipment data analysis, they require a high level of technical expertise from business personnel, and many struggle to master SQL writing. Even with some SQL skills, complex query statements are prone to errors, potentially leading to incorrect analysis results and consequently impacting equipment maintenance decisions, fault diagnosis, and optimized scheduling strategies.
[0005] Using BI analytics tools: Business intelligence (BI) analytics tools offer graphical interfaces and diverse functionalities, enabling business personnel to perform a certain level of data analysis. However, BI tools typically require users to possess a certain level of professional knowledge, are complex to operate, and often cannot adapt to the dynamic changes in the power grid equipment field. Furthermore, BI tools often rely on specific data structures and database systems, lacking sufficient flexibility to meet the analytical needs of different power grid equipment and operating environments.
[0006] The limitations of these traditional methods and tools in power grid equipment management and analysis necessitate optimization through more intelligent and efficient analytical methods to improve the reliability, stability, and management efficiency of power grid equipment operation. Summary of the Invention
[0007] The purpose of this invention is to overcome the shortcomings of the prior art and provide a data intelligent auxiliary analysis method, system, device and medium, which have the characteristics of accurate analysis results and high flexibility.
[0008] To achieve the above objectives, the present invention adopts the following technical solution:
[0009] In a first aspect, the data intelligent auxiliary analysis method of the present invention includes:
[0010] To obtain the user's query question;
[0011] Based on the user's query, a semantic search is performed in the API vector database to obtain relevant API vectors;
[0012] The relevant API vectors obtained from semantic retrieval are associated with the API repository to obtain the APIs associated with the question;
[0013] Based on the API associated with the question, the final result of the query is obtained using a large language model.
[0014] A further improvement of the data intelligent assisted analysis method described in this invention lies in:
[0015] Furthermore, before performing semantic retrieval in the API vector database based on the user's query to obtain the API vector, the process further includes:
[0016] Build an API repository containing several APIs related to device management data analysis;
[0017] The input parameter enumeration values are retrieved based on the BM25 algorithm and used as an extension of the user's query question to complete the user's query question.
[0018] The API vector encoder in the context separation and interactive fusion API retrieval algorithm encodes the functional descriptions and parameter information of all APIs related to device management data analysis into API vectors, and constructs an API vector database through these API vectors.
[0019] Furthermore, the process of obtaining the final query result based on the API associated with the question and using a large language model is as follows:
[0020] Based on the API associated with the question, a first major model suggestion word is constructed. The first major model suggestion word is input into the large language model to obtain API parameter values. The API is then filled with API parameter values to obtain the API with filled parameters.
[0021] Execute the API after filling in the parameters to obtain the API query results;
[0022] Based on the API query results and the user's query question, a second major model suggestion word is constructed. This second major model suggestion word is then input into the large language model to obtain the final query result.
[0023] Furthermore, after obtaining the final conclusion of the query, the process also includes:
[0024] Call the chart visualization API to convert the final result of the query into a chart.
[0025] Secondly, the data intelligent auxiliary analysis system of the present invention includes:
[0026] The retrieval module is used to retrieve the questions queried by the user.
[0027] The semantic retrieval module is used to perform semantic retrieval in the API vector database based on the user's query to obtain relevant API vectors;
[0028] The association module is used to associate the relevant API vectors obtained from semantic retrieval with the API repository to obtain the API associated with the question;
[0029] The first query module is used to obtain the final query result based on the API associated with the question and using a large language model.
[0030] A further improvement of the data intelligent auxiliary analysis system described in this invention is that:
[0031] Furthermore, it also includes:
[0032] The first construction module is used to build an API repository, which contains several APIs related to device management data analysis.
[0033] The completion module is used to recall the input parameter enumeration values based on the BM25 algorithm, and use the input parameter enumeration values as an extension of the user's query question to complete the user's query question;
[0034] The second construction module is used in the API vector encoder of the context-separated interactive fusion API retrieval algorithm to encode the function descriptions and parameter information of all APIs related to device management data analysis into API vectors, and to build an API vector database through the API vectors.
[0035] Furthermore, the first query module includes:
[0036] The second query module is used to construct a first major model suggestion word based on the API associated with the question, input the first major model suggestion word into the large language model to obtain API parameter values, and fill the API with API parameter values to obtain the API with filled parameters.
[0037] The execution module is used to execute the API after the parameters are filled in, and obtain the results of the API query;
[0038] The third query module is used to construct a second major model suggestion word based on the API query results and the user's query question, and input the second major model suggestion word into the large language model to obtain the final query result.
[0039] Furthermore, it also includes:
[0040] The calling module is used to call the chart visualization API to convert the final result of the query into a chart.
[0041] Thirdly, the computer device of the present invention includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the data intelligent auxiliary analysis method.
[0042] Fourthly, the computer-readable storage medium of the present invention stores a computer program, which, when executed by a processor, implements the steps of the data intelligent auxiliary analysis method.
[0043] The present invention has the following beneficial effects:
[0044] In practical operation, the data intelligent auxiliary analysis method, system, device and medium described in this invention intelligently retrieves and associates APIs related to user query questions through the constructed power equipment management data analysis API repository and API vector database, thereby greatly improving the efficiency, flexibility and accuracy of data analysis, covering a wide range of query intents, and then using a large language model for querying, which is simple and convenient to operate, and the reasoning efficiency of the large language model is high. Attached Figure Description
[0045] The accompanying drawings, which form part of this specification, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute an undue limitation of the invention. In the drawings:
[0046] Figure 1 This is a flowchart of the method of the present invention;
[0047] Figure 2 This is a system structure diagram of the present invention;
[0048] Figure 3 This is a schematic diagram of the method of the present invention;
[0049] Figure 4 This is a flowchart illustrating the query and offline construction process of this invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] In the description of this invention, it should be understood that the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.
[0052] It should also be understood that the terminology used in this specification is for the purpose of describing particular embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.
[0053] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination and all possible combinations of one or more of the associated listed items, and includes such combinations. For example, A and / or B can represent three cases: A alone, A and B simultaneously, and B alone. Additionally, the character " / " in this invention generally indicates that the preceding and following objects have an "or" relationship.
[0054] It should be understood that although terms such as first, second, third, etc., may be used in the embodiments of the present invention to describe the preset range, these preset ranges should not be limited to these terms. These terms are only used to distinguish the preset ranges from one another. For example, without departing from the scope of the embodiments of the present invention, the first preset range may also be referred to as the second preset range, and similarly, the second preset range may also be referred to as the first preset range.
[0055] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments of the invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0057] The accompanying drawings illustrate various structural schematic diagrams according to embodiments disclosed in this invention. These drawings are not to scale, and some details have been enlarged for clarity, and some details may have been omitted. The shapes of the various regions and layers shown in the drawings, as well as their relative sizes and positional relationships, are merely exemplary and may deviate from reality due to manufacturing tolerances or technical limitations. Furthermore, those skilled in the art can design regions / layers with different shapes, sizes, and relative positions as needed.
[0058] Example 1
[0059] refer to Figure 1 , Figure 3 and Figure 4 The data intelligent assisted analysis method of the present invention includes the following steps:
[0060] 1) Build an API repository for power equipment management data analysis;
[0061] Using a power grid equipment management system, multiple API interfaces for querying the status values of power grid equipment are constructed. Each API interface includes a function name, function description, input parameters, output parameters, and an enumeration of input parameters. Finally, all APIs are organized into a structured API repository for power grid equipment queries. This query system supports efficient status query requests and can quickly respond to query needs from users or the system.
[0062] It should be noted that the input parameter enumeration values are mainly for long-tail entities in the cell values of the power grid equipment database. When these long-tail input parameter enumeration values appear in the user query, the model usually has difficulty retrieving the relevant API or filling the parameter slots. Therefore, the enumeration values of API input parameters are constructed in the API repository of power grid equipment queries to supplement more information for subsequent API retrieval and slot filling.
[0063] 2) Construct an API retrieval algorithm that separates context and integrates interaction;
[0064] 21) User query expansion;
[0065] In the field of power grid equipment, API input parameter enumeration values may contain a large number of long-tail entity classes related to power grid equipment. These enumeration values occur infrequently, so traditional training methods may not be sufficient for training them. In this case, the BM25 algorithm is used to recall relevant input parameters through input parameter enumeration values, thereby ensuring that the input parameters corresponding to dynamically updated long-tail entities in the power equipment scenario can be flexibly recalled, avoiding directly encoding all enumeration values into the API vector database. Specifically:
[0066]
[0067] Where, q i For the user query, the i-th token after Q-segmentation; PE represents the concatenated information of each long-tail entity enumeration value and its corresponding input parameter information; IDF(q i f(q) represents the inverse document frequency, which measures the importance of the token; i ,PE) represents q i The frequency of occurrence in PE; L represents the average length of all PEs; Recall(Q,PE) represents the recall score between user query Q and API parameter enumeration value PE.
[0068] 22) User queries encoder;
[0069] The user query Q and the recalled power grid equipment parameter enumeration value PE are each split into tokens based on BERT wordpieces. The user query information tokens are represented as q1, q2, ..., qn. Then, the input parameters (keys) and enumeration values (values) of the recalled enumeration parameters are split into token pairs, represented as follows:<pek0,pev0> ;<pek1,pev1> ,...,<pekn,pevn> All tokens are concatenated, and a special token [Q] is inserted after the starting token to indicate the start of the user query. After the user query ends, a token [QR] is inserted to indicate the start of the user query expansion. For each key-value pair of the recalled input parameters, a special token [PEK] is inserted to indicate the start of the recalled input parameter key, and a special token [PEV] is inserted to indicate the start of the recalled input parameter value. Finally, the tokens are input into the BERT deep transformer structure to obtain a set of embeddings as vector encodings of these tokens, specifically represented as follows:
[0070] E q:= BERT([Q],q0,q1,...,q n ,
[0071] [QR],[PEK],pek0,[PEV],pev0,...,[PEK],pek n [PEV], pev n )
[0072] 23) API encoder;
[0073] The API description information D and parameter information P are each segmented into tokens based on the BERT wordpiece. The API description information tokens are represented as d1, d2, ..., dn, and the API parameter information tokens are represented as p1, p2, ..., pn. The document encoder inserts a special token [D] after the initial BERT token to indicate the start of the API function description. After the API function description ends, a token [P] is inserted to indicate the start of the API parameters.
[0074] The token sequence is input into the BERT network, and then the embeddings corresponding to punctuation marks and API code symbols are removed to reduce the number of embedding vectors in each document. Finally, a set of API-encoded vectors is output, denoted as E. api ,Right now:
[0075] E api :=Filter(BERT([D],d0,d1,...,d n ,[P],p0,p1,...,p n ))
[0076] 24) Integrate user queries with API vector interactions;
[0077] Vector encoding of user query E q and API vector encoding E api Interactive fusion is performed, where I(q,a) represents the interaction between each query vector. Each vector representation of API is compared with E. api (1:N a The dot product is performed, and the result is used as the similarity score. The maximum similarity score is taken, and the final user query and API relevance score is a combination of the maximum cosine similarity scores, i.e.:
[0078]
[0079] 25) Construct the optimization objective function:
[0080] A batch of training samples {qk ,a + k ,a - k} k∈[1,n] It consists of n triples, where a + k To query q k API positive samples, a - k To query q k For the API negative samples, the optimization objective function L for model training is:
[0081]
[0082] Among them, y i The labels are 1 for positive sample pairs and 0 for negative sample pairs. i represents the Euclidean distance between sample pairs, and margin is a hyperparameter that constrains the minimum distance between negative sample pairs.
[0083] The model is fine-tuned using the aforementioned optimization objective function, optimizing the model's weights so that both the user query encoder and the API encoder take into account each other's contextual interactions.
[0084] The API encoder trained above performs offline encoding on all APIs in the API repository for power grid equipment queries, resulting in an API vector database for power grid equipment queries.
[0085] 3) Obtain the user's query question, search for input parameters and enumeration values in the API repository of power grid equipment query based on the BM25 algorithm, expand the user's query question, and then perform semantic retrieval based on the API vector database of power grid equipment query to obtain relevant API vectors.
[0086] 4) Based on the user's query, perform semantic retrieval on the API vector database for power grid equipment queries to obtain relevant APIs;
[0087]
[0088] Where E q E is a vector representation of a user query. api This is an API vector representation.
[0089] 5) API repository for querying related power grid equipment;
[0090] The retrieved API vectors are associated with the API repository for power grid equipment queries to obtain the APIs associated with the question.
[0091] 6) API slot filling and API call code generation for power grid equipment queries;
[0092] Based on the API's functional description, input parameters, user queries, and query extensions associated with the problem, a first major model suggestion word is constructed. The task description is API parameter slot filling and API call code generation. Then, the first major model suggestion word is input into the large language model to fill API parameter values and generate API call code.
[0093] 7) Call the API;
[0094] Execute the API after filling in the parameters to obtain the value or data list queried by the API.
[0095] 8) Generate a response;
[0096] Based on the API, the data values or data lists returned by the API query, and the user's query question, a second major model suggestion word is constructed. The second major model suggestion word is then input into the large language model to obtain the final query result.
[0097] 9) Visualize charts and graphs;
[0098] Call the chart visualization API to convert the API query results into charts.
[0099] This invention has the following characteristics:
[0100] This invention fully utilizes existing API resources in power grid equipment business scenarios by constructing an API repository and API vector database for power grid equipment data analysis. Furthermore, based on a large language model, this invention achieves intelligent parsing of user queries and rapid generation of data analysis results through semantic retrieval, API association, slot filling, API calls, and comprehensive response answers. In addition, this invention provides visualization chart functionality, transforming the queried data list into intuitive charts, further enhancing the readability and usability of data analysis. By enabling the parsing and API calls of complex data queries through natural language input, business personnel can complete data analysis tasks without needing SQL writing skills. Simultaneously, automatic calling of visualization APIs through task orchestration transforms query results into easily understandable chart formats, reducing the cumbersome operation of business intelligence (BI) tools and enhancing business personnel's understanding and application of data analysis results.
[0101] Compared to NL2SQL technology in the field of data intelligence assistance, the advantages of this invention are as follows: NL2SQL is typically limited to SQL queries in structured databases, exhibiting certain limitations when dealing with unstructured data, dynamic data, or complex business logic. In contrast, this invention, by calling a query API, can flexibly adapt to diverse data query needs and handle various underlying data sources, including unstructured and dynamic data. Furthermore, when dealing with complex queries or multi-table joins, NL2SQL needs to strictly adhere to SQL syntax and be highly compatible with the database structure, making the process of generating query statements more complex and challenging. In contrast, this invention, through API calls, encapsulates complex query logic within the API, eliminating the need to directly generate complex query statements and avoiding syntax and structure matching issues in SQL generation, thereby improving accuracy.
[0102] Due to the complexity of business operations in the power grid equipment sector, data analysis needs can be extremely complex, and the potential number of APIs can be enormous. Carrying all API description information could lead to the context exceeding the maximum allowed tokens of a large language model. This invention constructs an API vector database and retrieves APIs relevant to the user's query by searching the API repository. When the large language model performs text-to-API conversion, it only carries APIs relevant to the user's question. This significantly reduces the size of the context input to the large language model and improves its inference efficiency.
[0103] This invention proposes a context-separated interactive fusion mechanism: this mechanism, while maintaining the expressive power of deep language models, can independently pre-encode API information, thereby improving the model's performance in online queries. Through a dual-encoder architecture, user queries and API functional descriptions and parameters are encoded independently, ensuring that the query and API tokens are independent during the encoding process. Therefore, API encoding can be pre-processed and cached offline, while only the user query is encoded during querying, and similarity is calculated through vector interaction fusion, significantly improving the efficiency of online queries.
[0104] This invention, by combining the BM25 algorithm, recalls API input parameters and enumeration values of long-tail entity classes that may appear in user queries, and uses them as extensions to supplement the query context. In the power equipment field, user queries frequently involve API input parameter enumeration values of long-tail entity classes. However, due to the limited training data for these enumeration values, traditional retrieval models struggle to capture them effectively. Furthermore, the types of input parameter enumeration values in the power sector are numerous and often change with business needs, making direct encoding into an API vector database impractical. Therefore, a parameter enumeration value recall strategy based on the BM25 algorithm is designed. This strategy recalls relevant input parameter enumeration values during the query process as query extensions, thus ensuring both flexibility and completeness of query information.
[0105] Example 2
[0106] refer to Figure 2 The data intelligent auxiliary analysis system of the present invention includes:
[0107] The retrieval module is used to retrieve the questions queried by the user.
[0108] The semantic retrieval module is used to perform semantic retrieval in the API vector database based on the user's query to obtain relevant API vectors;
[0109] The association module is used to associate the relevant API vectors obtained from semantic retrieval with the API repository to obtain the API associated with the question;
[0110] The first query module is used to obtain the final query result based on the API associated with the question and using a large language model.
[0111] In this embodiment, the embodiment further includes:
[0112] The calling module is used to call the chart visualization API to convert the final result of the query into a chart.
[0113] This embodiment also includes:
[0114] The first construction module is used to build an API repository, which contains several APIs related to power equipment management data analysis.
[0115] The completion module is used to recall the input parameter enumeration values based on the BM25 algorithm, and use the input parameter enumeration values as an extension of the user's query question to complete the user's query question;
[0116] The second construction module is used to encode the function descriptions and parameter information of all APIs related to power equipment management data analysis into API vectors in the context-separated interactive fusion API retrieval algorithm, and to build an API vector database through the API vectors.
[0117] In this embodiment, the first query module includes:
[0118] The second query module is used to construct a first major model suggestion word based on the API associated with the question, input the first major model suggestion word into the large language model to obtain API parameter values, and fill the API with API parameter values to obtain the API with filled parameters.
[0119] The execution module is used to execute the API after the parameters are filled in, and obtain the results of the API query;
[0120] The third query module is used to construct a second major model suggestion word based on the API query results and the user's query question, and input the second major model suggestion word into the large language model to obtain the final query result.
[0121] The module division in this embodiment is illustrative and represents only one logical functional division. In actual implementation, other division methods may be used. Furthermore, the functional modules in each embodiment of this application can be integrated into a single processor, exist as separate physical entities, or be integrated into a single module. The integrated modules described above can be implemented in hardware or as software functional modules.
[0122] Example 3
[0123] A computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it implements the steps of the data intelligent auxiliary analysis method, including, for example,: obtaining a user query question; performing a semantic search in an API vector database based on the user query question to obtain relevant API vectors; associating the relevant API vectors obtained from the semantic search with an API repository to obtain APIs associated with the question; and using a large language model based on the APIs associated with the question to obtain the final query conclusion. The memory may include main memory, such as high-speed random access memory, and may also include non-volatile memory, such as at least one disk storage device. The processor, network interface, and memory are interconnected via an internal bus, which may be an industry-standard architecture bus, a peripheral component interconnection standard bus, an extended industry-standard architecture bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. The memory is used to store the program; specifically, the program may include program code, which includes computer operation instructions. The memory may include main memory and non-volatile memory, and provides instructions and data to the processor.
[0124] Example 4
[0125] A computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the data intelligent auxiliary analysis method. For example, the method includes: obtaining a user query question; performing a semantic search in an API vector database based on the user query question to obtain relevant API vectors; associating the relevant API vectors obtained through semantic search with an API repository to obtain APIs associated with the query question; and using a large language model based on the APIs associated with the query question to obtain a final query conclusion. Specifically, the computer-readable storage medium includes, but is not limited to, volatile memory and / or non-volatile memory. The volatile memory may include random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include read-only memory (ROM), hard disk, flash memory, optical disk, magnetic disk, etc.
[0126] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0127] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0128] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0129] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0130] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and disclosure of the invention. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of the invention are indicated by the following claims.
[0131] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of the invention is limited only by the appended claims.
[0132] The above description is merely a preferred embodiment of the present invention and does not constitute any limitation on the present invention. Any simple modifications, alterations, or equivalent structural changes made to the above embodiments based on the technical essence of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A data intelligent assisted analysis method, characterized in that, include: To obtain the user's query question; Based on the user's query, a semantic search is performed in the API vector database to obtain relevant API vectors; The relevant API vectors are associated with the API repository to obtain the APIs associated with the problem; Based on the API associated with the question, the final result of the query is obtained using a large language model; Before performing semantic retrieval in the API vector database based on the user's query to obtain relevant API vectors, the process further includes: Build an API repository containing several APIs related to power equipment management data analysis; Based on the BM25 algorithm, the input parameter enumeration values of long-tail entities of power grid equipment are recalled, and the input parameter enumeration values are used as an extension of the user's query question to complete the user's query question. User query encoder construction: The user query Q and the recalled power grid equipment parameter enumeration value PE are each split into tokens based on BERT wordpieces. The user query information tokens are represented as q1, q2, ..., qn. Then, the input parameters key and enumeration values of the recalled enumeration parameters are split into token pairs, represented as follows:<pek0,pev0> ;<pek1,pev1> ,...,<pekn,pevn> All tokens are concatenated, and a special token [Q] is inserted after the starting token to indicate the start of the user query. After the user query ends, a token [QR] is inserted to indicate the start of the user query expansion. For each key-value pair of the recalled input parameters, a special token [PEK] is inserted to indicate the start of the recalled input parameter key, and a special token [PEV] is inserted to indicate the start of the recalled input parameter value. Finally, the tokens are input into the BERT deep transformer structure to obtain a set of embeddings as vector encodings of these tokens, specifically represented as follows: API encoder build: The API description information D and parameter information P are divided into tokens based on the BERT wordpiece. The API description information tokens are represented as d1, d2, ..., dn, and the API parameter information tokens are represented as p1, p2, ..., pn. The document encoder inserts a special token [D] after the BERT start token to indicate the start of the API function description. After the API function description ends, a token [P] is inserted to indicate the start of the API parameters. The token sequence is input into the BERT network, and then the embedding corresponding to the punctuation and API code symbol is removed to reduce the number of embedding vectors of each document, and finally a set of API code vectors is output, denoted as That is: The user query encoder is used to encode user queries and extended query information, and the API encoder is used to encode API function descriptions and parameter information. Fine-tuning is performed based on training samples, using the following optimization objective function to optimize the model's weights, ensuring that both the user query encoder and API encoder consider each other's contextual interactions. A batch of training samples... It consists of n triples, where, For query API positive samples, For query For the API negative samples, the optimization objective function L for model training is: The API encoder is used to encode the APIs in the API repository offline to obtain API vectors, and an API vector database is built. A relevance score is calculated based on the query vector and the API vector in the API vector database. Semantic retrieval is then performed based on the relevance score to obtain the target API vector. The target API is obtained by associating the target API vector with the corresponding API. Construct the first large language model prompt word based on the target API, input it into the large language model, and obtain the API parameter values.
2. The data intelligent assisted analysis method according to claim 1, characterized in that, The process of obtaining the final query result based on the API associated with the question and using a large language model is as follows: Based on the API associated with the question, a first major model suggestion word is constructed. The first major model suggestion word is input into the large language model to obtain API parameter values. The API is then filled with the API parameter values to obtain the API with filled parameters. Execute the API after filling in the parameters to obtain the API query results; Based on the API query results and the user's query question, a second major model suggestion word is constructed. This second major model suggestion word is then input into the large language model to obtain the final query result.
3. The data intelligent assisted analysis method according to claim 2, characterized in that, After obtaining the final conclusion of the query, the following is also included: Call the chart visualization API to convert the API query results into charts.
4. A data intelligent auxiliary analysis system, characterized in that, include: The retrieval module is used to retrieve the questions queried by the user. The semantic retrieval module is used to perform semantic retrieval in the API vector database based on the user's query to obtain relevant API vectors; The association module is used to associate the relevant API vectors with the API repository to obtain the APIs associated with the question; The first query module is used to obtain the final query result based on the API associated with the question and using a large language model. Also includes: The first construction module is used to build an API repository, which contains several APIs related to power equipment management data analysis. The completion module is used to recall long-tail input parameter enumeration values based on the BM25 algorithm, and use the input parameter enumeration values as an extension of the user's query question to complete the user's query question. The second construction module is used to encode the function descriptions and parameter information of all APIs related to power equipment management data analysis into API vectors in the context-separated interactive fusion API retrieval algorithm, and to build an API vector database through the API vectors. User query encoder construction: The user query Q and the recalled power grid equipment parameter enumeration value PE are each split into tokens based on BERT wordpieces. The user query information tokens are represented as q1, q2, ..., qn. Then, the input parameters key and enumeration values of the recalled enumeration parameters are split into token pairs, represented as follows:<pek0,pev0> ;<pek1,pev1> ,...,<pekn,pevn> All tokens are concatenated, and a special token [Q] is inserted after the starting token to indicate the start of the user query. After the user query ends, a token [QR] is inserted to indicate the start of the user query expansion. For each key-value pair of the recalled input parameters, a special token [PEK] is inserted to indicate the start of the recalled input parameter key, and a special token [PEV] is inserted to indicate the start of the recalled input parameter value. Finally, the tokens are input into the BERT deep transformer structure to obtain a set of embeddings as vector encodings of these tokens, specifically represented as follows: API encoder build: The API description information D and parameter information P are divided into tokens based on the BERT wordpiece. The API description information tokens are represented as d1, d2, ..., dn, and the API parameter information tokens are represented as p1, p2, ..., pn. The document encoder inserts a special token [D] after the BERT start token to indicate the start of the API function description. After the API function description ends, a token [P] is inserted to indicate the start of the API parameters. The token sequence is input into the BERT network, and then the embeddings corresponding to punctuation marks and API code symbols are removed to reduce the number of embedding vectors in each document. Finally, a set of API-encoded vectors is output, represented as... ,Right now: The user query encoder is used to encode user queries and extended query information, and the API encoder is used to encode API function descriptions and parameter information. Fine-tuning is performed based on training samples, using the following optimization objective function to optimize the model's weights, ensuring that both the user query encoder and API encoder consider each other's contextual interactions. A batch of training samples... It consists of n triples, where, For query API positive samples, For query For the API negative samples, the optimization objective function L for model training is: The API encoder is used to encode the APIs in the API repository offline to obtain API vectors, and an API vector database is built. A relevance score is calculated based on the query vector and the API vector in the API vector database. Semantic retrieval is then performed based on the relevance score to obtain the target API vector. The target API is obtained by associating the target API vector with the corresponding API.
5. The data intelligent auxiliary analysis system according to claim 4, characterized in that, The first query module includes: The second query module is used to construct a first major model suggestion word based on the API associated with the question, input the first major model suggestion word into the large language model to obtain API parameter values, and fill the API with API parameter values to obtain the API with filled parameters. The execution module is used to execute the API after the parameters are filled in, and obtain the results of the API query; The third query module is used to construct a second major model suggestion word based on the API query results and the user's query question, and input the second major model suggestion word into the large language model to obtain the final query result.
6. The data intelligent auxiliary analysis system according to claim 5, characterized in that, Also includes: The calling module is used to call the chart visualization API and convert the API query results into charts.
7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the steps of the data intelligent assisted analysis method as described in any one of claims 1-3.
8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the data intelligent assisted analysis method as described in any one of claims 1-3.
Citation Information
Patent Citations
Question and answer prompt system, question and answer prompt method and device, library construction method and device and model training method and device
CN117648422A
Intelligent number asking method based on large language model
CN119646021A
