Power grid risk detection method, device and equipment based on knowledge graph

By using a knowledge graph-based approach, multi-source detection data of the power grid is acquired, and feature extraction and mapping are performed to construct a target knowledge graph. This solves the problem of insufficient accuracy in traditional power grid risk detection and enables precise detection of power grid risks.

CN122174935APending Publication Date: 2026-06-09ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
Filing Date
2026-01-28
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

Traditional power grid risk detection methods lack the integration of specific professional knowledge in the power grid field, resulting in insufficient accuracy in risk detection.

Method used

A knowledge graph-based approach is adopted to acquire multi-source detection data, perform feature extraction and mapping processing, construct a target knowledge graph, and use preset entities, attributes and constraints in the power grid field for clustering and risk detection.

Benefits of technology

It significantly improves the accuracy of power grid risk detection, reduces semantic errors, and enables precise identification and judgment of power grid risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122174935A_ABST
    Figure CN122174935A_ABST
Patent Text Reader

Abstract

The application relates to a power grid risk detection method, device and equipment based on a knowledge graph. The method comprises the following steps: acquiring multi-source detection data of a power grid to be detected; performing feature extraction on the multi-source detection data to obtain a plurality of feature data; performing mapping processing on the feature data and a preset knowledge graph according to the label of each feature data, and determining a target knowledge graph comprising the plurality of feature data according to the mapping result; wherein the preset knowledge graph is used for representing various types of preset entities, preset attributes of each type of preset entity, and constraint relationships between the preset entities; clustering target entities corresponding to the feature data with a category label according to the target knowledge graph to obtain a plurality of feature data clusters; performing risk detection on each feature data cluster, and determining a risk detection result of the power grid to be detected according to the detection result. The method can improve the accuracy of power grid risk detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power risk detection technology, and in particular to a power grid risk detection method, device, and equipment based on knowledge graphs. Background Technology

[0002] As the power grid continues to expand, the types of equipment become increasingly complex, and the operating environment becomes more diversified, the power grid faces more and more risk factors, and the difficulty of risk detection is constantly increasing.

[0003] In traditional technologies, features are typically extracted from each power data point using deep learning models, and then integrated through operations such as feature alignment and dimension mapping. Finally, risk detection is performed based on the fused features, attempting to improve the comprehensiveness of risk detection by strengthening the feature correlation between different power data.

[0004] However, the aforementioned traditional technologies lack the integration of specific expertise in the power grid field, remaining only at the level of associating raw data characteristics, ultimately leading to insufficient accuracy in power risk detection. Summary of the Invention

[0005] Therefore, it is necessary to provide a knowledge graph-based method, device, and equipment for power grid risk detection to address the aforementioned technical problems and improve the accuracy of power grid risk detection.

[0006] Firstly, this application provides a power grid risk detection method based on a knowledge graph, comprising: acquiring multi-source detection data of the power grid to be detected; extracting features from the multi-source detection data to obtain multiple feature data; each feature data having a category label, attribute label, or relationship label; mapping the feature data to a preset knowledge graph according to the label of each feature data, and determining a target knowledge graph including multiple feature data according to the mapping result; wherein, the preset knowledge graph is used to represent preset entities of each category, preset attributes of each preset entity of each category, and constraint relationships between preset entities; clustering the target entities corresponding to the feature data with category labels according to the target knowledge graph to obtain multiple feature data clusters; performing risk detection on each feature data cluster, and determining the risk detection result of the power grid to be detected according to the detection result.

[0007] Secondly, this application also provides a power grid risk detection device based on a knowledge graph, comprising: an acquisition module for acquiring multi-source detection data of the power grid to be detected; a feature extraction module for extracting features from the multi-source detection data to obtain multiple feature data; wherein each feature data has a category label, attribute label, or relationship label; a graph construction module for mapping the feature data to a preset knowledge graph according to the label of each feature data, and determining a target knowledge graph including multiple feature data according to the mapping result; wherein the preset knowledge graph is used to represent preset entities of each category, preset attributes of each preset entity of each category, and constraint relationships between preset entities; a clustering module for clustering the target entities corresponding to the feature data with category labels according to the target knowledge graph to obtain multiple feature data clusters; and a detection module for performing risk detection on each feature data cluster, and determining the risk detection result of the power grid to be detected according to the detection result.

[0008] Thirdly, this application also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the various method embodiments provided in the first aspect above.

[0009] Fourthly, this application also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the various method embodiments provided in the first aspect above.

[0010] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the various method embodiments provided in the first aspect above.

[0011] The aforementioned knowledge graph-based power grid risk detection method, device, and equipment, by acquiring multi-source detection data of the power grid to be detected, can provide more comprehensive data for power grid risk detection. By extracting features from the multi-source detection data, multiple feature data are obtained, each with a category label, attribute label, or relationship label. This transforms the multi-source detection data into structured and semantically clear feature data, overcoming the limitation of feature data lacking semantic meaning and ensuring domain semantic consistency. By utilizing a pre-defined knowledge graph representing various pre-defined entities, entity attributes, and inter-entity constraints in the power grid domain, the labeled feature data is mapped and a target knowledge graph is constructed. This deeply integrates power grid domain expertise into the data processing flow, making feature data integration no longer dependent on simple low-level feature alignment, but rather based on establishing associations according to domain semantic constraints. This effectively compensates for the lack of domain knowledge support, enabling the feature data to possess... By leveraging the constraints of domain knowledge, semantic errors are significantly reduced, and data reliability is improved. By clustering target entities corresponding to feature data with category labels based on the target knowledge graph, multiple feature data clusters are obtained. This allows feature data with the same or similar semantic attributes and conforming to the constraints of the power grid domain to be accurately aggregated into feature data clusters. This avoids the problems of scattered risk data of the same type and misassociation of dissimilar data caused by relying solely on physical features, thus improving the accuracy of risk detection. By performing risk detection on each feature data cluster and determining the risk detection result of the power grid to be detected based on the detection results, cluster-level detection based on multi-feature fusion, and with the help of the constraints and attribute definitions between entities in the target knowledge graph, accurate identification and judgment of power grid risks can be achieved. This fundamentally solves the problem of insufficient targeting and low accuracy of power grid risk detection caused by the lack of domain semantic association, significantly improving the accuracy of power grid risk detection. Attached Figure Description

[0012] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 An application environment diagram for a knowledge graph-based power grid risk detection method provided in this application embodiment;

[0014] Figure 2 A flowchart illustrating a knowledge graph-based power grid risk detection method provided in this application embodiment;

[0015] Figure 3A flowchart illustrating a mapping process provided in an embodiment of this application;

[0016] Figure 4 A flowchart illustrating a feature data extraction process provided in an embodiment of this application;

[0017] Figure 5 A flowchart illustrating the process of determining target text data provided in an embodiment of this application;

[0018] Figure 6 This application provides a schematic diagram of a process for extracting feature data based on a feature extraction model, as illustrated in an embodiment of the present application.

[0019] Figure 7 A flowchart illustrating the process of determining a feature data cluster provided in an embodiment of this application;

[0020] Figure 8 A flowchart illustrating the process of determining cluster centers provided in this application embodiment;

[0021] Figure 9 A flowchart illustrating another process for determining a feature data cluster provided in an embodiment of this application;

[0022] Figure 10 A schematic diagram illustrating intra-class separation contrast provided in an embodiment of this application;

[0023] Figure 11 A schematic diagram illustrating inter-class separation contrast provided in an embodiment of this application;

[0024] Figure 12 A structural block diagram of a knowledge graph-based power grid risk detection device provided in this application embodiment;

[0025] Figure 13 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0027] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments or any combination of multiple embodiments.

[0028] The knowledge graph-based power grid risk detection method provided in this application can be applied to, for example... Figure 1 In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or located in the cloud or on other network servers. Terminal 102 acquires multi-source detection data of the power grid to be tested and sends it to server 104. Server 104 performs risk detection methods on the multi-source detection data to determine the risk detection result of the power grid to be tested, thereby achieving risk detection of the power grid to be tested. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, drones, etc. Server 104 can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0029] In one exemplary embodiment, such as Figure 2 As shown, a risk detection method is provided, which can be applied to... Figure 1 Taking server 104 as an example, the following steps are included:

[0030] S201, acquire multi-source detection data of the power grid to be tested.

