A water conservancy industry knowledge graph construction method, device and equipment and a storage medium

By generating entity, attribute, and relation vectors through target large models and embedded models, and combining Elasticsearch, Milvus, and Neo4j to construct a knowledge graph for the water conservancy industry, the problems of scattered data management and lack of semantic standards are solved, and efficient and accurate knowledge graph construction and intelligent application are achieved.

CN123159486APending Publication Date: 2026-11-24WATER RESOURCES INFORMATION CENT OF THE MINISTRY OF WATER RESOURCES +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611350265.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-02
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

The water conservancy industry faces challenges such as complex data sources, diverse structures, and decentralized management, as well as a lack of unified semantic standards and knowledge organization systems. This results in low efficiency and poor quality in knowledge graph construction, making it unable to support complex correlation analysis and intelligent decision-making assistance across multiple business scenarios.

Method used

By employing a target large model and a pre-defined embedding model, vectors are generated through entity, attribute, and relation extraction. Combined with Elasticsearch, Milvus, and Neo4j, a knowledge graph is constructed to achieve unified storage and intelligent reasoning analysis of multi-source heterogeneous data.

Benefits of technology

It improves the efficiency and quality of knowledge graph construction in the water conservancy industry, provides a unified data foundation, supports application scenarios such as information retrieval and analysis decision-making, and provides knowledge support for industry development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123159486A_ABST
    Figure CN123159486A_ABST
Patent Text Reader

Abstract

This application discloses a method, apparatus, equipment, and storage medium for constructing a knowledge graph in the water conservancy industry, relating to the field of artificial intelligence technology. The method includes: acquiring initial water conservancy document data and converting the document format of the initial water conservancy document data into a target format to obtain target water conservancy document data; using a target large-scale model to determine the entities, attributes, and relationships corresponding to the target water conservancy document data, and using a preset embedding model to determine the entity vectors corresponding to the entities, the attribute vectors corresponding to the attributes, and the relationship vectors corresponding to the relationships; using the target large-scale model to determine the target entity classes corresponding to the entities based on the entity vectors and attribute vectors, and determining the target relationship classes corresponding to the target entity classes based on the relationship vectors; and constructing a target knowledge graph for the water conservancy industry based on the entities, attributes, relationships, target entity classes, and target relationship classes. As can be seen, this application can improve the efficiency and quality of constructing a knowledge graph for the water conservancy industry.
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, equipment, and storage medium for constructing a knowledge graph for the water conservancy industry. Background Technology

[0002] The water conservancy industry currently faces challenges due to the complexity, diversity, and fragmented management of its data sources. This data includes various heterogeneous types such as industry standard documents, internal data from business management systems, and academic papers. At present, water conservancy industry information systems generally adopt traditional database management or isolated business system approaches. Data within each system is closed, lacking unified semantic standards and knowledge organization systems. This makes it impossible to support the fusion of multi-source heterogeneous data and dynamic knowledge reasoning, and further hinders effective connectivity between different business systems, limiting cross-system business collaboration and comprehensive decision-making capabilities.

[0003] Knowledge graphs, as an important means of organizing and representing knowledge in complex domains, possess technical advantages such as breaking down data silos, establishing unified semantic networks, and supporting intelligent reasoning and analysis. However, the construction of knowledge graphs in the water conservancy industry is still in its initial stage, with problems such as limited knowledge extraction methods, incomplete ontology design systems, and inconsistent quality of knowledge fusion. These issues make it difficult to support complex correlation analysis and intelligent decision-making in multiple business scenarios, thus hindering the development of water conservancy informatization and intelligence.

[0004] In conclusion, improving the efficiency and quality of knowledge graph construction in the water conservancy industry is a pressing technical problem that needs to be solved. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a method, apparatus, equipment, and storage medium for constructing a knowledge graph in the water conservancy industry, which can improve the efficiency and quality of knowledge graph construction in the water conservancy industry. The specific solution is as follows: Firstly, this application provides a method for constructing a knowledge graph for the water conservancy industry, including: Acquire initial water conservancy document data from the water conservancy industry, and convert the document format of the initial water conservancy document data into a target format to obtain target water conservancy document data; The target large model is used to determine the entity corresponding to the target water conservancy document data, the attribute corresponding to the entity, and the relationship corresponding to the entity. The entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relationship vector corresponding to the relationship are determined by a preset embedding model. The target entity class corresponding to the entity is determined based on the entity vector and the attribute vector using the target large model, and the target relation class corresponding to the target entity class is determined based on the relation vector; Construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

[0006] Optionally, the step of using the target large model to determine the entity corresponding to the target water conservancy document data, the attribute corresponding to the entity, and the relationship corresponding to the entity includes: First prompt words are generated based on entity extraction, attribute extraction, and relation extraction tasks; The target large model is used to perform the entity extraction task on the target water conservancy document data based on the first prompt word, so as to obtain the entity corresponding to the target water conservancy document data; The target large model is used to perform the attribute extraction task on the entity based on the first prompt word to obtain the attribute corresponding to the entity; The target large model is used to perform the relation extraction task on the entity based on the first prompt word, so as to obtain the relation corresponding to the entity.

