Hydropower knowledge graph construction method and device based on multi-agent and electronic equipment

CN122905036APending Publication Date: 2026-10-13DADU RIVER HYDROPOWER DEV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610751411.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-28
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0004]本发明提供一种基于多智能体的水电知识图谱构建方法、装置和电子设备,用以解决现有技术中的水电知识图谱构建方法精准度差、可靠性低的缺陷

Benefits of technology

[0015]本发明提供的一种基于多智能体的水电知识图谱构建方法、装置和电子设备,通过利用抽取智能体,在预设的水电设备资源模型约束下,对水电领域的文本集进行实体-属性-值抽取,得到抽取结果,计算抽取结果中属性值的不确定性熵值;基于抽取结果生成标准水电Schema;基于标准水电Schema,由抽取智能体生成候选关系三元组;由精炼智能体对候选关系三元组进行上下文合理性评估,得到语义得分;由校验智能体对候选关系三元组进行反事实对抗检测,计算得到矛盾率;基于不确定性熵值、语义得分和矛盾率,计算联合置信度评分,对候选关系三元组进行过滤,得到目标三元组,生成水电知识图谱。本发明通过多智能体交叉验证与联合打分机制,能够有效抑制大模型的事实幻觉,无需大量数据标注即可构建高精度、高可靠的水电知识图谱。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905036A_ABST
    Figure CN122905036A_ABST
Patent Text Reader

Abstract

The application provides a kind of water and electricity knowledge graph construction method, device and electronic equipment based on multi-agent, method includes: using extraction agent, under the constraint of pre-set water and electricity equipment resource model, entity-attribute-value extraction is carried out on the text set of water and electricity field, extraction result is obtained, and the uncertainty entropy value of attribute value is calculated;Standard water and electricity Schema is generated based on the extraction result, and on this basis, candidate relationship triple is generated by the extraction agent;By refining agent, context rationality evaluation is carried out on candidate relationship triple, and semantic score is obtained;By checking agent, counterfactual confrontation detection is carried out on candidate relationship triple, and contradiction rate is calculated;Based on uncertainty entropy value, semantic score and contradiction rate, joint confidence score is calculated, candidate relationship triple is filtered, target triple is obtained, and water and electricity knowledge graph is generated.The application improves the accuracy and reliability of knowledge graph through multi-agent cross validation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of artificial intelligence technology, and in particular to a method, apparatus, and electronic device for constructing a hydropower knowledge graph based on multiple agents. Background Technology

[0002] With the digital transformation of the hydropower industry, massive amounts of unstructured text data have been accumulated during the operation, inspection, and maintenance of hydropower stations. Constructing a high-quality hydropower knowledge graph and achieving systematic knowledge management is of great significance for supporting intelligent fault diagnosis and smart control of hydropower equipment.

[0003] However, traditional knowledge graph construction techniques mainly rely on manually preset rules or require large amounts of professionally labeled data for fine-tuning deep learning models, resulting in significant technical bottlenecks such as high labor costs, long construction cycles, and poor domain generalization ability. In recent years, general-purpose large language models have been gradually applied to knowledge extraction tasks, but in the highly specialized hydropower vertical field, a single general-purpose large model is prone to producing factual illusions when processing complex text, leading to problems such as blurred entity boundaries, mismatched business logic, and violations of professional common sense. In addition, existing extraction schemes generally lack effective verification mechanisms, resulting in extremely low factual reliability of the generated graph data. Summary of the Invention

[0004] This invention provides a method, apparatus, and electronic device for constructing a hydropower knowledge graph based on multiple agents, in order to solve the defects of poor accuracy and low reliability in existing hydropower knowledge graph construction methods.

[0005] This invention provides a method for constructing a hydropower knowledge graph based on multi-agent systems, comprising: Retrieve text sets related to hydropower; Using an extraction agent, under the constraints of a preset hydropower equipment resource model, entity-attribute-value extraction is performed on the text set to obtain the extraction results, and the uncertainty entropy value of the attribute values ​​in the extraction results is calculated. The extraction results are mapped to a preset hydropower standard ontology to generate a standard hydropower schema, which includes resource identifiers and logical constraints. Based on the constraints of the standard hydropower schema, the extraction agent generates candidate relation triples; the refining agent evaluates the contextual rationality of the candidate relation triples to obtain semantic scores; and the verification agent performs counterfactual adversarial detection on the candidate relation triples to calculate the contradiction rate. Based on the uncertainty entropy value, the semantic score, and the contradiction rate, the joint confidence score of the candidate relation triples is calculated, the candidate relation triples are filtered to obtain the target triples, and a hydropower knowledge graph is generated based on the target triples.

[0006] In some embodiments, calculating the uncertainty entropy value of the attribute values ​​in the extraction result includes: Obtain the predicted probability of each word element corresponding to the attribute value; Based on the predicted probability of each word, the information entropy of each word is calculated; The information entropy of all the terms corresponding to the attribute value is summed and then inverted to obtain the uncertainty entropy value of the attribute value.

[0007] In some embodiments, mapping the extraction result to a preset hydropower standard ontology includes: If the uncertainty entropy value is determined to be greater than a preset threshold, the original terms are extracted from the extraction results. Calculate the similarity between the original terminology and each concept in the hydropower standard ontology, whereby the similarity includes lexical similarity and semantic similarity; The lexical similarity and the semantic similarity are weighted and fused to obtain the matching score between the original term and the corresponding concept; Based on the matching score, the original terms are mapped to the corresponding hydropower standard ontology concepts.