[0031] Multi-source detection data refers to various types of data derived from different information carriers or sensing methods, used to characterize the state of the power grid. This includes, but is not limited to, on-site inspection images, review report documents, and equipment monitoring data (such as numerical data like temperature, humidity, voltage, and current). Furthermore, multi-source detection data can also be multimodal data, meaning it includes multiple forms of data used to characterize the power grid state, such as images, text, audio, and video. Optionally, to meet the risk detection needs of different scenarios within the power grid under test, multi-source detection data for different scenarios can be selectively acquired. For example, for network detection scenarios, multi-source detection data characterizing the network state can be acquired to detect network risks; for production detection scenarios, multi-source detection data characterizing the safe production status of the power grid can be acquired to detect production risks.

[0032] For multi-source monitoring data characterizing the safe operation status of the power grid, various acquisition devices deployed at the site of the power grid under test can be used to collect the multi-source monitoring data in real time. For example, high-definition cameras can be used to collect on-site inspection images of transmission lines, substation equipment, etc.; various sensors installed on power grid equipment can be used to collect equipment monitoring data such as temperature, humidity, voltage, and current during equipment operation; and review report text documents (such as safety inspection review reports, equipment maintenance review reports, etc.) and unstructured records filled out by staff can be exported from the power grid management terminal. All multi-source monitoring data collected by these acquisition devices are sent to terminal 102, which then sends the multi-source monitoring data of the power grid under test to server 104, so that server 104 can obtain the multi-source monitoring data of the power grid under test.

[0033] S202, feature extraction is performed on the multi-source detection data to obtain multiple feature data.

[0034] Each feature data has a category label, attribute label, or relationship label.

[0035] Feature data refers to key data units extracted from multi-source detection data that reflect the state of the power grid. Category labels are tags used to identify the entity category to which the feature data belongs. Attribute labels are tags used to identify the attribute category to which the feature data belongs. Relationship labels are tags used to identify the type of relationship between entities reflected by the feature data. Optionally, server 104 can use appropriate feature extraction methods for different multi-source detection data. For example, statistical feature extraction methods can be used for numerical data in multi-source detection data, word embedding feature extraction methods can be used for textual data, and convolutional feature extraction methods can be used for image data. This allows for the separation of key features reflecting the power grid state from the multi-source detection data, forming multiple feature data sets. Simultaneously, based on professional definitions in the power grid field, each extracted feature data set can be assigned a category label, attribute label, or relationship label.

[0036] As an alternative implementation, different types of data in multi-source detection data can be converted into text data in a unified format, and feature extraction methods adapted to text data can be used to extract features to obtain multiple feature data with category labels, attribute labels, or relationship labels.

[0037] It should be noted that since step 203 involves mapping feature data to a preset knowledge graph, the feature extraction stage of multi-source detection data must ensure that the labels match the preset entities of each category in the preset knowledge graph, the preset attributes of each category of preset entities, and the constraint relationships between preset entities.

[0038] As an alternative implementation, category labels can include entity types, and these entity types should correspond to the types of preset entities in a preset knowledge graph. For example, for a production inspection scenario of a power grid to be inspected, the preset knowledge graph defines four preset entities: professional entities, verification item indicator entities, drill-level standard entities, and personnel qualification entities. Therefore, when determining the category labels for feature data, the corresponding feature data needs to be labeled as one of these four types (or a more specific subclass). This ensures that feature data with category labels can be correctly assigned to the preset entities during mapping.

[0039] Furthermore, attribute labels can include attribute types, and the settings of these attribute types should correspond to the preset attributes of the corresponding preset entities in the preset knowledge graph. For example, if a preset entity in the preset knowledge graph defines a threshold as an attribute type, the attribute labels of the corresponding feature data can be determined according to the threshold attribute type.

[0040] Furthermore, the relation labels can include relation types, and the settings of these relation types correspond to the relation types of the pre-defined entity constraint relationships in the pre-defined knowledge graph. For example, for the production detection scenario of the power grid to be detected, the pre-defined knowledge graph defines words such as "belong to", "belong to", and "belong to" as belonging to the "belong to" relation. Then, the relation labels of the corresponding feature data can be determined according to the relation types defined therein.

[0041] It is also important to note that, to ensure that feature data with attribute labels and feature data with relation labels correspond to feature data with category labels, attribute labels can also include entity pointing information, such as associated entity identifiers. For example, for the specific data "the number of self-exposed problems in the safety supervision profession is 5" in multi-source detection data, the feature data "safety supervision profession, number of self-exposed problems is 5" can be extracted. The label "safety supervision profession" can be set as the specific category label of the verification item entity, "safety supervision profession" can be set as the specific category label of the profession entity, and "the number of self-exposed problems is 5" can be set as the attribute label. From this data, the feature data "safety supervision profession" corresponding to "the number of self-exposed problems is 5" can be determined, thereby determining the entity pointing information of the attribute label "the number of self-exposed problems is 5".

[0042] Furthermore, relationship labels can also include entity association information, such as identifiers of at least two related entities (source entity identifier and destination entity identifier). For example, for the specific data "Insufficient self-disclosure of problems belongs to the safety supervision profession" in multi-source detection data, the feature data (insufficient self-disclosure of problems, belongs to, safety supervision profession) can be extracted. The label "insufficient self-disclosure of problems" can be set as the specific category label of the verification item entity, "safety supervision profession" can be set as the specific category label of the profession entity, and "belongs to" can be set as the specific relationship label of the affiliation relationship. From this data, the source entity ("insufficient self-disclosure of problems") and the destination entity ("safety supervision profession") corresponding to "belongs to" can be determined, thereby determining the entity association information of the relationship label "belongs to".

[0043] S203: Based on the label of each feature data, perform mapping processing on the feature data and the preset knowledge graph, and determine the target knowledge graph including multiple feature data based on the mapping result.

[0044] The pre-defined knowledge graph is used to represent pre-defined entities of various categories, pre-defined attributes of each category of pre-defined entities, and the constraints between pre-defined entities. The pre-defined knowledge graph refers to a pre-constructed semantic network used to represent pre-defined entities of various categories, pre-defined attributes of each category of pre-defined entities, and the constraints between pre-defined entities in different scenarios within the power grid domain. This pre-defined knowledge graph standardizes and structures the core concepts (i.e., pre-defined entities), relationships between concepts (i.e., constraints), and attribute constraints (i.e., pre-defined attributes) related to power grid safety production risks, enabling dispersed feature data to have a unified semantic consensus and avoiding ambiguity.

[0045] The so-called target knowledge graph refers to a semantic network containing specific feature data of the power grid to be detected, formed by matching and mapping the extracted feature data with a preset knowledge graph.

[0046] Optionally, predefined entity types, predefined attributes for each type of predefined entity, and constraints between predefined entities can be defined in advance. Feature data with category labels is filtered, and these feature data are attached to the corresponding predefined entities according to the category labels. Based on this, for feature data with attribute labels and relationship labels, the attribute information of each instance entity (i.e., each feature data with category labels under the predefined entity) and the association relationships between instance entities are determined according to the attribute labels, relationship labels, predefined attributes of each type of predefined entity in the predefined knowledge graph, and constraints between predefined entities, thereby forming a target knowledge graph including multiple feature data.

[0047] As an optional implementation method, for the production testing scenario of the power grid to be tested, a pre-defined knowledge graph can be constructed based on the business specifications for power grid safety production risk auditing. The root entity in the pre-defined knowledge graph is defined as the "power grid safety production risk entity," which is then broken down into four categories of pre-defined entities: "professional entities," "verification item indicator entities," "drill-level standard entities," and "personnel qualification entities." The attribute constraints of each type of pre-defined entity are clarified (i.e., pre-defined attributes, such as the "drill-level standard entity" must include attributes such as "threshold, effective time, scope of application, and whether it is a veto"), and the "verification item indicator entity" must be bound to the attributes of "professional affiliation and risk level." Relational semantic rules are formulated (i.e., the constraint relationships between pre-defined entities, such as the "affiliation" relationship is only used for the "verification item-professional" hierarchical association, and the "constraint" relationship is only used for the "drill-level standard-verification item" quantitative matching). The OWL2 (Web Ontology Language 2) language is used to describe and form a standardized entity schema file (i.e., a structured file describing the pre-defined entities, pre-defined attributes, and constraint relationships), providing a unified semantic specification for the subsequent mapping of feature data.

[0048] S204. Based on the target knowledge graph, cluster the target entities corresponding to the feature data with category labels to obtain multiple feature data clusters.

[0049] Here, a target entity refers to the feature data with category labels attached to a preset entity in the target knowledge graph. A feature data cluster refers to a dataset formed by clustering semantically similar and closely related target entities using clustering algorithms. Optionally, the feature data with category labels attached to the preset entity in the target knowledge graph can be identified as target entities. Based on the attribute information and relationships of each target entity, a clustering algorithm can be used to cluster the target entities, thereby obtaining multiple feature data clusters.