[0007] Optionally, the method for constructing a knowledge graph for the water conservancy industry further includes: Acquire multi-source document data from the water conservancy industry and store the multi-source document data in a preset object storage database to obtain a corresponding target corpus, so as to obtain the initial water conservancy document data from the target corpus; A target retrieval library is built based on Elasticsearch and the multi-source document data, a target vector database is built based on Milvus, and a target graph database is built based on Neo4j.

[0008] Optionally, converting the initial water conservancy document data into a target format to obtain the target water conservancy document data includes: Based on preset image recognition technology and preset text extraction technology, the document format of the initial water conservancy document data is converted into Markdown format to obtain the target water conservancy document data; Generate metadata information corresponding to the target water conservancy document data; the metadata information includes source information, type information, and author information; The target water conservancy document data and the metadata information are stored in the target retrieval database.

[0009] Optionally, after determining the entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relation vector corresponding to the relation through a preset embedding model, the method further includes: The entity vector, the attribute vector, and the relation vector are stored in the target vector database; Accordingly, determining the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model includes: If the target entity class corresponding to the entity exists in the target retrieval library, then the target big model is used to determine whether the entity belongs to the target entity class. If it does, then the entity is added to the target entity class. If the target entity class corresponding to the entity does not exist in the target retrieval library, then based on the attribute vector corresponding to the entity and the entity vector corresponding to the entity, the target attribute vector and target entity vector that meet the preset similarity conditions are retrieved from the target vector database, and the target similar entities corresponding to the target attribute vector and the target entity vector are determined. The target big model is used to determine whether the entity belongs to the entity class corresponding to the target similar entity. If it does not belong, the target big model is used to generate the target entity class corresponding to the entity based on the second prompt word, and the target entity class is added to the target retrieval database.

[0010] Optionally, determining the target relation class corresponding to the target entity class based on the relation vector includes: Determine whether the target relation class corresponding to the target entity class exists in the target retrieval database; If it does not exist, then based on the relation vector, determine the related entity class that has an association with the target entity class, and use the target big model to generate the target relation class corresponding to the target entity class according to the third prompt word; Based on each entity in the target entity class and each entity in the related entity class, the association probability between the target entity class and the related entity class is determined, and the target relationship class and the association probability are added to the target retrieval database.

[0011] Optionally, the step of constructing a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class includes: Based on the target entity class and the target relationship class, the entity, the attribute, and the relationship are stored in the target graph database; The entities are used as nodes, and connections are established between nodes corresponding to different entities with related relationships based on the target graph database to obtain the target knowledge graph of the water conservancy industry. Accordingly, after constructing the target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class, the method further includes: Obtain the target water conservancy information query statement input by the user, and use the target large model to convert the water conservancy information query statement into a corresponding target water conservancy information query task; The target retrieval library and the target knowledge graph are invoked to execute the target water conservancy information query task, and the water conservancy information query result corresponding to the target water conservancy information query task is determined based on the task execution result.

[0012] Secondly, this application provides a knowledge graph construction device for the water conservancy industry, comprising: The format conversion module is used to acquire initial water conservancy document data from the water conservancy industry and convert the document format of the initial water conservancy document data into a target format to obtain the target water conservancy document data. The vector determination module is used to determine the entity corresponding to the target water conservancy document data, the attribute corresponding to the entity, and the relationship corresponding to the entity using the target large model, and to determine the entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relationship vector corresponding to the relationship respectively through a preset embedding model; The relationship class determination module is used to determine the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model, and to determine the target relationship class corresponding to the target entity class based on the relationship vector; The knowledge graph construction module is used to construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

[0013] Thirdly, this application provides an electronic device, comprising: Memory, used to store computer programs; A processor is used to execute the computer program to implement the aforementioned method for constructing a knowledge graph for the water conservancy industry.

[0014] Fourthly, this application provides a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for constructing a knowledge graph in the water conservancy industry.

[0015] In this application, initial water conservancy document data is first obtained, and the document format of the initial water conservancy document data is converted into a target format to obtain target water conservancy document data. Then, a target big data model is used to determine the entities, attributes, and relationships corresponding to the target water conservancy document data. A preset embedding model is used to determine the entity vector, attribute vector, and relationship vector corresponding to each entity. Subsequently, the target big data model is used to determine the target entity class corresponding to each entity based on the entity vector and attribute vector, and the target relationship class corresponding to each target entity class is determined based on the relationship vector. Finally, a target knowledge graph for the water conservancy industry is constructed based on the entities, attributes, relationships, target entity classes, and target relationship classes. As can be seen, this application first obtains initial water conservancy document data, converts its format into a target format to obtain target water conservancy document data, laying the foundation for subsequent processing. Next, the target big data model is used to extract entities, their corresponding attributes, and relationships from the target water conservancy document data, while a preset embedding model is used to generate vectors corresponding to each entity, attribute, and relationship. Then, the target large model is used again to determine the target entity class corresponding to the entity based on entity vectors and attribute vectors, and the target relation class corresponding to the target entity class is determined based on relation vectors. Finally, entities, attributes, relations, target entity classes, and target relation classes are integrated to complete the construction of the water conservancy industry target knowledge graph. In this way, this application achieves data standardization through format conversion, providing a unified data foundation for subsequent processing; by using the large model for knowledge extraction and classification, combined with vectors generated by the embedded model, semantic information can be captured more accurately, improving the accuracy of entity, attribute, relation, and category judgments, thereby ensuring that the constructed knowledge graph can more comprehensively and accurately reflect the knowledge system of the water conservancy industry. In this way, this application can improve the construction efficiency and quality of the water conservancy industry knowledge graph, and the final knowledge graph can serve the information retrieval, analysis, and decision-making applications of the water conservancy industry, providing strong knowledge support for industry development. Attached Figure Description

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

