Power system knowledge graph construction method and device, computer equipment, readable storage medium and program product
By extracting and integrating graph elements from structured and unstructured data of the power system, we eliminate ambiguities between data sources, mine implicit associations, and generate target knowledge graphs, which solves the problem that traditional technologies cannot effectively support power system management and operation and maintenance. , improving data quality and management support capabilities.
Patent Information
- Application Number
- CN202410693061.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-31
- Publication Date
- 2024-09-20
AI Technical Summary
Traditional technology cannot effectively eliminate the ambiguity between data from different data sources in the power system, and cannot mine implicit associations between data sources, resulting in the inability to provide effective support for power system management and operation and maintenance.
By acquiring structured and unstructured data, we extract map elements respectively, build an initial knowledge map, filter out abnormal data, synchronize timestamps, fuse multi-source data, perform map data inference and completion, and generate the target knowledge map.
It eliminates ambiguities between data sources, mines implicit associations, provides high-quality data support, improves data quality, and enhances support capabilities for power system management and operation and maintenance.
Smart Images

Figure CN118674034A
Abstract
Description
Technical Field
[0001] The present application relates to the field of knowledge graph technology, and in particular to a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for constructing a knowledge graph for a power system. Background Art
[0002] In power systems, SCADA (Supervisory Control and Data Acquisition) is usually used to monitor the operation of equipment in the power system and collect data from different data sources in the power system for decision analysis. How to effectively integrate data from multiple data sources to provide decision support for the power system is crucial to the management and operation of the power system.
[0003] In traditional technology, data from multiple data sources in the power system can be integrated manually or simply counted based on computers. However, this method cannot effectively eliminate the ambiguity between data from different data sources, nor can it effectively mine the implicit associations between data from different data sources. As a result, the integrated power system data cannot provide effective support for the management and operation of the power system. Summary of the invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for constructing a power system knowledge graph that can effectively eliminate ambiguity between data from different data sources in the power system and effectively mine implicit associations between data from different data sources, thereby providing effective support for the management and operation of the power system.
[0005] In a first aspect, the present application provides a method for constructing a knowledge graph of a power system, comprising:
[0006] Obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements;
[0007] Acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0008] Fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0009] Perform graph data inference on the fused knowledge graph to obtain graph completion data, and perform graph data completion on the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0010] In one embodiment, graph elements are extracted from structured data and unstructured data respectively to obtain graph elements, including:
[0011] Based on the graph element mapping rule configured for the structured data, extract the graph element from the structured data to obtain a first graph element;
[0012] Based on the data volume and domain type of the unstructured data, determine a graph element extraction rule that matches the unstructured data, and extract the graph elements from the unstructured data according to the graph element extraction rule to obtain a second graph element;
[0013] The first graph element and the second graph element are collected to obtain a graph element for constructing an initial knowledge graph.
[0014] In one embodiment, based on the data volume and domain type of the unstructured data, a graph element extraction rule matching the unstructured data is determined, and according to the graph element extraction rule, the unstructured data is subjected to graph element extraction to obtain a second graph element, including:
[0015] When the amount of unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where there are extractable semantic features, extracting semantic features from the unstructured data;
[0016] generating a text extraction template matching the extracted semantic features;
[0017] Based on the text extraction template, the second graph element is extracted from the unstructured data.
[0018] In one embodiment, based on the data volume and domain type of the unstructured data, a graph element extraction rule matching the unstructured data is determined, and according to the graph element extraction rule, the unstructured data is subjected to graph element extraction to obtain a second graph element, including:
[0019] When the amount of unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open domain from which no semantic features can be extracted, the unstructured data is labeled;
[0020] Based on the preset data extraction model, graph elements are extracted from the unstructured data that has completed data annotation to obtain the second graph elements.
[0021] In one embodiment, the initial knowledge graph and multi-source target data are fused to obtain a fused knowledge graph, including:
[0022] Generate a to-be-fused atlas containing multi-source target data;
[0023] Perform knowledge graph alignment processing on the initial knowledge graph and the graph to be fused, and determine the equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused;
[0024] Based on the equivalent graph element pairs, the initial knowledge graph and the graph to be fused are fused to obtain a fused knowledge graph.
[0025] In one embodiment, graph data reasoning is performed on the fused knowledge graph to obtain graph completion data, and graph data completion is performed on the fused knowledge graph based on the graph completion data to obtain a target knowledge graph, including:
[0026] Perform relationship mining on the connection relationships between multiple entities in the fusion knowledge graph to obtain the first graph completion data;
[0027] Based on the path formed by the connection relationship between multiple entities in the fusion knowledge graph, the path prediction is performed to obtain the second graph completion data;
[0028] Obtaining distributed vector representations of the connection relationships between entities in the fused knowledge graph, extracting implicit association information in the fused knowledge graph from the distributed vector representation, and obtaining third graph completion data;
[0029] Based on the first graph completion data, the second graph completion data and the third graph completion data, the graph data of the fused knowledge graph is completed to obtain the target knowledge graph.
[0030] In a second aspect, the present application also provides a device for constructing a knowledge graph of a power system, comprising:
[0031] The initial graph construction module is used to obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively, obtain graph elements, and construct the initial knowledge graph based on the graph elements;
[0032] A multi-source target data acquisition module is used to acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0033] The graph fusion module is used to fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0034] The graph data inference module performs graph data inference on the fused knowledge graph to obtain graph completion data, and completes the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0035] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0036] Obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements;
[0037] Acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0038] Fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0039] Perform graph data inference on the fused knowledge graph to obtain graph completion data, and perform graph data completion on the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0040] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:
[0041] Obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements;
[0042] Acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0043] Fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0044] Perform graph data inference on the fused knowledge graph to obtain graph completion data, and perform graph data completion on the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0045] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0046] Obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements;
[0047] Acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0048] Fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0049] Perform graph data inference on the fused knowledge graph to obtain graph completion data, and perform graph data completion on the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0050] The above-mentioned power system knowledge graph construction method, device, computer equipment, computer-readable storage medium and computer program product first extract graph elements from the structured data and unstructured data of the power system respectively to obtain graph elements, thereby constructing an initial knowledge graph based on the graph elements, so that data from different data sources in the power system can be stored based on the initial knowledge graph in the future. Further, the multi-source original data of the power system can be obtained, the abnormal data in the multi-source original data can be screened out, and the retained multi-source original data can be synchronized with the timestamp to obtain multi-source target data with higher data quality from different data sources. Then, the initial knowledge graph and the multi-source target data are fused to eliminate the ambiguity between the data from different data sources to obtain a fused knowledge graph, and then the fused knowledge graph is subjected to graph data reasoning to effectively mine the implicit associations between the data from different data sources to obtain graph completion data, thereby completing the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph, so that the data from different data sources stored in the target knowledge graph can be used to provide effective support for the management and operation of the power system in the future. That is, based on the above method, a target knowledge graph can be obtained, which can eliminate ambiguity between data from different data sources in the power system, effectively mine implicit associations between data from different data sources, and store data from different data sources in the power system. This is conducive to the subsequent provision of effective support for the management and operation and maintenance of the power system based on the multi-source data integrated in the target knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0052] Figure 1 An application environment diagram of a method for constructing a knowledge graph of a power system in one embodiment;
[0053] Figure 2A schematic diagram of the structure of a knowledge graph platform in one embodiment;
[0054] Figure 3 A schematic diagram of a flow chart of a method for constructing a knowledge graph of a power system in one embodiment;
[0055] Figure 4 A schematic diagram of an LSTM-CRF entity recognition model in one embodiment;
[0056] Figure 5 A schematic diagram of a process of fusing a knowledge graph in one embodiment;
[0057] Figure 6 A schematic diagram of the workflow of the AMIE algorithm in one embodiment;
[0058] Figure 7 A schematic diagram of a flow chart of a method for constructing a knowledge graph of a power system in another embodiment;
[0059] Figure 8 It is a structural block diagram of a device for constructing a knowledge graph of a power system in one embodiment;
[0060] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0062] The power system knowledge graph construction method provided in the embodiment of the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 of the power system can communicate with the server 104 of the power system through the network. The data storage system can store the data that the server 104 needs to process. The data storage system can be integrated on the server 104, or it can be placed on the cloud or other network servers. The server 104 can first obtain the structured data and unstructured data of the power system from the terminal 102 of the power system, and extract the graph elements of the structured data and the unstructured data respectively to obtain the graph elements, thereby constructing an initial knowledge graph based on the graph elements, and storing the initial knowledge graph on the server 104. Further, the server 104 can obtain the multi-source original data of the power system from the terminal 102 of the power system, filter out the abnormal data in the multi-source original data, and perform timestamp synchronization processing on the retained multi-source original data to obtain multi-source target data, and then fuse the initial knowledge graph and the multi-source target data to obtain a fused knowledge graph, and then perform graph data reasoning on the fused knowledge graph to obtain graph completion data, and finally, perform graph data completion on the fused knowledge graph based on the graph completion data to obtain the target knowledge graph. The terminal 102 of the power system may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, IoT devices, etc., and a SCADA (Supervisory Control and Data Acquisition) system may be deployed on the terminal 102 to collect data in the power system and transmit the collected data to the server 104. The server 104 may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.
[0063] In one possible implementation, Figure 2 As shown, a structural schematic diagram of a knowledge graph platform for application of a power system knowledge graph construction method is provided, wherein the overall functional structure of the knowledge graph platform includes a data layer, a core layer, and an application layer.
[0064] Specifically, the data layer is used to extract data from the database of the power system through standardized process processing, and uniformly store it as triple data that conforms to the RDF / RDFS / OWL standard, that is, it is stored as triple data that can be used to build a knowledge graph. Among them, the database of the power system includes but is not limited to: MySQL, Oracle, SQL Server, Hive, PostgreSQL. That is, the server can obtain the structured data and unstructured data of the power system based on the data layer of the knowledge graph platform, and extract graph elements from the structured data and unstructured data respectively to obtain graph elements (triplet data that can be used to build the initial knowledge graph).
[0065] Specifically, the core layer is used to provide algorithms and knowledge graph analysis algorithms in the data processing process for data consumption scenarios, including but not limited to: path analysis algorithm, time series analysis algorithm, correlation analysis algorithm, entity fuzzy search algorithm, entity fusion algorithm, entity linking algorithm, entity labeling algorithm, entity alignment, and relationship completion. For example, the server can fuse the initial knowledge graph and multi-source target data based on the entity fusion algorithm and entity alignment to obtain a fused knowledge graph. The server can also perform graph data reasoning on the fused knowledge graph based on the path analysis algorithm and relationship completion to obtain graph completion data.
[0066] Specifically, the application layer is used to provide a variety of business application scenarios such as graph management, concept management, attribute management, entity management, data management, and graph analysis based on data and core algorithm capabilities. Among them, graph management can provide users with a graph list for users to select the required list; graph management can also provide users with the functions of adding new graphs, modifying graphs, graph configuration, and ontology fusion, which is convenient for users to edit graphs and fuse graphs. Concept management can provide users with the functions of concept tree, concept fusion, and concept editing. Attribute management can provide users with the functions of attribute list, attribute fusion, and attribute editing. Entity management can provide users with an entity list for users to select the required entity, and can provide users with the functions of entity fusion and entity publishing. Data management can provide users with the functions of data source configuration, model extraction, and data source editing. Graph analysis can provide users with the functions of key path analysis, entity distribution analysis, and knowledge exploration analysis, which is convenient for users to mine hidden information of knowledge graphs based on graph analysis.
[0067] In an exemplary embodiment, Figure 3 As shown in the figure, a method for constructing a knowledge graph of a power system is provided. Figure 1 The server in the example is used to illustrate, including the following steps 302 to 308. Among them:
[0068] Step 302: Obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements.
[0069] The structured data of the power system includes but is not limited to: attribute feature information, such as power equipment name, equipment code, voltage level, type, label, etc. The unstructured data of the power system includes but is not limited to: a large amount of free text, files, etc., such as fault information, images and reports of the power system.
[0070] Optionally, the server can obtain structured and unstructured data of the power system from the database of the power system, and then extract graph elements from the structured and unstructured data respectively according to the graph element extraction rules corresponding to the structured and unstructured data, and obtain graph elements, that is, triple data that conforms to the RDF / RDFS / OWL standards, so as to build an initial knowledge graph containing entities, relationships between entities, and entity attributes based on graph elements. In the process of building the initial knowledge graph, the server also needs to establish the knowledge system of the graph, associate the source of structured data, associate the concepts of the knowledge system with the data, perform data fusion to avoid data conflicts, and ensure the visualization of the internal relationships of the knowledge graph.
[0071] It should be noted that, taking triple data that conforms to the RDF standard as an example, it is in the form of an RDF graph. An RDF graph can be defined as a finite set of triples (s, p, o), each triple can be expressed as a declarative sentence, s is the subject, p is the predicate, and o is the object, and (s, p, o) represents that resource s has an association relationship p with resource o, or that resource s has attribute p and its value is o. The triple table is the simplest and most direct way to store knowledge graphs in a relational database. The principle is to establish a table with three columns in the relational database. The table mode is: triple table (subject, predicate, object), and each triple in the constructed knowledge graph is stored as a row of records in the triple table. The triple database for RDF graph is a knowledge graph database specially developed for storing large-scale RDF data. It supports SPARQLA, the standard query language of standard RDF. In this embodiment, considering the semantic analysis requirements, component compatibility and scalability, the semantic web RDF model can be selected as the knowledge representation model of the power system knowledge graph. That is, in this embodiment, the triple database supporting RDF graph storage and the open source MongoDB database component can be used to realize the storage of power system related knowledge graph data.
[0072] Step 304 , acquiring multi-source original data of the power system, filtering out abnormal data in the multi-source original data, and performing time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data.
[0073] Optionally, the server can obtain the multi-source original data (a kind of time series data) of the power system collected by the SCADA system from the SCADA system. Among them, the SCADA system collects continuous time series data in the time dimension, and the sampling interval is generally several seconds to several minutes, including hundreds of dimensions, and the recorded content includes the power equipment operation status information and the external environment status information. The power equipment operation status information mainly includes: equipment power generation, power, current, voltage and other information; the external environment status information mainly includes: environmental wind speed, wind direction, temperature, pressure and other information. The data collected and recorded by the SCADA system can form an information network to monitor the information of each device in the power system in real time and comprehensively.
[0074] Furthermore, considering that the data collected by the SCADA system has the characteristics of high noise, delay, coupling, and time series correlation, the server needs to pre-process the multi-source raw data, including but not limited to data cleaning, conversion, feature extraction, etc., to filter out abnormal data in the multi-source raw data, reduce the impact of noise and outliers, improve data quality and reduce data processing complexity. Furthermore, considering the problem of data collection time synchronization from different data sources, the server also needs to use timestamps to synchronize the measurement data from different data sources to ensure that all data can be compared and analyzed under the same time reference, that is, the server can synchronize the retained multi-source raw data with timestamps to obtain multi-source target data.
[0075] For example, the abnormal data in the multi-source raw data can be generally divided into the following types: bottom accumulation type, power band deviation type, middle accumulation type, and discrete type. The preprocessing of these types of data can be implemented based on the Bien method, least squares filtering, and discreteness analysis method to ensure data integrity and accuracy. Among them:
[0076] (1) The Bien method is mainly used for data smoothing, such as processing power curves when the external environment fluctuates greatly. The Bien method is specifically: divide the data into several small intervals in order from small to large, attribute the actual data to these small intervals, calculate the statistical data in each interval by mathematical statistics, and then use the statistical results to replace the actual measured data in the interval. Its basic principle is: divide the data into several small intervals, process the data in each interval by mathematical statistics, divide the standardized data into intervals (the interval length can be set by yourself), and then calculate the standardized average value for each interval to obtain the measurement curve.
[0077] (2) Least squares filtering can be used for polynomial fitting of data and error estimation. If the residual formula is defined as ,in, is the error, is the fitted value, is the true value, then the principle of least squares is to select , so that the sum of squares of errors is minimized, that is .
[0078] (3) The dispersion analysis method is to reflect the degree of deviation of the data from the expected value according to certain indicators through statistical analysis of the data. Among them, the confidence level of the data that conforms to the normal distribution and falls within the range of 2 mean square errors around the mean reaches more than 95%. Based on this, when processing the power system data, the data far away from the center of the power main band can be filtered out, and the integrity of the data can be retained. For example, in the customary power curve of the wind turbine group, when the wind speed is less than the rated wind speed, the power increases exponentially with the increase of wind speed. At this time, the power points are distributed vertically. When the wind speed is greater than the rated wind speed, the power no longer increases with the increase of wind speed. At this time, the power points are distributed horizontally. According to this characteristic of the power curve, the data can be filtered in sections, that is, the section less than the rated wind speed uses horizontal filtering, and the section greater than the rated wind speed uses vertical filtering.
[0079] Step 306, fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph.
[0080] Among them, knowledge fusion mainly solves the problem of knowledge heterogeneity, including language layer heterogeneity and model layer heterogeneity, which is conducive to the formation of a higher quality knowledge base / knowledge graph.
[0081] Optionally, the server may convert the multi-source target data into a knowledge graph to be fused, thereby realizing knowledge fusion by fusing the initial knowledge graph and the knowledge graph to be fused, that is, fusing the initial knowledge graph and the multi-source target data to obtain a fused knowledge graph.
[0082] Step 308, perform graph data inference on the fused knowledge graph to obtain graph completion data, and complete the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0083] Optionally, the server can complete and verify the quality of the fused knowledge graph through a mining algorithm, and can also use a graph structure-based reasoning algorithm, such as a path sorting algorithm, to perform link prediction tasks on the fused knowledge graph. It can also use a reasoning method based on distributed representation learning to map the fused knowledge graph to a vector space to mine implicit associations between entities and relationships in the fused knowledge graph, thereby obtaining graph completion data for the fused knowledge graph, and then completing the graph data of the fused knowledge graph based on the graph completion data to obtain a target knowledge graph, so that the context awareness, reasoning ability, flexibility and scalability provided by the target knowledge graph can be used in the future to support power system decision-making, for example, analyzing abnormal data of the power system based on the target knowledge graph, and providing processing solutions and possible impact ranges.
[0084] Exemplarily, knowledge graph, as a powerful data organization and analysis tool, can provide new possibilities for intelligent decision-making. In this embodiment, data from different sources can be integrated and connected based on the knowledge graph to form a rich, semantic information network. This information network not only records the relationship between entities, but also reveals the implicit associations between data through logical reasoning. Therefore, in the context of decision support, the power system target knowledge graph constructed in this embodiment can provide the following advantages: context awareness, reasoning ability, flexibility and scalability. For example, when the data of a certain power equipment is abnormal, the server can analyze the cause of the abnormal data based on the target knowledge graph, and provide a processing solution and the possible impact range of the processing solution. At the same time, in a visual form, it can promptly push the number, location, voltage level and other information of the equipment associated with the abnormal data to the operation and maintenance personnel of the power system.
[0085] In the above-mentioned power system knowledge graph construction method, the graph elements of the structured data and unstructured data of the power system are first extracted respectively to obtain the graph elements, so as to construct the initial knowledge graph based on the graph elements, so that the data from different data sources in the power system can be stored based on the initial knowledge graph in the future. Furthermore, the multi-source original data of the power system can be obtained, the abnormal data in the multi-source original data can be screened out, and the retained multi-source original data can be synchronized with the timestamp to obtain multi-source target data with higher data quality from different data sources. Then, the initial knowledge graph and the multi-source target data are fused to eliminate the ambiguity between the data from different data sources to obtain the fused knowledge graph, and then the graph data reasoning is performed on the fused knowledge graph to effectively mine the implicit associations between the data from different data sources to obtain the graph completion data, so as to complete the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph, so that the data from different data sources stored in the target knowledge graph can be used to provide effective support for the management and operation of the power system in the future. That is, based on the above method, a target knowledge graph can be obtained, which can eliminate ambiguity between data from different data sources in the power system, effectively mine implicit associations between data from different data sources, and store data from different data sources in the power system. This is conducive to the subsequent provision of effective support for the management and operation and maintenance of the power system based on the multi-source data integrated in the target knowledge graph.
[0086] In an exemplary embodiment, graph elements are extracted from structured data and unstructured data respectively to obtain graph elements, including:
[0087] Based on the graph element mapping rule configured for the structured data, extract the graph element from the structured data to obtain a first graph element;
[0088] Based on the data volume and domain type of the unstructured data, determine a graph element extraction rule that matches the unstructured data, and extract the graph elements from the unstructured data according to the graph element extraction rule to obtain a second graph element;
[0089] The first graph element and the second graph element are collected to obtain a graph element for constructing an initial knowledge graph.
[0090] Optionally, for structured data, graph element mapping rules can be predefined, and the server can store the defined graph element mapping rules, such as which database table structures in structured data can correspond to which types of graph elements (classes, attributes, entities, etc.). Based on this, the server can extract graph elements from the structured data based on the graph element mapping rules configured for the structured data to obtain the first graph element, that is, according to the graph element mapping rules, directly convert the database table structure in the structured data into triple data that conforms to the RDF / RDFS / OWL standard.
[0091] Optionally, for unstructured data, the server can first determine the graph element extraction rules that match the unstructured data based on the data volume and domain type of the unstructured data, and judge whether to extract based on the text extraction template or based on the preset data extraction model, and then extract graph elements from the unstructured data according to the determined graph element extraction rules to obtain the second graph element, that is, triple data that conforms to the RDF / RDFS / OWL standard.
[0092] Finally, the server can collect the first graph element and the second graph element to obtain the graph element used to construct the initial knowledge graph.
[0093] In this embodiment, for structured data and unstructured data, graph elements can be extracted in an adaptive manner respectively, which is conducive to obtaining more accurate graph elements, thereby ensuring the accuracy of the constructed initial knowledge graph, and constructing a knowledge graph that is adapted to the data structure of multi-source data of the power system (including structured and unstructured), which is convenient for subsequent fusion / storage of multi-source data of the power system.
[0094] In one embodiment, based on the data volume and domain type of the unstructured data, a graph element extraction rule matching the unstructured data is determined, and according to the graph element extraction rule, the unstructured data is subjected to graph element extraction to obtain a second graph element, including:
[0095] When the amount of unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where there are extractable semantic features, extracting semantic features from the unstructured data;
[0096] generating a text extraction template matching the extracted semantic features;
[0097] Based on the text extraction template, the second graph element is extracted from the unstructured data.
[0098] Among them, the second graph element extraction algorithm based on text extraction template is suitable for small-scale and limited-domain entity relationship extraction problems.
[0099] Optionally, when the amount of unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where there are extractable semantic features, in this case, the structure of the unstructured data is simple, and specific semantic features can be quickly and accurately extracted. Based on this, the server can extract semantic features from the unstructured data according to a preset natural language processing algorithm or manually configured extraction rules. Furthermore, the server can generate a fixed-format text extraction template that matches the extracted semantic features, and then extract the second graph element from the unstructured data based on the text extraction template.
[0100] For example, taking unstructured data as an example, the equipment associated with the power system project is usually named in the form of "XXX station#main transformer, XX line", and the names of substations, transformers, and lines show more prominent template attributes. For this type of data, the server can extract more obvious semantic features, thereby generating a text extraction template, and then can quickly realize relationship extraction on small-scale data sets.
[0101] In this embodiment, for unstructured data with a small amount of data or belonging to a limited field, the second graph element can be quickly extracted by extracting semantic features and then generating a text extraction template based on the extracted semantic features.
[0102] In one embodiment, based on the data volume and domain type of the unstructured data, a graph element extraction rule matching the unstructured data is determined, and according to the graph element extraction rule, the unstructured data is subjected to graph element extraction to obtain a second graph element, including:
[0103] When the amount of unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open domain from which no semantic features can be extracted, the unstructured data is labeled;
[0104] Based on the preset data extraction model, graph elements are extracted from the unstructured data that has completed data annotation to obtain the second graph elements.
[0105] Optionally, when the amount of unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open field where no semantic features can be extracted, in this case, the structure of the unstructured data is complex, and specific semantic features cannot be extracted quickly and accurately. Based on this, the server can annotate the unstructured data according to manually triggered data annotation instructions, and then extract graph elements from the annotated unstructured data based on a preset data extraction model to obtain a second graph element.
[0106] Exemplarily, the preset data extraction model can be specifically: an LSTM-CRF entity recognition model constructed based on conditional random fields (CRF) and long short-term memory neural network (LSTM), that is, the server can obtain the second graph element based on the LSTM-CRF entity recognition model by data annotation and graph element extraction for unstructured data in WORD / PDF / WPS format with a data volume greater than or equal to a preset amount or belonging to an open domain.
[0107] Further, such as Figure 4 As shown in the figure, a schematic diagram of the LSTM-CRF entity recognition model is provided. The LSTM-CRF entity recognition model can include an Embedding layer, a bidirectional LSTM layer, and a CRF layer. The Embedding layer includes structures such as Mark, Watney, Visisted, and Mars. The bidirectional LSTM layer includes structures such as l1~l4, r1~r4, and c1~c4. The CRF layer includes structures such as B-PER, B-PER, O, and S-LOC. Embedding is not just used to simply number or identify objects, but to map objects to a high-dimensional feature space through feature abstraction and encoding while trying to maintain the similarity between objects. It can capture the similarity and relationship between objects. LSTM is a variant of a recurrent neural network (RNN) that aims to solve the gradient vanishing and gradient exploding problems of traditional RNN when processing long sequences, and can effectively capture and process long-term dependencies in sequence data. CRF is a typical discriminant model that has good applications in word segmentation, part-of-speech tagging, named entity recognition, and other fields.
[0108] In this embodiment, for unstructured data with large data volume or belonging to open fields, the second graph elements can be extracted quickly and accurately through a preset data extraction model.
[0109] In one embodiment, the initial knowledge graph and multi-source target data are fused to obtain a fused knowledge graph, including:
[0110] Generate a to-be-fused atlas containing multi-source target data;
[0111] Perform knowledge graph alignment processing on the initial knowledge graph and the graph to be fused, and determine the equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused;
[0112] Based on the equivalent graph element pairs, the initial knowledge graph and the graph to be fused are fused to obtain a fused knowledge graph.
[0113] Among them, merging two knowledge graphs can eliminate the ambiguity between entities, relationships, and attributes in the two knowledge graphs, form a high-quality knowledge base, and solve the heterogeneity problem of the two knowledge graphs. The ideas for solving the heterogeneity problem can specifically include: fusion solutions at the abstract layer - ontology matching, instance matching, and considering the calculation of attribute similarity and entity similarity of the data during the fusion process.
[0114] Optionally, the server may generate a graph to be fused containing multi-source target data, and then perform data preprocessing on the initial knowledge graph and the graph to be fused, such as grammatical normalization and data normalization, respectively, to improve the accuracy of subsequent knowledge graph alignment. Then, the server may perform knowledge graph alignment on the initial knowledge graph after data preprocessing and the graph to be fused, that is, calculate the attribute similarity between the initial knowledge graph and the graph to be fused, and obtain the attribute similarity vector by combining the single attribute similarity, thereby obtaining the entity similarity according to the attribute similarity vector, and then determine the equivalent entity pairs (combinations of similar entities in the two graphs) and equivalent class / subclass pairs (combinations of similar classes / subclasses in the two graphs) between the initial knowledge graph and the knowledge graph to be fused based on the entity similarity, and use the equivalent entity pairs and equivalent class / subclass pairs as equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused. Furthermore, the server may record the links between the two graphs based on the equivalent graph element pairs, so as to fuse the initial knowledge graph and the graph to be fused according to the links between the two graphs to obtain a fused knowledge graph.
[0115] Furthermore, according to the link between the two graphs, the initial knowledge graph and the graph to be fused are fused to obtain the fused knowledge graph, which may specifically include: selecting the equivalent element pairs of potential matches as candidates according to the equivalent element pairs to which the links between the two graphs belong, and reducing the size of the candidates as much as possible to achieve data blocking. At the same time, based on the principle of load balancing, the number of entities in all blocks is ensured to be equal, thereby ensuring the degree of performance improvement of the blocking. Based on this, the server can fuse the initial knowledge graph and the graph to be fused, and during the fusion process, evaluate the accuracy, recall rate and other indicators of the knowledge graph obtained after the fusion. If the indicator evaluation meets the standard, the fused knowledge graph is output. Among them, the commonly used blocking methods include Hash function-based blocking, neighbor blocking, etc. Hash function-based blocking can be implemented based on the following methods: combining multiple simple hash functions, Canopy clustering, sorting neighbor algorithm, Red-Blue SetCover, etc. Load balancing can be achieved through multiple Map-Reduce operations.
[0116] For example, based on the above process of fusing knowledge graphs, the process of fusing knowledge graphs in this embodiment can be specifically as follows: Figure 5 As shown, that is, the server can first perform data preprocessing on the initial knowledge graph and the graph to be fused, and then align the knowledge graphs to record the links between the two graphs, so as to block the entities of the two graphs according to the links. In the blocking process, the load balancing principle must be followed to achieve the fusion of the two graphs. At the same time, the fused graph will be evaluated. When it is determined that all the evaluation indicators are qualified, the fused knowledge graph can be output.
[0117] Exemplarily, the attribute similarity calculation may specifically include:
[0118] (1) Calculate attribute similarity based on edit distance, which may include calculating attribute similarity based on Levenshtein Distance, Wagner and Fisher Distance, and Edit Distance with affine gaps. The purpose of calculating Levenshtein Distance (minimum edit distance) is to convert one string into another with the least editing operations. It is a typical dynamic programming problem and can be calculated using a dynamic programming algorithm. For example, calculate the edit distance between Lvensshtain and Levenshtein: Converting Lvensshtain to Levenshtein requires 3 operations, and the edit distance is 3. The edit distance represents the cost of editing operations such as insertion, deletion, and substitution. Furthermore, Wagner and Fisher Distance is an extension of Levenshtein Distance, which assigns different weights to the cost of editing operations, where del, ins, and sub are the costs of deletion, insertion, and substitution, respectively. Furthermore, Edit Distance withaffine gaps introduces the concept of gap based on Levenshtein Distance and Wagner and Fisher Distance, replacing editing operations such as insertion, deletion and replacement with gap opening and gap extension, where s is the cost of open extension, e is the cost of extend gap, and l is the length of gap. For example, to calculate the distance between Lvenshtain and Levenshtein, first align the two words head to tail, and regard the corresponding missing parts as gaps. The first e and the third to last e are missing from the upper and lower words, which are two gaps. The lower word is missing an s and an a from the upper word, which are two gaps. Adding them together, there are 4 gaps, and the length of each gap is 1.
[0119] (2) Calculate attribute similarity based on set similarity, which can specifically include measuring similarity based on Dice coefficient / Jaccard coefficient / TF-IDF. Among them, the Dice coefficient is used to measure the similarity between two sets. Since a string can be understood as a set, the Dice coefficient can be used to measure the similarity of strings. Taking Lvensshtain and Levenshtein as an example, the similarity between the two is 2*9 / (11+11)=0.82. The Jaccard coefficient is suitable for processing the similarity of short texts and is similar to the definition of the Dice coefficient. Both coefficients can convert text into sets. In addition to using symbols to separate words, you can also consider using n-grams to separate words, using n-grams to separate sentences, etc. to construct sets and calculate similarity. Measuring similarity based on TF-IDF is mainly used to evaluate the importance of a character or a word to a document. For example, there are 50,000 articles in a corpus, 20,000 of which contain the word "health". Now there is an article with 1,000 words, and "health" appears 30 times. Then simTF-IDF=30 / 1000*log(50000 / (20000+1))=0.012.
[0120] Exemplarily, the calculation of entity similarity may include: (1) Aggregation: weighted average method, that is, weighted sum of each component of the similarity score vector to obtain the final entity similarity, and set a threshold for each component of the similarity vector. If the threshold is exceeded, the two entities are connected. (2) Clustering: Clustering can be divided into hierarchical clustering, correlation clustering, Canopy+K-means, etc. Hierarchical clustering can divide data at different levels by calculating the similarity between data points of different categories, and finally form a tree-like clustering structure. (3) Representation learning: Map the entities and relationships in the knowledge graph to low-dimensional space vectors, and directly use mathematical expressions to calculate the similarity between each entity. This type of method does not rely on any text information, and obtains the deep features of the data.
[0121] In this embodiment, the fusion of the initial knowledge graph and the graph to be fused containing multi-source target data can be realized, so as to achieve the fusion of the knowledge graph structure and the multi-source data in the power system, which is conducive to eliminating ambiguity between multi-source data in the power system and forming a high-quality knowledge base, so that the management and operation of the power system can be effectively supported in the future based on the multi-source data carried in the target knowledge graph.
[0122] In one embodiment, graph data reasoning is performed on the fused knowledge graph to obtain graph completion data, and graph data completion is performed on the fused knowledge graph based on the graph completion data to obtain a target knowledge graph, including:
[0123] Perform relationship mining on the connection relationships between multiple entities in the fusion knowledge graph to obtain the first graph completion data;
[0124] Based on the path formed by the connection relationship between multiple entities in the fusion knowledge graph, the path prediction is performed to obtain the second graph completion data;
[0125] Obtaining distributed vector representations of the connection relationships between entities in the fused knowledge graph, extracting implicit association information in the fused knowledge graph from the distributed vector representation, and obtaining third graph completion data;
[0126] Based on the first graph completion data, the second graph completion data and the third graph completion data, the graph data of the fused knowledge graph is completed to obtain the target knowledge graph.
[0127] Optionally, the server can perform relationship mining on the connection relationships between multiple entities in the fused knowledge graph based on a rule reasoning algorithm to obtain the first graph completion data. Among them, the rule reasoning algorithm can be specifically implemented based on the AMIE algorithm (Association Rule Mining under Incomplete Evidence, an association rule mining algorithm based on an incomplete knowledge base). The AMIE algorithm supports mining closed rules from an incomplete knowledge base. The AMIE algorithm can learn to predict the rules for each relationship in turn. For each relationship, starting from the rule with an empty rule body, the rule body can be expanded through three operations to retain candidate (closed) rules with support greater than a threshold. Figure 6 As shown in Figure 1, a schematic diagram of the workflow of the AMIE algorithm is provided. It follows the rule of marriedTo(y,z)ˆhasChild(y,x)→hasChild(z,x) to expand the rule body. The three operations include: adding hanging edges, that is, Figure 6 Add dangling atom in (O D ), a hanging edge means that one end of the edge is a variable that has not appeared before, while the other end has appeared in the rule; add an instance edge, which is similar to a hanging edge. One end of the edge is also a variable or constant that has appeared in the rule, but the other end is a constant that has not appeared before, that is, an entity in the knowledge base; add a closed edge, that is Figure 6 Add closing atom in (O C ), a closed edge is an edge that connects two elements (variables or constants) that already exist in the rule.
[0128] Optionally, the server can perform path prediction based on a path ranking algorithm and a path formed by connection relationships between multiple entities in the fused knowledge graph to obtain the second graph completion data. Among them, the Path Ranking Algorithm (PRA) is an inference algorithm that uses relationship paths as features and is usually used for link prediction tasks in knowledge graphs. Because the relationship path it obtains actually corresponds to a Horn clause, the path features calculated by the PRA algorithm can be converted into logical rules, which facilitates the discovery and understanding of hidden knowledge in the knowledge graph. The basic idea of the PRA algorithm is to predict a certain specific relationship that may exist between entities by discovering a set of relationship paths connecting two entities. The main contents include: feature extraction, feature calculation, and classifier training.
[0129] Optionally, the server can obtain the distributed vector representation of the connection relationship between entities and entities in the fused knowledge graph based on reasoning based on distributed representation learning, and then extract the implicit association information in the fused knowledge graph from the distributed vector representation to obtain the third graph completion data. Among them, the central idea based on distributed representation learning is to find a mapping function to map the symbolic representation to the vector space for numerical representation, thereby reducing the dimensionality disaster and capturing the implicit association between entities and relationships. The key point is that it can be calculated directly and quickly. Distributed representation learning can specifically include: TransE (Translating Embedding) series algorithms, etc., which can be used for downstream tasks such as node classification, link prediction, etc.
[0130] Finally, the server can complete the graph data of the fused knowledge graph based on the first graph completion data, the second graph completion data and the third graph completion data, and during the completion process, perform conflict detection and eliminate conflicting completion content to obtain the target knowledge graph.
[0131] In this embodiment, by performing graph data reasoning on the fused knowledge graph, new facts, new relationships, new rules, etc. can be inferred from the fused knowledge graph, which is conducive to enriching the multi-source data in the obtained target knowledge graph and facilitating subsequent analysis based on the data in the target knowledge graph.
[0132] In one possible implementation, Figure 7 As shown, a flow chart of another method for constructing a power system knowledge graph is provided, which mainly includes the following steps:
[0133] Step 702, obtaining structured data and unstructured data of the power system;
[0134] Step 704: extracting graph elements from the structured data based on the graph element mapping rule configured for the structured data to obtain a first graph element;
[0135] When the amount of unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where there are extractable semantic features, step 706 is executed to extract the semantic features in the unstructured data, generate a text extraction template matching the extracted semantic features, and extract a second graph element from the unstructured data based on the text extraction template;
[0136] When the amount of unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open domain from which no semantic features can be extracted, step 708 is executed to annotate the unstructured data, and based on a preset data extraction model, graph elements are extracted from the annotated unstructured data to obtain a second graph element.
[0137] Step 710, collecting the first graph element and the second graph element to obtain a graph element for constructing an initial knowledge graph, and constructing the initial knowledge graph based on the graph element;
[0138] Step 712, filtering out abnormal data from the multi-source original data of the power system, and performing time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0139] Step 714, generating a to-be-fused atlas containing multi-source target data;
[0140] Step 716, performing knowledge graph alignment processing on the initial knowledge graph and the graph to be fused, and determining equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused;
[0141] Step 718, based on the equivalent graph element pairs, the initial knowledge graph and the graph to be fused are fused to obtain a fused knowledge graph;
[0142] Step 720, performing relationship mining on the connection relationship of multiple entities in the fused knowledge graph to obtain first graph completion data;
[0143] Step 722, based on the path formed by the connection relationship between multiple entities in the fused knowledge graph, path prediction is performed to obtain second graph completion data;
[0144] Step 724, obtaining a distributed vector representation of the connection relationship between entities in the fused knowledge graph, extracting implicit association information in the fused knowledge graph from the distributed vector representation, and obtaining third graph completion data;
[0145] Step 726, based on the first graph completion data, the second graph completion data and the third graph completion data, the graph data of the fused knowledge graph is completed to obtain the target knowledge graph.
[0146] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0147] Based on the same inventive concept, the embodiment of the present application also provides a power system knowledge graph construction device for implementing the power system knowledge graph construction method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more power system knowledge graph construction device embodiments provided below can refer to the limitations of the power system knowledge graph construction method above, and will not be repeated here.
[0148] In an exemplary embodiment, Figure 8 As shown, a power system knowledge graph construction device is provided, including: an initial graph construction module 802, a multi-source target data acquisition module 804, a graph fusion module 806 and a graph data reasoning module 808, wherein:
[0149] The initial graph construction module is used to obtain structured data and unstructured data of the power system, extract graph elements from the structured data and unstructured data respectively, obtain graph elements, and construct the initial knowledge graph based on the graph elements;
[0150] A multi-source target data acquisition module is used to acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data;
[0151] The graph fusion module is used to fuse the initial knowledge graph and multi-source target data to obtain a fused knowledge graph;
[0152] The graph data inference module performs graph data inference on the fused knowledge graph to obtain graph completion data, and completes the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph.
[0153] In the above-mentioned power system knowledge graph construction device, the structured data and unstructured data of the power system are firstly respectively extracted from the graph elements to obtain the graph elements, thereby constructing the initial knowledge graph based on the graph elements, so that the data from different data sources in the power system can be stored based on the initial knowledge graph in the future. Further, the multi-source original data of the power system can be obtained, the abnormal data in the multi-source original data can be screened out, and the retained multi-source original data can be synchronized with the timestamp to obtain multi-source target data with higher data quality from different data sources. Then, the initial knowledge graph and the multi-source target data are fused to eliminate the ambiguity between the data from different data sources to obtain the fused knowledge graph, and then the graph data reasoning is performed on the fused knowledge graph to effectively mine the implicit association between the data from different data sources to obtain the graph completion data, thereby completing the graph data of the fused knowledge graph based on the graph completion data to obtain the target knowledge graph, so that the data from different data sources stored in the target knowledge graph can be used to provide effective support for the management and operation of the power system in the future. That is, based on the above method, a target knowledge graph can be obtained, which can eliminate ambiguity between data from different data sources in the power system, effectively mine implicit associations between data from different data sources, and store data from different data sources in the power system. This is conducive to the subsequent provision of effective support for the management and operation and maintenance of the power system based on the multi-source data integrated in the target knowledge graph.
[0154] In one of the embodiments, the initial graph construction module is also used to: extract graph elements from structured data based on graph element mapping rules configured for structured data to obtain first graph elements; determine graph element extraction rules that match unstructured data based on the data volume and domain type of unstructured data, and extract graph elements from unstructured data according to the graph element extraction rules to obtain second graph elements; and collect the first graph elements and the second graph elements to obtain graph elements for constructing the initial knowledge graph.
[0155] In one of the embodiments, the initial graph construction module is also used to: extract semantic features from the unstructured data when the amount of unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where extractable semantic features exist; generate a text extraction template that matches the extracted semantic features; and extract a second graph element from the unstructured data based on the text extraction template.
[0156] In one of the embodiments, the initial graph construction module is also used to: when the amount of unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open domain where no semantic features can be extracted, annotate the unstructured data; and extract graph elements from the annotated unstructured data based on a preset data extraction model to obtain a second graph element.
[0157] In one of the embodiments, the graph fusion module is also used to: generate a graph to be fused containing multi-source target data; perform knowledge graph alignment processing on the initial knowledge graph and the graph to be fused, and determine the equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused; based on the equivalent graph element pairs, fuse the initial knowledge graph and the graph to be fused to obtain a fused knowledge graph.
[0158] In one of the embodiments, the graph data inference module is also used to: perform relationship mining on the connection relationship between multiple entities in the fused knowledge graph to obtain first graph completion data; perform path prediction based on the path formed by the connection relationship between multiple entities in the fused knowledge graph to obtain second graph completion data; obtain a distributed vector representation of the connection relationship between entities in the fused knowledge graph, extract implicit association information in the fused knowledge graph from the distributed vector representation, and obtain third graph completion data; perform graph data completion on the fused knowledge graph based on the first graph completion data, the second graph completion data, and the third graph completion data to obtain a target knowledge graph.
[0159] Each module in the above-mentioned power system knowledge graph construction device can be implemented in whole or in part by software, hardware and their combination. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0160] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Fig. 9 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store power system knowledge graph construction data. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for constructing a power system knowledge graph is implemented. Those skilled in the art can understand that Fig. 9The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0161] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0162] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0163] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0164] It should be noted that the information (including but not limited to device information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0165] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0166] The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of the present application. The above-mentioned embodiments only express several implementation methods of the present application, and their descriptions are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present application. It should be pointed out that for ordinary technicians in this field, without departing from the concept of the present application, several deformations and improvements can be made, which all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the attached claims.
Claims
1. A method for constructing a knowledge graph of a power system. It is characterized in that The method comprises: Acquire structured data and unstructured data of the power system, extract graph elements from the structured data and the unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements; Acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data; Fusing the initial knowledge graph and the multi-source target data to obtain a fused knowledge graph; Perform graph data inference on the fused knowledge graph to obtain graph completion data, and perform graph data completion on the fused knowledge graph based on the graph completion data to obtain a target knowledge graph.
2. The method according to claim 1, It is characterized in that The extracting graph elements from the structured data and the unstructured data respectively to obtain graph elements includes: Based on the graph element mapping rule configured for the structured data, extracting the graph element from the structured data to obtain a first graph element; Based on the data volume and domain type of the unstructured data, determine a graph element extraction rule matching the unstructured data, and extract graph elements from the unstructured data according to the graph element extraction rule to obtain a second graph element; The first graph element and the second graph element are collected to obtain a graph element for constructing the initial knowledge graph.
3. The method according to claim 2, It is characterized in that The step of determining a graph element extraction rule matching the unstructured data based on the data volume and domain type of the unstructured data, and extracting graph elements from the unstructured data according to the graph element extraction rule to obtain a second graph element includes: When the amount of the unstructured data is less than a preset amount, or the unstructured data belongs to a limited field where there are extractable semantic features, extracting semantic features from the unstructured data; generating a text extraction template matching the extracted semantic features; Based on the text extraction template, a second graph element is extracted from the unstructured data.
4. The method according to claim 2, It is characterized in that The step of determining a graph element extraction rule matching the unstructured data based on the data volume and domain type of the unstructured data, and extracting graph elements from the unstructured data according to the graph element extraction rule to obtain a second graph element includes: When the amount of the unstructured data is greater than or equal to a preset amount, or the unstructured data belongs to an open domain from which no semantic features can be extracted, data annotation is performed on the unstructured data; Based on the preset data extraction model, graph elements are extracted from the unstructured data that has completed data annotation to obtain the second graph elements.
5. The method according to claim 1, It is characterized in that The fusing the initial knowledge graph and the multi-source target data to obtain a fused knowledge graph includes: Generate a to-be-fused atlas containing the multi-source target data; Performing knowledge graph alignment processing on the initial knowledge graph and the graph to be fused, and determining equivalent graph element pairs between the initial knowledge graph and the knowledge graph to be fused; Based on the equivalent graph element pairs, the initial knowledge graph and the graph to be fused are fused to obtain a fused knowledge graph.
6. The method according to claim 1, It is characterized in that The performing graph data reasoning on the fused knowledge graph to obtain graph completion data, and performing graph data completion on the fused knowledge graph based on the graph completion data to obtain a target knowledge graph, includes: Performing relationship mining on the connection relationships between multiple entities in the fused knowledge graph to obtain first graph completion data; Based on the path formed by the connection relationship between multiple entities in the fused knowledge graph, path prediction is performed to obtain second graph completion data; Obtaining a distributed vector representation of the connection relationship between entities in the fused knowledge graph, extracting implicit association information in the fused knowledge graph from the distributed vector representation, and obtaining third graph completion data; Based on the first graph completion data, the second graph completion data and the third graph completion data, the graph data of the fused knowledge graph is completed to obtain a target knowledge graph.
7. A device for constructing a knowledge graph of a power system, It is characterized in that The device comprises: An initial graph construction module is used to obtain structured data and unstructured data of the power system, extract graph elements from the structured data and the unstructured data respectively to obtain graph elements, and construct an initial knowledge graph based on the graph elements; A multi-source target data acquisition module is used to acquire multi-source original data of the power system, filter out abnormal data in the multi-source original data, and perform time stamp synchronization processing on the retained multi-source original data to obtain multi-source target data; A graph fusion module, used to fuse the initial knowledge graph and the multi-source target data to obtain a fused knowledge graph; The graph data inference module performs graph data inference on the fused knowledge graph to obtain graph completion data, and performs graph data completion on the fused knowledge graph based on the graph completion data to obtain a target knowledge graph.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program. It is characterized in that When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, It is characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Power grid monitoring field knowledge graph construction method based on multi-source data fusion
CN113094516A
Data access and integration method based on power brain
CN113255917A
Analysis processing and knowledge graph construction method based on multi-source heterogeneous big data
CN115640406A
Construction method of target time sequence knowledge graph oriented to space-based data
CN115718805A
Urban microgrid operation and maintenance risk prediction method, device, equipment and medium
CN116205346A
Cited By
Automatic data cleaning method and system based on knowledge graph
CN118916354A
Data source management method and system based on automatic operation and maintenance tool
CN120256411A
Periodical knowledge graph construction method, periodical knowledge question-answering method and periodical knowledge graph construction device
CN120373432A
Power operation data processing method and device, electronic equipment and storage medium
CN121390591A