[0050] Because the target knowledge graph supplements the target entity with professional semantic features, for example, for the target entity "material allocation completion rate", the target knowledge graph has defined its attribute information such as "belongs to the supply chain profession" and "95% is the 4-diamond standard". Therefore, during clustering, these semantic attribute information will be used together with the quantitative indicators of the target entity (such as the allocation completion rate of 92%) as clustering features. This ensures that "supply chain profession 4-diamond level entity" and "3-diamond level entity" are accurately divided into different feature clusters, avoiding clustering bias caused by relying solely on numerical values ​​(such as mistakenly classifying "supply chain 92%" and "safety supervision 92%" into the same category), and ensuring the accuracy of power grid risk detection.

[0051] S205 performs risk detection on each feature data cluster and determines the risk detection result of the power grid to be detected based on the detection results.

[0052] The risk detection result refers to the risk assessment result of the power grid under test, which may include whether a risk exists and / or the risk level. Optionally, risk detection can be performed on the power grid state reflected by each feature data cluster according to preset risk determination rules, thereby determining the detection result of each feature cluster, and finally determining the risk detection result of the power grid under test based on the detection results of each feature cluster.

[0053] As an optional implementation, risk assessment rules can be predefined in a preset knowledge graph, such as rules for major risks, significant risks, and general risks (e.g., equipment defect severity ≥ 9.0 → major risk; 7.0-8.9 → significant risk). For each feature data cluster, the attribute information (attribute values, etc.) and relationships (e.g., constraint values ​​of constraint relationships) of the target entities within the cluster are matched with the risk assessment rules. If the feature data cluster matches the major risk assessment rule, such as when the numerical attribute of a certain verification item exceeds the safety threshold and is a veto item, then the feature data cluster is marked as high risk; if it matches the significant risk assessment rule, it is marked as medium risk; if it matches the general risk assessment rule, it is marked as low risk. By combining the risk levels of all feature data clusters, a risk detection result for the power grid to be tested is formed, and a power grid risk detection report with risk levels can also be generated.

[0054] The aforementioned knowledge graph-based power grid risk detection method, by acquiring multi-source detection data of the power grid to be detected, can provide more comprehensive data for power grid risk detection. By extracting features from the multi-source detection data, multiple feature data are obtained, each with category, attribute, or relation labels. This transforms the multi-source detection data into structured and semantically clear feature data, overcoming the limitation of feature data lacking semantic meaning and ensuring domain semantic consistency. Furthermore, by utilizing a pre-defined knowledge graph representing various pre-defined entities, entity attributes, and inter-entity constraints in the power grid domain, the labeled feature data is mapped and a target knowledge graph is constructed. This deeply integrates power grid domain expertise into the data processing flow, enabling feature data integration to move beyond simple low-level feature alignment and instead establish connections based on domain semantic constraints. This effectively compensates for the lack of domain knowledge support, giving the feature data domain-specific characteristics. The constraint of knowledge significantly reduces semantic errors and improves data reliability. By clustering target entities corresponding to feature data with category labels based on the target knowledge graph, multiple feature data clusters are obtained. This allows feature data with the same or similar semantic attributes and conforming to the constraints of the power grid domain to be accurately aggregated into feature data clusters. This avoids the problems of scattered risk data of the same type and misassociation of dissimilar data caused by relying solely on physical features, thus improving the accuracy of risk detection. By performing risk detection on each feature data cluster and determining the risk detection result of the power grid to be detected based on the detection results, cluster-level detection based on multi-feature fusion, with the help of the constraints and attribute definitions between entities in the target knowledge graph, can achieve accurate identification and judgment of power grid risks. This fundamentally solves the problem of insufficient targeting and low accuracy of power grid risk detection caused by the lack of domain semantic association, and significantly improves the accuracy of power grid risk detection.

[0055] Based on the above embodiments, in an exemplary embodiment, the mapping process in S203 is further refined. For example... Figure 3 As shown, the following steps may be included:

[0056] S301, for each feature data with a category label, according to the preset knowledge graph, find the preset entity that matches the category label as the reference entity, and determine each feature data with a category label as the target entity.

[0057] Optionally, as described in S202 above, the category label may include an entity type corresponding to the type of a preset entity in the preset knowledge graph (e.g., the entity type is the type of the preset entity, or a subtype of the preset entity type). Based on this, for each feature data with a category label, the preset entities of each category can be traversed in the preset knowledge graph to find a preset entity that matches the feature data with the category label, or the feature data with the category label can be used as the target entity and attached to its matching preset entity.

[0058] For example, based on category labels and preset entities of each category in the preset knowledge graph, feature data such as "insufficient self-disclosure of problems" and "average number of power outages per user" with the category label of the verification item entity are matched with the preset entity "verification item indicator entity" in the preset knowledge graph. These two feature data are then used as two target entities of the preset entity "verification item indicator entity" in the preset knowledge graph and attached to the preset entity "verification item indicator entity".

[0059] S302, for each feature data with attribute tags, filter the first entity corresponding to the feature data from the target entities according to the attribute tags, and determine the target attribute of the first entity according to the feature data and the preset attribute corresponding to the preset entity that matches the first entity as represented by the preset knowledge graph.

[0060] Here, the so-called first entity refers to the specific entity (i.e., feature data with category labels) that corresponds to the feature data with attribute labels in the target entity. The so-called target attribute refers to the attribute information of the first entity, which is jointly determined by the feature data with attribute labels corresponding to the first entity and the preset attributes of the preset entities corresponding to the first entity in the preset knowledge graph. Optionally, the attribute labels may include entity pointing information, thereby determining the matching first entity for each feature data with attribute labels based on the attribute labels of the feature data. Since the preset attributes of each preset entity in the preset knowledge graph limit the attribute types that such preset entities must include (the attribute types can be determined by the attribute names), when mapping the feature data with attribute labels corresponding to the first entity to the preset knowledge graph, it is necessary to jointly determine the target attribute of the first entity based on the feature data with attribute labels corresponding to the first entity and the preset attributes of the preset entities corresponding to the first entity represented by the preset knowledge graph.

[0061] As an optional implementation, the preset attributes of the preset entity corresponding to the first entity can be determined from the preset knowledge graph, and the set of required attributes of the first entity can be determined based on these preset attributes. The actual set of associated attributes of the first entity can be determined based on the feature data with attribute tags corresponding to the first entity.

[0062] The required attribute set is compared with the actual associated attribute set. If the actual attribute set contains all the required attributes, the attribute integrity is satisfied, and the target attribute of the first entity is determined based on the actual associated attribute set. If the actual attribute set is missing an attribute type from the required attribute set, the missing attribute type can be added to the actual attribute set, and the attribute value of the missing attribute type can be set to the default value. The target attribute of the first entity is then determined based on the supplemented actual attribute set.

[0063] S303, for each feature data with a relation label, determine the target constraint relationship that matches the feature data based on the constraint relationship between the preset entities represented by the preset knowledge graph, and determine the constraint relationship between each second entity based on the second entity corresponding to the relation label and the preset entity associated with the target constraint relationship.

[0064] In this context, each second entity belongs to the target entity. A second entity refers to the target entity corresponding to a relation label. A target constraint relationship refers to a constraint relationship in the preset knowledge graph that matches the feature data with the relation label. Optionally, as described in S202 above, the relation label may include relation type and entity association information. Based on this, for each feature data with a relation label, the relation types of constraint relationships in the preset knowledge graph can be traversed according to its relation label to find the constraint relationship that matches the relation label, thus using the matching constraint relationship as the target constraint relationship for the feature data with the relation label. The preset entity defined by the target constraint relationship and each second entity corresponding to the relation label (the second entities can be determined based on entity association information) are determined. It is then determined whether each second entity belongs to the preset entity type defined by the target constraint relationship. If it does, the constraint relationship between the second entities is determined according to the target constraint relationship; otherwise, the target constraint relationship is not used as the constraint relationship between the second entities.

[0065] For example, if the relationship label is "subordination", the corresponding "subordination" constraint relationship is found from the preset knowledge graph. This "subordination" constraint relationship is limited to only existing between the "verification item indicator entity class" and the "professional entity class". The two second entities corresponding to the relationship label (such as the "transmission line insulation inspection" entity and the "transmission professional" entity) are substituted into the target constraint relationship. It is verified whether the categories of the two second entities meet the constraint relationship requirements ("transmission line insulation inspection" belongs to the verification item indicator entity class, and "transmission professional" belongs to the professional entity class). After the verification is passed, the "subordination" constraint relationship between the two entities is determined.