[0008] In some embodiments, the step of performing counterfactual adversarial detection on the candidate relation triples by the verification agent and calculating the contradiction rate includes: The verification agent generates counterfactual perturbation samples for the entities or relations of the candidate relation triples, and constructs a counterfactual sample set. For each sample in the counterfactual sample set, a logical judgment is made, and the number of samples in the judgment results that contradict the logic of the hydropower field is counted. The ratio of the number of samples in the judgment result that contradict the logic of the hydropower field to the total number of samples in the counterfactual sample set is calculated, and the ratio is used as the contradiction rate of the candidate relation triple.

[0009] In some embodiments, calculating the joint confidence score of the candidate relation triples based on the uncertainty entropy value, the semantic score, and the contradiction rate includes: Obtain the retrieval-enhanced evidence matching score and multi-agent consistency rate corresponding to the candidate relation triple; the retrieval-enhanced evidence matching score is used to characterize the degree of evidence alignment between the candidate relation triple and the hydropower professional documents recalled through enhanced retrieval; the multi-agent consistency rate is used to characterize the degree of consensus among the extraction agent, the refinement agent and the verification agent regarding the validity of the candidate relation triple. Assign corresponding preset weight coefficients to the retrieval enhancement evidence matching score, the multi-agent consistency rate, the semantic score, the contradiction rate, and the uncertainty entropy value, respectively; Based on the retrieval-enhanced evidence matching score, the multi-agent consistency rate, the semantic score, the contradiction rate, and the uncertainty entropy value, as well as the corresponding preset weight coefficients, a joint weighted calculation is performed to obtain the joint confidence score of the candidate relation triples.

[0010] In some embodiments, the formula for calculating the joint confidence score includes: ; in, This represents the candidate relation triple. This represents the attribute value. This represents the joint confidence score; This represents the enhanced evidence matching score of the search. The preset weight coefficients are assigned to enhance the evidence matching score of the retrieval. This represents the consensus rate among the multiple agents. The preset weighting coefficients corresponding to the consensus rate of the multi-agent system; This represents the semantic score. The preset weight coefficients corresponding to the semantic score; This represents the contradiction rate. The preset weighting coefficient corresponding to the contradiction rate; This represents the uncertainty entropy value. This represents the preset weighting coefficient corresponding to the uncertainty entropy value.

[0011] In some embodiments, after filtering the candidate relation triples to obtain the target triples, the method further includes: Obtain the triples that were filtered out from the candidate relation triples; Using the filtered triples as query conditions, perform a new multi-document enhanced search to obtain the newly added text data; Based on the newly added text data, the hydropower knowledge graph is optimized.

[0012] In some embodiments, a hydropower knowledge graph is generated based on the target triples, including: The target triplet is subjected to redundancy elimination processing to obtain the processed target triplet. Verify whether the processed target triples satisfy the logical constraints of the standard hydropower schema, the logical constraints including domain constraints and range constraints; The processed target triples that have passed verification are encoded into a semantic network standard format and injected into the logical reasoning rules of hydropower equipment to generate the hydropower knowledge graph.

[0013] The present invention also provides a device for constructing a hydropower knowledge graph based on multiple agents, comprising: The acquisition unit is used to acquire text sets in the field of hydropower. An extraction unit is used to extract entity-attribute-value from the text set using an extraction agent under the constraints of a preset hydropower equipment resource model, to obtain extraction results, and to calculate the uncertainty entropy value of the attribute values ​​in the extraction results. A mapping unit is used to map the extraction results to a preset hydropower standard ontology to generate a standard hydropower schema, wherein the standard hydropower schema includes resource identifiers and logical constraints. The evaluation unit is used to generate candidate relation triples by the extraction agent based on the constraints of the standard hydropower schema; to evaluate the contextual rationality of the candidate relation triples by the refining agent and obtain a semantic score; and to perform counterfactual adversarial detection on the candidate relation triples by the verification agent and calculate the contradiction rate. The construction unit is used to calculate the joint confidence score of the candidate relation triples based on the uncertainty entropy value, the semantic score and the contradiction rate, filter the candidate relation triples to obtain the target triples, and generate a hydropower knowledge graph based on the target triples.

[0014] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the hydropower knowledge graph construction method based on any of the above-described methods.

[0015] This invention provides a method, apparatus, and electronic device for constructing a hydropower knowledge graph based on multi-agent systems. By utilizing an extraction agent, under the constraints of a pre-defined hydropower equipment resource model, entity-attribute-value extraction is performed on a text set in the hydropower domain to obtain extraction results. The uncertainty entropy value of the attribute values ​​in the extraction results is calculated. A standard hydropower schema is generated based on the extraction results. Based on the standard hydropower schema, candidate relation triples are generated by the extraction agent. A refinement agent evaluates the contextual rationality of the candidate relation triples to obtain semantic scores. A verification agent performs counterfactual adversarial detection on the candidate relation triples to calculate the contradiction rate. Based on the uncertainty entropy value, semantic score, and contradiction rate, a joint confidence score is calculated, and the candidate relation triples are filtered to obtain target triples, thus generating a hydropower knowledge graph. This invention, through multi-agent cross-validation and joint scoring mechanisms, can effectively suppress factual illusions in large models and construct a high-precision, highly reliable hydropower knowledge graph without requiring extensive data annotation. Attached Figure Description

[0016] To more clearly illustrate the technical solutions in this invention 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 some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0017] Figure 1 This is a flowchart illustrating the hydropower knowledge graph construction method based on multi-agent provided by the present invention.

[0018] Figure 2 This is a flowchart illustrating the calculation process of the joint confidence score of candidate relation triples provided by the present invention.

[0019] Figure 3 This is a schematic diagram of the structure of the hydropower knowledge graph construction device based on multi-agent provided by the present invention.

[0020] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0022] Figure 1This is a flowchart illustrating the hydropower knowledge graph construction method based on multi-agent technology provided by the present invention, as shown below. Figure 1 As shown, the method includes the following steps: Step 110: Obtain the text set in the field of hydropower.

