A large-scale model efficiency improvement method in the photovoltaic field based on knowledge graph and vector retrieval enhancement
By constructing a photovoltaic field terminology database and a vector expert knowledge base, combined with knowledge graph fusion and vector retrieval, the problems of redundant answers and insufficient correlation capabilities in large photovoltaic field models are solved, and accurate and globally correlated photovoltaic field large model applications are realized.
Patent Information
- Application Number
- CN202411937284.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-26
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2044-12-26
AI Technical Summary
Existing general pre-trained large language models perform poorly in complex professional fields when applied in the photovoltaic field. The answers contain redundant information irrelevant to the industry. Traditional RAG based on vector databases lacks global correlation capabilities, and the knowledge graph focuses on retrieval, ignoring the spatiotemporal distribution characteristics and data timeliness of the photovoltaic field.
By building a database of photovoltaic field-specific terms, eliminating ambiguity, generating a vector expert knowledge base, and combining it with knowledge graph fusion, we can achieve knowledge graph fusion in the time and space dimensions. By combining vector retrieval and question amplification, we can perform logical reasoning and historical question and answer recall to generate accurate and relevant answers.
It improves the application effect of large models in the photovoltaic field, provides targetedness and accuracy, removes redundant industry information, reflects the logical connection between information, and supports decision-making by front-line staff and leaders.
Smart Images