[0066] It should be noted that this embodiment does not impose any restrictions on the execution order of S302-S303.

[0067] As an optional implementation, the constraint relationships in the preset knowledge graph also include attribute constraints. This means that the constraint relationship defines the attributes of the corresponding entities as attributes of the constraint relationship. Based on these attribute constraints, the target attributes in the second entities are converted into attributes of the constraint relationships between the second entities. For example, the "constraint" relationship exists only between the "Diamond Grade Standard Entity" and the "Verification Item Entity," and is used to represent the quantitative requirements of the standard. Meanwhile, "threshold" is an attribute of the "constraint" relationship itself, not an attribute of the "Diamond Grade Standard Entity." When the association between the two second entities, "4-Diamond Standard" and "Equipment Defect Detection Rate" (i.e., the aforementioned constraint relationship), is determined to be a constraint relationship (referring to the specific type of constraint relationship), the target attribute "threshold: 90%" which might originally be attached to the second entity "4-Diamond Standard" is transferred and attached to the "constraint" relationship established between these two second entities, becoming an attribute of that relationship.

[0068] As another optional implementation method, a unique mapping relationship can be established between the target entity and the corresponding multi-source detection data (such as the ID of the on-site inspection image or the text number of the review report), and a data association attribute field can be added to the target knowledge graph to realize bidirectional traceability between the target entity and the multi-source detection data.