[0023] In the field of hydropower, the text collection refers to a collection of unstructured or semi-structured documents related to the operation, equipment maintenance, and industry standards of hydropower stations. Specifically, it may include one or more of the following: hydropower equipment operation logs, maintenance records, equipment standard manuals, fault analysis reports, and industry standards and specifications.

[0024] Optionally, text data in the field of hydropower can be crawled from external public networks using web crawler technology, or it can be directly read from the storage medium or database of the local business system of the hydropower station, or it can be obtained through application programming interface calls. This embodiment of the invention does not specifically limit these methods.

[0025] Optionally, the original text set in the field of hydropower can be obtained, and the original text set can be preprocessed such as data cleaning, data transformation, standardization, and normalization to obtain the text set in the field of hydropower.

[0026] Step 120: Using an extraction agent, under the constraints of a preset hydropower equipment resource model, perform entity-attribute-value extraction on the text set to obtain the extraction results, and calculate the uncertainty entropy value of the attribute values ​​in the extraction results.

[0027] Here, "extraction agent" refers to an artificial intelligence program with natural language understanding and information extraction capabilities, such as a large language model agent that performs specific tasks. "Preset hydropower equipment resource model constraints" refers to a pre-defined rule framework that reflects the relationship between the physical composition and business attributes of hydropower equipment.

[0028] The extraction result refers to the data set with specific business significance that is identified and structurally extracted from the text set. The extraction result includes at least entities, entity attributes, and attribute values. Entity-attribute-value extraction (ATA-VDE) of a text set involves identifying entities, their characteristic attributes, and specific attribute values ​​from the text set. For example, extracting the entity "generator," the attribute "operating temperature," and the specific attribute value "eighty degrees Celsius" from the text.

[0029] Among them, the uncertainty entropy value is used to quantify the internal confidence or uncertainty of the extracting agent when generating attribute values.

[0030] Optionally, the uncertainty entropy value of the attribute value can be obtained by numerically calculating the probability distribution state during the output process of the extraction agent. The larger the uncertainty entropy value, the less confidence the extraction agent has in the extracted attribute value. Extraction under the constraints of a preset hydropower equipment resource model can effectively limit the generalization divergence of the extraction agent and reduce erroneous extractions that deviate from the hydropower domain.

[0031] Specifically, using a hydropower equipment resource model as a constraint, the entity-attribute-value (EAV) extraction is performed by the extraction agent, mathematically expressed as: ; in, It refers to the physical entities involved in hydropower, including equipment, components, faults, parameters, measures, and operating conditions; The attributes include the rated value, real-time value, status, reason, location, duration, etc. Represents attribute values, including numerical values, descriptions, levels, Boolean states, etc. This is a template for EAV extraction prompts related to hydropower. This represents a strong constraint schema, limiting entity types, attribute ranges, and value range types. Indicates the first indivual, Indicates the first indivual.

[0032] Example of extraction results: Water turbine, rated speed, 1500 r / min; Guide bearing, malfunction symptom: abnormally high temperature; Speed ​​governor, handling measures, adjust oil pressure to the rated range.

[0033] Step 130: Map the extraction results to the preset hydropower standard ontology to generate a standard hydropower schema, which includes resource identifiers and logical constraints.

[0034] Among them, the preset hydropower standard ontology is a pre-constructed knowledge network that reflects the standardized expression forms and hierarchical structure of professional terms in the field of hydropower.

[0035] It should be noted that, given that the initial extraction results obtained from the text set may contain non-standard expressions of professional terms or inconsistent terminology, it is necessary to align them with the standard concepts in the hydropower standard ontology in order to generate a standardized standard hydropower schema.

[0036] The standard hydropower schema, or standardized hydropower knowledge graph schema layer, defines the top-level organizational structure of the data. Resource identifiers assign globally unique identity codes to each transformed standard concept or entity, ensuring unambiguous global links between underlying data. Logical constraints refer to the inherent physical boundaries or business limitations between entities and between entities and attributes in the hydropower industry scenario. Generating a standard hydropower schema can resolve the inconsistency in the representation of multi-source heterogeneous text data.

[0037] Step 140: Based on the constraints of the standard hydropower schema, the extraction agent generates candidate relation triples; the refinement agent evaluates the contextual rationality of the candidate relation triples to obtain semantic scores; and the verification agent performs counterfactual adversarial detection on the candidate relation triples to calculate the contradiction rate.

[0038] Among them, the candidate relation triple is a data structure unit composed of a head entity, a relation, and a tail entity in sequence. Based on the framework guidance of the aforementioned standard hydropower schema, the extracted agent further derives the association rules between entities and assembles them into candidate relation triples.

[0039] Among them, the refining agent and the verification agent are evaluation model units that cooperate with the extraction agent but are functionally independent.

[0040] Specifically, the refining agent, considering the linguistic context of the original text, judges whether the semantic expression of the candidate relation triplet is fluent, conforms to natural language logic, and reflects the true intent of the original text. Based on this, a semantic score is quantified; a higher semantic score indicates better semantic coherence of the candidate relation triplet. The verification agent constructs adversarial sample conditions that violate objective facts by introducing interference features or modifying nodes into the candidate relation triplet or the original text, thereby detecting the robustness of the system's logical judgment results. The calculated contradiction rate characterizes the probability of logical conflict occurring after perturbation; a lower contradiction rate indicates a stronger ability of the candidate relation triplet to resist adversarial interference.

[0041] Optionally, the knowledge relationships related to water and electricity can be divided into three categories, covering all business logic: ; Typical relationship example: 1) The guide bearing malfunctioned due to insufficient lubrication. 2) Water turbine, monitoring parameters, vibration amplitude; 3) Temperature value, positively correlated, vibration value.

