Knowledge graph enhancement methods and electronic devices for power construction data sources

By constructing a knowledge graph of power construction data sources, generating neighborhood subgraphs, and performing information fusion and reasoning, the problem of low information density in traditional power construction safety management is solved, achieving more efficient and accurate risk identification and management.

CN121212299BActive Publication Date: 2026-04-03STATE GRID BEIJING ELECTRIC POWER CO +3
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-04-03

AI Technical Summary

Technical Problem

Traditional power construction safety management methods suffer from limited coverage, incomplete risk assessment, and low information density of knowledge graphs, making it difficult to efficiently and accurately extract and utilize key information.

Method used

By constructing a knowledge graph of power construction data sources, multiple entities and connections are obtained, a neighborhood subgraph is generated, the neighborhood subgraph is merged with the target entity, and information reasoning and enhancement are performed using a cross-attention model to dynamically update the knowledge graph.

Benefits of technology

It improves the information density and overall quality of knowledge graphs, enhances the accuracy and efficiency of risk identification and management, and supports real-time security decision-making and risk control.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121212299B_ABST
    Figure CN121212299B_ABST
Patent Text Reader

Abstract

This invention discloses a method and electronic device for enhancing the knowledge graph of a power construction data source. The method includes: acquiring a knowledge graph of the power construction data source, wherein the knowledge graph is constructed through multiple entities and first connection relationships between the entities; constructing a neighborhood subgraph of a target entity among the multiple entities based on the knowledge graph, wherein the neighborhood subgraph represents local information associated with the target entity in the knowledge graph; fusing the neighborhood subgraph and the target entity to obtain a fusion result, and performing reasoning on the target entity based on the fusion result to obtain extended information of the target entity; and enhancing the knowledge graph based on the extended information to obtain a target knowledge graph. This invention solves the technical problem of low information density in knowledge graphs in related technologies.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power systems, and more specifically, to a method and electronic device for enhancing the knowledge graph of power construction data sources. Background Technology

[0002] With the increasing complexity and openness of power systems, traditional power construction safety management methods face challenges such as limited coverage and incomplete risk assessment. The complexity, variability, and uncertainty of construction sites require management strategies to identify and assess various safety hazards in real time and accurately to achieve refined risk control. Therefore, constructing a comprehensive knowledge graph in the field of power construction safety has become a research hotspot. A knowledge graph can systematically integrate information from various aspects of the power construction process, including equipment, personnel, and environment, providing a data foundation for risk identification and management.

[0003] However, knowledge graphs are large in scale and complex in structure. How to efficiently and accurately extract and utilize key information from them has become an urgent problem to be solved. Traditional reasoning methods often struggle to handle such complex knowledge structures, resulting in low information density of knowledge graphs in related technologies.

[0004] There is currently no effective solution to the above problems. Summary of the Invention

[0005] This invention provides a method and electronic device for enhancing the knowledge graph of power construction data sources, in order to at least solve the technical problem of low information density of knowledge graphs in related technologies.

[0006] According to one aspect of the present invention, a method for enhancing a knowledge graph of a power construction data source is provided, comprising: acquiring a knowledge graph of the power construction data source, wherein the knowledge graph is constructed through multiple entities and first connection relationships between the multiple entities; constructing a neighborhood subgraph of a target entity among the multiple entities based on the knowledge graph, wherein the neighborhood subgraph is used to represent local information associated with the target entity in the knowledge graph; fusing the neighborhood subgraph and the target entity to obtain a fusion result, and performing reasoning on the target entity based on the fusion result to obtain extended information of the target entity; and enhancing the knowledge graph based on the extended information to obtain a target knowledge graph.

[0007] Furthermore, the knowledge graph of the power construction data source is obtained, including: obtaining the power construction data source and its data storage structure and data representation; extracting multiple entities and the first connection relationships between the multiple entities based on the data storage structure and data representation; performing format conversion based on the multiple entities and the connection relationships between the multiple entities to obtain the format data of the power construction data source; and generating the knowledge graph corresponding to the power construction data source based on the format data.

[0008] Furthermore, based on the knowledge graph, a neighborhood subgraph of the target entity among multiple entities is constructed, including: traversing other entities in the knowledge graph associated with the target entity, and the second connection relationship between the target entity and other entities; and constructing a neighborhood subgraph of the target entity based on the other entities and the second connection relationship.

[0009] Further, constructing a neighborhood subgraph of the target entity based on other entities and the second connection relationship includes: in response to the inclusion of multiple other sub-entities among the other entities, determining that the second connection relationship contains multiple sub-connection relationships between multiple other sub-entities and the target entity; ranking the multiple other sub-entities based on the association strength between the multiple other sub-entities and the target entity to obtain a first ranking result; ranking the multiple sub-connection relationships based on the association strength between the multiple sub-connection relationships and the target entity to obtain a second ranking result; and constructing a neighborhood subgraph based on the first ranking result and the second ranking result.

[0010] Furthermore, based on the first and second sorting results, a neighborhood subgraph is constructed, including: based on the first and second sorting results, determining the target sub-entity among multiple other sub-entities and the target sub-connection among multiple sub-connection relationships; and constructing a neighborhood subgraph with the target entity and target sub-entity as nodes and the target sub-connection as edges.

[0011] Furthermore, the multiple other sub-entities are ranked based on the association strength between the multiple other sub-entities and the target entity to obtain a first ranking result, including: mapping the multiple other sub-entities and the target entity to the target vector space to obtain a first vector of the multiple other sub-entities and a second vector of the target entity; and ranking the multiple other sub-entities based on the cosine similarity of the first vector and the second vector to obtain the first ranking result.

[0012] Furthermore, the multiple sub-connections are sorted based on the association strength between the multiple sub-connections and the target entity to obtain a second sorting result, including: mapping the multiple sub-connections and the target entity to the target vector space to obtain the third vector of the multiple sub-connections and the second vector of the target entity; and sorting the multiple sub-connections based on the cosine similarity between the third vector and the second vector to obtain the second sorting result.

[0013] Furthermore, the neighborhood subgraph and the target entity are fused to obtain the fusion result, including: inputting the neighborhood subgraph and the target entity into the cross-attention model, and using the cross-attention model to fuse the neighborhood subgraph and the target entity to obtain the fusion result.

[0014] Furthermore, the cross-attention model includes a first cross-attention layer and a second cross-attention layer. The neighborhood subgraph and the target entity are input into the cross-attention model, and the neighborhood subgraph and the target entity are fused using the cross-attention model to obtain a fusion result. This includes: using the first cross-attention layer to map the neighborhood subgraph to the target vector space to obtain a fourth vector of the neighborhood subgraph; using the second cross-attention layer to fuse the fourth vector and the second vector to obtain a fusion vector; and determining the fusion result based on the fusion vector.

[0015] Furthermore, the method also includes: constructing a loss function based on the fusion vector and the standard fusion vector, wherein the standard fusion vector is the standard fusion vector of the neighborhood subgraph and the target entity; and using the loss function to update the model parameters of the attention model.