[0069] Furthermore, a two-tier architecture of graph database and ontology reasoning engine is adopted for storage: the graph database is responsible for storing the triple data (i.e., target entity-target attribute-constraint relationship) of the instance layer (including the feature data mapped to the preset knowledge graph mentioned above), supporting efficient graph traversal queries; the ontology reasoning engine loads OWL (Web Ontology Language) ontology files (which store preset entities of each category, preset attributes of each category of preset entities, and constraint relationships between preset entities), performs semantic verification on the data in the instance layer (such as verifying whether the auditor's qualification level matches the qualification requirements of the diamond-level standard), automatically corrects redundant / conflicting relationships (such as removing duplicate "belonging" relationships and correcting the threshold range error of "constraint" relationships), and generates implicit relationships to supplement reasoning (such as deriving "A is related to C" from "A belongs to B, B is related to C"), finally forming a structured, conflict-free, and reasonable complete knowledge graph as the target knowledge graph.

[0070] In this embodiment, the extracted discrete entities and relationships are merely isolated data units. However, through the design of a pre-defined knowledge graph and the method of feature data mapping, entities from multi-source detection data across modalities can be incorporated into a unified semantic framework, solving the semantic alignment problem that cannot be achieved by simply storing multi-source detection data in a database. The target knowledge graph, through the ontology reasoning engine and the instance layer association construction method, constructs semantic reasoning rules based on entity relationships, a core capability that cannot be achieved by simple data storage. The ontology reasoning engine can automatically deduce implicit relationships, while a graph database that only stores entities and relationships can only complete basic traversal queries and cannot achieve implicit knowledge mining based on power grid safety business rules, nor can it provide a basis for judging semantic similarity for clustering fusion. Furthermore, through ontology constraints (i.e., the pre-defined entities of each category in the pre-defined knowledge graph, the pre-defined attributes of each category of pre-defined entities, and the constraint relationships between pre-defined entities) and the construction method of reasoning optimization, the structured semantic network of entity-relationship-attribute provides a unique semantic association benchmark for subsequent clustering fusion: the similarity judgment between entities during the clustering process depends not only on the numerical features of entity attributes but also on the semantic associations defined in the target knowledge graph. In summary, this embodiment transforms the extracted discrete entities / relationships into a structured knowledge system that is understandable, inferable, and serviceable by using an ontology layer design, instance layer filling, and graph storage and optimization approach. The domain semantics, inference rules, and business association logic it carries cannot be replaced by simply relying on database storage of entity-relationship data, thus providing semantic association support for the subsequent clustering and fusion of multi-source detection data.

[0071] Based on the above embodiments, in an exemplary embodiment, the feature data extraction process in S202 is further refined. For example... Figure 4 As shown, the following steps may be included:

[0072] S401 converts the multi-source detection data into corresponding target text data.

[0073] Each target text data item contains semantic annotation information. Target text data refers to text data converted from different types of multi-source detection data into a unified format. Semantic annotation information refers to the initial labels affixed to the target text data; these initial labels can be category labels, attribute labels, or relationship labels.

[0074] Optionally, a data conversion model can be used to uniformly convert multi-source detection data. For example, for video data (if included in multi-source detection data), keyframe images can be extracted first, and then text data can be generated through OCR recognition and image semantic analysis; for audio data (such as on-site inspection voice recordings), speech-to-text technology can be used to convert it into text data. After converting the multi-source detection data into text data in a unified format, each text data is segmented, and initial labels are added to the segmented text units to obtain target text data with semantic annotation information.

[0075] S402, input each target text data into the feature extraction model to obtain multiple feature data.

[0076] The so-called feature extraction model refers to a pre-trained algorithm model used to extract core semantic features from target text data and generate labeled feature data. Optionally, for the production detection scenario of the power grid to be detected, each target text data can be input into a feature extraction model pre-trained in the field of power grid safety production. This feature extraction model can then output core semantic units with category labels, attribute labels, or relation labels, i.e., multiple feature data.

[0077] In this embodiment, by first converting multi-source detection data into unified target text data and adding semantic annotation information, the problem of feature extraction difficulties caused by heterogeneous multi-source data formats is solved, enabling different types of data to be feature extracted through unified text processing logic. By adopting a dedicated feature extraction model, the core semantic information in the power grid field can be identified more accurately, improving the efficiency and accuracy of feature data extraction, providing high-quality input data for subsequent mapping processing and risk detection, and further improving the overall accuracy of risk detection.

[0078] Based on the above embodiments, in an exemplary embodiment, the process of determining the target text data in S401 is further refined. For example... Figure 5 As shown, the following steps may be included:

[0079] S501, extract text information from image data to obtain image text data.

[0080] Image data refers to data in the form of images from multi-source detection data, such as images of power transmission lines and substation equipment taken during on-site inspections. Image-text data refers to text information extracted from image data using text extraction techniques.

[0081] Optionally, for image data in multi-source detection data, a combined architecture of Connectionist Text Proposal Network (CTPN) and convolutional recurrent neural network can be used to extract text. Specifically, the first step is to detect text regions in the image data using the Connectionist Text Proposal Network (CTPN); the second step is to use the convolutional recurrent neural network to perform character recognition on each detected text region, converting the text in the image data into text data; the third step is to correct and optimize the text data by using character similarity matching (e.g., distinguishing between '1' and 'I') and contextual semantic verification (e.g., 'professional type' should be followed by a reasonable classification word) to correct recognition errors, output accurate text, and obtain the final image text data.

[0082] S502, Natural Language Processing is performed on the image text data and the initial text data respectively to obtain the corresponding target text data.

[0083] The initial text data refers to data that originally existed in text form in the multi-source detection data, such as review report text documents and inspection record text. Optionally, natural language processing is performed on the image text data output by OCR and the initial text data in the multi-source detection data. Specifically, text data of different formats are converted into plain text format with standard UTF-8 encoding to eliminate format differences; a special word segmentation dictionary for the Anfeng domain (containing professional terms such as "verification item indicators" and "diamond grade standards") is used to segment the text data after the format is unified, avoiding the incorrect segmentation of professional terms by general word segmentation tools; function words without actual semantic meaning (such as "of", "at", "for") and redundant information (such as repeated fields) in the segmented text data are filtered out, and core semantic units are retained; initial labels are applied to the filtered text units. Initial labels can include category labels (such as "verification item entity", such as "insufficient self-exposure of problems", "average number of power outages per user", etc.), attribute labels (such as "number of self-exposed problems", "number of users with power outages"), or relationship labels (such as "belongs to: safety supervision profession"), laying the foundation for subsequent entity extraction.

[0084] In this embodiment, through the above processing, the multi-source detection data is transformed from heterogeneous forms of images and text into structured text data (i.e., target text data) with a unified structure and clear semantics. This eliminates the format and semantic barriers of cross-modal data, ensuring the accuracy of feature extraction and thus indirectly improving the accuracy of risk detection results.

[0085] Based on the above embodiments, in an exemplary embodiment, the feature extraction model includes an encoding layer and a decoding layer. The process of determining feature data in S402 above is further refined. For example... Figure 6 As shown, the following steps may be included:

[0086] S601, each target text data is input into the encoding layer to obtain the entity feature vectors determined by the encoding layer based on the context features of the target text data.

[0087] In this context, the encoding layer refers to the network layer in the feature extraction model used to convert text data into vector representations. Contextual features refer to the semantic association information between each word in the target text data and the words preceding and following it. Entity feature vectors are numerical vectors that convert entity information in the text to represent the semantic features of the entities. Optionally, to construct a high-quality target knowledge graph, risk entities (such as "equipment defect type," "auditor qualification level," "diamond level standard threshold," etc.) need to be accurately extracted from the target text data. A Long Short-Term Memory-Conditional Random Field Model (LSTM-CRF) can be used as the feature extraction model to address the problems of coarse granularity and large boundary errors in the recognition of power industry terminology using traditional methods. The LSTM layer is used as the encoding layer, and the CRF layer as the decoding layer. The target text data is processed as follows: each word in the target text data (such as "senior auditor," "equipment defect closure rate") is mapped to a high-dimensional vector, denoted as... The vector dimension is determined using a word vector model in the power sector (such as a model pre-trained based on a corpus of power grid safety production), ensuring that the vector reflects the semantic relationships of professional terms. Using a high-dimensional vector A as input, the contextual features in the text sequence are extracted through the forget gate, input gate, and output gate mechanisms of LSTM, resulting in entity feature vectors. The extraction process formula is as follows:

[0088] (1)

[0089] (2)

[0090] (3)

[0091] In the formula, Represents the activation function; and Represents the weight matrix and bias matrix; , , Represents the forget gate, input gate, and output gate vectors; Represents the state vector of candidate memory cells; This represents the updated memory cell state vector; Represents the entity feature vector.

[0092] S602, input each entity feature vector into the decoding layer to obtain the feature data determined by the decoding layer through decoding the entity feature vector.

[0093] The decoding layer, in this context, refers to the network layer in the feature extraction model used to convert entity feature vectors into labeled feature data. Optionally, it will be derived from... Extract entity feature vectors As input to the CRF layer, the state distribution probability is calculated, and the resulting output is a sequence of labeled knowledge entities (feature data with labels) from the entire multi-source detection data, thus completing the knowledge entity extraction. State distribution probability The calculation formula is as follows:

[0094] (4)

[0095] In the formula, Represents the normalization factor; Represents the weights of the characteristic function; A sequence of labels representing knowledge entities; Represents the transition characteristic function; The number of tags representing knowledge entities; This represents the number of entity feature vectors. The optimal label sequence is obtained by maximizing the conditional probability, i.e.:

[0096] (5)

[0097] (6)

[0098] (7)

[0099] In the formula, The optimal label sequence of knowledge entities in the multi-source detection data representing the risks to power grid safety production, i.e., the set of knowledge entity extraction results; Representing the Individual entities (i.e., feature data); Representing the The label of an entity.

[0100] In this embodiment, the precise extraction of feature data is achieved through the collaborative work of the encoding and decoding layers: the encoding layer can fully capture the contextual semantic features of the target text data, enabling the entity feature vector to more comprehensively reflect the semantic information of the entity and avoiding information loss caused by isolated word features; the decoding layer ensures the accuracy and rationality of label assignment by applying label constraints or probability prediction, reducing the probability of label misjudgment. This refined design of the feature extraction model further improves the accuracy of feature data extraction and labeling, providing a more reliable foundation for subsequent mapping processing and risk detection, and helping to improve the accuracy of risk detection results.

[0101] Based on the above embodiments, in an exemplary embodiment, the process of determining the feature data clusters in S404 is further refined. For example... Figure 7 As shown, the following steps may be included:

[0102] S701, Based on the attribute information of the target entities corresponding to the feature data with category labels in the target knowledge graph, determine the semantic features of each target entity.

[0103] Here, semantic features refer to the set of features that can characterize the core semantics of a target entity. Optionally, attribute information of each target entity (such as the attribute values ​​of "risk level" and "professional affiliation" of "verification item indicator entity") can be extracted from the target knowledge graph, and the attribute values ​​can be converted into numerical features to form the semantic feature vector of each target entity, i.e., semantic features.

[0104] S702, determine the semantic distance between the semantic features of each target entity.

[0105] Semantic distance refers to a quantitative indicator that measures the similarity or degree of association between two target entities at the semantic level. The more similar and closely associated they are semantically, the smaller the semantic distance; conversely, the smaller the semantic distance, the greater the similarity or association. Optionally, the Euclidean distance algorithm can be used to calculate the Euclidean distance between the semantic feature vectors of each target entity and use it as the semantic distance.

[0106] S703, based on semantic distance, determines multiple cluster centers from each target entity.

[0107] Here, cluster centers refer to representative core entities selected from all target entities, serving as the benchmark for subsequent clustering. Their semantic features can reflect the core attributes and relationships of a certain type of risky entities. Optionally, a density peak clustering algorithm can be used to calculate the local density of each target entity (i.e., the number of other target entities within a preset semantic distance range around the target entity) and the minimum semantic distance from the target entity to entities with higher local density. Target entities with high local density and large minimum semantic distance are selected as cluster centers.

[0108] S704. Based on the constraint relationships between target entities in the target knowledge graph, the semantic features of each cluster center, and the semantic features of each target entity other than the multiple cluster centers, determine multiple feature data clusters.

[0109] Optionally, the semantic distance between each remaining entity and each cluster center is calculated. At the same time, the constraint relationship between the remaining entity and each cluster center in the target knowledge graph is referenced, and the remaining entity is assigned to the cluster corresponding to the cluster center with the smallest semantic distance and a constraint relationship (such as the existence of "membership" relationship, "constraint" relationship, etc.) to form multiple feature data clusters.

[0110] As an optional implementation, the process of determining the feature data cluster can also include the following steps:

[0111] Step 1: Based on the target knowledge graph, feature extraction is performed on the target entities corresponding to the feature data with category labels to obtain the semantic features of each target entity. Each semantic feature includes the attribute information and semantic association features of the target entity. The semantic association features are determined based on the constraint relationships of the target entity in the target knowledge graph, its predefined entity category, and the predefined entity categories of the associated entities in the constraint relationships. Semantic features refer to the set of features that can characterize the semantic attributes and association relationships of a target entity, including attribute information and semantic association features. Attribute information refers to the various target attributes of the target entity in the target knowledge graph, such as the "location" and "severity" of a defect entity, and the "service life" and "rated voltage" of an equipment entity. Semantic association features are features derived based on the semantic relationships of the target entity in the knowledge graph, and are jointly determined by the constraint relationship type of the target entity, its own predefined entity category, and the predefined entity categories of the associated entities. Associated entities refer to other target entities directly connected to the target entity through constraint relationships, such as "Safety Supervision Specialty" which is connected to the target entity "Insulation Defect" through a "belonging" relationship; "Safety Supervision Specialty" is considered an associated entity. Optionally, for each target entity in the target knowledge graph, its inherent attribute information is extracted from the target knowledge graph, including numerical attributes (such as defect occurrence time and severity score) and textual attributes (such as defect location description and inspection personnel notes), forming an attribute information set for the entity; all constraint relationships of the target entity in the target knowledge graph (such as "attribution - safety supervision specialty" and "association - transformer B") are analyzed, and combined with its own preset entity category (such as "insulation defect category") and the preset entity categories of associated entities (such as "specialty category" and "equipment category"), semantic relationship encoding is used (such as encoding "attribution" relationship into a specific vector and mapping entity category into semantic identifier) ​​to generate semantic association features that can represent the semantic association pattern of the entity; the attribute information and semantic association features are integrated to obtain the complete semantic features of each target entity.

[0112] Step 2: For each target entity, determine the semantic distance between the target entity and other target entities based on its semantic features. Optionally, for each target entity, its semantic features can first be converted into a standardized semantic feature vector (where attribute information is type-adaptively encoded: numerical attributes are normalized, and textual attributes are converted into vectors through word embedding; semantic association features map constraint relationship types and entity category identifiers into fixed-dimensional vectors). Subsequently, calculate the similarity or distance value between the semantic feature vectors of this target entity and each other target entity: for attribute information, Euclidean distance is used to calculate the similarity of numerical features, and cosine similarity is used to calculate the matching degree of textual features; for semantic association features, the association similarity is calculated by comparing the consistency of constraint relationship types and the matching degree of entity categories, and assigning different weights; finally, the attribute information similarity and the semantic association feature similarity are weighted and fused (the weights can be preset or adaptively adjusted according to the power grid risk detection requirements) to obtain the quantitative value of the semantic distance between the two target entities.

[0113] Step 3: Determine multiple cluster centers from each target entity based on semantic distances. Optionally, for the production inspection scenario of the power grid to be inspected, the preset number K of cluster centers can be determined first based on the preset number of categories of power grid safety production risks (such as the number of categories of equipment defects, environmental hazards, operational violations, etc.) or by analyzing the semantic distance distribution. Subsequently, clustering algorithms (such as K-means++, density peak clustering, etc.) can be used to select cluster centers. For example, in the process of selecting cluster centers using the K-means++ algorithm, a target entity can be randomly selected as the first cluster center. Then, the longest semantic distance from each remaining target entity to the first cluster center is calculated, and the target entity with the largest distance is selected as the next cluster center. This process is repeated until K cluster centers are selected, ensuring that the semantic distance between each cluster center is large enough to cover the semantic features of different types of target entities.

[0114] Step 4: Based on the semantic features of each target entity (excluding the cluster centers) and the semantic features of each cluster center, determine multiple feature data clusters. Optionally, first extract the semantic feature vectors of the determined cluster centers as the baseline vectors for each feature data cluster; second, for each target entity (excluding the cluster centers), calculate the similarity between its semantic feature vector and the semantic feature vector of each cluster center; then, assign each target entity to the cluster corresponding to a cluster center with a similarity greater than a similarity threshold; finally, perform semantic consistency verification on the target entities within each cluster (e.g., verify the constraint relationship type of entities within the cluster, whether the preset entity category conforms to the semantic rules of the same type of risk), and eliminate abnormal entities with excessive semantic deviation, ultimately forming multiple feature data clusters with highly similar semantic features corresponding to specific risk types.

[0115] In this embodiment, the feature data cluster determination process constructs comprehensive semantic features (integrating inherent entity attributes with constraint relationships and entity categories in the knowledge graph) that include attribute information and semantic association features. This avoids the one-sidedness of semantic representation caused by single attribute features, providing a more logical basis for the accurate clustering of risk entities. A semantic distance calculation method using a weighted fusion of attribute information and semantic association features is adopted to more accurately measure the semantic similarity between entities, reducing semantic misjudgments caused by simple numerical matching. The number of cluster centers is determined by combining the preset number of power grid risk classifications or the semantic distance distribution, and a clustering algorithm is used to screen the cluster centers, ensuring that the cluster centers can represent different risk types and avoiding center selection bias. The remaining entities are allocated to form feature data clusters based on semantic distance and knowledge graph constraint relationships, so that entities within a cluster have both semantic similarity and domain constraint consistency, improving intra-cluster homogeneity and inter-cluster heterogeneity. The above process effectively optimizes the clustering effect of risk entities, providing structurally clear and semantically consistent analysis units for subsequent risk assessment, reducing risk type confusion and judgment bias, and significantly improving the accuracy of power grid risk detection.

[0116] Based on the above embodiments, in an exemplary embodiment, the process of determining the cluster center in S703 is further refined. For example... Figure 8 As shown, the following steps may be included:

[0117] S801: For each target entity, determine the density value corresponding to the target entity based on the semantic distance.

[0118] Density value refers to a quantitative indicator used to characterize the density of other entities around a target entity; a higher density value indicates a greater number of similar entities surrounding the target entity. Optionally, because multi-source detection data has a complex distribution and blurred boundaries in the entity feature space, it is prone to problems such as intra-class dispersion and inter-class overlap. Density peak clustering algorithm, by introducing the concepts of local density and relative distance, can automatically identify cluster centers and effectively divide semantically consistent entity clusters, thereby achieving accurate clustering and fusion of multi-source detection data and improving the effect of clustering similar entities and distinguishing dissimilar entities. The density peak clustering method is used to perform cluster analysis on the extracted entities. Specifically, step 1: Input... The algorithm parameter, the cutoff distance E, is set. E is adaptively determined by multiplying the standard deviation of the target entity attributes by 1.2, ensuring coverage of the nearest neighbor range of more than 80% of the entities. Step 2: Calculate the Euclidean distance between target entities (i.e., the semantic distance mentioned above) and construct the distance matrix. ,Right now:

[0119] (8)

[0120] (9)

[0121] In the formula, Represents the target entity With the target entity The Euclidean distance between them; , Representing the target entities respectively With the target entity The Individual attribute information.

[0122] Step 3: Calculate the local density using the following formula. and density distance .

[0123] (10)

[0124] (11)

[0125] (12)

[0126] In the formula, This represents the cutoff distance.

[0127] Step 4: Calculate the local density of each target entity. and density distance product (i.e., density value):

[0128] (13)

[0129] S802 identifies target entities with density values ​​greater than the density threshold as cluster centers.

[0130] The density threshold refers to a pre-set critical density value used to select cluster centers. This threshold can be adjusted based on historical data and actual needs in the power grid field. Optionally, the density value of each target entity is compared with the density threshold. If the density value of a target entity is greater than the density threshold, that target entity is selected as a cluster center. Regarding the aforementioned density value... You can choose Target entities that are significantly higher than their surrounding counterparts are designated as density peak points (i.e., cluster centers), denoted as . .

[0131] In this embodiment, the cluster centers are accurately determined by density value calculation and density threshold screening, ensuring the rationality of subsequent clustering results and enabling the effective aggregation of similar target entities. This provides a clear analysis unit for power grid risk detection and helps improve the accuracy of risk detection results.

[0132] Based on the above embodiments, in an exemplary embodiment, the process of determining the feature data clusters in S704 is further refined. For example... Figure 9 As shown, the following steps may be included:

[0133] S901, for each remaining entity, determine the cluster center corresponding to the remaining entity based on the constraint relationship between each target entity in the target knowledge graph and the similarity corresponding to each remaining entity.

[0134] The remaining entities are all target entities excluding the multiple cluster centers. Similarity is a quantitative indicator used to measure the semantic similarity between the remaining entities and the cluster centers; a higher similarity indicates a closer semantic relationship. Optionally, a cosine similarity algorithm is used to calculate the cosine similarity between the semantic feature vector of each remaining entity and the semantic feature vector of each cluster center, and this cosine similarity is used as the overall similarity.

[0135] As an optional implementation method, based on cosine distance Calculate the cosine similarity between the semantic feature vector of each remaining entity and the semantic feature vector of each cluster center, using the following formula:

[0136] (14)

[0137] (15)

[0138] (16)

[0139] In the formula, Represents the remaining entities; Cluster centers representing the affiliation; represent Local density; Represents an indicator function; represent and The distance; Represents cosine similarity.

[0140] S902, based on the cluster center corresponding to each remaining entity, determine multiple cluster centers for each remaining entity, based on the constraint relationships between each target entity in the target knowledge graph and the similarity corresponding to each remaining entity.

[0141] Optionally, you can first query the constraint relationship between the remaining entity and each cluster center entity in the target knowledge graph, filter out the cluster centers that have a constraint relationship with the remaining entity (if the remaining entity is a verification item indicator entity, it is only allowed to establish a "membership" relationship with the professional category entity cluster center), and then select the cluster center with the highest similarity from the filtered cluster centers as the cluster center corresponding to the remaining entity.

[0142] S903, determine multiple feature data clusters based on the cluster center corresponding to each remaining entity.

[0143] Optionally, each remaining entity is assigned to the cluster containing its corresponding cluster center. Each cluster contains one cluster center and multiple remaining entities, forming multiple feature data clusters. Entities within the same cluster have high semantic similarity and matching constraint relationships.

[0144] As an optional implementation, for each feature data cluster, based on the semantic relationships in the knowledge graph, the multimodal data (i.e., the multi-source detection data mentioned above) corresponding to the target entities of the same feature data cluster can be fused together to achieve multimodal data clustering fusion. The fusion formula is as follows:

[0145] (17)

[0146] In the formula, Indicates the concatenation function; Representing the Multimodal data fusion results for risk categories; Representing the No. 1 in the cluster individual entities The corresponding multimodal data.

[0147] Through the above process, clustering and fusion of multi-source detection data based on knowledge entities can be completed. The fusion result includes entity attribute summaries, multi-source detection data links, and semantic associations of the target knowledge graph, ensuring that the fused data retains both the original information and structured semantics. Furthermore, the multi-source detection data that has undergone clustering and fusion is added as new instantiated data to the instance layer of the target knowledge graph: the fused data uses the fused risk cluster instance (i.e., feature data cluster) as the core node, linking the attribute summary information of all target entities under that cluster, multi-source detection data, and semantic association rules of clustering and fusion, becoming an important component of the target knowledge graph instance layer. This process enables the target knowledge graph to overcome the limitations of discrete data in the entity extraction (i.e., feature data extraction) stage, not only supplementing the complete risk information after multimodal fusion but also enriching the semantic association dimensions between target entities (such as adding instance relationships like "fusion cluster-containing-entity" and "fusion data-association-multi-source detection data"), making the semantic network of the target knowledge graph more complete and further strengthening its semantic support capability for power grid risk auditing.

[0148] In this embodiment, the quality of feature data clusters is further improved by refining the clustering and allocation process of the remaining entities: accurate similarity calculation provides a reliable quantitative basis for entity allocation; the introduction of constraint relationships avoids semantically similar but conflicting entities being incorrectly assigned to the same cluster, ensuring the consistency of entities within a cluster. High-quality feature data clusters enable subsequent risk detection to more accurately identify the characteristics of similar risks, reduce false positives and false negatives, and thus improve the accuracy of risk detection results.

[0149] Based on the above embodiments, in an exemplary embodiment, the method may further include the following steps: Step 1, acquiring multi-source detection data of the power grid to be detected. Step 2, extracting text information from the image data in the multi-source detection data to obtain image text data. Step 3, performing natural language processing on the image text data and the initial text data respectively to obtain the corresponding target text data. Step 4, inputting each target text data into the encoding layer of the feature extraction model to obtain the entity feature vectors determined by the encoding layer based on the context features of the target text data. Step 5, inputting each entity feature vector into the decoding layer of the feature extraction model to obtain the feature data determined by the decoding layer through decoding the entity feature vectors. Step 6, for each feature data with a category label, searching for a preset entity whose category matches the category label according to a preset knowledge graph, and mapping the feature data with the category label to the matching preset entity to obtain the target entity of the matching preset entity. Step 7, for each feature data with an attribute label, filtering the first entity corresponding to the feature data from the target entities according to the attribute label, and determining the target attribute of the first entity according to the preset attribute represented by the feature data and the preset attribute corresponding to the first entity in the preset knowledge graph. Step 8: For each feature data with a relation label, determine the target constraint relationship matching the feature data based on the constraint relationship between preset entities represented by the preset knowledge graph. Then, determine the constraint relationship between each second entity based on the second entity corresponding to the relation label and the preset entity associated with the target constraint relationship. Step 9: Based on the mapping results of steps 6-8, determine the target knowledge graph including multiple feature data. Step 10: Based on the attribute information of the target entities corresponding to the feature data with category labels in the target knowledge graph, determine the semantic features of each target entity. Step 11: Determine the semantic distance between the semantic features of each target entity. Step 12: For each target entity, determine the density value corresponding to the target entity based on the semantic distance, and identify target entities with density values ​​greater than the density threshold as cluster centers. Step 13: Based on the semantic features of each target entity other than the multiple cluster centers and the semantic features of each cluster center, determine the similarity between each remaining entity and each cluster center. Step 14: For each remaining entity, based on the constraint relationship between each target entity in the target knowledge graph and the similarity values ​​corresponding to the remaining entities, determine the cluster center corresponding to the remaining entity. Step 15: Based on the cluster center corresponding to each remaining entity, determine multiple cluster centers for each remaining entity. These cluster centers are determined according to the constraints between target entities in the target knowledge graph and the similarity scores of the remaining entities. Step 16: Based on the cluster center corresponding to each remaining entity, determine multiple feature data clusters. The specific implementation methods of steps 1-16 are the same as those in the above method embodiments and will not be repeated here.

[0150] The following example, which involves conducting an actual safety inspection of a power grid to be tested, verifies the risk detection methods provided in the above embodiments.

[0151] Multi-source detection data includes real-time power grid data (from different system platforms), text data, image data, etc. Knowledge entities (i.e., feature data) are extracted from this multimodal data. The extracted knowledge entities are mapped to a pre-defined knowledge graph to obtain the target knowledge graph, and the density peak clustering algorithm is used to cluster the target entities in the target knowledge graph. To verify the effectiveness of the above clustering method in the power grid safety production risk detection process, intra-cluster density and inter-cluster separation are used as evaluation indicators. The former measures the similarity of risk samples of the same type after clustering, reflecting whether the target entity clustering effectively retains the common characteristics of the same type of risk; the latter measures the degree of feature difference between different risk categories after clustering, verifying whether the target entity clustering effectively amplifies the feature boundaries of dissimilar risks and avoids erroneous clustering of different categories. The results are as follows: Figure 10 and Figure 11 As shown.

[0152] from Figure 10 As can be seen from this embodiment (i.e. Figure 10 The minimum intra-class tightness of the method studied in this embodiment is 0.92, while the minimum intra-class tightness of the clustering method based on radial basis generative adversarial networks is 0.70, the minimum intra-class tightness of the clustering method based on the Word2Vec model is 0.80, and the minimum intra-class tightness of the clustering method based on improved evidence theory is 0.84. By comparison, the intra-class tightness of this embodiment is relatively higher, indicating that the data feature distribution of similar clustered samples is more concentrated, the feature differences are smaller, and the clustering effect is better. This is because the rich semantic context provided by the target knowledge graph makes the distribution of similar entities more concentrated in the feature space, and density peak clustering can more accurately capture semantic consistency, thereby significantly improving the intrinsic consistency of similar data after clustering.

[0153] from Figure 11 As can be seen from this embodiment (i.e. Figure 11The minimum inter-class separation degree of the method studied in this embodiment is 0.90, while the minimum inter-class separation degree of the clustering method based on radial basis generative adversarial networks is 0.74, the minimum inter-class separation degree of the clustering method based on the Word2Vec model is 0.84, and the minimum inter-class separation degree of the clustering method based on improved evidence theory is 0.84. By comparison, the inter-class separation degree of this embodiment is relatively larger, indicating that the clustering method of this embodiment achieves effective differentiation between different categories and avoids erroneous clustering. This is mainly due to the rich semantic association information provided by the target knowledge graph, which enhances the distinguishability of target entities of different categories in the vector space; at the same time, the density peak clustering algorithm effectively divides the cluster boundaries based on relative distance, significantly reducing the overlap and erroneous clustering between dissimilar data, and ensuring that the risk features of each major category have good separability after multimodal clustering.

[0154] In summary, both the intra-class compactness and inter-class separation in this embodiment remain above 0.9, demonstrating the clustering effect of the method. This is mainly because the target knowledge graph provides rich semantic associations and contextual information, guiding the density peak clustering algorithm to generate clusters with higher semantic consistency. This results in a more clustered distribution of risk entities of the same type in the vector space, and a more dispersed distribution of risk entities of different major categories in the vector space, verifying the high quality and high reliability of its final clustering results.

[0155] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0156] Based on the same inventive concept, this application also provides a knowledge graph-based power grid risk detection device for implementing the aforementioned knowledge graph-based power grid risk detection method. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations of one or more knowledge graph-based power grid risk detection device embodiments provided below can be found in the limitations of the risk detection method described above, and will not be repeated here.

[0157] In one exemplary embodiment, such as Figure 12 As shown, a power grid risk detection device based on a knowledge graph is provided, including: an acquisition module 1201, a feature extraction module 1202, a graph construction module 1203, a clustering module 1204, and a detection module 1205, wherein: the acquisition module 1201 is used to acquire multi-source detection data of the power grid to be detected; the feature extraction module 1202 is used to extract features from the multi-source detection data to obtain multiple feature data; wherein each feature data has a category label, attribute label, or relationship label; the graph construction module 1203 is used to perform feature extraction on each feature data according to the label of each feature data. The feature data is mapped to a preset knowledge graph, and a target knowledge graph including multiple feature data is determined based on the mapping result. The preset knowledge graph is used to represent preset entities of each category, preset attributes of each category of preset entities, and constraint relationships between preset entities. The clustering module 1204 is used to cluster the target entities corresponding to feature data with category labels according to the target knowledge graph to obtain multiple feature data clusters. The detection module 1205 is used to perform risk detection on each feature data cluster and determine the risk detection result of the power grid to be detected based on the detection result.

[0158] In an exemplary embodiment, the graph construction module 1203 is specifically configured to: for each feature data with a category label, search for a preset entity whose category matches the category label according to a preset knowledge graph, and determine each feature data with a category label as a target entity; for each feature data with an attribute label, filter the first entity corresponding to the feature data from the target entities according to the attribute label, and determine the target attribute of the first entity according to the feature data and the preset attribute corresponding to the preset entity that matches the first entity as represented by the preset knowledge graph; for each feature data with a relation label, determine the target constraint relationship that matches the feature data according to the constraint relationship between preset entities represented by the preset knowledge graph, and determine the constraint relationship between each second entity according to each second entity corresponding to the relation label and the preset entity associated with the target constraint relationship; wherein each second entity belongs to the target entity.

[0159] In an exemplary embodiment, the feature extraction module 1202 includes: a conversion unit that converts multi-source detection data into corresponding target text data, wherein each target text data has semantic annotation information; and an extraction unit that inputs each target text data into a feature extraction model to obtain multiple feature data.

[0160] In an exemplary embodiment, the multi-source detection data includes image data and initial text data; the conversion unit is specifically used to: extract text information from the image data to obtain image text data; and perform natural language processing on the image text data and the initial text data respectively to obtain the corresponding target text data.

[0161] In an exemplary embodiment, the feature extraction model includes an encoding layer and a decoding layer. The extraction unit is specifically used to: input each target text data into the encoding layer to obtain the entity feature vectors determined by the encoding layer based on the context features of the target text data; and input each entity feature vector into the decoding layer to obtain the feature data determined by the decoding layer by decoding the entity feature vectors.

[0162] In an exemplary embodiment, the clustering module 1204 includes: a first determining unit, configured to determine the semantic features of each target entity based on the attribute information of the target entities corresponding to the feature data with category labels in the target knowledge graph; a second determining unit, configured to determine the semantic distance between the semantic features of each target entity; a third determining unit, configured to determine multiple cluster centers from each target entity based on the semantic distance; and a clustering unit, configured to determine multiple feature data clusters based on the constraint relationships between each target entity in the target knowledge graph, the semantic features of each cluster center, and the semantic features of each target entity other than the multiple cluster centers.

[0163] In an exemplary embodiment, the third determining unit is specifically configured to: for each target entity, determine the density value corresponding to the target entity based on semantic distance; and determine the target entities with density values ​​greater than the density threshold as cluster centers.

[0164] In an exemplary embodiment, the clustering unit is specifically configured to: determine the similarity between each remaining entity and each cluster center based on the semantic features of each target entity other than the multiple cluster centers and the semantic features of each cluster center; wherein, the remaining entities are each target entity other than the multiple cluster centers; for each remaining entity, determine the cluster center corresponding to the remaining entity based on the constraint relationships between each target entity in the target knowledge graph and the similarity corresponding to the remaining entity; determine multiple feature data clusters based on the cluster center corresponding to each remaining entity.

[0165] Each module in the aforementioned risk detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.

[0166] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 13 As shown, the computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores multi-source detection data. The I / O interfaces are used for information exchange between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a knowledge graph-based power grid risk detection method.

[0167] Those skilled in the art will understand that Figure 13 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0168] In one exemplary embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0169] In one exemplary embodiment, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the steps in the above-described method embodiments.