[0042] Optionally, candidate relation triples are generated by the extraction agent: ; The refined agent scores the contextual reasonableness of candidate relation triples: ; in, The closer the result is to 1, the more the candidate relation triplet conforms to the logic of the hydropower field.

[0043] Step 150: Based on the uncertainty entropy value, semantic score and contradiction rate, calculate the joint confidence score of candidate relation triples, filter the candidate relation triples to obtain the target triples, and generate a hydropower knowledge graph based on the target triples.

[0044] The joint confidence score is the final evaluation score calculated using a set numerical fusion rule, taking into account multiple dimensions of data, including uncertainty entropy, semantic score, and contradiction rate. This score comprehensively reflects the factual accuracy and logical rationality of the candidate relation triples.

[0045] Optionally, candidate relation triples whose joint confidence scores do not meet the qualifying threshold are intercepted and removed, thus obtaining the remaining high-quality target triples. Entities in all target triples are treated as network nodes and relations as edges, and they are systematically combined and connected into a directed graph data structure that supports inference queries.

[0046] In this embodiment of the invention, a multi-agent collaborative architecture is constructed by constructing an extraction agent, a refinement agent, and a verification agent that supervise each other. This achieves the quantification of uncertainty in the extraction of underlying entities, the assessment of contextual rationality, and the verification of adversarial logic at the counterfactual level. This mechanism, which calculates confidence scores based on multi-dimensional independent indicators and performs rigorous filtering, effectively avoids factual errors and logical illusions in the extraction process of a single model. It fundamentally ensures the quality of the final target triples in the database and significantly improves the accuracy and factual reliability of hydropower knowledge graph data.

[0047] In some embodiments, calculating the uncertainty entropy value of the attribute values ​​in the extraction result includes: Obtain the predicted probability of each word corresponding to the attribute value; Based on the predicted probability of each word, the information entropy of each word is calculated. The information entropy of all the tokens corresponding to the attribute value is summed and then inverted to obtain the uncertainty entropy value of the attribute value.

[0048] In this context, a lexical unit refers to the smallest basic data unit that the extraction agent uses to process and generate natural language text. The prediction probability refers to the numerical value by which the extraction agent infers the likelihood of a specific lexical unit appearing based on the context when generating that lexical unit.

[0049] Optionally, the probability distribution matrix in the output process can be parsed and extracted by directly calling the underlying interface of the extraction agent, thereby accurately reading the generation probability, i.e., the prediction probability, of each word element contained in the attribute value. Information entropy is a physical quantity used to measure the degree of randomness or uncertainty in a single-step word element generation process. The specific way to calculate the information entropy of each word element can be achieved by multiplying the prediction probability of each word element by the logarithm of that prediction probability.

[0050] It should be noted that since a complete attribute value is usually composed of multiple lexical units, it is necessary to sum and invert the information entropy of all the lexical units corresponding to the attribute value. The information entropy of all the individual lexical units that make up the attribute value can be linearly accumulated at the numerical level, and the sum can be inverted. This maps the discrete lexical-level uncertainty to a macroscopic, overall attribute value-level uncertainty measure.

[0051] For example, suppose the extracted attribute value is 80 degrees Celsius. This attribute value is composed of three independent words: 8, 10, and degrees Celsius within the extraction agent. The prediction probability of each of these three words at the time of generation is obtained by parsing them. Then, the independent information entropy of each of these three words is calculated based on the probability values. Finally, the three information entropies are added together and the negative value is taken as the final uncertainty entropy value of the complete attribute value of 80 degrees Celsius.

[0052] Optionally, to quantify the illusory risk of the extraction results, token-level information entropy is introduced for attribute values. Perform confidence level calculation: ; ; in, Indicates the generation of attribute values The basis for The predicted probability of each token; This represents the uncertainty entropy value; a larger value indicates greater uncertainty in the model and a higher risk of hallucination. For the set entropy threshold, This indicates the total number of tokens.

[0053] In this embodiment of the invention, by obtaining the predicted probability of each word corresponding to the attribute value, the information entropy of each word is calculated based on the predicted probability of each word, and the information entropy of all words corresponding to the attribute value is summed and inverted to obtain the uncertainty entropy value of the attribute value. This provides extremely reliable data support for subsequent joint confidence assessment and the construction of a high-quality hydropower knowledge graph.

[0054] In some embodiments, mapping the extraction results to a preset hydropower standard ontology includes: If the uncertainty entropy value is greater than a preset threshold, the original terms are extracted from the extraction results. Calculate the similarity between the original terms and the concepts in the hydropower standard ontology. The similarity includes lexical similarity and semantic similarity. We perform a weighted fusion of lexical similarity and semantic similarity to obtain the matching score between the original terms and the corresponding concepts; Based on the matching score, the original terms are mapped to the corresponding hydropower standard ontology concepts.

[0055] The preset threshold refers to a pre-defined numerical benchmark used to determine the reliability of attribute value extraction results. An uncertainty entropy value greater than the preset threshold indicates that the extraction agent lacks sufficient certainty regarding the currently extracted data, posing a risk of misunderstanding due to non-standard textual expressions. In this case, a mapping alignment process needs to be triggered. Raw terms refer to unprocessed initial vocabulary extracted directly from text sets in the hydropower field. Extracting raw terms from the extraction results involves separately extracting these highly uncertain, non-standard expressions as target objects for subsequent ontology mapping processing.

[0056] Optionally, the hydropower standard body shall include at least: equipment body, monitoring index body, fault body, procedure body and spare parts body.