[0016] According to another aspect of the present invention, a knowledge graph enhancement device for power construction data sources is also provided, comprising: an acquisition module for acquiring a knowledge graph of a power construction data source, wherein the knowledge graph is constructed through multiple entities and a first connection relationship between the multiple entities; a construction module for constructing a neighborhood subgraph of a target entity among the multiple entities based on the knowledge graph, wherein the neighborhood subgraph is used to represent local information associated with the target entity in the knowledge graph; a fusion module for fusing the neighborhood subgraph and the target entity to obtain a fusion result, and performing reasoning on the target entity based on the fusion result to obtain extended information of the target entity; and an enhancement module for enhancing the knowledge graph based on the extended information to obtain a target knowledge graph.

[0017] According to another aspect of the present invention, an electronic device is also provided, comprising: a memory storing an executable program; and a processor for running the program, wherein the program executes the knowledge graph enhancement method for the power construction data source described above when it runs.

[0018] According to another aspect of the present invention, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to execute the knowledge graph enhancement method for the power construction data source described above.

[0019] In this embodiment of the invention, firstly, a knowledge graph of the power construction data source is obtained; then, a neighborhood subgraph of the target entity among multiple entities is constructed based on the knowledge graph; secondly, the neighborhood subgraph and the target entity are fused to obtain a fusion result, and the target entity is inferred based on the fusion result to obtain extended information of the target entity; finally, the knowledge graph is enhanced based on the extended information to obtain the target knowledge graph. It is noteworthy that this application constructs a knowledge graph through multiple entities and the first connection relationships between them, determines a neighborhood subgraph based on local information associated with the target entity in the knowledge graph, and then fuses the neighborhood subgraph with the target entity to obtain a fusion result; next, based on the fusion result, the target entity is inferred to identify potential risks or associated information to obtain extended information; finally, the extended information obtained through inference is fed back to the original knowledge graph to form the target knowledge graph. The above mechanisms, through the construction of neighborhood subgraphs, ensure the local precision of information, enabling the model to perform reasoning based on the most relevant entities and relationships, thus improving the efficiency and accuracy of reasoning. Dynamic updates to the knowledge graph allow it to continuously improve with the discovery of new information. Furthermore, feedback from reasoning results allows the knowledge graph to supplement and correct the connections between entities, increasing information density and ensuring the integrity of knowledge representation. This achieves the technical objective of enhancing the knowledge graph, improving the local precision of entity association information, enhancing the overall quality and update efficiency of the knowledge graph, and ultimately solving the technical problem of low information density in knowledge graphs in related technologies. Attached Figure Description

[0020] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0021] Figure 1 This is a flowchart of a knowledge graph augmentation method for power construction data sources according to an embodiment of the present invention;

[0022] Figure 2 This is a flowchart of an optional knowledge graph augmentation method for power construction data sources according to an embodiment of the present invention;

[0023] Figure 3 This is a schematic diagram of a neighborhood subgraph construction process according to an embodiment of the present invention;

[0024] Figure 4 This is a schematic diagram of the structure of a multi-layer attention model according to an embodiment of the present invention;

[0025] Figure 5 This is a schematic diagram of a knowledge graph enhancement device for power construction data sources according to an embodiment of the present invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] According to an embodiment of the present invention, an embodiment of a knowledge graph augmentation method for power construction data sources is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0029] Figure 1 This is a flowchart of a knowledge graph augmentation method for power construction data sources according to an embodiment of the present invention, such as... Figure 1 As shown, the method includes the following steps:

[0030] Step S102: Obtain the knowledge graph of the power construction data source, wherein the knowledge graph is constructed through multiple entities and the first connection relationship between the multiple entities.

[0031] The aforementioned power construction data source can refer to a data source containing information related to power construction. Power construction data sources can include, but are not limited to, graph databases, ternary files, relational databases, text data, and image data. The specific power construction data source needs to be determined based on the actual situation, and is not limited here.

[0032] The aforementioned knowledge graph can refer to a structured knowledge base that uses a graph structure to represent entities and the relationships between them. In a knowledge graph, entities are nodes in the graph, and relationships are edges in the graph. The functions of a knowledge graph can include, but are not limited to, information integration, knowledge discovery, decision support, and intelligent recommendation. The specific functions of a knowledge graph can be determined according to actual needs and are not limited here.

[0033] The aforementioned entities can refer to the basic elements in the knowledge graph. The types of entities can include, but are not limited to, specific equipment, personnel, standards, projects, etc. The specific entity type needs to be determined according to the actual situation and is not limited here. Each entity can be used to represent a specific object or concept in power construction. At the same time, by using entities as nodes, a knowledge graph can be constructed through the relationships between entities.

[0034] The aforementioned first connection relationship can refer to the direct connection between entities. The first connection relationship can include, but is not limited to, the physical connection between devices, the management relationship between personnel and projects, etc. The specific first connection relationship needs to be determined according to the actual situation, and is not limited here. The first connection relationship can be used to directly reflect the direct interaction or association between entities, and can also be used to construct the neighborhood subgraph of the target entity, that is, the set of entities and relationships directly related to the target entity.

[0035] In one optional embodiment, entities and their initial connections are extracted from diverse power construction data sources, such as graph databases, triple files, and relational databases. After unifying the data format, a knowledge graph is constructed. The power construction data sources provide the foundation for building entities and relationships. The knowledge graph integrates this information into a structured knowledge network, and the entities and initial connections specifically express the knowledge and connections within the power construction field, thus providing a solid data foundation for subsequent knowledge reasoning and applications.

[0036] Step S104: Construct a neighborhood subgraph of the target entity among multiple entities based on the knowledge graph, wherein the neighborhood subgraph is used to represent local information associated with the target entity in the knowledge graph.

[0037] The target entity mentioned above can refer to the central entity among multiple entities that can be used for analysis. The target can usually be an entity from which more information is to be obtained or reasoning is to be done, such as a specific security device or key personnel in a project. The target entity can serve as the starting point for reasoning, helping to focus the analysis and ensure the relevance and practicality of the reasoning results.

[0038] The aforementioned neighborhood subgraph can refer to a subset of entities and relationships directly or indirectly related to a target entity. The neighborhood subgraph represents the local environment and related information of the target entity in the knowledge graph. The types of neighborhood subgraphs can include, but are not limited to, direct neighbors (entities connected by direct relationships), indirect neighbors (entities connected by multi-step relationships), and various relationships between entities. The specific neighborhood subgraph needs to be determined according to the entity type and the tightness of the relationship. There are no restrictions here. Neighborhood subgraphs can be used to extract the entities and relationships most relevant to the target entity, thereby reducing noise and improving efficiency and accuracy in the reasoning process.