[0170] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0171] It should be noted that the data involved in this application (including but not limited to data used for analysis, such as multi-source detection data) are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0172] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this 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. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one of relational databases and non-relational databases. Non-relational databases may include blockchain-based distributed databases, etc., and are not limited thereto. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited thereto. The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this application. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the appended claims.

Claims

1. A power grid risk detection method based on knowledge graphs, characterized in that, The method includes: Acquire multi-source detection data of the power grid under test; Feature extraction is performed on the multi-source detection data to obtain multiple feature data; wherein each feature data has a category label, attribute label or relationship label; Based on the label of each feature data, the feature data is mapped to a preset knowledge graph, and based on the mapping result, a target knowledge graph including the multiple feature data is determined; wherein, the preset knowledge graph is used to represent each category of preset entities, the preset attributes of each category of preset entities, and the constraint relationships between preset entities; Based on the target knowledge graph, target entities corresponding to feature data with the category labels are clustered to obtain multiple feature data clusters; Risk detection is performed on each feature data cluster, and the risk detection result of the power grid to be detected is determined based on the detection results.

2. The method according to claim 1, characterized in that, The step of mapping the feature data to a preset knowledge graph based on the label of each feature data includes: For each feature data with a category label, a preset entity matching the category label is found based on a preset knowledge graph, and each feature data with a category label is identified as a target entity. For each feature data with an attribute label, the first entity corresponding to the feature data is selected from the target entities according to the attribute label, and the target attribute of the first entity is determined according to the feature data and the preset attribute corresponding to the preset entity that matches the first entity as represented by the preset knowledge graph. For each feature data with a relation label, a target constraint relationship matching the feature data is determined based on the constraint relationship between preset entities represented by the preset knowledge graph. Furthermore, the constraint relationship between each second entity is determined based on each second entity corresponding to the relation label and the preset entity associated with the target constraint relationship. Each second entity belongs to the target entity.