[0017] Figure 1 A flowchart of a knowledge graph construction method for the water conservancy industry is provided in this application; Figure 2 A schematic diagram of a knowledge graph construction device for the water conservancy industry provided in this application; Figure 3 This application provides a structural diagram of an electronic device. Detailed Implementation

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

[0019] The water conservancy industry currently faces challenges due to the complexity, diversity, and fragmented management of its data sources. This data includes various heterogeneous types such as industry standard documents, internal data from business management systems, and academic papers. Currently, water conservancy information systems generally employ traditional database management or isolated business system approaches. Data within each system is closed, lacking unified semantic standards and knowledge organization systems. This hinders the fusion of multi-source heterogeneous data and dynamic knowledge reasoning, and prevents effective connectivity between different business systems, limiting cross-system business collaboration and comprehensive decision-making capabilities. Knowledge graphs, as an important means of organizing and representing knowledge in complex domains, possess technical advantages in breaking down data silos, establishing unified semantic networks, and supporting intelligent reasoning and analysis. However, the construction of knowledge graphs in the water conservancy industry is still in its early stages, suffering from problems such as limited knowledge extraction methods, incomplete ontology design systems, and inconsistent knowledge fusion quality. This makes it difficult to support complex correlation analysis and intelligent decision-making assistance across multiple business scenarios, thus restricting the development of water conservancy informatization and intelligence. Therefore, this application provides a water conservancy industry knowledge graph construction scheme that can improve the efficiency and quality of knowledge graph construction.

[0020] See Figure 1 As shown in the figure, this invention discloses a method for constructing a knowledge graph in the water conservancy industry, which may include: Step S11: Obtain initial water conservancy document data from the water conservancy industry, and convert the document format of the initial water conservancy document data into the target format to obtain the target water conservancy document data.

[0021] This embodiment adopts a three-layer architecture design: "physical layer - logical layer - application layer". Each layer has clear logic, is decoupled and independent, and collaboratively supports business requirements. Details are as follows: (1) Physical layer: As a data support platform, it is responsible for the storage and management of multi-source heterogeneous water conservancy data, including corpus, vector database, graph database and retrieval library, providing a standardized and authoritative data foundation for upper-level knowledge modeling and application.

[0022] (2) Logic layer: As the core of knowledge modeling and intelligent extraction, it undertakes the tasks of entity and relation extraction, heterogeneous entity alignment, knowledge fusion and logical reasoning, ensuring the integrity of the knowledge graph structure and guaranteeing the consistency, integrity and semantic correctness of knowledge.

[0023] (3) Application layer: For users and water conservancy business systems, it provides functions such as entity management, relationship management, knowledge graph visualization, intelligent question answering and retrieval, supports the business needs of multiple scenarios in the water conservancy industry, and improves the level of intelligence and visualization of information application.

[0024] It should be noted that the physical layer, as the data foundation of the knowledge graph system, is responsible for storing multi-source heterogeneous data from the water conservancy industry and constructing an authoritative and standardized data foundation. In this embodiment, multi-source document data from the water conservancy industry is first acquired and stored in a preset object storage database to obtain the corresponding target corpus, so that initial water conservancy document data can be subsequently retrieved from the target corpus. Then, a target retrieval library is constructed based on Elasticsearch and the multi-source document data, a target vector database is constructed based on Milvus, and a target graph database is constructed based on Neo4j. Specifically, the core components and functions of the physical layer are as follows: (1) Corpus: Using object storage, such as MinIO, to store large-scale heterogeneous water conservancy data resources, and to collect multi-source data such as national industry standards, technical specifications, policy documents, academic papers, and scientific research results as the original data source of the system.

[0025] (2) Search Database: Built on Elasticsearch, it enables efficient full-text retrieval, structured querying, and complex condition filtering of multi-source text data in the water conservancy industry. Through inverted index, it performs high-performance retrieval of text content such as policies and regulations, technical specifications, and scientific research papers, and supports functions such as multi-condition combined query, keyword highlighting, and relevance sorting, providing strong support for knowledge discovery and rapid location.