[0039] The aforementioned local information can refer to information that is directly or indirectly related to the target entity in the neighborhood subgraph. Local information may include, but is not limited to, the entity's attributes and the connection relationships between entities. The specific local information needs to be determined according to the actual situation and is not limited here. Local information provides specific and detailed basis for reasoning, which helps to deeply understand the attributes of the target entity and its role in the power construction scenario, thereby making accurate risk assessments and safety decisions.

[0040] In one optional embodiment, by constructing a neighborhood subgraph of the target entity among multiple entities in the knowledge graph, local information directly related to the target entity is effectively focused. Through the construction of the neighborhood subgraph, not only is redundant information in the knowledge graph filtered out, but the computational burden of the reasoning process is also reduced, thereby greatly improving the efficiency and accuracy of knowledge reasoning.

[0041] Step S106: The neighborhood subgraph and the target entity are fused to obtain the fusion result, and the target entity is inferred based on the fusion result to obtain the extended information of the target entity.

[0042] The aforementioned fusion result can refer to the comprehensive information generated after merging and processing the information of the target entity and the neighborhood subgraph. The type of fusion result can be a numerical vector, which contains multi-dimensional features such as the attributes, relationship strength, and contextual information of the target entity and the neighborhood subgraph. It can be used for subsequent reasoning and decision support. As the input for reasoning, the fusion result integrates the information of the target entity with its surrounding environment, enabling the reasoning process to consider both the internal attributes and external relationships of the target entity, thereby improving the accuracy and depth of reasoning.

[0043] The aforementioned extended information refers to more comprehensive and in-depth information about the target entity obtained after reasoning based on the fusion results. Extended information may include, but is not limited to, the potential risks of the target entity and recommended safety measures. The specific extended information needs to be determined according to the actual situation and is not limited here. Extended information supplements the basic attributes of the target entity, provides the specific application and potential risk of the entity in complex power construction scenarios, and helps construction managers to formulate more accurate safety strategies and risk control measures.

[0044] The aforementioned reasoning can refer to the process of inferring extended information about the target entity based on the fusion results. This process includes not only direct inference based on existing knowledge, but also prediction of unknown relationships and attributes. Reasoning can transform entity and relationship information in the knowledge graph into specific decision-making basis, helping power construction departments to assess on-site safety conditions in real time, identify potential risks, and provide immediate safety guidance.

[0045] In one optional embodiment, a deep learning model is used to fuse the feature information of the target entity and its neighborhood subgraph. The resulting fusion is a highly integrated and semantically coherent representation. Based on this fusion, the model can perform accurate reasoning to obtain extended information about the target entity in the construction scenario, such as potential safety issues and suggested countermeasures. This method not only improves the efficiency and accuracy of reasoning but also allows for dynamic adjustments based on real-time data changes, providing comprehensive, timely, and accurate decision support for power construction safety.

[0046] Step S108: Enhance the knowledge graph based on the extended information to obtain the target knowledge graph.

[0047] The aforementioned enhancement can refer to supplementing and enriching the entities and relationships in the original knowledge graph by using extended information obtained through reasoning. The enhancement process usually involves adding new entities or relationships or updating the attributes of existing entities. The specific enhancement process can be adjusted according to actual needs and is not limited here. Enhancement can be used to improve the completeness, accuracy and practicality of the knowledge graph, enabling it to better reflect the complexity and dynamic changes in the field of power construction safety.

[0048] The aforementioned target knowledge graph can refer to an enhanced version of the knowledge graph. The target knowledge graph contains more comprehensive and in-depth information on power construction safety, especially extended information obtained through reasoning. The target knowledge graph may include, but is not limited to, graphs containing potential risk assessments and graphs containing practical recommendations. The specific target knowledge graph needs to be determined based on the extended information, which is not limited here. The target knowledge graph provides decision-makers in power construction with a more comprehensive and detailed information database, which can support more accurate risk management and safety planning.

[0049] In one optional embodiment, a neighborhood subgraph of the target entity is constructed based on the knowledge graph, and a series of extended information, such as potential security risks and effective security measures, is inferred from the subgraph. This extended information is then used to enhance the original knowledge graph, forming the target knowledge graph. The target knowledge graph not only includes the original entities and relationships but also integrates new information obtained through reasoning, significantly improving the graph's practical value and completeness. This process dynamically updates the knowledge graph to reflect the latest power construction safety situation while reducing unnecessary information and maintaining a clear graph structure and computational efficiency. Ultimately, the target knowledge graph provides a more accurate and comprehensive data foundation for power construction safety supervision, risk assessment, and decision support, greatly enhancing the level of intelligent safety management.

[0050] In one alternative embodiment, Figure 2 This is a flowchart of an optional knowledge graph augmentation method for power construction data sources according to an embodiment of the present invention, such as... Figure 2 As shown, the method includes the following steps:

[0051] Step S202: Obtain the knowledge graph of the power construction data source, wherein the knowledge graph includes the relationships between entities and the unified knowledge graph data format; Step S204: Construct a neighborhood subgraph of the target entity among multiple entities based on the knowledge graph, including other entities and relationships related to the target entity; Step S206: Use an encoder to fuse entity and neighborhood subgraph information for knowledge reasoning.

[0052] In the above process, by standardizing the knowledge graph format and constructing neighborhood subgraphs, the multi-dimensional data of power construction can be organized and utilized more systematically, avoiding interference from invalid information and improving the relevance of reasoning. Secondly, by using an encoder to fuse entity and neighborhood subgraph information, and through the cross-attention mechanism in the encoder, the complex relationships and influences between entities are accurately captured, improving the information processing capability in the reasoning process. This makes the knowledge reasoning related to power construction safety more accurate, providing construction personnel with timely safety guidance and enhancing their ability to respond to emergencies.

[0053] In this embodiment of the invention, firstly, a knowledge graph of the power construction data source is obtained; then, a neighborhood subgraph of the target entity among multiple entities is constructed based on the knowledge graph; secondly, the neighborhood subgraph and the target entity are fused to obtain a fusion result, and the target entity is inferred based on the fusion result to obtain extended information of the target entity; finally, the knowledge graph is enhanced based on the extended information to obtain the target knowledge graph. It is noteworthy that this application constructs a knowledge graph through multiple entities and the first connection relationships between them, determines a neighborhood subgraph based on local information associated with the target entity in the knowledge graph, and then fuses the neighborhood subgraph with the target entity to obtain a fusion result; next, based on the fusion result, the target entity is inferred to identify potential risks or associated information to obtain extended information; finally, the extended information obtained through inference is fed back to the original knowledge graph to form the target knowledge graph. The above mechanisms, through the construction of neighborhood subgraphs, ensure the local precision of information, enabling the model to perform reasoning based on the most relevant entities and relationships, thus improving the efficiency and accuracy of reasoning. Dynamic updates to the knowledge graph allow it to continuously improve with the discovery of new information. Furthermore, feedback from reasoning results allows the knowledge graph to supplement and correct the connections between entities, increasing information density and ensuring the integrity of knowledge representation. This achieves the technical objective of enhancing the knowledge graph, improving the local precision of entity association information, enhancing the overall quality and update efficiency of the knowledge graph, and ultimately solving the technical problem of low information density in knowledge graphs in related technologies.