3. The method according to claim 1, characterized in that, The feature extraction process of the multi-source detection data yields multiple feature data, including: The multi-source detection data are converted into corresponding target text data; each target text data has semantic annotation information. Each target text data is input into the feature extraction model to obtain multiple feature data.

4. The method according to claim 3, characterized in that, The multi-source detection data includes image data and initial text data; the conversion of the multi-source detection data into corresponding target text data includes: Text information is extracted from the image data to obtain image text data; Natural language processing is performed on the image text data and the initial text data respectively to obtain the corresponding target text data.

5. The method according to claim 3, characterized in that, The feature extraction model includes an encoding layer and a decoding layer; the input of each target text data into the feature extraction model yields multiple feature data, including: Each target text data is input into the encoding layer to obtain the entity feature vectors determined by the encoding layer based on the context features of the target text data; Each entity feature vector is input into the decoding layer to obtain the feature data determined by the decoding layer through decoding the entity feature vector.

6. The method according to any one of claims 1-5, characterized in that, The step involves clustering target entities corresponding to feature data with the category labels based on the target knowledge graph to obtain multiple feature data clusters, including: Based on the attribute information of the target entities corresponding to the feature data with the category labels in the target knowledge graph, the semantic features of each target entity are determined. Determine the semantic distance between the semantic features of each target entity; Based on the semantic distance, multiple cluster centers are determined from each target entity; Based on the constraint relationships between target entities in the target knowledge graph, the semantic features of each cluster center, and the semantic features of each target entity other than the multiple cluster centers, multiple feature data clusters are determined.

