A power grid professional knowledge graph construction method for a green supply chain platform
By extracting triples from historical disaster data of the power grid and constructing a dynamic penalty and intelligent merging mechanism, the clustering results are optimized, solving the problem of complex unstructured text information in the power grid knowledge graph and realizing the construction of a more accurate and logically consistent power grid knowledge graph.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TECH TRAINING CENT OF STATE GRID HUBEI ELECTRIC POWER CO LTD
- Filing Date
- 2026-02-28
- Publication Date
- 2026-06-16
AI Technical Summary
Traditional knowledge graphs suffer from complex unstructured text information and inconsistent semantics in describing power grid equipment damage and related component material requirements. This makes entity extraction and semantic parsing difficult, reducing the accuracy of power grid knowledge graph construction.
A method for constructing a power grid knowledge graph for a green supply chain platform is adopted. By extracting triples from historical disaster data of the power grid and combining semantic similarity and word frequency-inverse document rate, a dynamic penalty mechanism and an intelligent merging mechanism are constructed to optimize the clustering results and generate a more accurate power grid knowledge graph.
It improves the accuracy and completeness of the power grid knowledge graph, solves the retrieval problem caused by inconsistent entity representation, and enhances the accuracy and logical consistency of the power grid knowledge graph construction.
Smart Images