[0054] Optionally, the knowledge graph of the power construction data source is obtained, including: obtaining the power construction data source and its data storage structure and data representation; extracting multiple entities and the first connection relationships between the multiple entities based on the data storage structure and data representation; performing format conversion based on the multiple entities and the connection relationships between the multiple entities to obtain the format data of the power construction data source; and generating the knowledge graph corresponding to the power construction data source based on the format data.

[0055] The aforementioned data storage structure can refer to a framework describing how data is organized and stored in a computer environment. Data storage structure types can include, but are not limited to, relational databases, key-value stores, and graph databases. The specific data storage structure needs to be determined based on the actual storage situation of the power construction data source, and is not limited here. The data storage structure determines the data access and processing methods. Choosing a suitable data storage structure helps improve the efficiency and flexibility of data processing and facilitates subsequent data extraction and format conversion.

[0056] The aforementioned data representation methods can refer to methods that describe how data is encoded and presented in a computer. The types of data representation methods can include, but are not limited to, tabular form, document form, graph form (such as adjacency matrix or adjacency list), vector form (such as word vector representation), etc. The specific data representation method needs to be determined according to the actual situation of the power construction data source, and is not limited here. The data representation method determines the input form of the subsequent inference model. Choosing an appropriate data representation method helps to improve the efficiency of data extraction and transformation.

[0057] The aforementioned first connection relationship can refer to the association or interaction between entities that are directly represented or implicitly present in the power construction data source. The types of first connection relationships can include, but are not limited to, operational relationships, membership relationships, standard compliance relationships, influence relationships, and spatial relationships. The specific first connection relationship needs to be determined based on the actual connection relationships between multiple entities; no limitation is made here. The first connection relationship acts as a bridge in constructing the knowledge graph, connecting various entities in the power construction scenario and clarifying the interrelationships in attributes, states, or functions between entities. By extracting and analyzing the first connection relationships, a relationship network between entities can be constructed in the knowledge graph, thus providing an information foundation for subsequent neighborhood subgraph construction and reasoning.

[0058] The aforementioned formatted data refers to data that has been uniformly processed and converted into a specific format. Formatted data ensures the consistency and understandability of the data, enabling data from different sources to be integrated into the same knowledge graph, which facilitates subsequent knowledge reasoning and decision support.

[0059] In one optional embodiment, when constructing a knowledge graph for power construction safety, the data storage structure and representation of different power construction data sources are first identified and understood, laying the foundation for efficient data extraction. Next, a targeted method is used to extract multiple entities and their inter-entity connections (i.e., the first connection relationships) from the data sources. Subsequently, the entities and relationships are format-converted to a triplet format, facilitating the construction and processing of the knowledge graph. Finally, based on the converted data format, the knowledge graph is generated, further improving its structure and information quality. Through this process, the model can handle diverse data sources and unify data formats, not only improving information integration efficiency but also providing more accurate and comprehensive data support for subsequent decision support and risk assessment, significantly enhancing the safety management level of power construction.

[0060] Optionally, constructing a neighborhood subgraph of the target entity among multiple entities based on the knowledge graph includes: traversing other entities associated with the target entity in the knowledge graph, and the second connection relationship between the target entity and other entities; and constructing a neighborhood subgraph of the target entity based on the other entities and the second connection relationship.

[0061] The aforementioned other entities can refer to entities that are directly or indirectly related to the target entity in the knowledge graph. Other entities may include, but are not limited to, hardware devices, software systems, construction personnel, safety incident instances, operating procedures, etc. The specific other entities need to be determined according to the actual scenario, and are not limited here. Other entities can be used to associate with the target entity and together constitute important background information for understanding the attributes of the target entity and its role in the security scenario, which is the basis for knowledge reasoning.

[0062] The aforementioned second connection relationship can refer to the direct or indirect connection established between the target entity and other entities in the knowledge graph. The second connection relationship can include, but is not limited to, the operational relationship between equipment and personnel, the association relationship between equipment and security events, etc. The specific second connection relationship needs to be determined according to actual needs and application scenarios, and is not limited here. Through the second connection relationship, the potential security risks and coping strategies of the entity can be inferred, which is a key element in constructing the neighborhood subgraph.

[0063] In one optional embodiment, all other entities associated with the target entity in the knowledge graph are first traversed, and second connections between the target entity and other entities are identified. Then, a neighborhood subgraph is constructed based on the identified other entities and second connections. This traversal process ensures that all relevant entities and relationships are fully considered, and the constructed neighborhood subgraph comprehensively reflects the local environment and key connections of the target entity. Furthermore, the neighborhood subgraph is not limited to directly connected entities but also includes entities indirectly connected through multi-step relationships, thus forming a richer and more coherent entity relationship network. This reduces redundant information in the analysis process, improves the efficiency and accuracy of knowledge reasoning, and ensures the timeliness and accuracy of decision support.

[0064] Optionally, constructing a neighborhood subgraph of the target entity based on other entities and the second connection relationship includes: in response to the other entities including multiple other sub-entities, determining that the second connection relationship includes multiple sub-connection relationships between multiple other sub-entities and the target entity; ranking the multiple other sub-entities based on the association strength between the multiple other sub-entities and the target entity to obtain a first ranking result; ranking the multiple sub-connection relationships based on the association strength between the multiple sub-connection relationships and the target entity to obtain a second ranking result; and constructing a neighborhood subgraph based on the first ranking result and the second ranking result.

[0065] The aforementioned other sub-entities can refer to entities that are directly or indirectly related to the target entity in the power construction knowledge graph. The types of other sub-entities may include, but are not limited to, various components of equipment, specific clauses of safety standards, detailed descriptions of accident cases, etc. The specific other sub-entities need to be determined according to the actual situation, and are not limited here. Other sub-entities can be used to provide more specific information, which helps to deeply understand the characteristics of the target entity and its interaction with the environment.

[0066] The aforementioned sub-connection relationship can refer to the specific association between other sub-entities and the target entity. Sub-connection relationships are used to describe the direct or indirect connection between other sub-entities and the target entity. Sub-connection relationships can include, but are not limited to, the compositional relationship between components and equipment, the association between accident details and cases, etc. The specific sub-connection relationship needs to be determined according to the actual situation. Sub-connection relationships can be used to provide micro-level detailed support for the construction of neighborhood subgraphs.

[0067] The aforementioned association strength can refer to the importance of an entity or relationship in a knowledge graph. Association strength reflects the closeness and relevance between entities or relationships. When constructing a neighborhood subgraph, by calculating the association strength between other sub-entities and sub-connections and the target entity, entities and relationships with higher importance can be given priority, thereby constructing a subgraph structure with reasonable structure and key information, and improving the accuracy and efficiency of subsequent reasoning.