[0057] Similarity is used to quantitatively characterize the closeness between original terms and established hydropower standard concepts in multiple dimensions. Lexical similarity refers to the degree of similarity at the lexical level. It can be obtained by comparing literal overlap at the character level. For example, the edit distance or longest common subsequence of strings can be used to obtain similarity values ​​at the lexical level. Semantic similarity refers to the degree of similarity at the semantic level. For example, semantic similarity values ​​can be obtained by converting terms into word feature vectors using a natural language processing model and then calculating the angle between these vectors.

[0058] Among them, the matching score is a comprehensive score obtained after comprehensive calculation to represent the equivalence probability between terms and standard concepts. This score can take into account both the literal features and deep logical features of the text.

[0059] Optionally, the matching score can be calculated using the following formula: ; ; In the above formula, Represents lexical similarity based on N-Gram and edit distance; Represents cosine semantic similarity based on sentence vectors; The preferred weights are those specified in this invention.

[0060] Optionally, the standard concept with the highest matching score and meeting the basic score limit is selected from the candidate concepts. Then, the original terms in the extraction results are uniformly replaced or aligned to the standard ontology concept of the specification, thereby completing the standardization transformation of multi-source underlying data.

[0061] Specifically, the mapped concepts are converted into a canonical pattern / language: 1) Class declaration: ; 2) Object property declaration: ; 3) Domain and range constraints: , .

[0062] All entities are assigned unique identifiers to enable the graph to be addressable, interconnected, and reasonable.

[0063] In this embodiment of the invention, by combining the similarity calculation mechanism of literal word method and deep semantic dual dimensions, the technical defects of synonymous different names or confused expression of professional terms in hydropower industry texts are effectively overcome, and the accuracy of entity data alignment and the standardization of knowledge graph pattern layer construction are significantly improved.

[0064] In some embodiments, a verification agent performs counterfactual adversarial detection on candidate relation triples and calculates the contradiction rate, including: The verification agent generates counterfactual perturbation samples for entities or relations in candidate relation triples, and constructs a counterfactual sample set. For each sample in the counterfactual sample set, make a logical judgment and count the number of samples in the judgment results that contradict the logic of the hydropower field; The ratio of the number of samples in the judgment results that contradict the logic of the hydropower field to the total number of samples in the counterfactual sample set is used as the contradiction rate of the candidate relation triple.

[0065] Here, "verification agent" refers to an independent artificial intelligence evaluation unit specifically designed to verify logical consistency and factual accuracy. "Entity" refers to a specific equipment component or status parameter in the hydropower field, and "relationship" refers to the physical connection or business association between entities.

[0066] Optionally, the original, initially extracted correct or questionable triplet data can be deliberately modified in terms of attributes, features, or nodes added or deleted to construct test data that violates objective facts or common business sense—that is, counterfactual perturbation samples. For example, if the original candidate relation triplet is "generator contains stator," the verification agent can perform word replacement on the tail entity "stator" to generate a counterfactual perturbation sample that "generator contains turbine." The counterfactual sample set is a unified summary of all test samples generated after the above perturbation processing.

[0067] Specifically, the verification agent combines common sense about the hydropower industry with the physical coupling rules of the underlying hydropower equipment to identify and determine whether the correlation described by each counterfactual sample is valid or possible in real electromechanical equipment business scenarios. It iterates through the entire counterfactual sample set, accumulating the number of abnormal samples that fail logical verification and violate real hydropower industry rules.

[0068] Based on this, the number of contradictory samples obtained from the aforementioned statistics is divided by the total number of perturbed samples in the counterfactual sample set to obtain a ratio, which is used as the contradiction rate of the candidate relation triples. This contradiction rate can accurately quantify the probability of the candidate relation triples causing system logic conflicts when facing external adversarial tampering, and thus reversely demonstrate the anti-interference ability and factual robustness of the initial extraction results.

[0069] Optionally, the formula for calculating the contradiction rate is as follows: ; in, Represents a set of counterfactual samples; This represents the contradiction rate; a higher value indicates a less reliable relationship.

[0070] In this embodiment of the invention, by verifying the intelligent agent to actively generate counterfactual perturbation samples and perform adversarial logic calculations, the system response verification process under complex interference scenarios is cleverly simulated. The accuracy of static facts in the graph, which was originally difficult to directly assess, is transformed into a contradiction rate ratio that can be dynamically quantified. This greatly enhances the system's ability to test and identify factual illusions in large language models and provides strong quantitative data support for subsequent multi-dimensional joint confidence scoring.

[0071] Figure 2 This is a flowchart illustrating the calculation process of the joint confidence score for candidate relation triples provided by this invention. Figure 2 As shown, in some embodiments, the joint confidence score of candidate relation triples is calculated based on uncertainty entropy, semantic score, and contradiction rate, including: Step 210: Obtain the retrieval enhancement evidence matching score and multi-agent consistency rate corresponding to the candidate relation triples.

[0072] Among them, the enhanced evidence matching score is used to characterize the degree of evidence alignment between candidate relation triples and hydropower professional documents recalled through enhanced retrieval; the multi-agent consensus rate is used to characterize the degree of consensus among the extraction agent, refinement agent, and verification agent regarding the validity of the candidate relation triples. Evidence alignment refers to the degree of fit between the candidate relation triples and hydropower professional documents; consensus consistency refers to the proportion of multiple independently operating artificial intelligence model units that reach the same affirmative conclusion when judging the authenticity and reasonableness of the same candidate relation triples.

[0073] Enhanced retrieval recall refers to the process of extracting text fragments most semantically relevant to the current query from external professional knowledge bases using techniques such as vectorized similarity retrieval. Hydropower professional documents refer to standardized textual materials such as authoritative and certified hydropower equipment maintenance procedures, manufacturer's instructions, or standard operation and maintenance manuals.