Figure CN121766416B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of knowledge graph construction technology, specifically to a method for constructing a power grid professional knowledge graph for a green supply chain platform. Background Technology
[0002] With the development of AI, when power systems fail due to natural disasters and require emergency repairs, building an online knowledge graph of the supply chain and using artificial intelligence for decision-making can identify problems in the supply chain in advance, adjust material scheduling in a timely manner, and conduct emergency responses to the power system. This significantly reduces the management costs of the supply chain and strengthens the ecological collaboration of the green supply chain.
[0003] Among these, a power grid knowledge graph for the supply chain is constructed by combining historical disaster data, power equipment ledgers, and real-time inventory data of power equipment in warehouses to support artificial intelligence in decision analysis. Therefore, accurate construction of the power grid knowledge graph is crucial. Traditional knowledge graphs are constructed by quantifying the relationships between structured keywords. However, descriptions of power grid equipment damage and related component and material needs in disaster scenarios often rely on unstructured text information collected manually. This data is characterized by complex sources, inconsistent semantic expressions, and overlapping entity relationships, making entity extraction and semantic parsing difficult and reducing the accuracy of the power grid knowledge graph construction. Summary of the Invention
[0004] To address the aforementioned technical issues, this application provides a method for constructing a power grid expertise graph for a green supply chain platform, thereby resolving existing problems.
[0005] The method for constructing a power grid expertise graph for a green supply chain platform, as proposed in this application, adopts the following technical solution:
[0006] One embodiment of this application provides a method for constructing a power grid expertise graph for a green supply chain platform, the method comprising the following steps:
[0007] Extract triples from historical disaster data of the power grid, where each triple includes a head entity, a relation, and a tail entity;
[0008] All triples are initially clustered. Within each cluster, the semantic similarity of any two triples in terms of entities and relations is analyzed to determine the first weight between any two triples. Within each cluster, the differences in term frequency-inverse document rate between any two triples in terms of head entity, relation, and tail entity are analyzed to determine the second weight between any two triples. Combined with the first weight, the intra-cluster penalty weight between any two triples in each cluster is determined. Based on the semantic similarity of any two triples and combined with the intra-cluster penalty weight, the first similarity update value between any two triples in each cluster is determined.
[0009] Between any two clusters, the semantic similarity of any two triples in terms of entities and semantic similarity in terms of relations are analyzed to determine the inter-cluster penalty weight of any two triples between any two clusters. Combined with the semantic similarity of any two triples between any two clusters, the second similarity update value of any two triples between any two clusters is determined.
[0010] Based on the first similarity update value and the second similarity update value, the initial clustering result is optimized to obtain the optimal clustering result, so as to construct a power grid professional knowledge graph.
[0011] Preferably, the distance metric used in the initial clustering process is the reciprocal of the sum of the semantic similarity of any two triples and a preset value, where the preset value is a constant greater than 0.
[0012] Preferably, the method for determining the first weight between any two triples is as follows:
[0013] For any two triples in each cluster, calculate the similarity between the semantic vector of the head entity of each triple and the semantic vector of the head entity and the semantic vector of the tail entity of the other triple. The normalized value of the maximum similarity is recorded as the first similarity between any two triples. For the semantic vector of the tail entity of each triple, the second similarity between any two triples is obtained according to the calculation method of the first similarity.
[0014] The average of the first similarity, the second similarity, and the semantic vector similarity between any two triples in each cluster is used as the first weight between any two triples in each cluster.
[0015] Preferably, the second weight between any two triples is the average of the differences in term frequency-inverse document rate (TFR) on the head entity, the differences in term frequency-inverse document rate (TFR) on the relation, and the differences in term frequency-inverse document rate (TFR) on the tail entity.
[0016] Preferably, the intra-cluster penalty weight between any two triples in each cluster is negatively correlated with the first weight between any two triples and positively correlated with the second weight.
[0017] Preferably, the first similarity update value between any two triples in each cluster is positively correlated with the semantic similarity between the two triples and negatively correlated with the intra-cluster penalty weight.
[0018] Preferably, the expression for the inter-cluster penalty weight of any two triples between any two clusters is: In the formula, This represents the inter-cluster penalty weight between the nth triplet in cluster p and the mth triplet in cluster q. Let represent the maximum and minimum values of the first similarity, second similarity, and semantic vector similarity between the nth triplet in cluster p and the mth triplet in cluster q, respectively, for any two triplets between any two clusters, calculated using the first similarity, second similarity, and semantic vector similarity of the relation between any two triplets. The expression represents the semantic similarity between the nth triplet in cluster p and the mth triplet in cluster q; ln() represents the logarithmic function with the natural constant as the base. This indicates the preset similarity threshold.
[0019] Preferably, the second similarity update value of any two triples between any two clusters is positively correlated with the semantic similarity of any two triples and negatively correlated with the inter-cluster penalty weight.
[0020] Preferably, the step of optimizing the initial clustering results to obtain the optimal clustering results includes:
[0021] All triples are used as input to the clustering algorithm. The similarity criteria in the clustering algorithm are iteratively updated according to the calculation method of the first similarity update value and the second similarity update value. The number of iterations is set to a preset number. The final output clustering result is taken as the optimal clustering result.
[0022] Preferably, the construction of the power grid professional knowledge graph includes:
[0023] Obtain word vectors from each equipment ledger data. Concatenate the semantic vectors of the head entity, relation, and tail entity of each cluster center in the optimal clustering result and denote them as feature vectors. Calculate the similarity between the word vectors of each equipment ledger data and the feature vectors of all cluster centers. Use each equipment ledger data as the hypernym of the cluster corresponding to the maximum similarity. Establish a master-slave hierarchical relationship between the cluster center within the cluster corresponding to the maximum similarity and the other triples within the cluster.
[0024] Import the master-slave triples from all clusters into the Neo4j graph database to obtain a power grid professional knowledge graph.
[0025] This application has at least the following beneficial effects:
[0026] To address the inaccurate clustering caused by the traditional DBSCAN density clustering algorithm neglecting the internal structure and key differences of triples, this application introduces a dynamic penalty mechanism after initial clustering. By comprehensively evaluating the semantic similarity and textual importance differences of triples within the same cluster, an intra-cluster penalty weight is constructed, which then corrects the original similarity to generate a first similarity update value. This mechanism can accurately identify and penalize "spuriously similar" triples, effectively amplifying their internal differences while preserving the high similarity of truly similar triples. This continuously optimizes the clustering results in iterations, ultimately laying a solid foundation for constructing a more accurate power grid knowledge graph. Furthermore, to address the problem of "same event, different clusters" caused by differences in entity structure, this embodiment introduces an intelligent merging mechanism between clusters: by analyzing triples between different clusters... By constructing inter-cluster penalty weights based on internal similarity differences, a second similarity update value is generated. This mechanism effectively identifies semantically consistent triples that have been incorrectly split and "rewards" their similarity, thereby promoting their merging during iteration and ensuring the integrity and accuracy of the clustering results. This provides a strong guarantee for constructing a logically consistent power grid knowledge graph. Finally, this application iteratively updates the similarity using intra-cluster penalties and inter-cluster merging mechanisms to drive the continuous optimization of the clustering results until convergence, thus obtaining the optimal clustering result. On this basis, the clusters are further standardized by combining equipment ledger data and a master-slave hierarchical relationship is constructed. Finally, the data is imported into a graph database to generate a knowledge graph, effectively solving the retrieval problem caused by inconsistent entity representations and improving the accuracy of power grid knowledge graph construction. Attached Figure Description
[0027] To more clearly illustrate the technical solutions and advantages in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0028] Figure 1 A flowchart illustrating the steps of a method for constructing a power grid expertise graph for a green supply chain platform, as provided in one embodiment of this application;
[0029] Figure 2 This is a schematic diagram of the first similarity update value extraction process provided in one embodiment of this application. Detailed Implementation
[0030] To further illustrate the technical means and effects adopted by this application to achieve the intended purpose of the invention, the following, in conjunction with the accompanying drawings and preferred embodiments, details the specific implementation, structure, features, and effects of a method for constructing a power grid knowledge graph for a green supply chain platform according to this application. In the following description, different "one embodiment" or "another embodiment" do not necessarily refer to the same embodiment. Furthermore, specific features, structures, or characteristics in one or more embodiments can be combined in any suitable form.
[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application pertains.
[0032] The following description, in conjunction with the accompanying drawings, details a specific scheme for constructing a power grid expertise graph for a green supply chain platform, as provided in this application.
[0033] This application provides an embodiment of a method for constructing a power grid professional knowledge graph for a green supply chain platform. Specifically, it provides the following method for constructing a power grid professional knowledge graph for a green supply chain platform. Please refer to [link to relevant documentation]. Figure 1 The method includes the following steps:
[0034] Step S1: Extract triples from the historical disaster data of the power grid, wherein each triple includes a head entity, a relation, and a tail entity.
[0035] By accessing the power grid system through the API interface, historical disaster data and equipment ledger data in the power grid can be obtained. The historical disaster data includes log data of power equipment failures caused by historical natural disasters in the power system of each power grid zone. The equipment ledger data includes equipment and technical parameter information of power equipment in each power grid zone.
[0036] The historical disaster data was extracted using the open-source knowledge extraction tool DeepDE to obtain triples (entity-relationship-entity: e.g., icing-causing circuit failure-transmission tower conductor). Simultaneously, the semantic vectors of the head entity, relation, and tail entity in each triple were obtained using the BERT language model, and the term frequency-inverse document rate (TF-IDF) of the head entity, relation, and tail entity was calculated. When multiple words were included in the entity and relation terms, the average TF-IDF of multiple analyses was used for subsequent calculations. The processes of knowledge extraction using the knowledge extraction tool, obtaining the semantic vectors of entities and relations in each triple using the BERT language model, and calculating the TF-IDF are all well-known techniques and will not be elaborated further.
[0037] Step S2: Perform preliminary clustering on all triples. Within each cluster, analyze the semantic similarity of any two triples on entities and on relations to determine the first weight between any two triples. Within each cluster, analyze the differences in term frequency-inverse document rate between any two triples on the head entity, relation, and tail entity to determine the second weight between any two triples. Combine the first weight to determine the intra-cluster penalty weight between any two triples in each cluster. Based on the semantic similarity of any two triples and the intra-cluster penalty weight, determine the first similarity update value between any two triples in each cluster.
[0038] When constructing a professional knowledge graph of the power grid, historical disaster data exhibits strong unstructured characteristics. Due to differences in data sources, regions, and recorders, the naming of power equipment and the description of disaster impacts are inconsistent. This directly leads to a large amount of redundancy and ambiguity in the entities themselves during the knowledge extraction process, and serious overlap in entity relationships. In addition, these extracted entities also have semantic inconsistencies with the structured equipment ledger data. Ultimately, these factors together result in serious information redundancy in the constructed knowledge graph and a lack of generalization and reasoning capabilities for processing multi-semantic information.
[0039] When using the DBSCAN density clustering algorithm to eliminate redundant information in triples, its traditional similarity measurement method has serious defects. The DBSCAN density clustering algorithm usually evaluates the overall similarity by concatenating the semantic vectors of entities and relationships. However, this concatenation strategy cannot effectively handle two typical situations: on the one hand, the DBSCAN density clustering algorithm is insensitive to the internal structure of triples. For example, when two triples only have the entity order reversed (such as <A, affects, B> and <B, affects, A>) but describe the same event, the difference in the concatenated vectors will be very large, resulting in the algorithm wrongly classifying them into different categories; on the other hand, the DBSCAN density clustering algorithm is easily misled by local high similarity. When two triples only have minor differences in one key entity or relationship, the high similarity of the rest may mask this key difference in vector calculation, making the overall similarity falsely high, thus misjudging events that should be distinguished as the same category. Therefore, this traditional method that ignores structure and local key differences seriously affects the accuracy of clustering.
[0040] Based on the above analysis, in this embodiment, all triples are initially clustered. In each clustering cluster, the semantic similarity of any two triples in entities and the semantic similarity in relationships are respectively analyzed to determine the first weight between any two triples; in each clustering cluster, the differences in the term frequency-inverse document frequency of the head entity, relationship, and tail entity of any two triples are respectively analyzed to determine the second weight between any two triples, and combined with the first weight to determine the intra-cluster penalty weight between any two triples in each clustering cluster; based on the semantic similarity between any two triples and combined with the intra-cluster penalty weight, to determine the first similarity update value between any two triples in each clustering cluster. The specific process is as follows:
[0041] First, all triples are used as the input of the DBSCAN density clustering algorithm. Among them, the reciprocal of the sum of the semantic similarity between any two triples and a preset value is used as the measurement distance, and all clustering clusters are output as the result after initial clustering.
[0042] It should be noted that in this embodiment, the vector obtained by concatenating the semantic vectors of the head entity, relationship, and tail entity of each triple is used as the semantic vector of each triple. The result of mapping the cosine similarity between the semantic vectors of any two triples within the range is used as the semantic similarity between any two triples. Among them, the calculation method of cosine similarity is a well-known technology and will not be elaborated here. Among them, the process of mapping the cosine similarity within the range is to divide the result of adding 1 to the cosine similarity by 2, and the mapping within the range can be obtained.
[0043] It should be noted that the preset value is used to prevent the denominator from being 0. The value is set manually. In this embodiment, the preset value is 0.01. Under the premise of ensuring that the denominator is not 0 and does not excessively affect the calculation result, the implementer can also set it according to the specific situation. This embodiment does not impose any special restrictions.
[0044] Furthermore, within each cluster, the semantic similarity of any two triples in terms of entities and semantic similarity in terms of relations are analyzed to determine the first weight between any two triples. Specifically:
[0045] For any two triples in each cluster, calculate the similarity between the semantic vector of the head entity of each triple and the semantic vector of the head entity and the semantic vector of the tail entity of the other triple. The normalized value of the maximum similarity is recorded as the first similarity between any two triples. For the semantic vector of the tail entity of each triple, the second similarity between any two triples is obtained according to the calculation method of the first similarity.
[0046] The average of the first similarity, the second similarity, and the semantic vector similarity between any two triples in each cluster is used as the first weight between any two triples in each cluster.
[0047] To facilitate understanding of the above content, the calculation expressions for the first similarity, the second similarity, and the similarity between the semantic vectors corresponding to the relations are given below to more clearly represent the calculation content. Specifically:
[0048] First similarity between the g-th triple and the k-th triple within cluster h The expression is: In the formula, represents the cosine similarity between the semantic vector of the head entity of the g-th triplet and the semantic vector of the head entity of the k-th triplet within cluster h, and the cosine similarity between the semantic vector of the head entity of the g-th triplet and the semantic vector of the tail entity of the k-th triplet, respectively; max[ ] represents the maximum value function.
[0049] The second similarity between the g-th triple and the k-th triple within cluster h The expression is: In the formula, represents the cosine similarity between the semantic vector of the tail entity of the g-th triplet and the semantic vector of the head entity of the k-th triplet within cluster h, and the cosine similarity between the semantic vector of the tail entity of the g-th triplet and the semantic vector of the tail entity of the k-th triplet, respectively; max[ ] represents the maximum value function.
[0050] The similarity of semantic vectors between the g-th triple and the k-th triple within cluster h. The expression is: In the formula, Cosine similarity is expressed between the semantic vector of the relation of the g-th triplet within cluster h and the semantic vector of the relation of the k-th triplet.
[0051] The first weight, as understood, is a quantitative assessment of the similarity in core semantic structure between any two triples within the same cluster. It characterizes the average semantic closeness of these two triples across the core dimensions of entity and relation, directly reflecting their essential similarity in terms of "what they say" and "how they relate." A higher first weight indicates a more consistent semantic core between the two triples, suggesting they describe the same or highly related event. This makes them more likely to be grouped together in the initial clustering. The calculation of the first weight is influenced by three key factors: the head of any triple... The higher the semantic similarity between the entity and the head and tail entities of another triple, the higher the semantic similarity between the tail entity and the head and tail entities of another triple, and the higher the semantic similarity of their relationship, the higher the first weight. This reflects a high degree of semantic matching between the entities and the relationship of the two triples. Therefore, the more likely the two triples are considered to be essentially the same event, the higher the trust level is given in subsequent calculations. Conversely, the lower these factors are, the lower the first weight. This reflects a significant semantic difference between the two triples in terms of entities or relationships. The two triples may describe different events, providing a basis for subsequent penalties and separation.
[0052] Furthermore, within each cluster, the differences between any two triples in terms of term frequency-inverse document rate for head entity, relation, and tail entity are analyzed to determine the second weight between any two triples. Specifically:
[0053] The second weight between any two triples is the average of the differences in term frequency-inverse document rate (TFR) on the head entity, the differences in TFR on the relation, and the differences in TFR on the tail entity. Specifically, in this embodiment, the expression for the second weight between any two triples is: In the formula, This represents the second weight between the g-th triple and the k-th triple in cluster h; Let represent the term frequency-inverse document rate of the g-th triplet head entity and the term frequency-inverse document rate of the k-th triplet head entity in cluster h, respectively. Let f(g) and f(k) represent the term frequency-inverse document rate of the g-th triple relation and the term frequency-inverse document rate of the k-th triple relation in cluster h, respectively. Let represent the term frequency-inverse document rate of the tail entity of the g-th triplet and the term frequency-inverse document rate of the tail entity of the k-th triplet in cluster h, respectively; ln() represents the logarithmic function with the natural constant as the base. These are preset constants greater than 0, and their values are all manually set. In this embodiment, All are 0.01. Provided that the denominator is not 0 and does not excessively affect the calculation result, the implementer may set it according to the specific situation. This embodiment does not impose any special restrictions.
[0054] The second weight can be understood as a quantitative assessment of the difference in text importance between any two triples within the same cluster. The second weight is used to characterize the TF-IDF values of the head entity, relation, and tail entity at the corresponding positions of the two triples, that is, their importance in the entire document set. It reflects the difference in the information contribution of the two triples. The larger the second weight, the more significant the semantic discrepancy between the two triples, even though they belong to the same cluster. This suggests a significant difference in the importance of their core words, perhaps one emphasizing device A and the other device B, indicating a potential semantic divergence that requires "penalization." The calculation of the second weight is influenced by three factors: the difference in TF-IDF values between the head entity, the relation, and the tail entity. The larger these factors are—meaning a greater difference in the TF-IDF values of the two words—the larger the second weight. This reflects a mismatch in the keyword importance of the two triples, suggesting they might be pseudo-similar triples that are superficially similar but fundamentally different, requiring a penalty weight to reduce their similarity. Conversely, the smaller these factors are—meaning the TF-IDF values of the two words are closer—the smaller the second weight. This reflects a high degree of consistency in the keyword importance of the two triples, indicating they are truly of the same category and do not require additional penalty.
[0055] Furthermore, this embodiment determines the intra-cluster penalty weight between any two triples in each cluster based on the first weight and the second weight, specifically:
[0056] In this embodiment, the intra-cluster penalty weight between any two triples in each cluster is negatively correlated with the first weight between any two triples and positively correlated with the second weight.
[0057] It should be understood that a positive correlation means that the dependent variable increases as the independent variable increases, and the dependent variable decreases as the independent variable decreases. The specific relationship can be additive or multiplicative, etc., and is determined by the actual application. This application does not impose any special restrictions. A negative correlation means that the dependent variable decreases as the independent variable increases, and the dependent variable increases as the independent variable decreases. The relationship can be subtractive or divisive, etc., and is determined by the actual application.
[0058] Preferably, as one implementation method, in this embodiment, the sum of the first weight and the preset factor between any two triples in each cluster is calculated, and the result of the second weight divided by the sum is used as the intra-cluster penalty weight between any two triples in each cluster. In practical applications, as other implementation methods, implementers may also adopt other calculation methods for positive or negative correlations according to specific circumstances. This embodiment does not impose any special restrictions.
[0059] It should be noted that the preset factor is a constant greater than 0, which is used to prevent the denominator from being 0. Under the premise of ensuring that the denominator is not 0 and does not excessively affect the calculation result, the implementer can also set it according to the specific situation. This embodiment does not impose any special restrictions.
[0060] Based on the intra-cluster penalty weight between any two triples in each cluster, it can be understood that the intra-cluster penalty weight is used to determine whether two triples in the same cluster should really stay together. The intra-cluster penalty weight is used to characterize the degree of mismatch between two triples in the two dimensions of "semantic similarity" and "importance consistency". It reflects the risk of forcibly classifying two triples into the same category. A higher intra-cluster penalty weight indicates that although the two triples are initially clustered together, they either differ semantically or have mismatched importance. This results in a significant reduction in their similarity during subsequent iterations, causing them to be separated in the next clustering. The calculation of the intra-cluster penalty weight is directly influenced by the first and second weights and is positively correlated with them. A smaller first weight and a larger second weight result in a larger intra-cluster penalty weight, reflecting that the two triples have both semantic differences and inconsistent keyword importance, a typical case of "incorrect clustering," thus inflicting a strong penalty to amplify their differences. Conversely, a larger first weight and a smaller second weight result in a smaller intra-cluster penalty weight, reflecting that the two triples not only have similar semantic cores but also match keyword importance, an ideal case of "correct clustering," thus reducing the penalty and maintaining their original high similarity.
[0061] Furthermore, this embodiment determines the first similarity update value between any two triples in each cluster based on the semantic similarity of any two triples and in combination with the intra-cluster penalty weight. Specifically:
[0062] In this embodiment, the first similarity update value between any two triples in each cluster is positively correlated with the semantic similarity between the two triples and negatively correlated with the intra-cluster penalty weight.
[0063] Preferably, as one implementation method, in this embodiment, the expression for the first similarity update value between any two triples in each cluster is: In the formula, This represents the first similarity update value between the g-th triplet and the k-th triplet in cluster h; This represents the semantic similarity between the g-th triplet and the k-th triplet in cluster h; represents the intra-cluster penalty weight between the g-th triplet and the k-th triplet in cluster h; exp() represents the exponential function with the natural constant as the base.
[0064] To clarify, the semantic similarity between the g-th triplet and the k-th triplet in cluster h is the cosine similarity between the semantic vectors of the g-th triplet and the semantic vectors of the k-th triplet in cluster h. The result of mapping within the range.
[0065] Preferably, the schematic diagram of the first similarity update value extraction process provided in this embodiment is as follows: Figure 2 As shown.
[0066] Based on the first similarity update value, it can be understood that after being corrected by the intra-cluster penalty mechanism, the first similarity update value is used to guide the "new distance" between two triples within the same cluster in the next round of clustering. The first similarity update value is used to characterize the true and trustworthy similarity between the two triples after considering the risk of internal inconsistency. The first similarity update value reflects the latest judgment on whether the two triples belong to the same class. The higher the first similarity update value, the more likely the two triples are of the same class. Its impact is that in the next round of DBSCAN clustering, they will be regarded as points that are closer together and are more likely to be assigned to the same cluster. The calculation process of the first similarity update value is affected by the original semantic similarity and the intra-cluster penalty weight. It is positively correlated with the former and negatively correlated with the latter. The greater the original semantic similarity, the larger the first similarity update value, which reflects that the basic semantic connection between the two triples is close, and its impact is to maintain their high similarity. On the other hand, the greater the intra-cluster penalty weight, the smaller the first similarity update value, which reflects that there is a potential conflict between the two triples, reducing their similarity and making them "distancing" in the clustering.
[0067] To address the issue of inaccurate clustering caused by the traditional DBSCAN density clustering algorithm neglecting the internal structure and key differences of triples, this embodiment introduces a dynamic penalty mechanism after initial clustering. By comprehensively evaluating the semantic similarity and text importance differences of triples within the same cluster, an intra-cluster penalty weight is constructed, which then corrects the original similarity to generate a first similarity update value. This mechanism can accurately identify and penalize "pseudo-similar" triples, effectively amplifying their internal differences while retaining the high similarity of truly similar triples. This allows for continuous optimization of clustering results during iteration, ultimately laying a solid foundation for constructing a more accurate power grid knowledge graph.
[0068] Step S3: Analyze the semantic similarity of any two triples in terms of entities and relations between any two clusters to determine the inter-cluster penalty weight of any two triples between any two clusters. Combine this with the semantic similarity of any two triples between any two clusters to determine the second similarity update value of any two triples between any two clusters.
[0069] Furthermore, to avoid structural differences between the two entities in a triplet, which could lead to two identical triples being classified into different classes, this embodiment analyzes the semantic similarity of any two triples in terms of entities and relations between any two clusters to determine the inter-cluster penalty weight of any two triples between any two clusters. This is then combined with the semantic similarity of any two triples between any two clusters to determine the second similarity update value of any two triples between any two clusters. The specific process is as follows:
[0070] First, between any two clusters, the semantic similarity of any two triples in terms of entities and semantic similarity in terms of relations are analyzed to determine the inter-cluster penalty weight of any two triples between any two clusters. Specifically:
[0071] As one implementation method, in this embodiment, the inter-cluster penalty weight between the nth triplet in cluster p and the mth triplet in cluster q is... The expression is: In the formula, Let represent the maximum and minimum values of the first similarity, second similarity, and semantic vector similarity between the nth triplet in cluster p and the mth triplet in cluster q, respectively, for any two triplets between any two clusters, calculated using the first similarity, second similarity, and semantic vector similarity of the relation between any two triplets. The expression represents the semantic similarity between the nth triplet in cluster p and the mth triplet in cluster q; ln() represents the logarithmic function with the natural constant as the base. This indicates the preset similarity threshold.
[0072] It should be noted that the preset similarity threshold is set manually. In this embodiment, the preset similarity threshold is set to 0.3, which is a choice that strikes a balance between algorithm sensitivity and stability. If this value is too high, many similar triples that should be merged will be ignored; if it is too low, a large number of unrelated triples may enter the complex calculation process, increasing unnecessary computational overhead and the risk of misjudgment. Therefore, 0.3 is a compromise value that can effectively capture potential similar pairs while filtering out obviously unrelated pairs.
[0073] Based on the inter-cluster penalty weight, it can be understood that the inter-cluster penalty weight is used to determine whether two triples from different clusters should be merged. The inter-cluster penalty weight characterizes the fact that although two triples are currently in different clusters, they may have been incorrectly separated due to structural differences, such as entity order. It reflects the potential value and urgency of merging the two triples into the same cluster. A smaller inter-cluster penalty weight indicates that the two triples are semantically highly consistent and have a balanced internal structure, making them highly likely to have been incorrectly split. Its impact is that in subsequent iterations, the similarity between the two triples will be increased, thus prompting the two triples to be merged. Triples are merged together in the next clustering. The calculation of the inter-cluster penalty weight is mainly affected by the maximum, minimum and average values of three similarities (head, tail and relation). When the three similarities are high and the differences are small, the inter-cluster penalty weight is small. This reflects that the greater the probability that two triples belong to the same cluster, the more "reward" is imposed on them to increase their similarity. Conversely, when the similarity difference is large or the overall similarity is low, the inter-cluster penalty weight is large. This reflects that they do describe different events and should be separated to maintain the distance between the two triples.
[0074] Furthermore, this embodiment determines the second similarity update value of any two triples between any two clusters based on the inter-cluster penalty weight of any two triples between any two clusters, combined with the semantic similarity of any two triples between any two clusters. Specifically:
[0075] In this embodiment, the second similarity update value of any two triples between any two clusters is positively correlated with the semantic similarity of any two triples and negatively correlated with the inter-cluster penalty weight.
[0076] Preferably, as one implementation method, in this embodiment, the expression for the second similarity update value between any two triples in each cluster is: In the formula, This represents the second similarity update value between the nth triplet in cluster p and the mth triplet in cluster q; This represents the semantic similarity between the nth triplet in cluster p and the mth triplet in cluster q. represents the inter-cluster penalty weight between the nth triplet in cluster p and the mth triplet in cluster q; exp[ ] represents the exponential function with the natural constant as the base.
[0077] To clarify, the semantic similarity between the nth triplet in cluster p and the mth triplet in cluster q is the cosine similarity between the semantic vectors of the nth triplet in cluster p and the mth triplet in cluster q. The result of mapping within the range.
[0078] The second similarity update value, after being corrected by the inter-cluster merging mechanism, represents the "new distance" between two triples in different clusters, used to guide the next round of clustering. It characterizes the true and reliable similarity of two triples after considering potential merging possibilities. This reflects the latest judgment on whether two triples should be classified into the same category. A higher second similarity update value indicates a stronger tendency to merge the two triples. In the next round of DBSCAN clustering, they will be considered closer points and more likely to be assigned to the same cluster. The calculation of the second similarity update value is influenced by the original semantic similarity and the inter-cluster penalty weight. It is positively correlated with the former and negatively correlated with the latter. The greater the original semantic similarity, the larger the second similarity update value, reflecting a certain semantic basis. Conversely, the smaller the inter-cluster penalty weight, the larger the second similarity update value, reflecting a greater similarity between the two triples, strongly promoting their merging in the next round of clustering.
[0079] To address the issue of "same event in different clusters" caused by structural differences in entities, this embodiment introduces an intelligent merging mechanism between clusters: by analyzing the internal similarity differences of triples between different clusters, an inter-cluster penalty weight is constructed, and a second similarity update value is generated. This mechanism can effectively identify those triples that are semantically highly consistent but have been incorrectly split, and "reward" their similarity, thereby promoting their merging in the iteration process. This ensures the integrity and accuracy of the clustering results and provides a strong guarantee for constructing a logically self-consistent power grid knowledge graph.
[0080] Step S4: Based on the first similarity update value and the second similarity update value, optimize the initial clustering result to obtain the optimal clustering result, so as to construct a power grid professional knowledge graph.
[0081] All triples are used as input to the DBSCAN density clustering algorithm. The similarity criterion in the clustering algorithm is iteratively updated according to the calculation method of the first similarity update value and the second similarity update value. The number of iterations is set to a preset number. The final output clustering result is taken as the optimal clustering result. In this embodiment, the preset number is 100.
[0082] It should be noted that the number of iterations is set to 100 to ensure that the clustering optimization process has sufficient time to reach convergence, while avoiding infinite loops or premature termination. If the number of iterations is too small, the algorithm may stop before it has had enough time to adjust, resulting in incomplete optimization and flawed clustering results. On the other hand, if no upper limit is set or the limit is set too high, convergence may occur after only a few dozen iterations, and subsequent iterations will be futile, wasting computational resources. Therefore, 100 iterations is an empirical and relatively safe upper limit, ensuring that on most datasets, the algorithm has a sufficient chance to find a stable and high-quality clustering result.
[0083] Furthermore, the semantic vectors of the head entity, relation, and tail entity of each cluster center in the optimal clustering result are concatenated and denoted as the feature vector. The similarity between the word vectors of each equipment ledger data and the feature vectors of all cluster centers is calculated. Each equipment ledger data is used as the superordinate word of the cluster corresponding to the maximum similarity. A master-slave hierarchical relationship is established between the cluster center in the cluster corresponding to the maximum similarity and the other triples in the cluster, so as to unify the retrieval standard of entities in the triples and avoid the difficulty in finding the corresponding fault type when inputting non-standard entity words during the subsequent knowledge graph construction. The triples of the master-slave relationship in all clusters are imported into the Neo4j graph database to obtain the power grid professional knowledge graph.
[0084] The process of establishing the master-slave hierarchical relationship and the process of constructing a knowledge graph using the Neo4j graph database are well-known technologies and will not be elaborated further.
[0085] Thus, this embodiment iteratively updates similarity using intra-cluster penalties and inter-cluster merging mechanisms, driving continuous optimization of clustering results until convergence, thereby obtaining the optimal clustering result. On this basis, it further combines equipment ledger data to standardize the entities of the clusters and construct master-slave hierarchical relationships, and finally imports them into a graph database to generate a knowledge graph, effectively solving the retrieval problem caused by inconsistent entity representations and improving the accuracy of power grid knowledge graph construction.
[0086] It should be noted that the order of the embodiments described above is merely for descriptive purposes and does not represent the superiority or inferiority of the embodiments. Furthermore, specific embodiments of this specification have been described above. Additionally, the processes depicted in the accompanying drawings do not necessarily require a specific or sequential order to achieve the desired results. In some implementations, multitasking and parallel processing are possible or may be advantageous.
[0087] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0088] The above-described embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them; modifications to the technical solutions described in the foregoing embodiments, or equivalent substitutions of some of the technical features, do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of this application, and should all be included within the protection scope of this application.
Claims
1. A method for constructing a power grid professional knowledge graph for a green supply chain platform, characterized in that, The method includes the following steps: Extract triples from historical disaster data of the power grid, where each triple includes a head entity, a relation, and a tail entity; All triples are initially clustered. Within each cluster, the semantic similarity of any two triples in terms of entities and relations is analyzed to determine the first weight between any two triples. Within each cluster, the differences in term frequency-inverse document rate between any two triples in terms of head entity, relation, and tail entity are analyzed to determine the second weight between any two triples. Combined with the first weight, the intra-cluster penalty weight between any two triples in each cluster is determined. Based on the semantic similarity of any two triples and combined with the intra-cluster penalty weight, the first similarity update value between any two triples in each cluster is determined. Between any two clusters, the semantic similarity of any two triples in terms of entities and semantic similarity in terms of relations are analyzed to determine the inter-cluster penalty weight of any two triples between any two clusters. Combined with the semantic similarity of any two triples between any two clusters, the second similarity update value of any two triples between any two clusters is determined. Based on the first similarity update value and the second similarity update value, the initial clustering result is optimized to obtain the optimal clustering result, so as to construct a power grid professional knowledge graph; Specifically, for any two triples in each cluster, the similarity between the semantic vector of the head entity of each triple and the semantic vector of the head entity and the semantic vector of the tail entity of the other triple is calculated. The normalized value of the maximum similarity is recorded as the first similarity between any two triples. For the semantic vector of the tail entity of each triple, the second similarity between any two triples is obtained according to the calculation method of the first similarity. The expression for the inter-cluster penalty weight of any two triples between any two clusters is: In the formula, This represents the inter-cluster penalty weight between the nth triplet in cluster p and the mth triplet in cluster q. , Let represent the maximum and minimum values of the first similarity, second similarity, and relational semantic vector similarity between the nth triplet in cluster p and the mth triplet in cluster q, respectively. The expression represents the semantic similarity between the nth triplet in cluster p and the mth triplet in cluster q; ln() represents the logarithmic function with the natural constant as the base. This indicates the preset similarity threshold.
2. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, In the initial clustering process, the distance metric is the reciprocal of the sum of the semantic similarity of any two triples and a preset value, where the preset value is a constant greater than 0.
3. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The method for determining the first weight between any two triples is as follows: The average of the first similarity, the second similarity, and the semantic vector similarity between any two triples in each cluster is used as the first weight between any two triples in each cluster.
4. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The second weight between any two triples is the average of the differences in term frequency-inverse document rate (TFR) on the head entity, the differences in TFR on the relation, and the differences in TFR on the tail entity.
5. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The intra-cluster penalty weight between any two triples in each cluster is negatively correlated with the first weight and positively correlated with the second weight between any two triples.
6. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The first similarity update value between any two triples in each cluster is positively correlated with the semantic similarity between the two triples and negatively correlated with the intra-cluster penalty weight.
7. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The second similarity update value of any two triples between any two clusters is positively correlated with the semantic similarity of any two triples and negatively correlated with the inter-cluster penalty weight.
8. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The process of optimizing the initial clustering results to obtain the optimal clustering results includes: All triples are used as input to the clustering algorithm. The similarity criteria in the clustering algorithm are iteratively updated according to the calculation method of the first similarity update value and the second similarity update value. The number of iterations is set to a preset number. The final output clustering result is taken as the optimal clustering result.
9. The method for constructing a power grid expertise graph for a green supply chain platform as described in claim 1, characterized in that, The construction of the power grid professional knowledge graph includes: Obtain word vectors from each equipment ledger data. Concatenate the semantic vectors of the head entity, relation, and tail entity of each cluster center in the optimal clustering result and denote them as feature vectors. Calculate the similarity between the word vectors of each equipment ledger data and the feature vectors of all cluster centers. Use each equipment ledger data as the hypernym of the cluster corresponding to the maximum similarity. Establish a master-slave hierarchical relationship between the cluster center within the cluster corresponding to the maximum similarity and the other triples within the cluster. Import the master-slave triples from all clusters into the Neo4j graph database to obtain a power grid professional knowledge graph.