[0068] The first ranking result mentioned above can refer to the result of ranking other sub-entities according to the association strength, and the second ranking result can refer to the result of ranking sub-connection relationships according to the association strength. The ranking result can be used to clarify the entities and relationships that need to be given priority when constructing a neighborhood subgraph, thereby improving the structure of the subgraph and ensuring the priority processing of important information.

[0069] In one optional embodiment, firstly, all other entities and their sub-entities associated with the target entity in the power construction knowledge graph, as well as the sub-connections between the target entity and these entities, are identified. Then, the target entity is ranked based on the association strength between these other sub-entities and sub-connections, resulting in a first ranking and a second ranking. This ranking process filters out the other sub-entities and sub-connections most relevant to the target entity, constructing a more structurally sound and information-refined neighborhood subgraph. This process emphasizes the local environment of the target entity; by selecting the most relevant entities and relationships, the constructed neighborhood subgraph is not only information-rich but also structurally clear, avoiding the computational burden of processing a large number of unrelated entities and relationships.

[0070] Optionally, based on the first and second sorting results, a neighborhood subgraph is constructed, including: based on the first and second sorting results, determining the target sub-entity among multiple other sub-entities and the target sub-connection among multiple sub-connection relationships; and constructing a neighborhood subgraph with the target entity and target sub-entity as nodes and the target sub-connection as edges.

[0071] The aforementioned target sub-connection relationship can refer to the set of relationships most closely related to the target entity selected from multiple sub-connection relationships. The target sub-connection relationship may include, but is not limited to, the functional connection between equipment components and the overall equipment, the logical relationship between safety standard clauses and the entire standard document, and the causal relationship between accident case details and the case as a whole. The specific target sub-connection relationship needs to be determined according to the actual situation, and is not limited here. The target sub-connection relationship clarifies the direct or indirect interaction between entities in the neighborhood subgraph, which helps to deeply understand the behavior patterns and safety status of the target entity.

[0072] The aforementioned target sub-entities can refer to a group of entities selected from multiple other sub-entities that are most closely related to the target entity. Target sub-entities cover various detailed entities in power construction, including but not limited to components of specific equipment, specific operators, and specific scenarios in accident cases. The specific target sub-entities need to be determined according to the actual situation and are not limited here. Target sub-entities are a key component of the neighborhood subgraph. They provide microscopic information about the environment in which the target entity is located, enrich the information dimensions of the neighborhood subgraph, and are conducive to more accurate risk assessment and safety decision-making.

[0073] In one optional embodiment, firstly, based on the first and second ranking results, the target sub-entities and target sub-connections most closely associated with the target entity are determined. This ensures that the neighborhood subgraph focuses on key information about the target entity's environment, avoiding interference from irrelevant entities and relationships, and improving the purity and utility of the subgraph. Subsequently, with the target entity as the center, target sub-entities as nodes, and target sub-connections as edges, the structure of the neighborhood subgraph is constructed. This process dynamically adjusts the composition of the subgraph to adapt to the knowledge needs of the target entity in different scenarios, while reducing noise information to make the reasoning process more efficient.

[0074] In one alternative embodiment, Figure 3 This is a schematic diagram of a neighborhood subgraph construction process according to an embodiment of the present invention, such as... Figure 3 As shown, Figure 3In the knowledge graph of power construction, entities are represented by e1 to e9. These entities may include, but are not limited to, generators (e1), transformers (e2), safety regulations (e3), and construction personnel (e4). Relationships between entities are represented by r1 to r8. For example, "e1 is connected to e2 through r1" can refer to the connection between generators and transformers, or the association between safety operating regulations and construction personnel.

[0075] Based on the above settings, the process of generating the neighborhood subgraph corresponding to each entity is as follows: First, select a target entity as the starting point; then, use an algorithm to traverse other entities and relationships that are directly or indirectly related to the target entity, such as... Figure 3 As shown, in the training data, e1 is the head node to be predicted, and e2 is the tail node to be predicted. e2 is excluded from the neighborhood subgraph of e1 to ensure that the model input does not contain labels. The dashed part is the neighborhood subgraph of node e1, which contains relationships and entities. The obtained related entities and relationships are sorted. The length of the neighborhood subgraph is controlled. From the sorted list of relationships and entities, the top k relationships and entities are selected and added to the neighborhood subgraph to form the final neighborhood subgraph.

[0076] Optionally, the multiple other sub-entities are sorted based on the association strength between the multiple other sub-entities and the target entity to obtain a first sorting result, including: mapping the multiple other sub-entities and the target entity to the target vector space to obtain a first vector of the multiple other sub-entities and a second vector of the target entity; and sorting the multiple other sub-entities based on the cosine similarity of the first vector and the second vector to obtain the first sorting result.

[0077] The aforementioned target vector space can refer to a low-dimensional mathematical space in which entities and relations are represented as vectors, allowing their similarity and relationships to be quantified and processed. By mapping entities and relations to the target vector space, we can use cosine similarity to measure the tightness of relationships between entities, which provides a foundation for entity ranking and subgraph construction.

[0078] The mapping methods mentioned above may include, but are not limited to, deep walk embedding (DeepWalk mapping), document to vector embedding (Doc2Vec mapping), and word to vector embedding (Word2Vec mapping). The specific mapping method needs to be determined based on the specific structure of the knowledge graph and the types of entities and relations, and is not limited here. Through effective mapping methods, entities and relations can be converted into vector representations, providing a mathematical foundation for subsequent analysis and reasoning, and enhancing the accuracy and efficiency of reasoning.

[0079] The first vector mentioned above can refer to the vector representation obtained after transforming other sub-entities into the target vector space. It reflects the characteristics and attributes of the sub-entities. The first vector is the key to calculating the correlation strength between other sub-entities and the target entity. By quantifying the characteristics of other sub-entities, we can more accurately understand the relationship between other sub-entities and the target entity, and provide a basis for ranking.

[0080] The second vector mentioned above can refer to the vector representation of the target entity in the target vector space, reflecting the attributes and state of the target entity. The second vector is the center of the neighborhood subgraph construction. The comparison result between the second vector and the first vector can be used to guide how to select the most relevant other sub-entities and improve the structure of the neighborhood subgraph.

[0081] The aforementioned cosine similarity can refer to a similarity index that measures the angle between vectors. It is used to compare the consistency of the vectors' directions, rather than their magnitudes. By calculating the cosine similarity between the first vector and the second vector, the association strength between other sub-entities and the target entity can be quantified. Sub-entities are sorted according to their similarity, and entities with stronger association with the target entity are processed first, thereby constructing a neighborhood subgraph with a reasonable structure and concise information.