[0074] Step 220: Assign corresponding preset weight coefficients to the enhanced evidence matching score, multi-agent consistency rate, semantic score, contradiction rate, and uncertainty entropy value.

[0075] Optionally, preset weighting coefficients can be determined by experts in the hydropower field based on their practical experience in map quality auditing; alternatively, preset weighting coefficients can be determined by automatically iteratively fitting a specific hydropower business training set using machine learning optimization algorithms. By allocating weighting coefficients appropriately, it can be ensured that more critical and reliable verification indicators occupy a suitable dominant position in the overall evaluation system.

[0076] Step 230: Based on the retrieval-enhanced evidence matching score, multi-agent consistency rate, semantic score, contradiction rate, and uncertainty entropy value, as well as the corresponding preset weight coefficients, perform joint weighted calculation to obtain the joint confidence score of the candidate relation triples.

[0077] Optionally, the numerical values ​​of the five dimensions mentioned above are multiplied by their corresponding preset weight coefficients, and then all the product results are linearly added or fused. Through this joint weighted calculation, the originally isolated word-level internal indicators, contextual semantic indicators, and external factual evidence indicators can be aggregated into a unified macro-evaluation score. The final joint confidence score can comprehensively and objectively reflect the overall quality of the candidate relation triple in all dimensions, including textual basis, semantic fluency, logical consistency, and multi-agent consensus.

[0078] In some embodiments, the formula for calculating the joint confidence score includes: ; in, This represents a candidate relation triple. Indicates the attribute value. Indicates the joint confidence score; This indicates the score for enhanced evidence matching in the search. To retrieve the preset weight coefficients corresponding to the evidence matching scores; This represents the consensus rate among multiple agents. The preset weighting coefficients corresponding to the consensus rate of multiple agents; Indicates semantic score, These are the preset weight coefficients corresponding to the semantic scores; Indicates the contradiction rate. The preset weighting coefficients corresponding to the contradiction rate; Represents the entropy value of uncertainty. This represents the preset weighting coefficient corresponding to the uncertainty entropy value.

[0079] In this embodiment of the invention, by introducing external retrieval to enhance evidence matching and internal multi-agent consensus mechanism, and combining semantic score, contradiction rate and uncertainty entropy value for multi-dimensional joint weighted scoring, the limitations of single-indicator evaluation in traditional knowledge extraction are completely broken. A rigorous filtering evaluation system that takes into account both internal model probability evaluation and alignment with external authoritative facts is constructed, providing a reliable decision basis for the subsequent screening of high-precision target triples.

[0080] In some embodiments, after filtering candidate relation triples to obtain the target triples, the method further includes: Retrieve the triples that were filtered out from the candidate relation triples; The filtered triples are used as query conditions to perform a new multi-document enhanced search to obtain the new text data; The hydropower knowledge graph was optimized based on the newly added text data.

[0081] Among them, the joint confidence score of the filtered triples is lower than the preset scoring threshold.

[0082] Optionally, the multi-agent system performs extraction, refinement, verification, and scoring on the newly added text data to obtain new target triples. Based on the new target triples, the hydropower knowledge graph is optimized.

[0083] Optionally, it can automatically detect and eliminate contradictory, conflicting, and redundant knowledge within the hydropower knowledge graph; and incrementally update the hydropower standard ontology and standard hydropower schema to adapt to new equipment, new standards, and new faults.

[0084] Alternatively, the iterative optimization function can be expressed as: ; in, This represents a self-supervised iterative update function. This indicates newly added text data.

[0085] In some embodiments, a hydropower knowledge graph is generated based on the target triples, including: Redundancy elimination is performed on the target triplet to obtain the processed target triplet. Verify whether the target triple after verification meets the logical constraints of the standard hydropower schema. The logical constraints include domain constraints and range constraints. The verified and compliant target triples are encoded into a semantic network standard format and injected into the logical reasoning rules of hydropower equipment to generate a hydropower knowledge graph.

[0086] Optionally, redundant relationships are eliminated from the target triples; based on the standard hydropower schema, schema compliance checks are performed on the target triples to check whether they meet the domain, value domain, and type constraints, and target triples that do not meet the constraints are eliminated; business enhancements are performed on the target triples to retain high-value relationships related to faults, safety, and maintenance.

[0087] The semantic web standard format can include Resource Description Framework (RDF), RDF Schema (RDFS), or Web Ontology Language (OWL). The hydropower knowledge graph supports the SPARQL protocol and RDF query language, and supports rule reasoning using the Semantic Web Rule Language (SWRL). The encoded hydropower knowledge graph can be directly connected to hydropower operation and maintenance platforms, decision-making systems, and edge inference terminals, enabling industrial-grade deployment.

[0088] The following describes the hydropower knowledge graph construction device based on multi-agent technology provided by the present invention. The hydropower knowledge graph construction device based on multi-agent technology described below and the hydropower knowledge graph construction method based on multi-agent technology described above can be referred to in correspondence with each other.

[0089] Figure 3 This is a schematic diagram of the structure of the hydropower knowledge graph construction device based on multi-agent provided by the present invention, as shown below. Figure 3 As shown, the multi-agent-based hydropower knowledge graph construction device 300 includes... Acquisition unit 310 is used to acquire a text set in the field of hydropower; Extraction unit 320 is used to extract entity-attribute-value from text set under the constraints of a preset hydropower equipment resource model using an extraction agent, to obtain extraction results, and to calculate the uncertainty entropy value of attribute values ​​in the extraction results. Mapping unit 330 is used to map the extraction results to a preset hydropower standard ontology to generate a standard hydropower schema, which includes resource identifiers and logical constraints. Evaluation unit 340 is used to generate candidate relation triples based on the constraints of the standard hydropower schema by an extraction agent; a refinement agent evaluates the contextual rationality of the candidate relation triples to obtain a semantic score; and a verification agent performs counterfactual adversarial detection on the candidate relation triples to calculate the contradiction rate. Unit 350 is used to calculate the joint confidence score of candidate relation triples based on uncertainty entropy, semantic score and contradiction rate, filter the candidate relation triples to obtain target triples, and generate hydropower knowledge graph based on target triples.