[0026] (3) Vector Database: Milvus is used as a high-performance vector database to store the feature vector representations of heterogeneous data in the water conservancy industry. Through vectorization processing, it supports functions such as similarity retrieval and semantic matching, providing basic capabilities for entity association and similar entity discovery.

[0027] (4) Graph Database: Built on Neo4j, it is responsible for storing entities and their relationships in the water conservancy industry. It expresses the multidimensional relationships between entities through graph data models, supports efficient path query, subgraph retrieval and relationship reasoning, and builds a comprehensive and intuitive water conservancy knowledge network, providing relational data support for knowledge graph construction and application.

[0028] The logic layer designed in this embodiment is the core of the system's knowledge modeling, intelligent extraction, and semantic reasoning, covering five major modules: multi-source data processing, knowledge extraction, vectorized encoding, entity alignment, and relationship fusion.

[0029] It should be noted that, to address the issue of disorganized and inconsistent formats in multi-source, heterogeneous water conservancy document data, the data processing module designs a document formatting strategy. Specifically, the conversion of the initial water conservancy document data into a target format to obtain the target water conservancy document data can include: first, converting the initial water conservancy document data into Markdown format based on preset image recognition and text extraction technologies to obtain the target water conservancy document data; then, generating metadata information corresponding to the target water conservancy document data; the metadata information includes source information, type information, and author information; and finally, storing the target water conservancy document data and the metadata information in the target retrieval database. Specifically, in this embodiment, initial water conservancy document data such as PDF, Word, HTML, and Excel can be uniformly converted into Markdown format target water conservancy document data using image recognition, text extraction, and other technologies. The target water conservancy document data can then be stored in the target retrieval database by paragraph, while adding metadata information such as source, type, and author to the target water conservancy document data for high-performance retrieval.

[0030] Step S12: Use the target large model to determine the entity corresponding to the target water conservancy document data, the attribute corresponding to the entity, and the relationship corresponding to the entity, and use a preset embedding model to determine the entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relationship vector corresponding to the relationship.

[0031] In this embodiment, a knowledge extraction module can be constructed based on a target large model and prompting learning technology to extract knowledge from the target water conservancy document data. Specifically, the above-mentioned determination of the entity, attribute, and relation corresponding to the target water conservancy document data using the target large model can include: firstly, generating a first prompt word based on entity extraction, attribute extraction, and relation extraction tasks; then, using the target large model to perform the entity extraction task on the target water conservancy document data based on the first prompt word to obtain the entity corresponding to the target water conservancy document data; subsequently, using the target large model to perform the attribute extraction task on the entity based on the first prompt word to obtain the attribute corresponding to the entity; and finally, using the target large model to perform the relation extraction task on the entity based on the first prompt word to obtain the relation corresponding to the entity. Specifically, in the knowledge extraction module, a first prompt word is first generated; using the target large model, the document content is traversed; and entity extraction, relation extraction, and attribute extraction tasks are performed on the target water conservancy document data using the first prompt word to obtain the entity, relation, and attribute corresponding to the entity corresponding to the target water conservancy document data. It should be noted that small sample examples can be incorporated into the prompts to improve the accuracy and recall of large models when performing extraction tasks.

[0032] It should be noted that the vectorization encoding module can encode the extracted entities, attributes, relationships, and corresponding paragraph content of the target water conservancy document data into high-dimensional semantic vectors using the BGE-large model, resulting in entity vectors, attribute vectors, relationship vectors, and paragraph content vectors, containing metadata such as ID, type, source document, document type, and context; among which, the context information is generated for the entity vectors, attribute vectors, and relationship vectors. Subsequently, the entity vectors, attribute vectors, and relationship vectors can be stored in the target vector database, which supports entity similarity calculation, entity definition alignment, implicit relationship discovery, and RAG (Retrieval-augmented Generation) question-answering retrieval.

[0033] Step S13: Using the target large model, determine the target entity class corresponding to the entity based on the entity vector and the attribute vector, and determine the target relation class corresponding to the target entity class based on the relation vector.

[0034] In this embodiment, an entity alignment module can be constructed based on a target large model and prompting learning technology to determine the target entity class. Specifically, the above-mentioned determination of the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model can include: if the target entity class corresponding to the entity exists in the target retrieval library, then the target large model is used to determine whether the entity belongs to the target entity class; if it does, the entity is added to the target entity class. If the target entity class corresponding to the entity does not exist in the target retrieval library, then based on the attribute vector and entity vector corresponding to the entity, target attribute vectors and target entity vectors that meet preset similarity conditions are retrieved from the target vector database, and the target similar entities corresponding to the target attribute vectors and target entity vectors are determined. The target large model is used to determine whether the entity belongs to the entity class corresponding to the target similar entity; if it does not belong, the target large model is used to generate the target entity class corresponding to the entity based on the second prompt word, and the target entity class is added to the target retrieval library. Specifically, the target large model is used to traverse entities and query the target retrieval library to see if a target entity class corresponding to the entity exists. If a target entity class exists in the target retrieval database, the context of existing entities in the target entity class and the current entity's context are extracted first. Then, through prompt learning, the target big model determines whether the current entity and existing entities in the target entity class belong to the same type of entity, thus determining whether the current entity belongs to the target entity class. If so, the current entity is classified into that target entity class. If no target entity class exists in the target retrieval database, the vector database is searched using entity vectors and attribute vectors to find the top 10 similar target entities. Then, it is queried whether the similar target entities belong to a certain entity class. If so, the target big model determines whether the current entity belongs to the corresponding entity class. If classification is still not possible, the target big model generates the target entity class corresponding to the current entity based on the second prompt word and adds the target entity class to the target retrieval database. In the above process, the probability of determining whether an entity belongs to a certain entity class can be set to 0.5. When updating or creating an entity class, if the name is manually named, it remains unchanged; otherwise, the name can be generated by the big model using a prompt template.