[0082] In one optional embodiment, multiple other sub-entities and the target entity are first mapped to the same target vector space using deep learning methods, generating a first vector and a second vector. Then, the other sub-entities are ranked based on the cosine similarity of the first and second vectors, yielding a first ranking result. This process effectively quantifies the correlation strength between entities and filters out the other sub-entities most relevant to the target entity. The constructed neighborhood subgraph is not only information-rich but also structurally clear, avoiding interference from irrelevant entities and improving the purity and utility of the subgraph. Simultaneously, cosine similarity ranking prioritizes the direct environment and key factors of the target entity, providing accurate data support for subsequent knowledge reasoning and risk management, significantly enhancing the intelligence level of power construction safety management and the ability to respond to emergencies.

[0083] Optionally, the multiple sub-connections are sorted based on the association strength between the multiple sub-connections and the target entity to obtain a second sorting result, including: mapping the multiple sub-connections and the target entity to the target vector space to obtain a third vector of the multiple sub-connections and a second vector of the target entity; and sorting the multiple sub-connections based on the cosine similarity between the third vector and the second vector to obtain the second sorting result.

[0084] The aforementioned third vector can refer to the vector representation obtained after transforming the sub-connection relationship into the target vector space. The third vector is the key to measuring the correlation strength between the sub-connection relationship and the target entity. In the environment of the power construction safety knowledge graph, different sub-connection relationships may have different impacts on the safety status of the target entity. The third vector can quantify the impact between the two, thereby filtering out the sub-connection relationships that are crucial to the safety of the target entity, and providing a basis for constructing neighborhood subgraphs and conducting subsequent knowledge reasoning.

[0085] In one optional embodiment, firstly, multiple sub-connections and target entities are mapped to the same target vector space, generating a third vector and a second vector. Then, the sub-connections are sorted based on the cosine similarity between the third and second vectors to obtain a second sorting result. This process utilizes vector mapping technology to represent the features of sub-connections and the states of target entities as mathematical vectors. By calculating the cosine similarity between the third and second vectors, a quantitative index of the association strength between sub-connections and target entities is obtained. This allows for the selection of sub-connections that have the greatest impact on the safety state of target entities, constructing a neighborhood subgraph with improved structure and key information. Simultaneously, by quantifying the association strength of connections, weak links in the safety management system can be identified more accurately, providing precise data support for safety supervision, risk assessment, and decision support in power construction.

[0086] Optionally, the neighborhood subgraph and the target entity are fused to obtain a fusion result, including: inputting the neighborhood subgraph and the target entity into a multi-layer attention model, and using the multi-layer attention model to fuse the neighborhood subgraph and the target entity to obtain a fusion result.

[0087] The aforementioned multi-layer attention model can refer to a deep learning architecture. Based on the vector representations of entities and relationships, the multi-layer attention model can capture the interdependence between entities and the importance of relationships, thereby providing support for constructing neighborhood subgraphs. The types of cross-attention models can include, but are not limited to, the attention mechanism in the Transformer encoder, Graph Attention Network (GAT), Multi-Head Attention, etc. The multi-layer attention model needs to be determined according to actual needs, and is not limited here. Attention models can be used to fuse information from entities and neighborhood subgraphs to enhance knowledge representation and reasoning capabilities.

[0088] In one alternative embodiment, entity and relation vectors from the neighborhood subgraph, along with the target entity's vector, are input into a cross-attention model. The attention model automatically assigns weights to each input element, reflecting the strength of the association between the entity or relation and the target entity. By calculating and comparing the cosine similarity between vectors, the attention model can capture key connections between entities, thereby emphasizing information that significantly impacts the target entity's security state during the fusion process. This reduces the model's computational burden, improves the accuracy of knowledge reasoning, and enhances the interpretability and application flexibility of the knowledge graph, making the reasoning process more transparent, easier to understand, and easier to adjust.

[0089] Optionally, the attention model includes a first cross-attention layer and a second cross-attention layer. The neighborhood subgraph and the target entity are input into the attention model, and the attention model is used to fuse the neighborhood subgraph and the target entity to obtain a fusion result. This includes: using the first cross-attention layer to map the neighborhood subgraph to the target vector space to obtain a fourth vector of the neighborhood subgraph; using the second cross-attention layer to fuse the fourth vector and the second vector to obtain a fusion vector; and determining the fusion result based on the fusion vector.

[0090] The aforementioned first cross-attention layer can refer to a network layer in the attention model. The first cross-attention layer can be used to map the entity and relation vectors in the neighborhood subgraph to the target vector space, that is, to unify them with the target entity vector into the same vector space, so as to facilitate subsequent fusion operations. The first cross-attention layer usually contains position encoding, which enables the model to consider the position information of the entity in the subgraph.

[0091] The aforementioned second cross-attention layer can refer to another network layer after the first cross-attention layer. The second cross-attention layer can further fuse the fourth vector output by the first cross-attention layer and the second vector of the target entity.

[0092] The aforementioned fourth vector can refer to the vector representation obtained after the first cross-attention layer maps the entities and relations in the neighborhood subgraph to the target vector space. The fourth vector contains the structural and semantic information of the entities and relations in the neighborhood subgraph.

[0093] The aforementioned fusion vector can refer to the vector representation after the second cross-attention layer fuses the fourth vector and the second vector. The fusion vector integrates the features of the target entity and the key entities and relationships in its neighborhood subgraph, and is an important mathematical representation for subsequent knowledge reasoning and decision support.

[0094] In one optional embodiment, an attention model comprising a first cross-attention layer and a second cross-attention layer is constructed to fuse information from the neighborhood subgraph and the target entity. The first cross-attention layer maps entity and relation vectors in the neighborhood subgraph to the target vector space, generating a fourth vector. Subsequently, the second cross-attention layer deeply fuses the fourth vector with the second vector of the target entity, producing a fused vector. This fused vector integrates the features of the target entity with information from key entities and relations in its neighborhood subgraph, providing an efficient representation for knowledge reasoning and decision support. Through this process, by assigning weights to entities and relations using an attention mechanism, the model can automatically identify and focus on entities that significantly impact the safety status of the target entity, thereby constructing a structurally improved neighborhood subgraph and providing strong data support for power construction safety management.

[0095] In one alternative embodiment, Figure 4 This is a schematic diagram of the structure of an attention model according to an embodiment of the present invention, such as... Figure 4 As shown, Figure 4 The input data includes: entity vectors and neighborhood subgraph vectors; the attention model includes: a first-layer cross-attention (i.e., the first cross-attention layer), a second-layer cross-attention (i.e., the second cross-attention layer), a layer normalization (i.e., the residual normalization layer), an entity feedforward neural network, and a subgraph feedforward neural network; the output data includes: predicted entity vectors and output neighborhood subgraph vectors.

[0096] After inputting the entity vector and neighborhood subgraph vector into the attention model, the first cross-attention layer processes the K and V vectors in the entity vector, outputting the K' and V' vectors. Then, the second cross-attention layer fuses the Q', K', and V' vectors in the entity vector to be predicted, obtaining richer feature information. Next, the residual normalization layer, entity feedforward neural network, residual normalization layer, and feedforward neural network process it sequentially to obtain the predicted entity vector. At the same time, the first cross-attention layer processes the Q vector of the neighborhood subgraph vector, and then the processed Q' vector and Q vector are input into the residual normalization layer for processing to obtain the output neighborhood subgraph vector.

