Data architecture knowledge intelligent retrieval method and system for novel electric power system construction
By building a knowledge graph and a generative search system, the problem of low asset management and search efficiency of power grid enterprises' digital architecture is solved, intelligent search and strategy recommendation are realized, and the efficiency and accuracy of asset management and problem discovery are improved.
Patent Information
- Application Number
- CN202411461318.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-03-11
AI Technical Summary
It is difficult to effectively organize and manage the digital architectural assets of power grid enterprises in existing technology, resulting in unclear asset status, low asset retrieval efficiency, and difficult to discover structural problems.
By collecting data from assets related to the enterprise's digital architecture, labeling, using RAG model and graph database to build a knowledge graph, semantic modeling based on deep learning models, and building a generative search system in combination with RAG and GPT to realize intelligent search services and monitoring and analysis and strategy recommendation based on scenario rules engine.
It has achieved a comprehensive analysis and problem discovery of digital architecture assets of power grid enterprises, improved asset retrieval efficiency, reduced the complexity and cost of architectural problem discovery, and improved the efficiency of knowledge transmission and learning.
Smart Images

Figure CN119597929A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing technology, and in particular to a method and system for intelligent retrieval of data-based architecture knowledge for construction of a new type of power system. Background Art
[0002] With the advancement of enterprise digital transformation, the scale of enterprise digital systems and data assets continues to expand, especially in power grid enterprises and other fields. The large scale of power grid digital systems and data assets, long end-to-end business data links, and complex technical architecture systems lead to the following problems:
[0003] 1. The current status of assets is unclear, there is a lack of effective organization and management, architecture assets are difficult to understand, and the accuracy of architecture asset data cannot be guaranteed. The huge amount of architecture asset data relies on traditional expert experience and manual review methods to analyze architecture problems, which cannot achieve comprehensive analysis and problem discovery. 2. The efficiency of asset retrieval is low. The architecture design results and current assets are mostly in the form of electronic documents and coexist with a small number of structured asset records, which increases the difficulty of integrating and establishing relationships between assets of different types and structures. In addition, the inventory and sorting of architecture assets are mostly organized and sorted in a manual topic manner. The complex architecture asset knowledge structure and the storage method of offline documents lead to problems such as high threshold for architecture knowledge learning, difficulty in knowledge transfer, and low retrieval efficiency. 3. It is difficult to discover architecture problems. Traditional architectures often face problems such as complex associations and low transparency, which leads to cumbersome and inefficient diagnostic and analysis processes in the digital support evaluation of business, multi-source data maintenance and management, and system integration routes. When facing complex systems, it is difficult to fully understand the details of architecture design and ensure the comprehensiveness and accuracy of analysis results by relying on expert experience and manual review. Summary of the invention
[0004] The purpose of the embodiments of the present invention is to provide a method and system for intelligent retrieval of data-based architecture knowledge for the construction of a new type of power system. The retrieval method can collect, integrate, and extract knowledge from data on assets related to the enterprise's digital architecture, build a knowledge graph, and implement intelligent retrieval services as well as monitoring, analysis, and strategy recommendations based on a scenario rule engine to solve the problems existing in the prior art.
[0005] In order to achieve the above-mentioned purpose, an embodiment of the present invention provides a method for intelligent retrieval of data-based architecture knowledge for new power system construction, the retrieval method comprising:
[0006] Collect various data types of assets related to the enterprise digital architecture;
[0007] Label the collected data;
[0008] By using the RAG model and graph database to perform data fusion and knowledge extraction, a knowledge graph is constructed;
[0009] Based on the deep learning model, semantic modeling is carried out to build accurate retrieval based on semantic understanding;
[0010] Combining RAG and GPT to build a generative search to meet the needs of enterprise architecture knowledge retrieval;
[0011] Componentize precise retrieval and generative retrieval technologies to meet the requirements of intelligent and accurate retrieval of enterprise databases;
[0012] Build a structured scenario rule library, use the rule engine to perform accuracy diagnosis analysis, and make strategy recommendations through the GPT model.
[0013] Optionally, labeling the collected data includes:
[0014] Determine the classification and hierarchy of tags based on the business needs and digital architecture characteristics of power grid enterprises;
[0015] For structured data, the value is automatically assigned according to the value of the data field;
[0016] For semi-structured and unstructured data, natural language processing technology and machine learning algorithms are used to automatically assign labels;
[0017] For some labels that are difficult to assign values automatically, they are assigned manually through expert evaluation and feedback from business personnel.
[0018] Optionally, data fusion and knowledge extraction are performed on the data by using the RAG model and graph database to construct a knowledge graph including:
[0019] Install and configure the selected graph database based on the data size, performance requirements, and scalability;
[0020] Convert the labeled data into a format supported by the graph database;
[0021] Use the import tool or API provided by the graph database to import data into the database, use entities as nodes, define the relationships between entities as edges, and establish the relationship between nodes and edges;
[0022] Establish the relationship between nodes and edges, design corresponding attributes for nodes and edges to store relevant information, and thus build a knowledge graph;
[0023] Convert the nodes and edges in the knowledge graph into vector representations and generate corresponding vectors for each node and edge;
[0024] Import the vector data of nodes and edges into the vector database and create an index to improve the efficiency of similarity retrieval.
[0025] Optionally, semantic modeling is performed based on deep learning models to build precise retrieval based on semantic understanding, including:
[0026] Obtain a large amount of text and corresponding annotation information related to the digital architecture of the power grid;
[0027] Encode the text in the knowledge of the digital architecture of the power grid through a deep learning model to capture the contextual relationship between words;
[0028] Analyze the output of the model's intermediate layers, extract the semantic vector of the text, and use dimensionality reduction techniques to visualize the high-dimensional semantic feature vectors to better understand the model's understanding of semantics;
[0029] Preprocess the query input by the user, and then input the query text into the trained deep learning model to obtain the semantic feature vector of the query;
[0030] Calculate the similarity between the query vector and the vectors in the vector database;
[0031] According to the similarity sorting results, the most relevant text is selected as the understanding of the user's query intention.
[0032] Optionally, combine RAG and GPT to build a generative search to meet the needs of enterprise architecture knowledge retrieval, including:
[0033] Load various data in the enterprise architecture design and management knowledge base;
[0034] The loaded document is segmented into “sentence” granularity through the segmenter to ensure semantic integrity;
[0035] Build the final vector database based on the segmented documents and knowledge graph;
[0036] According to the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the final vector database through the BGE-M3-Embedding model as the question context;
[0037] Select the ChatGLM3 model to predict the retrieved text library to get the next predicted word;
[0038] Fuse the retrieved knowledge fragments to form a coherent knowledge context;
[0039] The retrieved knowledge context and user query are input into the GPT-3 model to optimize the generated results to improve the accuracy of the answer.
[0040] Optionally, based on the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the vector database through the BGE-M3-Embedding model as the question context, including:
[0041] Get the text entered by the user to map into a query vector;
[0042] According to formula (1), the relevant distance between the query vector and each text library is obtained:
[0043]
[0044] Among them, L In Refers to the InfoNCE loss function value, which indicates the correlation distance between the query vector and each text library. x represents learning expectations, c represents the context used to understand the query sentence query vector and the document content compared with it, s represents the document content compared with the query vector, and f k (s t+k , c t ) represents the score function that measures the similarity or relevance between two texts, ∑ si∈S f k (s j ,c t ) means that given a context, the results of all the statements in the set combined with the context and calculated by the score function are summed.
[0045] According to the correlation distance between the query vector and each text library, the distance between the query vector and the relevant documents is shortened, and the distance between the documents irrelevant to the query vector is expanded.
[0046] Optionally, based on the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the vector database through the BGE-M3-Embedding model as the question context, including:
[0047] Based on the dense search, coefficient search and multi-vector search of the BGE-M3-Embedding model, the related texts calculated and zoomed in by formula (1) are searched, and the similarity scores of the three search methods are obtained;
[0048] The similarity scores obtained from the three retrievals are weighted and summed to obtain a teacher score;
[0049] The student model is trained to retrieve relevant texts to obtain three similarity scores, and three distillation losses are obtained based on the teacher score and the three similarity scores of the student model;
[0050] The loss function of the three distillation losses is calculated according to formula (2):
[0051] L=(1-T)*L ce +T*L kd , formula (2)
[0052] Among them, L represents the loss function, L ce represents the conventional loss function, L kd represents distillation loss, T represents temperature parameter;
[0053] The three distillation losses are ranked to select the text most relevant to the question.
[0054] Optionally, build a structured scenario rule library, use the rule engine to perform accuracy diagnosis analysis, and use the GPT model to make policy recommendations, including:
[0055] Based on the requirements of architecture design control, sort out the key structural design requirements and standards, identify and convert them into rules, and form a rule engine based on a structured rule base for different architecture design scenarios;
[0056] Use the rule engine to automatically check whether the relationship model of the five major architectures based on the rule base complies with the preset rules to identify potential problem points;
[0057] The GPT model understands the specific description of the architecture problem, and combined with rule services and knowledge graphs, GPT generates intelligent recommendations on strategies for managing architecture problems in this scenario.
[0058] On the other hand, the present invention also provides a new type of digital architecture knowledge intelligent retrieval system for power system construction, the retrieval system comprising:
[0059] The data layer is used to store enterprise structured and unstructured data;
[0060] The access layer uses intervention tools to achieve flexible access to data in the data layer;
[0061] The data processing layer uses the RAG model to deeply process and analyze the stored data, build a service engine, and convert the processed data into an architecture knowledge base to provide support for subsequent applications;
[0062] Analyze the decision-making layer, based on the GPT large language model, train and learn historical data, improve the intelligence level of decision-making, conduct in-depth demand analysis, and formulate accurate business rules and decision-making plans;
[0063] The service layer is used to provide rich interface services and support fast access to front-end applications or other systems;
[0064] The application layer obtains and renders the processed data through the interface provided by the service layer.
[0065] Through the above technical scheme, the present invention provides a new type of intelligent retrieval method for digital architecture knowledge of power system construction. By collecting fragmented data types related to the digital architecture of the enterprise, the collected data can be labeled, and then the RAG model and graph database are used for data fusion and knowledge extraction to construct a knowledge graph. Semantic modeling is performed based on the deep learning model to build a precise retrieval based on semantic understanding. Combine RAG and GPT to build a generative retrieval system. Componentize precise retrieval and generative retrieval technologies. Build a structured scenario rule library. Use the rule engine to perform accuracy diagnosis and analysis. Recommend strategies through the GPT model. This retrieval method can collect, fuse, and extract knowledge from the data of assets related to the digital architecture of the enterprise, build a knowledge graph, and realize intelligent retrieval services as well as monitoring analysis and strategy recommendations based on the scenario rule engine to solve the problems existing in the prior art.
[0066] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0068] Figure 1 is a flow chart of a method for intelligent retrieval of data-based architecture knowledge for new power system construction according to one embodiment of the present invention;
[0069] Figure 2 It is a flowchart of data labeling processing of a data-based architecture knowledge intelligent retrieval method for new power system construction according to an embodiment of the present invention;
[0070] Figure 3 It is a flow chart of constructing a knowledge graph of a method for intelligent retrieval of data-based architecture knowledge for construction of a new power system according to an embodiment of the present invention;
[0071] Figure 4It is a flowchart of accurate retrieval of a method for intelligent retrieval of knowledge of a data-based architecture for construction of a new type of power system according to an embodiment of the present invention;
[0072] Figure 5 is a flow chart of a generative search of a method for intelligent search of knowledge of a data-based architecture for construction of a new type of power system according to an embodiment of the present invention;
[0073] Figure 6 is a first flow chart of a retrieval problem of a method for intelligent retrieval of knowledge of a data-based architecture for construction of a new type of power system according to an embodiment of the present invention;
[0074] Figure 7 is a second flow chart of a retrieval problem of a method for intelligent retrieval of knowledge of a data-based architecture for construction of a new type of power system according to an embodiment of the present invention;
[0075] Figure 8 is a flow chart of strategy recommendation of a data-based architecture knowledge intelligent retrieval method for new power system construction according to an embodiment of the present invention;
[0076] Fig. 9 It is an architecture diagram of a digital architecture knowledge intelligent retrieval system for new power system construction according to one embodiment of the present invention. DETAILED DESCRIPTION
[0077] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0078] Figure 1 1 is a flow chart of a method for intelligent retrieval of data-based architecture knowledge for new power system construction according to an embodiment of the present invention. In the present invention, the process may include:
[0079] In step S1, various data types of assets related to the enterprise digital architecture are collected.
[0080] In step S2, the collected data is labeled.
[0081] In step S3, the data is fused and knowledge extracted by using the RAG model and graph database to construct a knowledge graph.
[0082] In step S4, semantic modeling is performed based on the deep learning model to build an accurate retrieval based on semantic understanding.
[0083] In step S5, RAG and GPT are combined to construct a generative search to meet the needs of enterprise architecture knowledge retrieval.
[0084] In step S6, the precise retrieval and generative retrieval technologies are componentized to meet the requirements of intelligence and accuracy in enterprise database retrieval.
[0085] In step S7, a structured scenario rule base is constructed, the rule engine is used to perform accuracy diagnosis analysis, and strategy recommendations are made through the GPT model.
[0086] In the present invention, when performing a search, various data types related to the digital architecture of the enterprise can be collected, and then the collected data can be labeled so that the data can meet the subsequent operation processing. By using the RAG model and the graph database, data fusion and knowledge extraction can be performed on the data, so that a knowledge graph can be constructed. Based on the deep learning model, semantic modeling can be performed to construct a precise search based on semantic understanding. Combining RAG and GPT can construct a generative search, which can meet the needs of enterprise architecture knowledge retrieval. By componentizing precise retrieval and generative retrieval technology, the advantages of both can be absorbed, so that the intelligence and accuracy of enterprise database retrieval can be met. By constructing a structured scenario structure library, the rule engine can be used for accuracy diagnosis and analysis, and the GPT model can be used for strategy recommendation. The retrieval method can collect, fuse, and extract knowledge from the data of assets related to the digital architecture of the enterprise, construct a knowledge graph, realize intelligent retrieval services, and monitoring analysis and strategy recommendations based on the scenario rule engine to solve the problems existing in the prior art.
[0087] In one embodiment of the present invention, Figure 2 As shown, the process of data labeling may include:
[0088] In step S8, the classification and hierarchy of tags are determined according to the business needs and digital architecture characteristics of the power grid enterprise.
[0089] In step S9, for structured data, values are automatically assigned according to the values of the data fields.
[0090] In step S10, natural language processing technology and machine learning algorithms are used to automatically assign labels to semi-structured and unstructured data.
[0091] In step S11, for some tags that are difficult to assign values automatically, manual assignment is performed through expert evaluation and business personnel feedback.
[0092] In the present invention, when labeling the collected data, the data can be collected first. When collecting data, for structured data, database connection tools, ETL (Extract, Transform, Load) tools, etc. can be used for collection. Business process data in business architecture assets and software system information in application architecture assets are extracted from relational databases through SQL queries. For semi-structured data, such as files in XML and JSON formats, special parsing tools can be used. The relevant architecture asset data is extracted from the configuration file of the application server using the JSON parsing library. For unstructured data, such as text files, images, videos, etc., natural language processing technology, image recognition technology, etc. can be used for collection. The description information of the business architecture assets is extracted from the scanned documents through OCR (Optical Character Recognition) technology, or the equipment status information is obtained from the equipment inspection image using image recognition technology as part of the technical architecture assets. After the collection is completed, the classification and hierarchy of the labels can be determined according to the business needs and digital architecture characteristics of the power grid enterprise. For business architecture assets, you can set business type tags (such as power transmission business, power distribution business, power sales business, etc.), business importance tags (high, medium, low), and business process stage tags (planning, design, implementation, operation and maintenance, etc.); for application architecture assets, you can set application type tags (management system, monitoring system, analysis tool, etc.), application function tags (data collection, data analysis, report generation, etc.); for data architecture assets, you can set data source tags (sensor data, manually entered data, external data, etc.), data type tags (structured data, semi-structured data, unstructured data), and data quality tags (high, medium, low); for technical architecture assets, you can set technology type tags (server technology, network technology, storage technology, etc.), technology maturity tags (emerging technology, mature technology, old technology, etc.); for security architecture assets, you can set security level tags (high, medium, low), and security risk type tags (network attack risk, data leakage risk, physical security risk, etc.). For structured data, you can automatically assign values according to the values of the data fields. According to the business type field in the business process data, automatically assign the corresponding business type tags to the business architecture assets. For semi-structured and unstructured data, natural language processing technology, machine learning algorithms, etc. can be used to automatically assign labels. Equipment operation and maintenance logs are analyzed through text classification algorithms to automatically assign equipment fault type labels to technical architecture assets. At the same time, manual review and adjustment can also be combined to ensure the accuracy of labels. For some labels that are difficult to assign automatically, manual assignment can be performed through expert evaluation, business personnel feedback, etc. Business importance labels and security level labels can be evaluated and determined by the company's management and security experts.
[0093] In one embodiment of the present invention, Figure 3 As shown, the process of building a knowledge graph can include:
[0094] In step S12, the selected graph database is installed and configured according to the data scale, performance requirements, and scalability.
[0095] In step S13, the labeled data is converted into a format supported by the graph database.
[0096] In step S14, the data is imported into the database using the import tool or API provided by the graph database, with entities as nodes, and relationships between entities defined as edges, to establish relationships between nodes and edges.
[0097] In step S15, the relationship between nodes and edges is established, and corresponding attributes are designed for nodes and edges to store relevant information, thereby constructing a knowledge graph.
[0098] In step S16, the nodes and edges in the knowledge graph are converted into vector representations, and corresponding vectors are generated for each node and edge.
[0099] In step S17, the vector data of the nodes and edges are imported into the vector database and indexed to improve the efficiency of similarity retrieval.
[0100] In the present invention, different graph database products, such as Neo4j, JanusGraph, etc., can be evaluated, and the selected graph database can be selected according to factors such as data scale, performance requirements, and scalability, and the selected graph database can be installed and configured. After selecting the graph database, the sorted labeled data can be converted into a format supported by the graph database, such as a CSV file, a JSON format, etc. Then, the data can be imported into the database using the import tool or API provided by the graph database, with the entity as a node, and the relationship between the entity defined as an edge, to establish the relationship between the node and the edge. Entities are used as nodes, such as system components, business modules, data objects, etc., and then the relationship between entities can be defined as an edge, such as a dependency relationship, an interaction relationship, an inclusion relationship, etc. After establishing the relationship between nodes and edges, corresponding attributes can be designed for the nodes and edges, so that they can be used to store related information, and then a knowledge graph can be constructed. After the knowledge graph is constructed, the nodes and edges in the knowledge graph can be converted into vector representations, so that corresponding vectors can be generated for each node and edge, and the vector data of the nodes and edges can be imported into the vector database, and an index can be established, so that the efficiency of similarity retrieval can be improved. When performing similarity retrieval, retrieval can be performed by methods such as cosine similarity and Euclidean distance.
[0101] In one embodiment of the present invention, Figure 4 As shown, the process of precise retrieval can include:
[0102] In step S18, a large amount of text related to the digital architecture of the power grid and corresponding annotation information are obtained.
[0103] In step S19, the text in the power grid digital architecture knowledge is encoded through a deep learning model to capture the contextual relationship between words.
[0104] In step S20, the intermediate layer output of the model is analyzed, the semantic vector of the text is extracted, and the high-dimensional semantic feature vector is visualized using dimensionality reduction technology to better understand the model's understanding of semantics.
[0105] In step S21, the query input by the user is preprocessed, and then the query text is input into the trained deep learning model to obtain a semantic feature vector of the query.
[0106] In step S22, the similarity between the query vector and the vectors in the vector database is calculated.
[0107] In step S23, based on the similarity ranking results, the most relevant text is selected as the understanding of the user's query intention.
[0108] In the present invention, when performing precise retrieval, a large amount of text related to the digital architecture of the power grid and corresponding annotation information, such as the category of the text, keywords, etc., can be obtained. Use a pre-trained language model to perform fine-tuning training on specific tasks, such as text classification, semantic similarity calculation, etc. Adjust the hyperparameters of the model, such as learning rate, batch size, number of training rounds, etc., to optimize the performance of the model. When performing precise search, different pre-trained language models, such as BERT, RoBERTa, etc., can be evaluated to consider their performance and applicability in semantic understanding tasks. According to the characteristics of the knowledge of the digital architecture of the power grid and the retrieval requirements, the most suitable model is selected. The text in the knowledge of the digital architecture of the power grid is encoded using a deep learning model to capture the contextual relationship between words. Through technologies such as the multi-head attention mechanism, the model can focus on words in different positions and better understand the semantics of the text. Analyze the output of the intermediate layer of the model and extract the semantic feature vectors of the text, which can reflect the semantic meaning of the text. Dimensionality reduction techniques, such as principal component analysis (PCA) or t-SNE, can be used to visualize high-dimensional semantic feature vectors to better understand the model's understanding of semantics. Preprocess the query input by the user, including word segmentation, stop word removal and other operations. Input the query text into the trained deep learning model to obtain the semantic feature vector of the query. Calculate the similarity between the query vector and the text vector in the knowledge base of the power grid digital architecture. Metrics such as cosine similarity and Euclidean distance can be used. According to the similarity sorting results, select the most relevant text as the understanding of the user's query intent. Other information, such as the user's historical query records, the user's role and permissions, can be combined to further optimize the understanding of the user's query intent.
[0109] In one embodiment of the present invention, Figure 5 As shown, the process of generative retrieval can include:
[0110] In step S24, various types of data in the enterprise architecture design management and control knowledge base are loaded.
[0111] In step S25, the loaded document is segmented into "sentence" granularity by a segmenter to ensure semantic integrity.
[0112] In step S26, a final vector database is constructed based on the segmented documents and knowledge graph.
[0113] In step S27, based on the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the final vector database through the BGE-M3-Embedding model as the question context.
[0114] In step S28, the ChatGLM3 model is selected to predict the retrieved text library to obtain the next predicted word.
[0115] In step S29, the retrieved knowledge fragments are fused to form a coherent knowledge context.
[0116] In step S30, the retrieved knowledge context and user query are input into the GPT-3 model to optimize the generated results to improve the accuracy of the answer.
[0117] In the present invention, when performing semantic retrieval, various types of data in the enterprise architecture design and management knowledge base can be loaded, including unstructured data (such as feasibility reports, business requirements, software requirements, outline designs, security protection plans, architecture management methods, technical policy highlights, information system design specifications, etc.), semi-structured documents (such as Excel data import, Json data parsing, etc.) and structured data (such as business architecture assets, application architecture assets, data architecture assets, technical architecture assets, security architecture assets, target blueprint architecture assets, etc.). The loading of documents is achieved through the Loader loader, and multiple document types such as txt and pdf are supported. Then a segmenter can be used to segment the loaded documents according to "sentence" particles to ensure the integrity of the semantics. At the same time, considering the limitations of Tokens, the segmentation granularity is usually controlled within 512 Tokens. Based on the segmented documents and knowledge graphs, a vector database can be constructed. According to the keywords input by the user, the BGE-M3-Embedding model can retrieve the top-k text libraries most relevant to the question from the final vector database as the question context, and then the retrieved text library can be predicted by the ChatGLM3 model to obtain the next predicted word. The retrieved knowledge fragments are fused to form a coherent knowledge context. Use text summarization, knowledge fusion algorithms and other technologies to extract key information and remove redundant content. The retrieved knowledge context and user query are input into the GPT-3 model to optimize the generated results to improve the accuracy of the answer.
[0118] In one embodiment of the present invention, Figure 6 As shown, the first process of the search question may include:
[0119] In step S31, the text input by the user is obtained to be mapped into a query vector.
[0120] In step S32, the relevant distance between the query vector and each text library is obtained according to formula (1):
[0121]
[0122] Among them, L InRefers to the InfoNCE loss function value, which indicates the correlation distance between the query vector and each text library. x represents learning expectations, c represents the context used to understand the query sentence query vector and the document content compared with it, s represents the document content compared with the query vector, and f k (s t+k , c t ) represents the score function that measures the similarity or relevance between two texts, ∑ si∈S f k (s j ,c t ) means that given a context, the results of all the statements in the set combined with the context and calculated by the score function are summed.
[0123] In step S33, according to the correlation distance between the query vector and each text library, the distance between the query vector and the relevant documents is shortened, and the distance between the documents irrelevant to the query vector is expanded.
[0124] In the present invention, the text input by the user can be mapped to a query vector. Contrastive learning aims to improve the performance of the model by comparing the differences between different samples. In the BGE-M3-Embedding model, the goal of contrastive learning is to shorten the distance between the query vector and related documents, while increasing the distance between the query vector and irrelevant documents, which can be achieved through the InfoNCE loss function.
[0125] In one embodiment of the present invention, Figure 7 As shown, the second process of searching the question may include:
[0126] In step S34, dense retrieval, coefficient retrieval and multi-vector retrieval based on the BGE-M3-Embedding model are used to retrieve the relevant texts calculated and zoomed in by formula (1), and the similarity scores of the three retrieval methods are obtained.
[0127] In step S35, the three retrieved similarity scores are weighted and summed to obtain a teacher score.
[0128] In step S36, the student model is trained to retrieve relevant texts to obtain three similarity scores, and three distillation losses are obtained based on the teacher score and the three similarity scores of the student model.
[0129] In step S37, the loss functions of the three distillation losses are calculated according to formula (2):
[0130] L=(1-T)*L ce +T*L kd , formula (2)
[0131] Among them, L represents the loss function, L ce represents the conventional loss function, L kd represents distillation loss, and T represents temperature parameter.
[0132] In step S38, the loss functions of the three distillation losses are sorted to select the text most relevant to the question.
[0133] In the present invention, the relevant texts calculated and zoomed in by formula (1) can be retrieved based on the dense retrieval, coefficient retrieval and multi-vector retrieval of the BGE-M3-Embedding model, and the similarity score of the next retrieval method can be obtained. The similarity scores of the three different methods are weighted and summed to obtain a teacher score. Then, the three similarity scores of the student model will learn the information of this teacher score, thereby obtaining three distillation losses. After obtaining the three distillation losses, the loss functions of the three distillation losses can be calculated according to formula (2). By sorting the loss functions of the three distillation losses, the text most relevant to the question can be selected.
[0134] In one embodiment of the present invention, Figure 8 As shown, the process of policy recommendation may include:
[0135] In step S39, based on the architecture design management and control requirements, key structural design requirements and standards are sorted out, identified and converted into rules, and a rule engine is formed according to a structured rule base for different architecture design scenarios.
[0136] In step S40, a rule engine is used to automatically check whether the relationship model of the five major architectures based on the rule base complies with the preset rules to identify potential problem points.
[0137] In step S41, the specific description of the architecture problem is understood through the GPT model, and combined with the rule service and knowledge graph, GPT generates intelligent recommendation suggestions for the strategy of architecture problem governance for the scenario.
[0138] In the present invention, the technology for constructing a structured scenario rule base based on the requirements of architecture design management and control is studied, key architecture design requirements and standards are sorted out, identified and converted into rules, and a structured rule base is constructed according to different architecture design scenarios to form a rule engine. The accuracy diagnosis and analysis technology of the five major architectures and their associations based on the rule base is studied, and the rule engine is used to automatically check whether the relationship models of the five major architectures meet the preset rules and identify potential problem points. The technology for recommending digital architecture problem governance strategies based on GPT is studied. The specific description of the architecture problem is understood through the GPT model, and combined with the rule service and knowledge graph, GPT generates intelligent recommendation suggestions for the strategy of architecture problem governance for the scenario.
[0139] On the other hand, the present invention also provides a data-based architecture knowledge intelligent retrieval system for new power system construction, such as Figure 8 As shown, the system may include: data layer, access layer, data processing layer, analysis and decision layer, service layer, and application layer. The data layer can use MySQL database as the storage core of structured data, use OSS object storage to effectively manage unstructured and semi-structured data; introduce Redis cache components to accelerate the access speed of background statistics and related data. The access layer can realize flexible data access through Kafka, Restful API or ETL tools; structured data is directly stored in MySQL, and unstructured and semi-structured data is stored in OSS document server; background statistics and related data are stored in Redis cache in real time to quickly respond to query needs. The data processing layer can use RAG model to deeply process and analyze the stored data; build a service engine to convert the processed data into an architecture knowledge base to provide support for subsequent applications. The analysis and decision layer can conduct in-depth demand analysis, formulate accurate business rules and decision-making plans; based on the GPT large language model, train and learn historical data to improve the intelligent level of decision-making. The service layer can provide rich interface services to support the rapid access of front-end applications or other systems; through the service engine, efficient data flow and application can be realized to meet diverse business needs. The application layer can obtain and render processed data through the interface provided by the service layer; present the analysis results to users in an intuitive and easy-to-understand manner to improve user experience.
[0140] Through the above technical scheme, the present invention provides a new type of intelligent retrieval method for digital architecture knowledge of power system construction. By collecting fragmented data types related to the digital architecture of the enterprise, the collected data can be labeled, and then the RAG model and graph database are used for data fusion and knowledge extraction to construct a knowledge graph. Semantic modeling is performed based on the deep learning model to build a precise retrieval based on semantic understanding. Combine RAG and GPT to build a generative retrieval system. Componentize precise retrieval and generative retrieval technologies. Build a structured scenario rule library. Use the rule engine to perform accuracy diagnosis and analysis. Recommend strategies through the GPT model. This retrieval method can collect, fuse, and extract knowledge from the data of assets related to the digital architecture of the enterprise, build a knowledge graph, and realize intelligent retrieval services as well as monitoring analysis and strategy recommendations based on the scenario rule engine to solve the problems existing in the prior art.
[0141] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0142] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0143] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0144] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0145] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0146] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0147] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0148] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0149] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
Claims
1. A new type of intelligent retrieval method for data-based architecture knowledge of power system construction, characterized in that: The retrieval method comprises: Collect various data types of assets related to the enterprise digital architecture; Label the collected data; By using the RAG model and graph database to perform data fusion and knowledge extraction, a knowledge graph is constructed; Based on the deep learning model, semantic modeling is carried out to build accurate retrieval based on semantic understanding; Combining RAG and GPT to build a generative search to meet the needs of enterprise architecture knowledge retrieval; Componentize precise retrieval and generative retrieval technologies to meet the requirements of intelligent and accurate retrieval of enterprise databases; Build a structured scenario rule library, use the rule engine to perform accuracy diagnosis analysis, and make strategy recommendations through the GPT model.
2. The search method according to claim 1, characterized in that: Labeling of collected data includes: Determine the classification and hierarchy of tags based on the business needs and digital architecture characteristics of power grid enterprises; For structured data, the value is automatically assigned according to the value of the data field; For semi-structured and unstructured data, natural language processing technology and machine learning algorithms are used to automatically assign labels; For some labels that are difficult to assign values automatically, they are assigned manually through expert evaluation and feedback from business personnel.
3. The search method according to claim 2, characterized in that: By using the RAG model and graph database to perform data fusion and knowledge extraction to build a knowledge graph, the following are included: Install and configure the selected graph database based on the data size, performance requirements, and scalability; Convert the labeled data into a format supported by the graph database; Use the import tool or API provided by the graph database to import data into the database, use entities as nodes, define the relationships between entities as edges, and establish the relationship between nodes and edges; Establish the relationship between nodes and edges, design corresponding attributes for nodes and edges to store relevant information, and thus build a knowledge graph; Convert the nodes and edges in the knowledge graph into vector representations and generate corresponding vectors for each node and edge; Import the vector data of nodes and edges into the vector database and create an index to improve the efficiency of similarity retrieval.
4. The search method according to claim 3, characterized in that: Based on the deep learning model, semantic modeling is carried out to build precise retrieval based on semantic understanding, including: Obtain a large amount of text and corresponding annotation information related to the digital architecture of the power grid; Encode the text in the knowledge of the digital architecture of the power grid through a deep learning model to capture the contextual relationship between words; Analyze the output of the model's intermediate layers, extract the semantic vector of the text, and use dimensionality reduction techniques to visualize the high-dimensional semantic feature vectors to better understand the model's understanding of semantics; Preprocess the query input by the user, and then input the query text into the trained deep learning model to obtain the semantic feature vector of the query; Calculate the similarity between the query vector and the vectors in the vector database; According to the similarity sorting results, the most relevant text is selected as the understanding of the user's query intention.
5. The search method according to claim 3, characterized in that: Combining RAG and GPT to build a generative search to meet the needs of enterprise architecture knowledge retrieval includes: Load various data in the enterprise architecture design and management knowledge base; The loaded document is segmented into "sentence" particles through the segmenter to ensure the semantic integrity; Based on the segmented documents and knowledge graph, the final vector database is constructed; According to the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the final vector database through the BGE-M3-Embedding model as the question context; Select the ChatGLM3 model to predict the retrieved text library to get the next predicted word; Fuse the retrieved knowledge fragments to form a coherent knowledge context; The retrieved knowledge context and user query are input into the GPT-3 model to optimize the generated results to improve the accuracy of the answer.
6. The search method according to claim 5, characterized in that: According to the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the final vector database through the BGE-M3-Embedding model as the question context, including: Get the text entered by the user to map into a query vector; According to formula (1), the relevant distance between the query vector and each text library is obtained: Among them, L In Refers to the InfoNCE loss function value, which indicates the correlation distance between the query vector and each text library. x represents learning expectations, c represents the context used to understand the query sentence query vector and the document content compared with it, s represents the document content compared with the query vector, and f k (s t+k , c t ) represents the score function that measures the similarity or relevance between two texts, ∑ si∈S f k (s j ,c t ) means that, given a context, the sum of the results obtained by combining all the statements in the set with the context and calculating the score function is performed; According to the correlation distance between the query vector and each text library, the distance between the query vector and the relevant documents is shortened, and the distance between the documents irrelevant to the query vector is expanded.
7. The search method according to claim 6, characterized in that: According to the keywords input by the user, the top-k text libraries most relevant to the question are retrieved from the vector database through the BGE-M3-Embedding model as the question context, including: Based on the dense search, coefficient search and multi-vector search of the BGE-M3-Embedding model, the related texts calculated and zoomed in by formula (1) are searched, and the similarity scores of the three search methods are obtained; The similarity scores obtained from the three retrievals are weighted and summed to obtain a teacher score; The student model is trained to retrieve relevant texts to obtain three similarity scores, and three distillation losses are obtained based on the teacher score and the three similarity scores of the student model; The loss function of the three distillation losses is calculated according to formula (2): L=(1-T)*L ce +T*L kd , formula (2) Among them, L represents the loss function, L ce represents the conventional loss function, L kd represents distillation loss, T represents temperature parameter; The three distillation losses are ranked to select the text most relevant to the question.
8. The search method according to claim 1, characterized in that: Build a structured scenario rule library, use the rule engine to perform accuracy diagnosis analysis, and use the GPT model to make strategy recommendations, including: Based on the requirements of architecture design control, sort out the key structural design requirements and standards, identify and convert them into rules, and form a rule engine based on a structured rule base for different architecture design scenarios; Use the rule engine to automatically check whether the relationship model of the five major architectures based on the rule base complies with the preset rules to identify potential problem points; The GPT model understands the specific description of the architecture problem, and combined with rule services and knowledge graphs, GPT generates intelligent recommendations on strategies for managing architecture problems in this scenario.
9. A new type of data-based architecture knowledge intelligent retrieval system for power system construction, characterized by: The retrieval system comprises: The data layer is used to store enterprise structured and unstructured data; The access layer uses intervention tools to achieve flexible access to data in the data layer; The data processing layer uses the RAG model to deeply process and analyze the stored data, build a service engine, and convert the processed data into an architecture knowledge base to provide support for subsequent applications; Analyze the decision-making layer, based on the GPT large language model, train and learn historical data, improve the intelligence level of decision-making, conduct in-depth demand analysis, and formulate accurate business rules and decision-making plans; The service layer is used to provide rich interface services and support fast access to front-end applications or other systems; The application layer obtains and renders the processed data through the interface provided by the service layer.
Citation Information
Cited By
Government affair information intelligent retrieval and generation system applying RAG technology
CN119807261A
Intelligent prompting method and system, computer equipment and storage medium
CN120744105A
Electric knowledge base accurate retrieval and intelligent question-answering system and method based on AI large model and knowledge graph
CN121029937A
A Precise Retrieval and Intelligent Question Answering System and Method for Electrical Knowledge Base Based on AI Large Model and Knowledge Graph
CN121029937B
Joint retrieval method and system based on knowledge enhancement, medium and terminal
CN121166936A