[0035] In this embodiment, the relationship fusion module can be used to determine the target relationship class corresponding to the target entity class based on the relationship vector. Specifically, it first determines whether a target relationship class corresponding to the target entity class exists in the target retrieval database. If not, it determines related entity classes with an association relationship to the target entity class based on the relationship vector, and uses the target big model to generate the target relationship class corresponding to the target entity class based on the third prompt word. Then, based on each entity in the target entity class and each entity in the related entity classes, it determines the association probability between the target entity class and the related entity classes, and adds the target relationship class and association probability to the target retrieval database. Specifically, the relationship fusion module can iterate through the target entity classes to determine whether a target relationship class exists between them. If it exists and has been manually determined, it is not updated. If it does not exist, or the target relationship class has not been manually determined, it can determine related entity classes with an association relationship to the current target entity class based on the relationship vector, and use the target big model to generate the target relationship class corresponding to the target entity class based on the third prompt word. Then, the association probability between the target entity class A and the related entity class B can be calculated using "number of relationships / (number of entities in target entity class A × number of entities in entity class B)". Finally, the target relationship class and association probability can be added to the target retrieval library.

[0036] Step S14: Construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

[0037] In this embodiment, the application layer provides intelligent and flexible knowledge graph interaction capabilities to business personnel, managers, and decision support systems. The application layer comprises multiple modules, as detailed below: (1) Entity Management Module: Responsible for the automatic extraction of entities and full lifecycle management to ensure data standardization, including the following functions: 1. Entity browsing and retrieval: Supports multi-condition combined query, keyword fuzzy search and entity type filtering.

[0038] 2. View entity details: Displays basic attributes, context summary, entity class, source document, and creation method.

[0039] 3. Entity editing and management: Supports manual addition and editing, i.e., completing attributes / defining the class to which the entity belongs, and deleting entities.

[0040] (2) Entity Class Management Module: Responsible for managing the generated entity classes to ensure data accuracy, and includes the following functions: 1. Entity browsing and retrieval: Supports multi-condition queries, keyword search, and filtering by entity.

[0041] 2. View entity class details: Displays basic attributes, name, number of entities, and other information.

[0042] 3. Entity Class Editing and Management: Supports manual addition of entity classes, i.e., specifying names and assigning entities, editing entity classes, such as modifying names / adding or removing entities, deleting entity classes, and turning entities into an unassigned state.

[0043] (3) Relationship Management Module: Responsible for managing the automatically inferred and extracted relation triples, i.e., entity-relation-entity, to ensure that the relation structure is reasonable and the semantics are accurate. It includes the following functions: 1. Relationship browsing and retrieval: multi-condition filtering, relationship type filtering, and connected entity filtering.

[0044] 2. Relationship triple details: Displays the associated entity, relationship type, and source.

[0045] 3. Relationship editing and management: Modify / delete relationships, manually add relationships.

[0046] (4) Relationship Management Module: Responsible for managing the automatically inferred and extracted relation triples, i.e., entity class-relation class-entity class, ensuring structural rationality, and includes the following functions: 1. Relationship-based browsing and retrieval: Supports multi-condition filtering, relationship type filtering, and connection entity type filtering.

[0047] 2. Details of Relationship Triples: Displays the associated entity class, relationship type, source, and deterministic score.

[0048] 3. Relationship Review and Management: Review and confirm relationship classes, and set the association probability to 1 after approval; modify / delete relationship classes; manually add relationship classes.

[0049] (5) Knowledge Graph Visualization Module: Supports intuitive display of entity, relation, and attribute networks. Specifically, firstly, entities, attributes, and relations can be stored in the target graph database based on the target entity class and target relation class; entities are used as nodes, and connections are established between nodes corresponding to different entities with related relationships based on the target graph database to obtain the target knowledge graph for the water conservancy industry. The functions of the knowledge graph visualization module are as follows: 1. Knowledge Network View: Presents entity / entity class nodes and relationship / relationship class edges in a graph structure, supports drag-and-drop and zoom operations, and provides attribute highlighting and other functions to help users quickly identify key information.