[0090] Optionally, the uncertainty entropy value of the attribute values ​​in the extraction results is calculated, including: Obtain the predicted probability of each word corresponding to the attribute value; Based on the predicted probability of each word, the information entropy of each word is calculated. The information entropy of all the tokens corresponding to the attribute value is summed and then inverted to obtain the uncertainty entropy value of the attribute value.

[0091] Optionally, the extraction results are mapped to a preset hydropower standard ontology, including: If the uncertainty entropy value is greater than a preset threshold, the original terms are extracted from the extraction results. Calculate the similarity between the original terms and the concepts in the hydropower standard ontology. The similarity includes lexical similarity and semantic similarity. We perform a weighted fusion of lexical similarity and semantic similarity to obtain the matching score between the original terms and the corresponding concepts; Based on the matching score, the original terms are mapped to the corresponding hydropower standard ontology concepts.

[0092] Optionally, the verification agent performs counterfactual adversarial detection on the candidate relation triples and calculates the contradiction rate, including: The verification agent generates counterfactual perturbation samples for entities or relations in candidate relation triples, and constructs a counterfactual sample set. For each sample in the counterfactual sample set, make a logical judgment and count the number of samples in the judgment results that contradict the logic of the hydropower field; The ratio of the number of samples in the judgment results that contradict the logic of the hydropower field to the total number of samples in the counterfactual sample set is used as the contradiction rate of the candidate relation triple.

[0093] Optionally, based on the uncertainty entropy value, semantic score, and contradiction rate, a joint confidence score for candidate relation triples is calculated, including: Obtain the retrieval-enhanced evidence matching score and multi-agent consistency rate corresponding to the candidate relation triples; the retrieval-enhanced evidence matching score is used to characterize the degree of evidence alignment between the candidate relation triples and the hydropower professional documents recalled through enhanced retrieval; the multi-agent consistency rate is used to characterize the degree of consensus among the extraction agent, the refinement agent, and the verification agent regarding the validity of the candidate relation triples. To enhance the retrieval of evidence matching score, multi-agent consistency rate, semantic score, contradiction rate, and uncertainty entropy value, corresponding preset weight coefficients are assigned. Based on the retrieval-enhanced evidence matching score, multi-agent consistency rate, semantic score, contradiction rate, and uncertainty entropy value, as well as the corresponding preset weight coefficients, a joint weighted calculation is performed to obtain the joint confidence score of the candidate relation triples.

[0094] Optionally, the formula for calculating the joint confidence score includes: ; in, This represents a candidate relation triple. Indicates the attribute value. Indicates the joint confidence score; This indicates the score for enhanced evidence matching in the search. To retrieve the preset weight coefficients corresponding to the evidence matching scores; This represents the consensus rate among multiple agents. The preset weighting coefficients corresponding to the consensus rate of multiple agents; Indicates semantic score, These are the preset weight coefficients corresponding to the semantic scores; Indicates the contradiction rate. The preset weighting coefficients corresponding to the contradiction rate; Represents the entropy value of uncertainty. This represents the preset weighting coefficient corresponding to the uncertainty entropy value.

[0095] Optionally, the above-mentioned device further includes an optimization unit, which is used to: after filtering the candidate relation triples to obtain the target triples, obtain the triples that were filtered out from the candidate relation triples; use the filtered triples as query conditions to perform multi-document enhanced retrieval again to obtain the new text data; and optimize the hydropower knowledge graph based on the new text data.

[0096] Optionally, a hydropower knowledge graph is generated based on the target triples, including: Redundancy elimination is performed on the target triplet to obtain the processed target triplet. Verify whether the target triple after verification meets the logical constraints of the standard hydropower schema. The logical constraints include domain constraints and range constraints. The verified and compliant target triples are encoded into a semantic network standard format and injected into the logical reasoning rules of hydropower equipment to generate a hydropower knowledge graph.

[0097] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communications bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other through the communications bus 440. The processor 410 can call logical instructions in the memory 430 to execute a multi-agent-based hydropower knowledge graph construction method. This method includes: acquiring a text set in the hydropower domain; using an extraction agent to extract entities, attributes, and values ​​from the text set under the constraints of a preset hydropower equipment resource model, obtaining extraction results, and calculating the uncertainty entropy value of the attribute values ​​in the extraction results; mapping the extraction results to a preset hydropower standard ontology to generate a standard hydropower schema, which includes resource identifiers and logical constraints; generating candidate relation triples by the extraction agent based on the constraints of the standard hydropower schema; evaluating the contextual rationality of the candidate relation triples by a refining agent to obtain semantic scores; performing counterfactual adversarial detection on the candidate relation triples by a verification agent to calculate the contradiction rate; calculating the joint confidence score of the candidate relation triples based on the uncertainty entropy value, semantic score, and contradiction rate; filtering the candidate relation triples to obtain target triples; and generating a hydropower knowledge graph based on the target triples.

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