Figure CN119988639B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of photovoltaic technology, and specifically relates to a method for improving the efficiency of large models in the photovoltaic field based on knowledge graph and vector retrieval enhancement. Background Art
[0002] Existing general pre-trained large language models (abbreviated as large models) learn common language knowledge by pre-training on massive data, and have transfer learning and generalization capabilities for general tasks. However, they perform poorly in professional and complex fields and have problems with hallucination answers. When using existing large models to search and ask questions for the photovoltaic industry, the answers obtained will contain redundant information irrelevant to the industry; 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. However, traditional RAG based on vector databases 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 simple 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 existing technology and provides a photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement, which takes into account the spatiotemporal distribution characteristics and data timeliness requirements of the photovoltaic field, realizes the fusion of knowledge graphs in the time dimension and 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 the knowledge graph construction process and retrieval and reasoning process;
[0006] The knowledge graph construction process is as follows: constructing a photovoltaic field proper noun library, eliminating ambiguities in photovoltaic industry data based on the photovoltaic field proper noun library, generating a photovoltaic field vector expert knowledge base based on the eliminated ambiguities in photovoltaic industry data, extracting photovoltaic information, generating different knowledge graphs based on the large model for the type of extracted photovoltaic information, and fusing different knowledge graphs to generate a comprehensive photovoltaic field knowledge graph;
[0007] The retrieval and reasoning process includes: performing vector retrieval based on user questions to obtain knowledge vectors, concatenating 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 obtaining derivation results by deriving and analyzing prompt words based on the amplified and rewritten questions and the recall graph; 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 terminology entries in the photovoltaic industry data and build a photovoltaic field terminology database;
[0011] S2. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities in photovoltaic industry data. Then, the photovoltaic industry data is preprocessed to generate a photovoltaic field vector expert knowledge base.
[0012] S3. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities among the site's natural environment information, site equipment topology information, and equipment status monitoring information. The site's natural environment information is preprocessed and input into the large model to generate a spatial environment knowledge graph. The site's 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.
[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. Segment the user question into text and convert it into a coded vector to obtain the user question vector. Input the user question vector into the photovoltaic field vector expert knowledge base and use the vector recall method to perform vector retrieval and recall knowledge vectors with a similarity higher than a 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 question enhancement prompt words into the text generation model to obtain the text answer and the expanded and rewritten question;
[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, 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 recalled graph;
[0019] P5. Sort and filter the recall graph based on the set weights;
[0020] P6: Integrate the information of the expanded and rewritten questions obtained in step P3 and the recall map 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, and use the vector recall method and the graph recall method to recall the history of question and answer to 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 the role answer prompt words;
[0025] P11. Input the character's answer prompt words into the character dialogue model to obtain the polished results, which are then reviewed and filtered by the character dialogue model and used as diagnostic feedback results.
[0026] Preferably, in step S2, the 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 photovoltaic field vector expert knowledge base is as follows:
[0029] The photovoltaic field proper noun library and pre-processed photovoltaic industry data are input into the language model according to a specific prompt word template. The language model output is then parsed into entity recognition and relationship extraction to obtain a relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, thereby generating a photovoltaic field vector expert knowledge base.
[0030] or:
[0031] The photovoltaic field proper noun library is input into the HMM hidden Markov model. The probability of the proper nouns in the photovoltaic field proper noun 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 Viterbi algorithm is used to obtain the hidden state sequence. The transition 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 proper noun library and the preprocessed photovoltaic industry data is obtained, and the photovoltaic field vector expert knowledge base is generated.
[0032] Preferably, in step S3, the pre-processing of the station natural environment information specifically includes:
[0033] Extract and retain: Based on the IQR method, outliers in 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 latitude and longitude information, topography and geological structure, status and elevation, hydrogeology, earthquake level and intensity, and meteorological data;
[0034] The preprocessed natural environment information of the station is input into the large model to generate a spatial environment knowledge graph. The weight of the spatial environment knowledge graph is the spatial weight, which 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 latitude, longitude and elevation information, and 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 in-station equipment topology, equipment manufacturer batch information, primary system wiring information, secondary system information, grid-connected equipment, and booster station information, and record it as CIM structured information. Use the large model to convert the CIM structured information into triples to obtain the station equipment topology. Extract and retain the engineering design and acceptance reports, and record them as unstructured information. Use the OCR recognition method to convert the unstructured information into structured data, and use the structured data to verify the station equipment topology.
[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. The physical connection relationship weight and the theoretical connection relationship weight are both 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 factory inspection reports and patrol inspection and random inspection reports, convert them into markdown format, retain the inspection time, inspection equipment information, equipment status, inspection results, inspection accuracy and implementation standards reported in the factory inspection reports and patrol inspection and random inspection reports, 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 large 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-referencing entities and the proxy entities.
[0043] Compared with the prior art, the present invention has the following beneficial effects:
[0044] (1) This 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, thereby improving the application effect of large-scale models in the photovoltaic field. The results are meaningful, comprehensive, and accurate, providing strong support for front-line staff and leadership decision-making.
[0045] (2) The present invention obtains text answers by inputting vector retrieval and question amplification and rewriting into a text generation model, filters and integrates information based on a set weight, and inputs the results into a logic deduction model to obtain deduction results. The results are integrated with historical question and answer recall to obtain character answers, which are then polished by a character 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.
[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, which can more quickly derive the photovoltaic industry knowledge graph, derivation results and professional answers, providing better support for staff decision-making. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] Figure 1 Construct a flow chart for the knowledge graph of an embodiment of the present invention;
[0048] Figure 2 This 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 according to an embodiment of the present invention;
[0050] Figure 4 This is an example diagram of the site equipment topology knowledge graph according to 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 clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. 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 making creative efforts are within the scope of protection of the present invention.
[0053] Example 1
[0054] The embodiment of the present invention provides a large-scale model efficiency improvement method in the photovoltaic field based on knowledge graph and vector retrieval enhancement, including a knowledge graph construction process and a retrieval and reasoning process;
[0055] The knowledge graph construction process is as follows: extracting the term explanation entries from the photovoltaic industry data, building a photovoltaic field proprietary term library, eliminating the intersection and combination ambiguities of photovoltaic industry data, site natural environment information, site equipment topology information and equipment status monitoring information based on the photovoltaic field proprietary term library, and generating a photovoltaic field vector expert knowledge base for the photovoltaic industry data, pre-processing the site natural environment information and inputting it into the large model to generate a spatial environment knowledge graph, pre-processing the site equipment topology information and inputting it into the large model to generate a site equipment topology knowledge graph, pre-processing 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 consists of three parts: First, large-scale 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 the knowledge vectors with user questions to obtain question enhancement processing prompts, and input the question enhancement processing prompts into the text generation model to obtain text-based question answers and obtain expanded and rewritten questions; Second, large-scale reasoning question answering based on knowledge graph enhancement, whose purpose is to use the real-world information in user questions to answer 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: input the expanded and rewritten questions into the comprehensive knowledge graph of the photovoltaic field to obtain the recall graph, and combine the expanded and rewritten questions and the recall graph into deduction analysis prompt words and input them into the logical deduction model to obtain the deduction results; third, the large model role question and answer based on historical question and answer recall aims to build dedicated roles in the photovoltaic field and have the ability to understand long conversations. Specifically: perform historical question and answer recall, integrate text answers, deduction results, and historical question and answer recall, and input them into the role dialogue model to obtain the polished results.
[0057] Specifically, industry data include national standards, industry specifications, guidance manuals, standard interpretations and other documents in the photovoltaic field; the industry data used in this example include: (1) National Standard Basic Terminology of Electric Power Engineering (Draft for Comment); (2) GB2297-1989: Terminology of Solar Photovoltaic Energy Systems; (3) National Standard: Specification for Solar Resource Assessment of Photovoltaic Grid-Connected Power Stations (Draft for Comment); (4) GD 001-2011: Technical Standard for Solar Power Generation Engineering: Method for Preparation of Photovoltaic Power Generation Project 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 Project (Trial); (6) GD 003-2011: Technical Standard for Solar Power Generation Engineering: Method for Preparation of Feasibility Study Report for Photovoltaic Power Generation Project (Trial Implementation); (7) Provisions for Preparation of Design Estimates and Fee Standards for Photovoltaic Power Generation Projects (Draft for Comment); (8) Quotas for Photovoltaic Power Generation Project Estimates (Draft for Comment); (9) Fee Standards for Survey and Design of Photovoltaic Power Generation Projects (Draft for Comment); (10) NB / T32001-2012: Technical Specification for Environmental Impact Assessment of Photovoltaic Power Stations; (11) NB / T32012-2013: Technical Specification for Real-time Monitoring of Solar Energy Resources in Photovoltaic Power Stations; (12) GB 50797-2012: Design Specification for Photovoltaic Power Stations; (13) GB 50794-2012: Construction Specification for Photovoltaic Power Stations; (14) GB / T 50795-2012: Specification for Construction Organization Design of Photovoltaic Power Generation Projects; (15) GB / T 50796-2012: Specification for Acceptance of Photovoltaic Power Generation Projects; (16) Energy Industry Standard: Procedure for On-site Component Inspection of Photovoltaic Power Stations (Draft for Comment); (17) GB / T 9535-1998: Design, Approval and Type Approval of Crystalline Silicon Photovoltaic Modules for Terrestrial Use; (18) DB13 / T 1289-2010: Crystalline Silicon Solar Cell Modules for Terrestrial Use; (19) NB / T 32004-2013: Technical Specification for Grid-Connected Photovoltaic Power Generation Inverters; (20) Energy Industry Standard: Technical Requirements for Efficiency Testing of Photovoltaic Power Station Inverters (Draft for Comment); (21) Energy Industry Standard: Technical Requirements for Electromagnetic Compatibility Testing of Photovoltaic Power Station Inverters (Draft for Comment); (22) GB / T19964-2012: Technical Regulations for Connection of Photovoltaic Power Stations to Power Systems; (23) GB / T 50866-2013: Design Specification for Connection of Photovoltaic Power Stations to Power Systems; (24) GB / T 29319-2012: Technical regulations for the connection of photovoltaic power generation systems to distribution networks; (25) NB / T32013-2013: Test procedures for voltage and frequency response of photovoltaic power stations; (26) NB / T 32014-2013: Technical regulations for anti-islanding detection of photovoltaic power stations; (27) GB / T 30152-2013: Test procedures for the connection of photovoltaic power generation systems to distribution networks;(28) National Standard: Grid Connection Inspection Procedure for Photovoltaic Power Stations (Draft for Comment); (29) National Standard: Technical Specification for Grid-Connected Characteristics Evaluation of Photovoltaic Power Generation Systems (Draft for Review); (30) Energy Industry Standard: Grid-Connected Performance Testing and Evaluation Methods for Photovoltaic Power Stations (Draft for Review); (31) National Standard: Technical Specification for Start-up Acceptance of Grid-Connected Photovoltaic Power Stations (Draft for Comment); (32) Energy Industry Standard: Technical Specification for Photovoltaic Power Generation Dispatching (Draft for Review); (33) National Standard: Guidelines for Modeling Photovoltaic Power Generation Systems (Draft for Comment); (34) National Standard: Model and Parameter Testing Procedure for Photovoltaic Power Generation Systems (Draft for Comment); (35) Energy Industry Standard: Technical Specification for Post-Evaluation of Photovoltaic Power Stations (Draft for Comment); (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 Specifications for Building Solar Photovoltaic Systems; (39) JGJ / T264-2012: Operation and Maintenance Specifications for Photovoltaic Building Integrated Systems;
[0058] The natural environment information of the station includes the natural conditions data of the station area and the project feasibility study report. The natural environment information of the station is first obtained from the "Resource Analysis" section of the feasibility study report, and is supplemented by the information of national ground meteorological observation stations. There are two methods to obtain data of national ground meteorological observation stations: 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-factor Query Interface"; Method 2: Query according to the latitude and longitude of the station area through the "Data Rectangular Area Range Query Interface";
[0059] Site equipment topology information includes CIM structured equipment information, engineering design and acceptance reports, etc. PV site equipment involves an extended model of the CIM model. Five classes of this extended model must be obtained: the core package, wire package, topology package, load model package, and measurement package. In the engineering design and acceptance report, focus on information such as the primary wiring diagram.
[0060] Equipment status monitoring information includes factory inspection reports, patrol inspection 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 embodiment, combined with Figure 1 As shown in the figure, the specific steps of knowledge graph construction include:
[0063] S1. Use regular expressions to extract terminology entries from photovoltaic industry documents. Assisted by manual correction by experts, a photovoltaic field terminology database is constructed to eliminate intersectional and combinational ambiguities.
[0064] For example, the terms “photovoltaic module”, “photovoltaic module string”, and “photovoltaic power generation unit” are extracted from Section 2.1 of Chapter 2, Terms and Symbols of GB 50797-2012, Specifications for Design of Photovoltaic Power Stations.
[0065] S2. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities in photovoltaic industry data. Then, the photovoltaic industry data is preprocessed to generate a photovoltaic field vector expert knowledge base.
[0066] S3. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities among the site's natural environment information, site equipment topology information, and equipment status monitoring information. The site's natural environment information is preprocessed and input into the large model to generate a spatial environment knowledge graph. The site's 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.
[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 achieved, 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] Combine Figure 2 As shown in Figure 2, the specific steps of retrieval reasoning include:
[0070] P1. Segment the user question text and convert it into an encoding vector to obtain the user question vector. Input the user question vector into the photovoltaic field vector expert knowledge base and use a vector recall method (such as the Chromium DB vector retrieval method) to retrieve the vectors. Recall the knowledge vectors whose similarity exceeds the threshold. Specifically, text segmentation can be implemented using the auto_tokenizer method in huggingface, and encoding vector conversion can be implemented using openai.embeding_3. 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 question enhancement prompt words into the text generation model to obtain a text answer and obtain the expanded and rewritten question. Specifically, the text generation model can use Chinese-LLaMA-Alapha.
[0073] P4. Based on the photovoltaic field proper noun library, perform entity extraction on the amplified and rewritten questions obtained in step P3. Let the extracted entity be the question entity. Input the question 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. Let the recalled knowledge graph be the recall graph. Specifically, if the "question 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 question 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, retaining the parts with high relevance and importance, and record them as the filtered graph;
[0075] P6: Integrate the information of the expanded and rewritten questions obtained in step P3 and the recall map 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 inference results to build a historical conversation repository. Specifically, the recorded expanded and rewritten questions, text answers, and inference results can be entered into an Elasticsearch database to build the historical conversation repository.
[0078] P9. Input the expanded and rewritten questions into the historical dialogue repository, and use the vector recall method and the graph recall method to recall the history of question and answer to 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 the role answer prompt words;
[0080] 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 as the diagnostic feedback result. Specifically, the character 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 filtered and information is integrated based on the set weights. The result is input into the logic deduction model to obtain the deduction result. The historical question and answer recall is integrated to obtain the character answer. After being polished by the character dialogue model, the answer obtained by the user is more targeted and accurate. It can remove 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, providing 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 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] The photovoltaic field proper noun library and pre-processed photovoltaic industry data are input into the language model according to a specific prompt word template. The language model output is then parsed into entity recognition and relationship extraction to obtain a relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, thereby generating a photovoltaic field vector expert knowledge base.
[0087] The method for generating the photovoltaic field vector expert knowledge base can also be:
[0088] The photovoltaic field proper noun library is input into the HMM hidden Markov model. The probability of the proper nouns in the photovoltaic field proper noun library appearing in 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. The transition probability matrix and the emission probability matrix are calculated based on the probability of the observation sequence appearing and the hidden state sequence. The relationship model between the photovoltaic field proper noun library and the preprocessed photovoltaic industry data is obtained, and the photovoltaic field vector expert knowledge base is generated.
[0089] Example 4
[0090] Based on Examples 1, 2, and 3, in this embodiment, in step S3, the preprocessing of the station natural environment information 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, sandstorms and lightning, etc.), and record them as station natural environment information; use the IQR method to eliminate outliers in the station natural environment information, and convert it into annual average trend station natural environment information through the 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 Minkowski distance (MinkowskiDistance) of the latitude, longitude and elevation information. 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 Indicates the horizontal axis, y i represents the vertical coordinate, 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] Two meteorological data sets are selected.
[0098]
[0099] Among them, “number of concordant pairs” represents the number of point pairs with consistent ranking order in the two datasets, “number of disconcordant pairs” represents the number of point pairs with inconsistent ranking order in the two datasets, and n represents the number of data in the dataset.
[0100] Furthermore, the pre-processing 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 large 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 reports, 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 OCR recognition, thereby converting the unstructured information such as engineering design and acceptance report into structured data, and verifying the site equipment topology through 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 in the figure, an example of the site equipment topology knowledge graph is given. The weight of the site equipment topology knowledge graph is the topological weight. The topological 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 components 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 location, 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, the equipment status monitoring information knowledge graph is taken as an example. 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 decay coefficient and the detection accuracy coefficient based on the report detection time and detection accuracy. Considering that the recent detection report is closer to the current state of the equipment, the time decay coefficient is set to increase the importance of the report with the latest date. Specifically, the calculation formula of the time decay coefficient is:
[0106]
[0107] Where 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 Examples 1, 2, 3, and 4, in this embodiment, the purpose of the knowledge graph fusion part is to fuse the three separate knowledge graphs: the spatial environment knowledge graph, the site equipment topology knowledge graph, and the equipment status monitoring information knowledge graph, so as to achieve the same concept and equipment corresponding to the same entity in the comprehensive graph. The specific method of the knowledge graph fusion processing is as follows:
[0110] Through the large 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 integrated 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 inverter 301 and inverter 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, such as "Dingsheng Electronics" and "Qingdao Dingsheng Electronics", which are actually the same manufacturer and can be identified as co-referential entities through vector space distance.
[0112] Example 6
[0113] Based on Examples 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 as follows: 30% for spatial weight, 50% for topological weight, and 60% for abnormal device status weight;
[0115] The above three weights can be combined arbitrarily and have overlapping 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% spatial weight and 50% topological weight. These three weights are searched independently, and the union of the results is finally taken.
[0116] Furthermore, 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 modifications, equivalent replacements, and improvements made within the scope of the present invention shall be included in the scope of protection of the present invention.
Claims
1. A photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement, characterized by: Including the knowledge graph construction process and retrieval reasoning process; The knowledge graph construction process is as follows: constructing a photovoltaic field proper noun library, eliminating ambiguities in photovoltaic industry data based on the photovoltaic field proper noun library, generating a photovoltaic field vector expert knowledge base based on the eliminated ambiguities in photovoltaic industry data, extracting photovoltaic information, generating different knowledge graphs based on the large model for the type of extracted photovoltaic information, and fusing different knowledge graphs to generate a comprehensive photovoltaic field knowledge graph; The retrieval and reasoning process includes: performing vector retrieval based on user questions to obtain knowledge vectors, concatenating 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 the question enhancement processing; inputting the amplified and rewritten questions into the comprehensive knowledge graph of 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 deduction results; performing historical question and answer recall, fusing the text-type answers, deduction results, and historical question and answer recall, and obtaining the polished results based on the fused text-type answers, deduction results, and historical question and answer recall; The specific steps of retrieval reasoning include: P1. Segment the user question into text and convert it into a coded vector to obtain the user question vector. Input the user question vector into the photovoltaic field vector expert knowledge base and use the vector recall method to perform vector retrieval and recall knowledge vectors with a similarity higher than a 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 question enhancement prompt words into the text generation model to obtain the text answer and the expanded and rewritten question; 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, 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 recalled graph; P5. Sort and filter the recall graph based on the set weights; P6: Integrate the information of the expanded and rewritten questions obtained in step P3 and the recall map 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, and use the vector recall method and the graph recall method to recall the history of question and answer to 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 the role answer prompt words; P11. Input the character's answer prompt words into the character dialogue model to obtain the polished results, which are then reviewed and filtered by the character dialogue model and used as diagnostic feedback results.
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 terminology entries in the photovoltaic industry data and build a photovoltaic field terminology database; S2. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities in photovoltaic industry data. Then, the photovoltaic industry data is preprocessed to generate a photovoltaic field vector expert knowledge base. S3. Based on the photovoltaic field's proprietary terminology database, natural language processing methods are used to eliminate intersectional and combinational ambiguities among the site's natural environment information, site equipment topology information, and equipment status monitoring information. The site's natural environment information is preprocessed and input into the large model to generate a spatial environment knowledge graph. The site's 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. 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: 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.
5. The photovoltaic field large model efficiency improvement method based on knowledge graph and vector retrieval enhancement according to claim 4 is characterized in that: In step S2, The method for generating the photovoltaic field vector expert knowledge base is as follows: The photovoltaic field proper noun library and pre-processed photovoltaic industry data are input into the language model according to a specific prompt word template. The language model output is then parsed into entity recognition and relationship extraction to obtain a relationship model between the photovoltaic field proper noun library and the pre-processed photovoltaic industry data, thereby generating a photovoltaic field vector expert knowledge base. or: The photovoltaic field proper noun library is input into the HMM hidden Markov model. The probability of the proper nouns in the photovoltaic field proper noun 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 Viterbi algorithm is used to obtain the hidden state sequence. The transition 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 proper noun library and the preprocessed photovoltaic industry data is obtained, and the photovoltaic field vector expert knowledge base is generated.
6. 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 pre-processing of the station natural environment information specifically includes: Extract and retain: Based on the IQR method, outliers in 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 latitude and longitude information, topography and geological structure, status and elevation, hydrogeology, earthquake level and intensity, and meteorological data; The preprocessed natural environment information of the station is input into the large model to generate a spatial environment knowledge graph. The weight of the spatial environment knowledge graph is the spatial weight, which 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 latitude, longitude and elevation information, and the climate similarity distance weight is obtained by calculating the Kendall rank correlation coefficient based on the annual curve of meteorological data.
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 pre-processing of the site equipment topology information specifically includes: 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 it as CIM structured information. Use the large model to convert the CIM structured information into triples to obtain the station equipment topology. Extract and retain the engineering design and acceptance reports, and record them as unstructured information. Use the OCR recognition method to convert the unstructured information into structured data, and use the structured data to verify the station equipment topology. 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. The physical connection relationship weight and the theoretical connection relationship weight are both preset values. The physical connection relationship weight is higher than the theoretical connection relationship weight.
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 pre-processing of the equipment status monitoring information specifically includes: Extract factory inspection reports and patrol inspection and random inspection reports, convert them into markdown format, retain the inspection time, inspection equipment information, equipment status, inspection results, inspection accuracy and implementation standards reported in the factory inspection reports and patrol inspection and random inspection reports, 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.
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 S4, the specific method of knowledge graph fusion processing is: Through the large 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-referencing entities and the proxy entities.