[0050] 2. Implicit Relationship Discovery: If there is no direct relationship between two entities, but there is a related class between the two entity classes to which they belong, the implicit relationship will be automatically detected and displayed to help users discover potential knowledge connections.

[0051] 3. Conditional Filtering View: Allows users to filter subgraphs by entity type, relationship type, and other conditions, accurately focusing on knowledge graph content within a specific scope and improving data analysis efficiency.

[0052] (6) Intelligent Question Answering and Retrieval Module: Integrating large language models, knowledge graph semantic retrieval, and RAG technology, it provides natural language interaction services, including the following functions: 1. Natural Language Question Answering: Business users input natural language, which is then converted into query requirements by a large model. The system calls the target knowledge graph and target retrieval database to return entity attributes, relationship links, source documents, and similar content recommendations.

[0053] 2. RAG Intelligent Question Answering: Based on vector databases and target retrieval libraries, it searches for relevant text paragraphs, combines a large model to generate answers, and traces back to the original text.

[0054] 3. Intelligent recommendation and similar entity discovery: After inputting an entity, similar entities, related documents and potential relationships are recommended.

[0055] Specifically, the intelligent question answering and retrieval module can first obtain the target water conservancy information query statement input by the user, and use the target big model to convert the water conservancy information query statement into the corresponding target water conservancy information query task; then it can call the target retrieval library and target knowledge graph to execute the target water conservancy information query task, and determine the water conservancy information query result corresponding to the target water conservancy information query task based on the task execution result.

[0056] This embodiment enables unified collection, cleaning, and standardization of multi-source heterogeneous water conservancy document data, constructing an authoritative and standardized knowledge data foundation. Utilizing large-scale models and prompting-based learning-driven knowledge extraction technology improves the automation, accuracy, and coverage of knowledge extraction from complex texts in the water conservancy industry. It establishes comprehensive water conservancy industry entities, unifies semantic standards, and resolves issues of ambiguity. Knowledge fusion and implicit reasoning ensure the integrity, semantic consistency, and business usability of the knowledge graph structure, supporting intelligent decision-making. The multi-functional application layer module meets the needs of concept, entity, and relationship management, graph visualization, and intelligent question answering, improving business operability and intelligence levels. Simultaneously, this embodiment enhances the informatization and intelligence levels of the water conservancy industry, providing intelligent support for flood control scheduling, digital twins, engineering management, and auxiliary decision-making.

[0057] As can be seen from the above, this embodiment first acquires initial water conservancy document data and converts the document format of the initial water conservancy document data into a target format to obtain target water conservancy document data. Then, using a target large-scale model, it determines the entities, attributes, and relationships corresponding to the target water conservancy document data, and uses a preset embedding model to determine the entity vector, attribute vector, and relationship vector respectively. Subsequently, using the target large-scale model, it determines the target entity class corresponding to the entity based on the entity vector and attribute vector, and determines the target relationship class corresponding to the target entity class based on the relationship vector. Finally, it constructs a target knowledge graph for the water conservancy industry based on the entities, attributes, relationships, target entity classes, and target relationship classes. As can be seen from the above, this embodiment first acquires initial water conservancy document data and converts its format into a target format to obtain target water conservancy document data, laying the foundation for subsequent processing. Next, using a target large-scale model, it extracts entities, their corresponding attributes, and relationships from the target water conservancy document data, and simultaneously generates vectors corresponding to each entity, attribute, and relationship using a preset embedding model. Then, the target large model is used again to determine the target entity class corresponding to the entity based on entity vectors and attribute vectors, and the target relation class corresponding to the target entity class is determined based on relation vectors. Finally, entities, attributes, relations, target entity classes, and target relation classes are integrated to complete the construction of the water conservancy industry target knowledge graph. In this way, this embodiment achieves data standardization through format conversion, providing a unified data foundation for subsequent processing; by using the large model for knowledge extraction and classification, combined with vectors generated by the embedded model, semantic information can be captured more accurately, improving the accuracy of entity, attribute, relation, and category judgments, thereby ensuring that the constructed knowledge graph can more comprehensively and accurately reflect the knowledge system of the water conservancy industry. In this way, this embodiment can improve the construction efficiency and quality of the water conservancy industry knowledge graph, and the final knowledge graph can serve the information retrieval, analysis, and decision-making applications of the water conservancy industry, providing strong knowledge support for industry development.

[0058] Accordingly, see Figure 2 As shown in the illustration, this application also provides a knowledge graph construction device for the water conservancy industry, which may include: The format conversion module 11 is used to acquire initial water conservancy document data in the water conservancy industry and convert the document format of the initial water conservancy document data into a target format to obtain target water conservancy document data; The vector determination module 12 is used to determine the entity, the attribute, and the relationship corresponding to the target water conservancy document data using the target large model, and to determine the entity vector, the attribute vector, and the relationship vector respectively through a preset embedding model. The relationship class determination module 13 is used to determine the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model, and to determine the target relationship class corresponding to the target entity class based on the relationship vector; The knowledge graph construction module 14 is used to construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