7. The method according to claim 6, characterized in that, The step of determining multiple cluster centers from each target entity based on the semantic distance includes: For each target entity, the density value corresponding to the target entity is determined based on the semantic distance; Target entities with density values ​​greater than the density threshold are identified as cluster centers.

8. The method according to claim 6, characterized in that, The step of determining multiple feature data clusters based on the constraint relationships between target entities in the target knowledge graph, the semantic features of each cluster center, and the semantic features of each target entity other than the multiple cluster centers, includes: Based on the semantic features of each target entity other than the multiple cluster centers and the semantic features of each cluster center, the similarity between each remaining entity and each cluster center is determined; wherein, the remaining entities are each target entity other than the multiple cluster centers. For each remaining entity, the cluster center corresponding to the remaining entity is determined based on the constraint relationships between each target entity in the target knowledge graph and the similarity corresponding to the remaining entity. Based on the cluster center corresponding to each remaining entity, multiple cluster centers are determined for each remaining entity based on the constraint relationships between each target entity in the target knowledge graph and the similarity corresponding to each remaining entity. Based on the cluster center corresponding to each remaining entity, multiple feature data clusters are determined.

9. A power grid risk detection device based on knowledge graphs, characterized in that, The device includes: The acquisition module is used to acquire multi-source detection data of the power grid under test; The feature extraction module is used to extract features from the multi-source detection data to obtain multiple feature data; wherein each feature data has a category label, attribute label or relationship label; The knowledge graph construction module is used to map the feature data to a preset knowledge graph based on the label of each feature data, and to determine the target knowledge graph including the multiple feature data based on the mapping result; wherein, the preset knowledge graph is used to represent each category of preset entities, the preset attributes of each category of preset entities, and the constraint relationships between preset entities. The clustering module is used to cluster target entities corresponding to feature data with the category labels according to the target knowledge graph, so as to obtain multiple feature data clusters; The detection module is used to perform risk detection on each feature data cluster and determine the risk detection result of the power grid to be detected based on the detection results.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 8.