Knowledge graph and vector retrieval enhancement-based photovoltaic field large model efficiency improvement method
By constructing a comprehensive knowledge graph and combining vector search technology, the problems of poor performance and redundant information in professional and complex fields in the application of photovoltaic field are solved, efficient information retrieval and reasoning are achieved, and accurate and relevant answers are provided.
Patent Information
- Application Number
- CN202411937284.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-05-13
- Estimated Expiration
- 2044-12-26
AI Technical Summary
The existing technology has problems such as poor performance in the professional and complex fields in the application of photovoltaics, answering redundant information that contains unrelated industries, lack of global correlation capabilities and logical connections.
By constructing a comprehensive knowledge graph that considers the spatiotemporal distribution characteristics and data timeliness in the photovoltaic field, and combining vector search technology, we can enhance the search and reasoning capabilities of large models in the photovoltaic field, and realize the knowledge graph fusion of time and space dimensions.
It improves the application effect of large models in the photovoltaic field, provides practical, comprehensive and accurate answers, can remove unrelated redundant information from the industry, has global correlation capabilities, and can reflect the logical connection between different information.
Smart Images

Figure CN119988639A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of photovoltaic technology, and specifically relates to a large model efficiency improvement method in the photovoltaic field based on knowledge graph and vector retrieval enhancement. Background Art
[0002] The existing general pre-trained large language model (abbreviated as large model) learns common language knowledge by pre-training on massive data, and has transfer learning and generalization capabilities on general tasks. However, it performs poorly in professional and complex fields and has problems with hallucination answers. When using the existing large model to search and ask questions for the photovoltaic industry, the answers obtained will contain redundant information irrelevant to the industry; the expert database retrieval enhancement technology RAG can retrieve information related to the input from the knowledge base and combine this information to enable the large language model to generate more accurate, relevant and rich answers, but the traditional RAG based on vector database lacks global association capabilities and cannot reflect the logical connection between information; knowledge graph technology is a technology used to organize and represent massive knowledge. It effectively represents complex information by constructing a graph structure of entities, relationships and attributes, but pure knowledge graphs focus on retrieval and have weak reasoning capabilities. Traditional power equipment knowledge graphs only consider equipment topology and monitoring results, ignoring the spatiotemporal distribution characteristics and data timeliness in the photovoltaic field. Summary of the invention
[0003] The present invention aims to address the deficiencies of the prior art and provides a large model efficiency improvement method in the photovoltaic field based on knowledge graph and vector retrieval enhancement, which takes into account the spatiotemporal distribution characteristics and data timeliness requirements in the photovoltaic field, realizes the fusion of knowledge graphs in the time dimension and the space dimension, has global association capabilities, and can reflect the logical connection between different information.
[0004] In order to achieve the above technical objectives, the present invention adopts the following technical solutions:
[0005] A large-scale model efficiency improvement method in the photovoltaic field based on knowledge graph and vector retrieval enhancement, including knowledge graph construction process and retrieval reasoning process;
[0006] The knowledge graph construction process is as follows: construct a photovoltaic field terminology library, eliminate ambiguity in photovoltaic industry data based on the photovoltaic field terminology library, and generate a photovoltaic field vector expert knowledge base based on the photovoltaic industry data that has eliminated ambiguity, extract photovoltaic information, and generate different knowledge graphs based on the large model according to the type of extracted photovoltaic information, and perform knowledge graph fusion processing on different knowledge graphs to generate a comprehensive knowledge graph in the photovoltaic field;
[0007] The retrieval reasoning process includes: performing vector retrieval based on user questions to obtain knowledge vectors, splicing the knowledge vectors with user questions to obtain prompt words for question enhancement processing, obtaining text-type questions and answers, and obtaining amplified and rewritten questions based on question enhancement processing; inputting the amplified and rewritten questions into the comprehensive knowledge graph in the photovoltaic field to obtain a recall graph, and deriving and analyzing prompt words based on the amplified and rewritten questions and the recall graph to obtain derivation results; performing historical question and answer recall, fusing text-type answers, derivation results, and historical question and answer recall, and obtaining polished results based on the fused text-type answers, derivation results, and historical question and answer recall.
[0008] Preferably, the extracted photovoltaic information includes site natural environment information, site equipment topology information and equipment status monitoring information. The site natural environment information is preprocessed and input into the large model to generate a spatial environment knowledge graph. The site equipment topology information is preprocessed and input into the large model to generate a site equipment topology knowledge graph. The equipment status monitoring information is preprocessed and input into the large model to generate an equipment status monitoring information knowledge graph. The spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph are fused to generate a comprehensive knowledge graph in the photovoltaic field.
[0009] Preferably, the specific steps of constructing the knowledge graph include:
[0010] S1. Use regular expressions to extract the term explanation items in the photovoltaic industry data and build a photovoltaic field term library;
[0011] S2. Based on the photovoltaic field special term library, natural language processing methods are used to eliminate the intersection ambiguity and combination ambiguity of photovoltaic industry data, and then the photovoltaic industry data is pre-processed to generate a photovoltaic field vector expert knowledge base;
[0012] S3. Based on the photovoltaic field terminology library, use natural language processing methods to eliminate the intersection ambiguity and combination ambiguity of the site natural environment information, site equipment topology information and equipment status monitoring information, pre-process the site natural environment information and input it into the large model to generate the spatial environment knowledge graph, pre-process the site equipment topology information and input it into the large model to generate the site equipment topology knowledge graph, pre-process the equipment status monitoring information and input it into the large model to generate the equipment status monitoring information knowledge graph;
[0013] S4. Perform knowledge graph fusion processing on the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to generate a comprehensive knowledge graph in the photovoltaic field.
[0014] Preferably, the specific steps of retrieval reasoning include:
[0015] P1. Perform text segmentation and encoding vector conversion on the user question to obtain the user question vector, input the user question vector into the photovoltaic field vector expert knowledge base, use the vector recall method to perform vector retrieval, and recall the knowledge vector with similarity higher than the threshold;
[0016] P2. Concatenate the recalled knowledge vector and the user question vector through key-value pairs to obtain prompt words for question enhancement processing;
[0017] P3. Input the prompt words for question enhancement processing into the text generation model to obtain text answers and obtain the expanded and rewritten questions;
[0018] P4. Perform entity extraction on the amplified and rewritten questions obtained in step P3 based on the photovoltaic field proper noun library, set the extracted entity as the question entity, input the question entity into the photovoltaic field comprehensive knowledge graph, use the graph recall method to perform knowledge graph recall, the recall can cover spatial information, batch information, verification record information or knowledge graphs that meet the depth limit, set the recalled knowledge graph as the recalled graph;
[0019] P5. Sort and filter the recall graph based on the set weights;
[0020] P6, integrating the information of the amplified and rewritten questions obtained in step P3 and the recall graph screened in step P5 to form the inference analysis prompt words;
[0021] P7. Input the derivation analysis prompt words into the logic derivation model to obtain the derivation results;
[0022] P8, record the expanded and rewritten questions, text-based answers and inference results, and build a historical dialogue repository;
[0023] P9. Input the expanded and rewritten questions into the historical dialogue repository, use the vector recall method and the graph recall method to recall the history of question and answer, and obtain the historical question and answer recall;
[0024] P10, the text answer obtained in step P3, the derivation result obtained in step P7, and the historical question and answer recall obtained in step P9 are distinguished and integrated in the form of key-value pairs to form a role answer prompt word;
[0025] P11. Input the character's answer prompt words into the character dialogue model to obtain the polished result, which is then reviewed and filtered by the character dialogue model and used as the diagnostic feedback result.
[0026] Preferably, in step S2, preprocessing of photovoltaic industry data includes text segmentation, encoding vector conversion, missing value correction, space processing, and denoising, text cleaning, stop word correction, and redundancy elimination based on a third-party library.
[0027] Preferably, in step S2,
[0028] The method for generating the vector expert knowledge base in the photovoltaic field is as follows:
[0029] Input the photovoltaic field proper noun library and pre-processed photovoltaic industry data into the language model according to a specific prompt word template, and then parse the language model output into entity recognition and relationship extraction, obtain the relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, and generate a photovoltaic field vector expert knowledge base;
[0030] or:
[0031] The photovoltaic field term library is input into the HMM hidden Markov model, and the probability of the proper nouns in the photovoltaic field term library appearing in the photovoltaic industry data is calculated through the forward algorithm, which is recorded as the probability of the observation sequence appearing. The hidden state sequence is obtained using the Viterbi algorithm, and the transfer probability matrix and the emission probability matrix are calculated through the probability of the observation sequence appearing and the hidden state sequence. The relationship model between the photovoltaic field term library and the preprocessed photovoltaic industry data is obtained, and the photovoltaic field vector expert knowledge base is generated.
[0032] Preferably, in step S3, preprocessing the natural environment information of the station specifically includes:
[0033] Extract and retain: Based on the IQR method, outliers of the natural environment information of the station are eliminated, and the natural environment information of the station is converted into the annual average trend through the sliding average method; the natural environment information of the station includes: geographical longitude and latitude information, topography and geological structure, state and elevation, hydrogeology, earthquake level and intensity, and meteorological data;
[0034] The preprocessed natural environment information of the station is input into the big model to generate a spatial environment knowledge graph. The weight of the spatial environment knowledge graph is the spatial weight. The spatial weight includes the spatial distance weight and the climate similarity distance weight. The spatial distance weight is obtained by calculating the Minkowski distance based on the longitude, latitude and elevation information. The climate similarity distance weight is obtained by calculating the Kendall rank correlation coefficient based on the annual curve of meteorological data.
[0035] Preferably, in step S3, preprocessing the site equipment topology information specifically includes:
[0036] Extract and retain the topological structure of the equipment in the station, the batch information of the equipment manufacturer, the primary system wiring information, the secondary system information, the grid-connected equipment and the booster station information, and record them as CIM structured information. Convert the CIM structured information into a triple form through the large model to obtain the topological structure of the station equipment. Extract and retain the engineering design and acceptance report, and record them as unstructured information. Convert the unstructured information into structured data through the OCR recognition method, and verify the topological structure of the station equipment through the structured data.
[0037] The site equipment topology structure is input into the big model to generate the site equipment topology knowledge graph. The weight of the site equipment topology knowledge graph is the topology weight. The topology weight includes the physical connection relationship weight and the theoretical connection relationship weight. Both the physical connection relationship weight and the theoretical connection relationship weight are preset values. The physical connection relationship weight is higher than the theoretical connection relationship weight.
[0038] Preferably, in step S3, preprocessing the equipment status monitoring information specifically includes:
[0039] Extract the factory inspection report and patrol inspection and random inspection report, convert the factory inspection report and patrol inspection and random inspection report into markdown format, retain the report inspection time, inspection equipment information, equipment status, inspection results, inspection accuracy and implementation standards in the factory inspection report and patrol inspection and random inspection report, and record them as equipment status monitoring information;
[0040] The equipment status monitoring information is input into the big model to generate the equipment status monitoring information knowledge graph. The weight of the equipment status monitoring information knowledge graph is the equipment status anomaly weight. The equipment status anomaly weight is obtained by calculating the time attenuation coefficient and the detection accuracy coefficient based on the reported detection time and detection accuracy.
[0041] Preferably, in step S4, the specific method of knowledge graph fusion processing is:
[0042] Through the big model, entity extraction is performed on the spatial environment knowledge graph, the station equipment topology knowledge graph and the equipment status monitoring information knowledge graph to obtain coding entities and name entities. The coding entities are fused through consistency association, and the name entities are fused by calculating the distance in the spatial vector, identifying the co-referential entities and the proxy entities.
[0043] Compared with the prior art, the beneficial effects of the present invention are:
[0044] (1) The present invention integrates the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to achieve the fusion of knowledge graphs in the time and space dimensions, improve the application effect of large models in the photovoltaic field, and provide strong support for front-line staff and leadership decision-making in a comprehensive and accurate manner.
[0045] (2) The present invention obtains text answers by inputting vector retrieval and amplification and rewriting of questions into a text generation model, screens and integrates information based on a set weight, and inputs the results into a logic deduction model to obtain deduction results, integrates historical question and answer recall, obtains role answers, and polishes them through a role dialogue model, so that the answers obtained by users are more targeted and accurate, and can remove redundant information irrelevant to the industry, have global association capabilities, and can reflect the logical connection between different information;
[0046] (3) The knowledge graph obtained by the present invention fully considers the spatiotemporal distribution characteristics and data timeliness of the photovoltaic industry, can effectively represent complex information, and combines the knowledge graph with text-based answers, so as to obtain the photovoltaic industry knowledge graph, derivation results and professional answers more quickly, providing better support for staff decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 A flow chart for constructing a knowledge graph for an embodiment of the present invention;
[0048] Figure 2 is a retrieval reasoning flow chart of an embodiment of the present invention;
[0049] Figure 3 This is an example diagram of the spatial environment knowledge graph of an embodiment of the present invention;
[0050] Figure 4 This is an example diagram of the site equipment topology knowledge graph of an embodiment of the present invention;
[0051] Figure 5 This is an example diagram of the equipment status monitoring information knowledge graph according to an embodiment of the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0053] Example 1
[0054] The embodiment of the present invention provides a photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement, including a knowledge graph construction process and a retrieval reasoning process;
[0055] The process of constructing the knowledge graph is as follows: extracting the term explanation entries in the photovoltaic industry data, constructing a photovoltaic field term library, eliminating the intersection ambiguity and combination ambiguity of photovoltaic industry data, site natural environment information, site equipment topology information and equipment status monitoring information based on the photovoltaic field term library, and generating a photovoltaic field vector expert knowledge base for the photovoltaic industry data, preprocessing the site natural environment information and inputting it into the large model to generate a spatial environment knowledge graph, preprocessing the site equipment topology information and inputting it into the large model to generate a site equipment topology knowledge graph, preprocessing the equipment status monitoring information and inputting it into the large model to generate an equipment status monitoring information knowledge graph, and performing knowledge graph fusion processing on the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to generate a comprehensive knowledge graph in the photovoltaic field;
[0056] The retrieval and reasoning process includes three parts: First, large-model text question answering based on vector retrieval and question enhancement, whose purpose is to "expand and rewrite the user's original spoken questions to make the text accurate, complete and standardized" and "answer from the perspective of text semantics", specifically: vector retrieval based on user questions to obtain knowledge vectors, concatenate knowledge vectors with user questions to obtain question enhancement processing prompts, and input question enhancement processing prompts into the text generation model to obtain text question answers and obtain expanded and rewritten questions; Second, large-model reasoning question answering based on knowledge graph enhancement, whose purpose is to use the real questions in user questions The first step is to retrieve the related information in the knowledge graph to support the large model to complete the logical reasoning task. Specifically, the amplified and rewritten questions are input into the comprehensive knowledge graph in the photovoltaic field to obtain the recall graph, and the amplified and rewritten questions and the recall graph are combined into the deduction analysis prompt words and input into the logical deduction model to obtain the deduction results; third, the large model role question and answer based on the historical question and answer recall is to build a dedicated role in the photovoltaic field and have the ability to understand long conversations. Specifically, historical question and answer recall is performed, and the text answers, deduction results, and historical question and answer recall are integrated, and input into the role dialogue model to obtain the polished results.
[0057] Specifically, industry materials include national standards, industry specifications, guidance manuals, standard interpretations and other documents in the photovoltaic field; the industry materials used in this example include: (1) National Standard Basic Terminology of Power Engineering (Draft for Comments); (2) GB2297-1989: Terminology of Solar Photovoltaic Energy System; (3) National Standard: Specification for Solar Resource Assessment of Photovoltaic Grid-connected Power Stations (Draft for Comments); (4) GD 001-2011: Technical Standard for Solar Power Generation Engineering: Method for Preparation of Photovoltaic Power Generation Engineering Planning Report (Trial); (5) GD 002-2011: Technical Standard for Solar Power Generation Engineering: Method for Preparation of Pre-Feasibility Study Report of Photovoltaic Power Generation Engineering (Trial); (6) GD 003-2011: Technical Standard for Solar Power Generation Projects: Method for Preparation of Feasibility Study Report for Photovoltaic Power Generation Projects (Trial Implementation)"; (7) Provisions for Preparation of Design Estimates and Fee Standards for Photovoltaic Power Generation Projects (Draft for Comments); (8) Quotas for Photovoltaic Power Generation Projects (Draft for Comments); (9) Fee Standards for Survey and Design of Photovoltaic Power Generation Projects (Draft for Comments); (10) NB / T32001-2012: Technical Specifications for Environmental Impact Assessment of Photovoltaic Power Stations; (11) NB / T32012-2013: Technical Specifications for Real-time Monitoring of Solar Energy Resources in Photovoltaic Power Stations; (12) GB 50797-2012: Design Specifications for Photovoltaic Power Stations; (13) GB 50794-2012: Construction Specifications for Photovoltaic Power Stations; (14) GB / T 50795-2012: Specifications for Construction Organization Design of Photovoltaic Power Generation Projects; (15) GB / T 50796-2012: Acceptance specification for photovoltaic power generation projects; (16) Energy industry standard: On-site component testing procedures for photovoltaic power stations (draft for comments); (17) GB / T 9535-1998: Design, appraisal and finalization of crystalline silicon photovoltaic modules for ground use; (18) DB13 / T 1289-2010: Crystalline silicon solar cell modules for ground use; (19) NB / T 32004-2013: Technical specifications for photovoltaic grid-connected inverters; (20) Energy industry standard: Technical requirements for efficiency testing of photovoltaic power station inverters (draft for comments); (21) Energy industry standard: Technical requirements for electromagnetic compatibility testing of photovoltaic power station inverters (draft for comments); (22) GB / T19964-2012: Technical regulations for photovoltaic power station access to power system; (23) GB / T 50866-2013: Design specifications for photovoltaic power station access to power system; (24) GB / T 29319-2012: Technical regulations for photovoltaic power generation system access to distribution network; (25) NB / T32013-2013: Voltage and frequency response test procedures for photovoltaic power stations; (26) NB / T 32014-2013: Technical regulations for anti-islanding test of photovoltaic power stations; (27) GB / T 30152-2013: Test procedures for photovoltaic power generation system access to distribution network;(28) National Standard: Grid-connected Photovoltaic Power Station Inspection Procedure (Draft for Comments); (29) National Standard: Technical Specification for Grid-connected Photovoltaic Power Generation System Characteristics Evaluation (Draft for Review); (30) Energy Industry Standard: Grid-connected Performance Test and Evaluation Method for Photovoltaic Power Station (Draft for Review); (31) National Standard: Technical Specification for Start-up Acceptance of Grid-connected Photovoltaic Power Station (Draft for Comments); (32) Energy Industry Standard: Technical Specification for Photovoltaic Power Generation Dispatch (Draft for Review); (33) National Standard: Guidelines for Photovoltaic Power Generation System Modeling (Draft for Comments); (34) National Standard: Regulations for Photovoltaic Power Generation System Model and Parameter Testing (Draft for Comments); (35) Energy Industry Standard: Technical Specification for Post-evaluation of Photovoltaic Power Station (Draft for Comments); (36) GB / T 29321-2012: Technical Specification for Reactive Power Compensation of Photovoltaic Power Stations; (37) JGJ203:2010: Technical Specification for Application of Solar Photovoltaic Systems in Civil Buildings, (38) DB11 / T 881-2012: Design specification for building solar photovoltaic systems; (39) JGJ / T264-2012: Operation and maintenance specification for photovoltaic building integrated systems;
[0058] The natural environment information of the station includes the natural condition data of the station area, the feasibility study report of the project, etc. The natural environment information of the station is obtained from the "Resource Analysis" chapter of the feasibility study report first, and is supplemented by the information of the national ground meteorological observation station. The data of the national ground meteorological observation station is obtained in the following two ways: Method 1, first refer to the "Observation Station Information Table" to determine the nearest station around the station, and then query the historical hourly observation data through the "Multi-point Time Interval Multi-element Query Interface"; Method 2, query according to the longitude and latitude of the station area through the "Data Rectangular Area Range Query Interface";
[0059] The site equipment topology information includes CIM structured equipment information, engineering design and acceptance report, etc. The photovoltaic site equipment involves the extended model of the CIM model. It is necessary to obtain the five categories of the extended model: Core package, Wires package, Topology package, LoadModel package, and Meas package. In the engineering design and acceptance report, focus on the primary wiring diagram and other information;
[0060] Equipment status monitoring information includes factory inspection reports, patrol inspections and random inspection reports. This information should be obtained according to a unified format standard template.
[0061] Example 2
[0062] Based on Example 1, in this example, combined with Figure 1 As shown in the figure, the specific steps of knowledge graph construction include:
[0063] S1. Use regular expressions to extract the term explanation items in the photovoltaic industry data. At the same time, with the assistance of expert manual correction, build a photovoltaic field special term library to eliminate intersectional ambiguity and combinational ambiguity;
[0064] For example, the terms "photovoltaic module", "photovoltaic module string", "photovoltaic power generation unit" and so on are extracted from the terms in Section 2.1 of Chapter 2, Terms and Symbols of GB 50797-2012, Design Specifications for Photovoltaic Power Stations.
[0065] S2. Based on the photovoltaic field special term library, natural language processing methods are used to eliminate the intersection ambiguity and combination ambiguity of photovoltaic industry data, and then the photovoltaic industry data is pre-processed to generate a photovoltaic field vector expert knowledge base;
[0066] S3. Based on the photovoltaic field terminology library, use natural language processing methods to eliminate the intersection ambiguity and combination ambiguity of the site natural environment information, site equipment topology information and equipment status monitoring information, pre-process the site natural environment information and input it into the large model to generate the spatial environment knowledge graph, pre-process the site equipment topology information and input it into the large model to generate the site equipment topology knowledge graph, pre-process the equipment status monitoring information and input it into the large model to generate the equipment status monitoring information knowledge graph;
[0067] S4. Perform knowledge graph fusion processing on the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to generate a comprehensive knowledge graph in the photovoltaic field.
[0068] By integrating the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph, the knowledge graph fusion of the time dimension and the space dimension is realized, which improves the application effect of large models in the photovoltaic field. It is meaningful, comprehensive and accurate, and provides strong support for the decision-making of front-line staff and leaders.
[0069] Combination Figure 2 As shown in Figure 1, the specific steps of retrieval reasoning include:
[0070] P1. Perform text segmentation and encoding vector conversion on the user question to obtain the user question vector, input the user question vector into the photovoltaic field vector expert knowledge base, use the vector recall method to perform vector retrieval (such as using the chroma DB vector retrieval method), and recall the knowledge vector with a similarity higher than the threshold; specifically, text segmentation can be implemented using the auto_tokenizer method in huggingface, encoding vector conversion can be implemented using openai.embeding_3, and the faiss vector library is preferred for vector library storage;
[0071] P2. Concatenate the recalled knowledge vector and the user question vector through key-value pairs to obtain prompt words for question enhancement processing;
[0072] P3. Input the prompt words for question enhancement processing into the text generation model to obtain text answers and obtain the expanded and rewritten questions. Specifically, the text generation model can use Chinese-LLaMA-Alapha.
[0073] P4. Perform entity extraction on the amplified and rewritten questions obtained in step P3 based on the photovoltaic field terminology library. Set the extracted entity as the problem entity, input the problem entity into the photovoltaic field comprehensive knowledge graph, and use the graph recall method to recall the knowledge graph. The recall can cover spatial information, batch information, verification record information, or a knowledge graph that meets the depth limit. Set the recalled knowledge graph as the recall graph; specifically, if the "problem entity" does not exist in the knowledge graph, return empty and skip the current step. Otherwise, perform multiple rounds of searches with a depth of N = 2 based on the current problem entity until the search results completely cover the three types of information: spatial information, batch information, and verification record information, or meet the depth limit, where the maximum depth does not exceed M, M = 10;
[0074] P5. Sort and filter the recall graph based on the set weights, retain the parts with high relevance and importance, and record them as the filter graph;
[0075] P6, integrating the information of the amplified and rewritten questions obtained in step P3 and the recall graph screened in step P5 to form the inference analysis prompt words;
[0076] P7. Input the derivation analysis prompt words into the logic derivation model. Specifically, the logic derivation model can use panda-LLaMa-65b to obtain the derivation results.
[0077] P8. Record the expanded and rewritten questions, text answers, and derivation results to build a historical conversation repository. Specifically, the recorded expanded and rewritten questions, text answers, and derivation results can be entered into an Elasticsearch database to build a historical conversation repository.
[0078] P9. Input the expanded and rewritten questions into the historical dialogue repository, use the vector recall method and the graph recall method to recall the history of question and answer, and obtain the historical question and answer recall;
[0079] P10, the text answer obtained in step P3, the derivation result obtained in step P7, and the historical question and answer recall obtained in step P9 are distinguished and integrated in the form of key-value pairs to form a role answer prompt word;
[0080] P11. Input the role answer prompt words into the role dialogue model to obtain the polished result, which is reviewed and filtered by the role dialogue model as the diagnostic feedback result. Specifically, the role dialogue model can use GLM-4-9b.
[0081] Through vector retrieval and question amplification and rewriting, the questions are input into the text generation model to obtain text answers. The recall graph is screened and information is integrated based on the set weights, and then input into the logic deduction model to obtain the deduction results. The historical question and answer recall is integrated to obtain the role answer, which is then polished by the role dialogue model. This makes the answers obtained by users more targeted and accurate, removes redundant information irrelevant to the industry, has global association capabilities, and can reflect the logical connection between different information.
[0082] The acquired knowledge graph fully considers the spatiotemporal distribution characteristics and data timeliness of the photovoltaic industry, can effectively represent complex information, and combines the knowledge graph with text-based answers, which can more quickly derive the photovoltaic industry knowledge graph, derivation results and professional answers, and provide better support for staff decision-making.
[0083] Example 3
[0084] Based on Examples 1 and 2, in this embodiment, in step S2, the preprocessing of the photovoltaic industry data includes text segmentation, encoding vector conversion, missing value correction, space processing, and denoising, text cleaning, stop word correction, and redundancy elimination based on a third-party library. Specifically, the third-party library can use jieba, re, beautifulsoup, SnowNLP, etc.;
[0085] Furthermore, the method for generating the photovoltaic field vector expert knowledge base is as follows:
[0086] Input the photovoltaic field proper noun library and pre-processed photovoltaic industry data into the language model according to a specific prompt word template, and then parse the language model output into entity recognition and relationship extraction, obtain the relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, and generate a photovoltaic field vector expert knowledge base;
[0087] The method for generating the photovoltaic field vector expert knowledge base can also be:
[0088] Input the photovoltaic field proper noun library into the HMM hidden Markov model, calculate the probability of the proper nouns in the photovoltaic field proper noun library appearing in the photovoltaic industry data through the forward algorithm, record it as the probability of the observation sequence appearing, use the Viterbi algorithm to obtain the hidden state sequence, calculate the transfer probability matrix and the emission probability matrix through the probability of the observation sequence appearing and the hidden state sequence, and obtain the relationship model between the photovoltaic field proper noun library and the preprocessed photovoltaic industry data, and generate the photovoltaic field vector expert knowledge base;
[0089] Example 4
[0090] Based on embodiments 1, 2 and 3, in this embodiment, in step S3, the preprocessing of the natural environment information of the station specifically includes:
[0091] Extract and retain: geographical longitude and latitude information, topography and geological structure, status and elevation, hydrogeology, earthquake level and intensity, meteorological data (such as temperature, rain, snow, wind, sandstorm and lightning, etc.), and record them as station natural environment information; remove outliers of station natural environment information based on IQR method, and convert it into annual average trend of station natural environment information through sliding average method;
[0092] The pre-processed natural environment information of the station is input into the large model to generate a spatial environment knowledge graph, such as Figure 3 As shown in the figure, an example of the generated spatial environment knowledge graph is given. The weight of the spatial environment knowledge graph is the spatial weight, which includes the spatial distance weight and the climate similarity distance weight.
[0093] The spatial distance weight is calculated based on the longitude, latitude and elevation information. The Minkowski distance is obtained. Specifically, for two points A (x1, x2, x3) and B (y1, y2, y3), the calculation method is as follows:
[0094]
[0095] Among them, d(A,B) represents the Minkowski distance, x i Represents the horizontal axis, y i represents the ordinate, and P represents the distance metric parameter;
[0096] The climate similarity distance weight is calculated based on the Kendall rank correlation coefficient of the annual curve of meteorological data. Specifically:
[0097] Select two meteorological data sets,
[0098]
[0099] Among them, “number of concordant pairs” represents the number of point pairs with consistent ranking order in the two data sets, “number of disconcordant pairs” represents the number of point pairs with inconsistent ranking order in the two data sets, and n represents the number of data in the data sets.
[0100] Furthermore, the preprocessing of the site equipment topology information specifically includes:
[0101] Extract and retain the in-station equipment topology, equipment manufacturer batch information, primary system wiring information, secondary system information, grid-connected equipment and booster station information, and record them as CIM structured information. Use the big model to convert the CIM structured information into a triple form (entity 1, relationship, entity 2), such as (PV module001, composition, PV string modulestring101), to obtain the site equipment topology. Extract and retain the engineering design and acceptance report, and record them as unstructured information. Use the OCR recognition method to convert the unstructured information into structured data. Specifically, the primary wiring diagram involved in the engineering design and acceptance report can be converted into structured data through the OCR recognition method, and then the unstructured information such as engineering design and acceptance report can be converted into structured data, and the site equipment topology can be verified through the structured data.
[0102] Input the site equipment topology structure into the big model to generate the site equipment topology knowledge graph, such as Figure 4 As shown, an example is given for the site equipment topology knowledge graph. The weight of the site equipment topology knowledge graph is the topology weight. The topology weight includes the physical connection relationship weight and the theoretical connection relationship weight. Both the physical connection relationship weight and the theoretical connection relationship weight are preset values. The physical connection relationship weight is higher than the theoretical connection relationship weight. The physical connection relationship weight includes the series connection relationship between photovoltaic modules and the collection relationship between photovoltaic strings and DC combiner boxes; the theoretical connection relationship weight includes the inclusion relationship between batches and entities, and the composition relationship between power generation elements and various parts. Specifically, the physical connection relationship weight can be set to 0.8, and the theoretical connection relationship weight can be set to 0.4.
[0103] Furthermore, the preprocessing of the equipment status monitoring information specifically includes:
[0104] Extract the factory inspection report and patrol inspection and random inspection report, convert the factory inspection report and patrol inspection and random inspection report (the factory inspection report and patrol inspection and random inspection report are generally in PDF format) into markdown format, extract the key information of the report template setting position, retain the report inspection time, inspection equipment information, equipment status, inspection results, inspection accuracy and implementation standards in the factory inspection report and patrol inspection and random inspection report, and record them as equipment status monitoring information;
[0105] Input the equipment status monitoring information into the big model to generate the equipment status monitoring information knowledge graph, such as Figure 5 As shown in the figure, an example is given for the equipment status monitoring information knowledge graph. The weight of the equipment status monitoring information knowledge graph is the equipment status anomaly weight. The equipment status anomaly weight is obtained by calculating the time attenuation coefficient and the detection accuracy coefficient based on the report detection time and the detection accuracy. Considering that the recent detection report is closer to the current state of the equipment, the time attenuation coefficient is set to increase the importance of the report with the updated date. Specifically, the calculation formula of the time attenuation coefficient is:
[0106]
[0107] Among them, weight(t) represents the time attenuation coefficient, t represents the current time, t0 represents the reference time, and λ is the attenuation coefficient.
[0108] Example 5
[0109] Based on embodiments 1, 2, 3 and 4, in this embodiment, the knowledge graph fusion part aims to fuse the three separate knowledge graphs of the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph, so as to realize that the same concept and equipment correspond to the same entity in the comprehensive graph. The specific method of knowledge graph fusion processing is as follows:
[0110] Through the big model, entity extraction is performed on the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to obtain coding entities and name entities. The coding entities are merged through consistency association. For example, the spatial environment knowledge graph and the site equipment topology knowledge graph are consistently associated through the power generation unit 501, and the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph are consistently associated through inverters 301 and inverters 302.
[0111] For name-type entities, the distance in the space vector is calculated to identify co-referential entities and proxy entities for fusion. For example, manufacturer 901 and manufacturer 909 are only different in the text entry expression. For example, "Dingsheng Electronics" and "Qingdao Dingsheng Electronics" are actually the same manufacturer and can be identified as co-referential entities through vector space distance.
[0112] Example 6
[0113] Based on embodiments 1, 2, 3, 4 and 5, in this embodiment, in step P3, the text generation model is Chinese-LLaMA-Alapha;
[0114] Furthermore, in step P5, the weights are set to be 30% for the spatial weight, 50% for the topological weight, and 60% for the abnormal device status weight;
[0115] The above three weights can be combined arbitrarily, and there are rewriting parts. They are not a complete set. Each weight is a constraint item for its own direction, and the sum is not equal to 1. For example, a phenomenon a must be within the range of 30% of spatial weight and 50% of topological weight. These three weights are searched independently, and the union of the results is taken.
[0116] Further, in step P7, the logical deduction class model is panda-LLaMa-65b;
[0117] Furthermore, in step P11, the character dialogue model is GLM-4-9b.
[0118] The above description is only an embodiment of the present invention and is not intended to limit the present invention. Any modification, equivalent replacement and improvement made within the application scope of the present invention shall be included in the protection scope of the present invention.
Claims
1. A photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement, characterized in that: Including knowledge graph construction process and retrieval reasoning process; The knowledge graph construction process is as follows: construct a photovoltaic field terminology library, eliminate ambiguity in photovoltaic industry data based on the photovoltaic field terminology library, and generate a photovoltaic field vector expert knowledge base based on the photovoltaic industry data that has eliminated ambiguity, extract photovoltaic information, and generate different knowledge graphs based on the large model according to the type of extracted photovoltaic information, and perform knowledge graph fusion processing on different knowledge graphs to generate a comprehensive knowledge graph in the photovoltaic field; The retrieval reasoning process includes: performing vector retrieval based on user questions to obtain knowledge vectors, splicing the knowledge vectors with user questions to obtain prompt words for question enhancement processing, obtaining text-type questions and answers, and obtaining amplified and rewritten questions based on question enhancement processing; inputting the amplified and rewritten questions into the comprehensive knowledge graph in the photovoltaic field to obtain a recall graph, and deriving and analyzing prompt words based on the amplified and rewritten questions and the recall graph to obtain derivation results; performing historical question and answer recall, fusing text-type answers, derivation results, and historical question and answer recall, and obtaining polished results based on the fused text-type answers, derivation results, and historical question and answer recall.
2. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 1 is characterized in that: The types of photovoltaic information extracted include site natural environment information, site equipment topology information and equipment status monitoring information. The site natural environment information is preprocessed and input into the large model to generate a spatial environment knowledge graph. The site equipment topology information is preprocessed and input into the large model to generate a site equipment topology knowledge graph. The equipment status monitoring information is preprocessed and input into the large model to generate an equipment status monitoring information knowledge graph. The spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph are fused to generate a comprehensive knowledge graph in the photovoltaic field.
3. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 2 is characterized in that: The specific steps of knowledge graph construction include: S1. Use regular expressions to extract the term explanation items in the photovoltaic industry data and build a photovoltaic field term library; S2. Based on the photovoltaic field special term library, natural language processing methods are used to eliminate the intersection ambiguity and combination ambiguity of photovoltaic industry data, and then the photovoltaic industry data is pre-processed to generate a photovoltaic field vector expert knowledge base; S3. Based on the photovoltaic field terminology library, use natural language processing methods to eliminate the intersection ambiguity and combination ambiguity of the site natural environment information, site equipment topology information and equipment status monitoring information, pre-process the site natural environment information and input it into the large model to generate the spatial environment knowledge graph, pre-process the site equipment topology information and input it into the large model to generate the site equipment topology knowledge graph, pre-process the equipment status monitoring information and input it into the large model to generate the equipment status monitoring information knowledge graph; S4. Perform knowledge graph fusion processing on the spatial environment knowledge graph, the site equipment topology knowledge graph and the equipment status monitoring information knowledge graph to generate a comprehensive knowledge graph in the photovoltaic field.
4. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 2 is characterized in that: The specific steps of retrieval reasoning include: P1. Perform text segmentation and encoding vector conversion on the user question to obtain the user question vector, input the user question vector into the photovoltaic field vector expert knowledge base, use the vector recall method to perform vector retrieval, and recall the knowledge vector with similarity higher than the threshold; P2. Concatenate the recalled knowledge vector and the user question vector through key-value pairs to obtain prompt words for question enhancement processing; P3. Input the prompt words for question enhancement processing into the text generation model to obtain text answers and obtain the expanded and rewritten questions; P4. Perform entity extraction on the amplified and rewritten questions obtained in step P3 based on the photovoltaic field proper noun library, set the extracted entity as the question entity, input the question entity into the photovoltaic field comprehensive knowledge graph, use the graph recall method to perform knowledge graph recall, the recall can cover spatial information, batch information, verification record information or knowledge graphs that meet the depth limit, set the recalled knowledge graph as the recalled graph; P5. Sort and filter the recall graph based on the set weights; P6, integrating the information of the amplified and rewritten questions obtained in step P3 and the recall graph screened in step P5 to form the inference analysis prompt words; P7. Input the derivation analysis prompt words into the logic derivation model to obtain the derivation results; P8, record the expanded and rewritten questions, text-based answers and inference results, and build a historical dialogue repository; P9. Input the expanded and rewritten questions into the historical dialogue repository, use the vector recall method and the graph recall method to recall the history of question and answer, and obtain the historical question and answer recall; P10, the text answer obtained in step P3, the derivation result obtained in step P7, and the historical question and answer recall obtained in step P9 are distinguished and integrated in the form of key-value pairs to form a role answer prompt word; P11. Input the character's answer prompt words into the character dialogue model to obtain the polished result, which is then reviewed and filtered by the character dialogue model and used as the diagnostic feedback result.
5. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 3 is characterized in that: In step S2, the preprocessing of photovoltaic industry data includes text segmentation, encoding vector conversion, missing value correction, space processing, as well as denoising, text cleaning, stop word correction, and redundancy elimination based on a third-party library.
6. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 5 is characterized in that: In step S2, The method for generating the vector expert knowledge base in the photovoltaic field is as follows: Input the photovoltaic field proper noun library and pre-processed photovoltaic industry data into the language model according to a specific prompt word template, and then parse the language model output into entity recognition and relationship extraction, obtain the relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, and generate a photovoltaic field vector expert knowledge base; or: The photovoltaic field term library is input into the HMM hidden Markov model, and the probability of the proper nouns in the photovoltaic field term library appearing in the photovoltaic industry data is calculated through the forward algorithm, which is recorded as the probability of the observation sequence appearing. The hidden state sequence is obtained using the Viterbi algorithm, and the transfer probability matrix and the emission probability matrix are calculated through the probability of the observation sequence appearing and the hidden state sequence. The relationship model between the photovoltaic field term library and the preprocessed photovoltaic industry data is obtained, and the photovoltaic field vector expert knowledge base is generated.
7. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 3 is characterized in that: In step S3, the preprocessing of the station natural environment information specifically includes: Extract and retain: Based on the IQR method, outliers of the natural environment information of the station are eliminated, and the natural environment information of the station is converted into the annual average trend through the sliding average method; the natural environment information of the station includes: geographical longitude and latitude information, topography and geological structure, state and elevation, hydrogeology, earthquake level and intensity, and meteorological data; The preprocessed natural environment information of the station is input into the big model to generate a spatial environment knowledge graph. The weight of the spatial environment knowledge graph is the spatial weight. The spatial weight includes the spatial distance weight and the climate similarity distance weight. The spatial distance weight is obtained by calculating the Minkowski distance based on the longitude, latitude and elevation information. The climate similarity distance weight is obtained by calculating the Kendall rank correlation coefficient based on the annual curve of meteorological data.
8. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 3 is characterized in that: In step S3, the preprocessing of the site equipment topology information specifically includes: Extract and retain the topological structure of the equipment in the station, the batch information of the equipment manufacturer, the primary system wiring information, the secondary system information, the grid-connected equipment and the booster station information, and record them as CIM structured information. Convert the CIM structured information into a triple form through the large model to obtain the topological structure of the station equipment. Extract and retain the engineering design and acceptance report, and record them as unstructured information. Convert the unstructured information into structured data through the OCR recognition method, and verify the topological structure of the station equipment through the structured data. The site equipment topology structure is input into the big model to generate the site equipment topology knowledge graph. The weight of the site equipment topology knowledge graph is the topology weight. The topology weight includes the physical connection relationship weight and the theoretical connection relationship weight. Both the physical connection relationship weight and the theoretical connection relationship weight are preset values. The physical connection relationship weight is higher than the theoretical connection relationship weight.
9. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 3 is characterized in that: In step S3, the preprocessing of the equipment status monitoring information specifically includes: Extract the factory inspection report and patrol inspection and random inspection report, convert the factory inspection report and patrol inspection and random inspection report into markdown format, retain the report inspection time, inspection equipment information, equipment status, inspection results, inspection accuracy and implementation standards in the factory inspection report and patrol inspection and random inspection report, and record them as equipment status monitoring information; The equipment status monitoring information is input into the big model to generate the equipment status monitoring information knowledge graph. The weight of the equipment status monitoring information knowledge graph is the equipment status anomaly weight. The equipment status anomaly weight is obtained by calculating the time attenuation coefficient and the detection accuracy coefficient based on the reported detection time and detection accuracy.
10. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 3 is characterized in that: In step S4, the specific method of knowledge graph fusion processing is: Through the big model, entity extraction is performed on the spatial environment knowledge graph, the station equipment topology knowledge graph and the equipment status monitoring information knowledge graph to obtain coding entities and name entities. The coding entities are fused through consistency association, and the name entities are fused by calculating the distance in the spatial vector, identifying the co-referential entities and the proxy entities.
Citation Information
Patent Citations
Government affair service field multi-strategy fusion dialogue method based on knowledge graph
CN116628172A
A ship test training scenario question and answer method, system, device and medium
CN118113855A
Customer service searching method and system based on intelligent large model
CN118296132A
Traditional Chinese medicine question-answering system construction method based on large language model and knowledge graph
CN118838996A
Large model knowledge question and answer optimization method based on semantic enhanced knowledge graph
CN118939779A
Cited By
Question answering method, optimization method, device and question answering system for photovoltaic cell experiment
CN120653740A
Question-and-answer methods, optimization methods, apparatus, and question-and-answer systems for photovoltaic cell experiments
CN120653740B
Domain information analysis method and system based on RAG and knowledge graph
CN121301391A
Open domain question and answer task processing method and comprehensive processing framework system
CN121766335A