[0059] In some specific embodiments, the vector determination module 12 may include: The first prompt word generation unit is used to generate first prompt words based on entity extraction tasks, attribute extraction tasks, and relation extraction tasks; An entity extraction unit is used to perform the entity extraction task on the target water conservancy document data based on the first prompt word using the target large model, so as to obtain the entity corresponding to the target water conservancy document data; An attribute extraction unit is used to perform the attribute extraction task on the entity based on the first prompt word using the target large model, so as to obtain the attribute corresponding to the entity; The relation extraction unit is used to perform the relation extraction task on the entity based on the first prompt word using the target large model, so as to obtain the relation corresponding to the entity.

[0060] In some specific embodiments, the water conservancy industry knowledge graph construction device may further include: The corpus determination module is used to acquire multi-source document data in the water conservancy industry and store the multi-source document data in a preset object storage database to obtain a corresponding target corpus, so as to obtain the initial water conservancy document data from the target corpus; The graph database construction module is used to build a target retrieval library based on Elasticsearch and the multi-source document data, a target vector database based on Milvus, and a target graph database based on Neo4j.

[0061] In some specific embodiments, the format conversion module 11 may include: The format conversion unit is used to convert the document format of the initial water conservancy document data into Markdown format based on preset image recognition technology and preset text extraction technology, so as to obtain the target water conservancy document data; Metadata information generation unit, used to generate metadata information corresponding to the target water conservancy document data; the metadata information includes source information, type information and author information; The data storage unit is used to store the target water conservancy document data and the metadata information into the target retrieval database.

[0062] In some specific embodiments, the water conservancy industry knowledge graph construction device may further include: A vector storage module is used to store the entity vector, the attribute vector, and the relation vector into the target vector database; Accordingly, the relationship class determination module 13 may include: An entity adding unit is used to determine whether an entity belongs to a target entity class if the target entity class corresponding to the entity exists in the target retrieval library; if it does, the entity is added to the target entity class. The similar entity determination unit is configured to, if the target entity class corresponding to the entity does not exist in the target retrieval library, retrieve the target attribute vector and the target entity vector that satisfy the preset similarity conditions in the target vector database based on the attribute vector and the entity vector corresponding to the entity, and determine the target similar entities corresponding to the target attribute vector and the target entity vector; The entity class generation unit is used to determine whether the entity belongs to the entity class corresponding to the target similar entity using the target big model. If it does not belong, the target big model is used to generate the target entity class corresponding to the entity based on the second prompt word, and the target entity class is added to the target retrieval library.

[0063] In some specific embodiments, the relationship class determination module 13 may include: The condition judgment unit is used to determine whether the target relation class corresponding to the target entity class exists in the target retrieval database; The relation class generation unit is used to determine the related entity class that has an association with the target entity class based on the relation vector if the target relation class corresponding to the target entity class does not exist in the target retrieval library, and to generate the target relation class corresponding to the target entity class based on the third prompt word using the target big model; The association probability determination unit is used to determine the association probability between the target entity class and the related entity class based on each entity in the target entity class and each entity in the related entity class, and to add the target relationship class and the association probability to the target retrieval database.

[0064] In some specific embodiments, the knowledge graph construction module 14 may include: An entity storage unit is used to store the entity, the attribute, and the relationship in the target graph database based on the target entity class and the target relationship class; The knowledge graph construction unit is used to take the entity as a node and establish connections between nodes corresponding to different entities with related relationships based on the target graph database to obtain the target knowledge graph of the water conservancy industry. Correspondingly, the water conservancy industry knowledge graph construction device may further include: The statement conversion module is used to obtain the target water conservancy information query statement input by the user, and use the target big model to convert the water conservancy information query statement into the corresponding target water conservancy information query task; The water resources information query result determination module is used to call the target retrieval database and the target knowledge graph to execute the target water resources information query task, and determine the water resources information query result corresponding to the target water resources information query task based on the task execution result.

[0065] Furthermore, embodiments of this application also disclose an electronic device, Figure 3 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the water conservancy industry knowledge graph construction method disclosed in any of the foregoing embodiments. Furthermore, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0066] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.

[0067] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0068] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the water conservancy industry knowledge graph construction method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.

[0069] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned method for constructing a knowledge graph for the water conservancy industry. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.

[0070] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.

[0071] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0072] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.

[0073] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0074] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for constructing a knowledge graph in the water conservancy industry, characterized in that, include: Acquire initial water conservancy document data from the water conservancy industry, and convert the document format of the initial water conservancy document data into a target format to obtain target water conservancy document data; The target large model is used to determine the entity, the attribute, and the relationship corresponding to the target water conservancy document data. The entity vector, the attribute vector, and the relationship vector are determined by a preset embedding model. The target entity class corresponding to the entity is determined based on the entity vector and the attribute vector using the target large model, and the target relation class corresponding to the target entity class is determined based on the relation vector; Construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