[0099] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0100] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0101] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for constructing a hydropower knowledge graph based on multi-agent systems, characterized in that, include: Retrieve text sets related to hydropower; Using an extraction agent, under the constraints of a preset hydropower equipment resource model, entity-attribute-value extraction is performed on the text set to obtain the extraction results, and the uncertainty entropy value of the attribute values ​​in the extraction results is calculated. The extraction results are mapped to a preset hydropower standard ontology to generate a standard hydropower schema, which includes resource identifiers and logical constraints. Based on the constraints of the standard hydropower schema, the extraction agent generates candidate relation triples; the refining agent evaluates the contextual rationality of the candidate relation triples to obtain semantic scores. The verification agent performs counterfactual adversarial detection on the candidate relation triples and calculates the contradiction rate. Based on the uncertainty entropy value, the semantic score, and the contradiction rate, the joint confidence score of the candidate relation triples is calculated, the candidate relation triples are filtered to obtain the target triples, and a hydropower knowledge graph is generated based on the target triples.

2. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, The calculation of the uncertainty entropy value of the attribute values ​​in the extraction result includes: Obtain the predicted probability of each word element corresponding to the attribute value; Based on the predicted probability of each word, the information entropy of each word is calculated; The information entropy of all the terms corresponding to the attribute value is summed and then inverted to obtain the uncertainty entropy value of the attribute value.

3. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, The step of mapping the extraction results to a preset hydropower standard ontology includes: If the uncertainty entropy value is determined to be greater than a preset threshold, the original terms are extracted from the extraction results. Calculate the similarity between the original terminology and each concept in the hydropower standard ontology, whereby the similarity includes lexical similarity and semantic similarity; The lexical similarity and the semantic similarity are weighted and fused to obtain the matching score between the original term and the corresponding concept; Based on the matching score, the original terms are mapped to the corresponding hydropower standard ontology concepts.

4. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, The step of performing counterfactual adversarial detection on the candidate relation triples by the verification agent and calculating the contradiction rate includes: The verification agent generates counterfactual perturbation samples for the entities or relations of the candidate relation triples, and constructs a counterfactual sample set. For each sample in the counterfactual sample set, a logical judgment is made, and the number of samples in the judgment results that contradict the logic of the hydropower field is counted. The ratio of the number of samples in the judgment result that contradict the logic of the hydropower field to the total number of samples in the counterfactual sample set is calculated, and the ratio is used as the contradiction rate of the candidate relation triple.

5. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, The calculation of the joint confidence score of the candidate relation triples based on the uncertainty entropy value, the semantic score, and the contradiction rate includes: Obtain the retrieval-enhanced evidence matching score and multi-agent consistency rate corresponding to the candidate relation triple; the retrieval-enhanced evidence matching score is used to characterize the degree of evidence alignment between the candidate relation triple and the hydropower professional documents recalled through enhanced retrieval; the multi-agent consistency rate is used to characterize the degree of consensus among the extraction agent, the refinement agent and the verification agent regarding the validity of the candidate relation triple. Assign corresponding preset weight coefficients to the retrieval enhancement evidence matching score, the multi-agent consistency rate, the semantic score, the contradiction rate, and the uncertainty entropy value, respectively; Based on the retrieval-enhanced evidence matching score, the multi-agent consistency rate, the semantic score, the contradiction rate, and the uncertainty entropy value, as well as the corresponding preset weight coefficients, a joint weighted calculation is performed to obtain the joint confidence score of the candidate relation triples.

6. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 5, characterized in that, The formula for calculating the joint confidence score include: ; in, This represents the candidate relation triple. This represents the attribute value. This represents the joint confidence score; This represents the enhanced evidence matching score of the search. The preset weight coefficients are assigned to the evidence matching scores used to enhance the retrieval. This represents the consensus rate among the multiple agents. The preset weighting coefficients corresponding to the consensus rate of the multi-agent system; This represents the semantic score. The preset weight coefficients corresponding to the semantic score; This represents the contradiction rate. The preset weighting coefficient corresponding to the contradiction rate; This represents the uncertainty entropy value. This represents the preset weighting coefficient corresponding to the uncertainty entropy value.

7. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, After filtering the candidate relation triples to obtain the target triples, the process further includes: Obtain the triples that were filtered out from the candidate relation triples; Using the filtered triples as query conditions, perform a new multi-document enhanced search to obtain the newly added text data; Based on the newly added text data, the hydropower knowledge graph is optimized.

8. The method for constructing a hydropower knowledge graph based on multi-agent technology according to claim 1, characterized in that, Based on the target triples, a hydropower knowledge graph is generated, including: The target triplet is subjected to redundancy elimination processing to obtain the processed target triplet. Verify whether the processed target triples satisfy the logical constraints of the standard hydropower schema, the logical constraints including domain constraints and range constraints; The processed target triples that have passed verification are encoded into a semantic network standard format and injected into the logical reasoning rules of hydropower equipment to generate the hydropower knowledge graph.

9. A device for constructing a hydropower knowledge graph based on multi-agent systems, characterized in that, include: The acquisition unit is used to acquire text sets in the field of hydropower. An extraction unit is used to extract entity-attribute-value from the text set using an extraction agent under the constraints of a preset hydropower equipment resource model, to obtain extraction results, and to calculate the uncertainty entropy value of the attribute values ​​in the extraction results. A mapping unit is used to map the extraction results to a preset hydropower standard ontology to generate a standard hydropower schema, wherein the standard hydropower schema includes resource identifiers and logical constraints. An evaluation unit is used to generate candidate relation triples by the extraction agent based on the constraints of the standard hydropower schema; and to evaluate the contextual rationality of the candidate relation triples by the refining agent to obtain a semantic score. The verification agent performs counterfactual adversarial detection on the candidate relation triples and calculates the contradiction rate. The construction unit is used to calculate the joint confidence score of the candidate relation triples based on the uncertainty entropy value, the semantic score and the contradiction rate, filter the candidate relation triples to obtain the target triples, and generate a hydropower knowledge graph based on the target triples.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the hydropower knowledge graph construction method based on multiple agents as described in any one of claims 1 to 8.