[0097] Specifically, the entity vector and the neighborhood subgraph vector are first fed into a multi-layered cross-attention calculation module. In this module, each element interacts with all other elements in the sequence and adjusts its representation based on these relationships. Through the first layer of cross-attention calculation, the neighborhood subgraph vector and the entity vector are compressed to the same dimension. The formula for the first layer of cross-attention calculation is:

[0098] ;

[0099] In the formula, Let Q represent the loss function, Q represent the vector obtained by projecting the neighborhood vector through the linear layer, and K and V represent the vectors obtained by projecting the entity vector through the linear layer. Indicates the length of vector K. S1 represents the transpose operation, and S1 represents the calculated first-layer cross-attention vector.

[0100] By performing a second-layer cross-attention calculation, the result of the first-layer cross-attention calculation and the vector to be predicted are expanded to the same dimension. The formula for the second-layer cross-attention calculation is as follows:

[0101] ;

[0102] In the formula, Let S1 represent the loss function, Q' represent the vector obtained by projecting the vector to be predicted through the linear layer, and K' and V' represent the vectors obtained by projecting S1 through the linear layer. Indicates the length of vector K. S1 represents the transpose operation, and S2 represents the calculated second-layer cross-attention vector.

[0103] The obtained attention-weighted representation is fed into a feedforward neural network, which consists of fully connected layers transformed by a nonlinear activation function. Residual connections and layer normalization are applied to the output of each feedforward neural network. Residual connections add the original input to the sub-layer output to prevent gradient vanishing or exploding and to promote information flow. Layer normalization normalizes the output of each sub-layer, helping to accelerate training convergence. Multiple cross-attention calculation modules and feedforward neural network modules are superimposed to form a Transformer encoder combining multi-layer attention mechanisms. Each layer further abstracts the input sequence, gradually capturing semantic information at different levels within the sequence. This efficiently integrates entity and neighborhood subgraph information, providing a precise vector representation and computational framework for knowledge reasoning in power construction safety scenarios.

[0104] Optionally, the method further includes: constructing a loss function based on the fusion vector and the standard fusion vector, wherein the standard fusion vector is the standard fusion vector of the neighborhood subgraph and the target entity; and using the loss function to update the model parameters of the cross-attention model.

[0105] The aforementioned standard fusion vector can refer to a vector that is pre-defined based on expert knowledge or known safety cases in the field of power construction safety, representing the fusion result of the neighborhood subgraph and the target entity under ideal conditions. The standard fusion vector contains the ideal feature representation of the target entity and the key entities and relationships in its neighborhood subgraph, and is the target of model learning and improvement.

[0106] The aforementioned loss function can refer to a quantitative indicator that measures the difference between the model's predicted output and the standard fusion vector. The types of loss functions can include, but are not limited to, mean squared error, cross-entropy loss, cosine similarity loss, etc. The specific type of loss function needs to be determined according to actual needs and is not limited here. The loss function can be used to supervise the training of the attention model to ensure that the fusion vector output by the model can be as close as possible to the standard fusion vector, that is, to accurately reflect the association strength and security information of entities and relationships in the target entity and its neighborhood subgraph.

[0107] In one optional embodiment, by calculating the loss between the fusion vector predicted by the model and the standard fusion vector, the learning process of the attention model can be supervised to ensure that its output accurately reflects the safety status and potential risks of the target entity. This training strategy enables the model to continuously adjust its parameters during training to more accurately capture key associations and safety information between entities. Simultaneously, by minimizing the loss function, the model can learn how to extract and fuse the most relevant safety factors from the neighborhood subgraph, providing a more reliable knowledge representation for safety assessment and decision-making in power construction.

[0108] In an optional embodiment, the model parameters of the cross-attention model are updated using local bias, and the local bias calculation formula is as follows:

[0109] ;

[0110] In the formula, j is the head entity vector, i is the neighborhood subgraph vector, and I is the vector length. Let Q be the projection vector through the linear layer. Indicates local bias. This represents the activation function.

[0111] Next, a learnable local bias is added to the cross-attention model according to the following formula:

[0112] ;

[0113] In the formula, Represents the loss function. The vector represents the local bias, Q represents the vector obtained by projecting the neighborhood vector through the linear layer, and K and V represent the vectors obtained by projecting the vector to be predicted through the linear layer. Let K be the length of the vector, and S1 represent the calculated first-layer cross-attention vector.

[0114] As shown above, local bias, by adding learnable parameters to the original cross-attention distribution during the cross-attention calculation process, allows the original cross-attention network model to model global dependencies without considering the distance between word vectors, directly focusing on all positions in the input sequence. The weighted average suppresses the association between adjacent words. By adding local bias and considering the local context, cross-attention can be further improved.

[0115] According to another aspect of the present invention, a knowledge graph enhancement device for power construction data sources is also provided. This device can execute the knowledge graph enhancement method for power construction data sources described in the above embodiments. The specific implementation method and preferred application scenarios are the same as those described in the above embodiments, and will not be repeated here.

[0116] Figure 5 This is a schematic diagram of a knowledge graph enhancement device for power construction data sources according to an embodiment of the present invention, such as... Figure 5 As shown, the device includes the following: an acquisition module 502, a construction module 504, a fusion module 506, and an enhancement module 508.

[0117] The acquisition module 502 is used to acquire the knowledge graph of the power construction data source, wherein the knowledge graph is constructed through multiple entities and the first connection relationship between the multiple entities; the construction module 504 is used to construct a neighborhood subgraph of the target entity among the multiple entities based on the knowledge graph, wherein the neighborhood subgraph is used to represent the local information associated with the target entity in the knowledge graph; the fusion module 506 is used to fuse the neighborhood subgraph and the target entity to obtain the fusion result, and to reason about the target entity based on the fusion result to obtain the extended information of the target entity; the enhancement module 508 is used to enhance the knowledge graph based on the extended information to obtain the target knowledge graph.

[0118] Optionally, the acquisition module includes: acquiring the power construction data source and its data storage structure and data representation; extracting multiple entities and the first connection relationships between the multiple entities from the power construction data source based on the data storage structure and data representation; performing format conversion based on the multiple entities and the connection relationships between the multiple entities to obtain the format data of the power construction data source; and generating a knowledge graph corresponding to the power construction data source based on the format data.

[0119] Optionally, the construction module includes: traversing other entities associated with the target entity in the knowledge graph, and the second connection relationship between the target entity and other entities; and constructing a neighborhood subgraph of the target entity based on the other entities and the second connection relationship.

[0120] Optionally, the construction module further includes: in response to the inclusion of multiple other sub-entities in other entities, determining that the second connection relationship includes multiple sub-connection relationships between multiple other sub-entities and the target entity; sorting the multiple other sub-entities based on the association strength between the multiple other sub-entities and the target entity to obtain a first sorting result; sorting the multiple sub-connection relationships based on the association strength between the multiple sub-connection relationships and the target entity to obtain a second sorting result; and constructing a neighborhood subgraph based on the first sorting result and the second sorting result.