2. The method for constructing a knowledge graph in the water conservancy industry according to claim 1, characterized in that, The step of using a target large model to determine the entities corresponding to the target water conservancy document data, the attributes corresponding to the entities, and the relationships corresponding to the entities includes: First prompt words are generated based on entity extraction, attribute extraction, and relation extraction tasks; The target large model is used to perform the entity extraction task on the target water conservancy document data based on the first prompt word, so as to obtain the entity corresponding to the target water conservancy document data; The target large model is used to perform the attribute extraction task on the entity based on the first prompt word to obtain the attribute corresponding to the entity; The target large model is used to perform the relation extraction task on the entity based on the first prompt word, so as to obtain the relation corresponding to the entity.

3. The method for constructing a knowledge graph in the water conservancy industry according to claim 1, characterized in that, Also includes: Acquire multi-source document data from the water conservancy industry and store the multi-source document data in a preset object storage database to obtain a corresponding target corpus, so as to obtain the initial water conservancy document data from the target corpus; A target retrieval library is built based on Elasticsearch and the multi-source document data, a target vector database is built based on Milvus, and a target graph database is built based on Neo4j.

4. The method for constructing a knowledge graph in the water conservancy industry according to claim 3, characterized in that, The step of converting the initial water conservancy document data into a target format to obtain the target water conservancy document data includes: Based on preset image recognition technology and preset text extraction technology, the document format of the initial water conservancy document data is converted into Markdown format to obtain the target water conservancy document data; Generate metadata information corresponding to the target water conservancy document data; the metadata information includes source information, type information, and author information; The target water conservancy document data and the metadata information are stored in the target retrieval database.

5. The method for constructing a knowledge graph in the water conservancy industry according to claim 3, characterized in that, After determining the entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relation vector corresponding to the relation through a preset embedding model, the method further includes: The entity vector, the attribute vector, and the relation vector are stored in the target vector database; Accordingly, determining the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model includes: If the target entity class corresponding to the entity exists in the target retrieval library, then the target big model is used to determine whether the entity belongs to the target entity class. If it does, then the entity is added to the target entity class. If the target entity class corresponding to the entity does not exist in the target retrieval library, then based on the attribute vector corresponding to the entity and the entity vector corresponding to the entity, the target attribute vector and target entity vector that meet the preset similarity conditions are retrieved from the target vector database, and the target similar entities corresponding to the target attribute vector and the target entity vector are determined. The target big model is used to determine whether the entity belongs to the entity class corresponding to the target similar entity. If it does not belong, the target big model is used to generate the target entity class corresponding to the entity based on the second prompt word, and the target entity class is added to the target retrieval database.

6. The method for constructing a knowledge graph in the water conservancy industry according to claim 3, characterized in that, Determining the target relation class corresponding to the target entity class based on the relation vector includes: Determine whether the target relation class corresponding to the target entity class exists in the target retrieval database; If it does not exist, then based on the relation vector, determine the related entity class that has an association with the target entity class, and use the target big model to generate the target relation class corresponding to the target entity class according to the third prompt word; Based on each entity in the target entity class and each entity in the related entity class, the association probability between the target entity class and the related entity class is determined, and the target relationship class and the association probability are added to the target retrieval database.

7. The method for constructing a knowledge graph in the water conservancy industry according to any one of claims 3 to 6, characterized in that, The construction of a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class includes: Based on the target entity class and the target relationship class, the entity, the attribute, and the relationship are stored in the target graph database; The entities are used as nodes, and connections are established between nodes corresponding to different entities with related relationships based on the target graph database to obtain the target knowledge graph of the water conservancy industry. Accordingly, after constructing the target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class, the method further includes: Obtain the target water conservancy information query statement input by the user, and use the target large model to convert the water conservancy information query statement into a corresponding target water conservancy information query task; The target retrieval library and the target knowledge graph are invoked to execute the target water conservancy information query task, and the water conservancy information query result corresponding to the target water conservancy information query task is determined based on the task execution result.

8. A knowledge graph construction device for the water conservancy industry, characterized in that, include: The format conversion module is used to acquire initial water conservancy document data from the water conservancy industry and convert the document format of the initial water conservancy document data into a target format to obtain the target water conservancy document data. The vector determination module is used to determine the entity corresponding to the target water conservancy document data, the attribute corresponding to the entity, and the relationship corresponding to the entity using the target large model, and to determine the entity vector corresponding to the entity, the attribute vector corresponding to the attribute, and the relationship vector corresponding to the relationship respectively through a preset embedding model; The relationship class determination module is used to determine the target entity class corresponding to the entity based on the entity vector and the attribute vector using the target large model, and to determine the target relationship class corresponding to the target entity class based on the relationship vector; The knowledge graph construction module is used to construct a target knowledge graph for the water conservancy industry based on the entity, the attribute, the relationship, the target entity class, and the target relationship class.

9. An electronic device, characterized in that, The electronic device includes a processor and a memory; wherein the memory is used to store a computer program, which is loaded and executed by the processor to implement the water conservancy industry knowledge graph construction method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Used to store computer programs, which, when executed by a processor, implement the water conservancy industry knowledge graph construction method as described in any one of claims 1 to 7.