[0121] Optionally, the construction module further includes: determining the target sub-entity among multiple other sub-entities and the target sub-connection relationship among multiple sub-connection relationships based on the first sorting result and the second sorting result; constructing a neighborhood subgraph with the target entity and the target sub-entity as nodes and the target sub-connection relationship as edges.

[0122] Optionally, the construction module further includes: mapping multiple other sub-entities and the target entity to a target vector space to obtain a first vector of multiple other sub-entities and a second vector of the target entity; and sorting the multiple other sub-entities based on the cosine similarity of the first vector and the second vector to obtain a first sorting result.

[0123] Optionally, the construction module further includes: mapping multiple sub-connection relationships and target entities to a target vector space to obtain a third vector of multiple sub-connection relationships and a second vector of the target entity; and sorting the multiple sub-connection relationships based on the cosine similarity of the third vector and the second vector to obtain a second sorting result.

[0124] Optionally, the fusion module includes: inputting the neighborhood subgraph and the target entity into a cross-attention model, and using the cross-attention model to fuse the neighborhood subgraph and the target entity to obtain a fusion result.

[0125] Optionally, the cross-attention model includes a first cross-attention layer and a second cross-attention layer. The fusion module further includes: using the first cross-attention layer to map the neighborhood subgraph to the target vector space to obtain a fourth vector of the neighborhood subgraph; using the second cross-attention layer to fuse the fourth vector and the second vector to obtain a fused vector; and determining the fusion result based on the fused vector.

[0126] Optionally, the device further includes: constructing a loss function based on the fusion vector and the standard fusion vector, wherein the standard fusion vector is the standard fusion vector of the neighborhood subgraph and the target entity; and using the loss function to update the model parameters of the cross-attention model.

[0127] In the above embodiments of the present invention, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0128] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units can be a logical functional division, and in actual implementation, there may be other division methods. For instance, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0129] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0130] Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0131] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0132] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of the present invention, and these improvements and modifications should also be considered within the scope of protection of the present invention.

Claims

1. A method for enhancing the knowledge graph of power construction data sources, characterized in that, include: A knowledge graph for acquiring power construction data sources is obtained, wherein the knowledge graph is constructed through multiple entities and a first connection relationship between the multiple entities, wherein the multiple entities are the basic elements in the knowledge graph, including equipment, personnel, standards and projects in power construction, and the first connection relationship is the relationship between the multiple entities, including operational relationship, subordinate relationship, standard compliance relationship, influence relationship and spatial relationship; Traverse the other entities associated with the target entity in the knowledge graph, as well as the second connection relationships between the target entity and other entities, wherein the target entity is the central entity used for analysis among the plurality of entities; In response to the inclusion of multiple other sub-entities among the other entities, it is determined that the second connection relationship includes multiple sub-connection relationships between the multiple other sub-entities and the target entity; Based on the association strength between the multiple other sub-entities and the target entity, the multiple other sub-entities are sorted to obtain a first sorting result, wherein the first sorting result is used to filter out the other sub-entities that are most relevant to the target entity among the multiple other sub-entities; The multiple sub-connections are sorted based on the association strength between the multiple sub-connections and the target entity to obtain a second sorting result, wherein the second sorting result is used to filter out the sub-connections that are most relevant to the target entity among the multiple sub-connections; Based on the first ranking result and the second ranking result, a neighborhood subgraph is constructed, wherein the neighborhood subgraph is used to represent local information in the knowledge graph associated with the target entity; The neighborhood subgraph and the target entity are fused to obtain a fusion result, and the target entity is inferred based on the fusion result to obtain extended information of the target entity, wherein the extended information is used to represent the risk status of the target entity in the power construction scenario; The knowledge graph is enhanced based on the extended information to obtain the target knowledge graph.

2. The method according to claim 1, characterized in that, Knowledge graphs for obtaining power construction data sources, including: Obtain the power construction data source and the data storage structure and data representation method of the power construction data source; Based on the data storage structure and the data representation method, multiple entities and the first connection relationship between the multiple entities in the power construction data source are extracted. Based on the multiple entities and the connection relationships between them, the format data of the power construction data source is obtained through format conversion. The knowledge graph corresponding to the power construction data source is generated based on the data in the specified format.

3. The method according to claim 1, characterized in that, Based on the first sorting result and the second sorting result, the neighborhood subgraph is constructed, including: Based on the first sorting result and the second sorting result, the target sub-entity among the plurality of other sub-entities and the target sub-connection relationship among the plurality of sub-connection relationships are determined; The neighborhood subgraph is constructed using the target entity and the target sub-entity as nodes and the target sub-connection relationship as edges.

4. The method according to claim 1, characterized in that, The multiple other sub-entities are sorted based on the association strength between the target entity and the multiple other sub-entities to obtain a first sorting result, including: Map the plurality of other sub-entities and the target entity to the target vector space to obtain a first vector of the plurality of other sub-entities and a second vector of the target entity; The other sub-entities are sorted based on the cosine similarity between the first vector and the second vector to obtain the first sorting result.

5. The method according to claim 1, characterized in that, The multiple sub-connections are sorted based on the association strength between the sub-connections and the target entity to obtain a second sorting result, including: Map the plurality of sub-connections and the target entity to the target vector space to obtain the third vector of the plurality of sub-connections and the second vector of the target entity; The multiple sub-connection relationships are sorted based on the cosine similarity between the third vector and the second vector to obtain the second sorting result.

6. The method according to claim 1, characterized in that, The neighborhood subgraph and the target entity are fused to obtain a fusion result, including: The neighborhood subgraph and the target entity are input into the cross-attention model, and the cross-attention model is used to fuse the neighborhood subgraph and the target entity to obtain the fusion result.

7. The method according to claim 6, characterized in that, The cross-attention model includes a first cross-attention layer and a second cross-attention layer. The neighborhood subgraph and the target entity are input into the attention model, and the cross-attention model is used to fuse the neighborhood subgraph and the target entity to obtain the fusion result, including: The neighborhood subgraph is mapped to the target vector space using the first cross-attention layer to obtain the fourth vector of the neighborhood subgraph; The second cross-attention layer is used to fuse the fourth vector and the second vector to obtain a fused vector; The fusion result is determined based on the fusion vector.

8. The method according to claim 7, characterized in that, The method further includes: A loss function is constructed based on the fusion vector and the standard fusion vector, wherein the standard fusion vector is the standard fusion vector of the neighborhood subgraph and the target entity; The model parameters of the cross-attention model are updated using the loss function.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to any one of claims 1 to 8.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the storage medium is located to perform the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Knowledge graph data processing method and device

    CN108875053A

  • Deep heterogeneous graph embedding model based on feature fusion

    CN114565053A