Construction method of time sequence knowledge graph in water conservancy field based on T-ATLOP model
By constructing a time-series knowledge graph in the water conservancy field based on the T-ATLOP model, the problem that static knowledge graphs cannot capture temporal changes is solved, the structured conversion of data and knowledge visualization in the water conservancy field are realized, and the emergency response capabilities and support for intelligent question-answering systems are improved.
Patent Information
- Application Number
- CN202410330539.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-21
- Publication Date
- 2025-09-26
AI Technical Summary
Existing static knowledge graphs cannot effectively capture knowledge that changes over time, and are unable to meet the needs of emergency response and intelligent question-answering systems in the water conservancy field.
A method for constructing a temporal knowledge graph in the water conservancy field based on the T-ATLOP model is adopted. By acquiring and annotating water conservancy data, a two-stage labeling strategy and the T-ATLOP model are used for knowledge extraction, and the subject-relationship-time-object quadruple data is constructed and visualized in a graph database.
It has achieved the integration and knowledge-based development of multi-source heterogeneous data in the water conservancy field, improved the emergency response capabilities of sudden incidents, and provided knowledge support for the intelligent assisted question-answering system.
Smart Images

Figure CN120705252A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of knowledge graph construction, and in particular to a method for constructing a time-series knowledge graph in the water conservancy field based on a T-ATLOP model. Background Art
[0002] A knowledge graph is a series of diverse graphics that display the development and structural relationships of knowledge. It uses visualization technology to describe knowledge resources and their carriers, and to mine, analyze, construct, map, and display knowledge and its interrelationships. By combining theories and methods from applied mathematics, graphics, information visualization, and information science with methods like citation analysis and co-occurrence analysis, knowledge graphs utilize visual graphs to vividly display the core structure, development history, cutting-edge fields, and overall knowledge architecture of a discipline, achieving a modern theory of multidisciplinary integration. This provides a practical and valuable reference for disciplinary research.
[0003] With the rapid development of information collection and transmission technologies and the progress of domain informatization, domain data is constantly updated, the amount of data is increasing, and semantic inconsistencies between data are common. Multi-source heterogeneous data is characterized by massive, dynamic, diverse content, and complex processing. How to interconnect distributed, stored, and managed data with different semantics, fully explore the value of domain data, and promote the efficient use of information resources is the key to promoting smart water conservancy. Using new information technology to improve water information technology, fully realizing the value of data, focusing on building application systems, assisting the refinement and intelligence of water industry management, conducting in-depth data fusion and mining applications, and resolving information silos. In recent years, research on knowledge graphs has mostly focused on static knowledge graphs that do not change over time, and there has been little exploration of time-varying knowledge graphs. Summary of the Invention
[0004] The purpose of this paper is to provide a method for constructing a time-series knowledge graph in the water conservancy field based on the T-ATLOP model. Embedding time-series information into the knowledge graph can help provide better knowledge support for subsequent relationship analysis, literature mining, question-and-answer interaction, and other tasks.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A method for constructing a time series knowledge graph in the water conservancy field based on the T-ATLOP model, characterized by comprising the following steps:
[0007] S1: Obtain basic water conservancy census data and perform document processing; the basic data includes structured data of the water conservancy census, and the document processing is performed using a large language model;
[0008] S2: Acquire water conservancy information related data, including water conservancy related event information report data extracted from the websites of various water conservancy departments;
[0009] S3: Use a two-stage labeling strategy to annotate the time, entity, and relationship of the data in S1 and S2 to obtain a document-level time series dataset in the water conservancy field;
[0010] S4: performing knowledge extraction on the water conservancy field document-level time series dataset based on the T-ATLOP model to obtain a water conservancy field time series quadruple;
[0011] S5: Store the quadruple in the graph database to complete the visualization construction of the time series knowledge graph in the water conservancy field.
[0012] Furthermore, the step 1 includes the following steps:
[0013] S1.1: Define entity classes, attributes, and relationships in the water conservancy field
[0014] S1.2: Structured data is based on the national water conservancy census data, and the water conservancy information is analyzed and summarized to obtain entity information.
[0015] S1.3: Considering the diversity of prompts and the coverage of information, a "two-step" prompt strategy is proposed for the construction of Prompt templates in the water conservancy field. The prompt template is generated according to the entity information in S1.2.
[0016] S1.4: Return relevant documents using the large language model based on the entity information in S1.2 and the prompt template in S1.3.
[0017] Furthermore, the step 2 includes the following steps:
[0018] S2.1: The data source for this part is the water conservancy news and local water affairs columns on the Ministry of Water Resources website. The web crawler keyword is defined as "water conservancy information";
[0019] S2.2: After crawling the page according to the initial URL, parse and retain the title and text, and then filter out valuable information, such as news events, from the parsed data according to the manually formulated rules and logic.
[0020] Furthermore, the "two-stage" labeling strategy in step 3 includes the following steps:
[0021] S3.1: The annotation process is divided into machine-assisted annotation based on hint engineering and heuristic annotation based on general disambiguation rules.
[0022] S3.2: Prompt engineering is divided into three strategies. The first strategy uses delimiters to clearly represent different parts of the input to avoid "prompt injection"; the second strategy requires structured output to improve the accuracy and consistency of the output and avoid ambiguity or errors in the output results; the third strategy: few-shot prompt, before asking the model to perform the actual task, provide the model with examples of successful performance of the required task, that is, manually annotate a small number of articles as prompts.
[0023] S3.3: We then perform heuristic annotation and design several general disambiguation rules to ensure consistency within the annotation guidelines. For example, when annotating entities, we remove all adjectives and only annotate the "entity head".
[0024] Furthermore, the knowledge extraction based on the T-ATLOP model in step 4 includes the following steps:
[0025] S4.1: Based on the ATLOP model, add the time perception layer and information fusion layer to construct the T-ATLOP model.
[0026] S4.2: The input of the T-ATLOP model is sequence-cut and then input into the DeBERTa model in the pre-training layer. DeBERTa uses a dual-vector method of content and position embedding to embed the token at position i in the text using two vectors, H i and P i|j represents it, which respectively represent its content and its relative position to the mark at position j;
[0027] S4.3: The entity relationship extraction layer is responsible for completing the content sub-vector H i Perform entity extraction and then use the position sub-vector P i|j After performing relation extraction, the probability distribution output of the entity relationship is obtained, and the entity relationship with the highest probability is selected as the credible triple (s, r, o), and then the relevant context is output through the Transformer decoder;
[0028] S4.4: Use the time extraction layer to extract the time information t from the relevant context and output it separately. Finally, t is fused with (s, r, o) to form a four-tuple (s, r, o, t) and saved in a CSV file.
[0029] Furthermore, the graph visualization in step 5 includes the following steps:
[0030] S5.1: Based on the definitions of entities in S1.1 and the logic of "object subject - relationship - time - object object", construct the ontology schema in the graph database NebulaGraph;
[0031] S5.2: Based on the CSV files in S4.4, batch fill the knowledge graph quadruple to complete data storage and knowledge graph visualization.
[0032] Compared with the prior art, the present invention has the following beneficial effects:
[0033] This paper proposes a method for constructing a temporal knowledge graph for the water conservancy sector based on the T-ATLOP model. This method can perform structured conversion on water conservancy-related data, extracting water conservancy entity information and temporal information from document-level data and converting it into "subject-relationship-time-object" quadruple data. This solves the problem of integrating and knowledge-based multi-source heterogeneous data, completing the construction of a temporal knowledge graph for the water conservancy sector. Using water conservancy entities as the basic clues, through knowledge reasoning and knowledge visualization, this method solves the problem of hydrologists' difficulty in quickly acquiring water conservancy knowledge from multi-source data. This method facilitates the utilization of water conservancy data in emergency response, thereby improving emergency response capabilities and providing a reference solution for the development and design of intelligent-assisted question-answering systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] In order to more clearly illustrate the technical solutions proposed in the present invention and their implementation effects, the following drawings are used to facilitate understanding of the relevant technical processes and implementation results.
[0035] Figure 1 This is a basic method flow chart of the present invention.
[0036] Figure 2 This is a diagram of the two-step prompt template generation method of the present invention.
[0037] Figure 3 This is a diagram of the data crawler method of the present invention.
[0038] Figure 4 Schematic diagram of the two-stage labeling method of the present invention.
[0039] Figure 5 This is a structural diagram of the T-ATLOP model of the present invention.
[0040] Figure 6 An example diagram of entity relationships around water conservancy information in the temporal knowledge graph constructed for the present invention. DETAILED DESCRIPTION
[0041] The following examples illustrate the specific implementation of the present invention, demonstrating how the present invention uses intelligent technology to solve the problem of constructing a time-series knowledge graph in the water conservancy field against multi-source heterogeneous data and achieve the technical effect. This paper uses water conservancy information as an example, using the Hebei Province Water Conservancy Census as the primary data source, integrating data from provincial and municipal water conservancy departments, and designing algorithms to achieve data fusion and knowledge representation.
[0042] Example 1:
[0043] like Figure 1 As shown in FIG, a method for constructing a time series knowledge graph in the water conservancy field based on the T-ATLOP model includes the following steps:
[0044] S1: Obtain basic water conservancy census data and perform document processing; the basic data includes structured data of the water conservancy census, and the document processing is performed according to the prompt template through the large language model;
[0045] S1.1: This section is as follows Figure 2 As shown, the requirement prompt section uses delimiters to isolate the rule text to be processed from other content, effectively reducing conflicts between prompts. It also provides the document's core theme or main content, as well as guidance on input and output data formats. This approach not only regularizes the output text but also facilitates parsing and subsequent operations. The small sample prompt section provides document examples generated from water conservancy survey data, common sense tips and expert experience in the water conservancy field, and links to similar documents, further activating the LLM's generative capabilities.
[0046] S1.2: Use LLM to analyze the data based on the template prompts generated in S1.1, forming a complete sentence. Then, perform grammatical and semantic checks and corrections to ensure fluency and accuracy before outputting it. For example, "Donghuangyu Reservoir is located in Jiushan Village, Donghuangyu Town, Qianxi County, Hebei Province. It is a medium-sized reservoir in the Luanhe Mountain Area (C010100)."
[0047] As an embodiment of the present invention, the relevant hydrological concepts are derived from the object class identification definitions defined in the water conservancy industry standard "Basic Database Table Structure and Identifiers of Water Conservancy Objects" approved by the Ministry of Water Resources; the basic water conservancy object data is derived from the Hebei Province Water Conservancy Census Data, which is tabular data.
[0048] S2: Acquire water conservancy information related data, including water conservancy related event information report data extracted from the websites of various water conservancy departments;
[0049] S2.1: The data source for this part is the water conservancy news and local water affairs columns on the Ministry of Water Resources website. The web crawler keyword is defined as "water conservancy information";
[0050] S2.2: After crawling the page based on the initial URL, parse and retain the title and body text, and then filter out valuable information from the parsed data based on manually formulated rules and logic, such as news events.
[0051] The step 2.2 includes the following steps
[0052] S2.2.1: Define the crawler's keyword as "water conservancy information" and then input the initially set URLs as the crawler program, i.e., URL links to water conservancy news and local water affairs in the Ministry of Water Resources of the People's Republic of China;
[0053] S2.3.2: Parse the data of the web page, among which, the simulated click module used in this article adopts the automated testing tool Selenium, which can simulate the behavior of the browser, such as opening a web page, entering keywords, clicking buttons, etc., so as to crawl the website information. After simulating the click, search for keywords on the new page to determine whether the web page has reached the correct page. If it meets the requirements, proceed to the next step, otherwise continue to click on the next web page. The page data parser uses the Python library Beautiful Soup to implement the function of the page data parser. It can easily extract the required data from HTML, such as titles, text, etc., and then filter out valuable information from the parsed data according to manually formulated rules and logic, such as news events. Finally, save this information in a local file in json format;
[0054] S3: Use a two-stage labeling strategy to annotate the time, entity, and relationship of the data in S1 and S2 to obtain a document-level time series dataset in the water conservancy field, such as Figure 4 As shown;
[0055] S3.1: The annotation process is divided into machine-assisted annotation based on hint engineering and heuristic annotation based on general disambiguation rules.
[0056] S3.2: Prompt engineering is divided into three strategies. The first strategy uses delimiters to clearly indicate different parts of the input to avoid "prompt injection" (for example: "###Classification###Entity Type 1: River"); the second strategy requires structured output to improve the accuracy and consistency of the output and avoid ambiguity or errors in the output results (for example: "###Output format requires ###JSON format, use start and end to mark character positions"); the third strategy: few-shot prompt, before asking the model to perform the actual task, provide the model with examples of successful performance of the required task, that is, manually annotate a small number of articles as prompts.
[0057] S3.3: Heuristic annotation was then performed, and several general disambiguation rules were designed to ensure consistency within the annotation guidelines. For example, when annotating entities, all adjectives were removed, and only the entity head was annotated (for example, "Xinjiang Kurgan Water Conservancy Project" was changed to "Kurgan Water Conservancy Project", and "project" was changed to "Kurgan Water Conservancy Project").
[0058] S4: The water conservancy field document-level time series dataset is subjected to knowledge extraction based on the T-ATLOP model to obtain the water conservancy field time series quadruple, such as Figure 5 shown.
[0059] S4.1: Based on the ATLOP model, add the time perception layer and information fusion layer to construct the T-ATLOP model.
[0060] S4.2: The input of the T-ATLOP model is sequence-cut and then input into the DeBERTa model in the pre-training layer. DeBERTa uses a dual-vector method of content and position embedding to embed the token at position i in the text using two vectors, H i and P i|j represents it, which respectively represent its content and its relative position to the mark at position j;
[0061] S4.3: The entity relationship extraction layer is responsible for completing the content sub-vector H i Perform entity extraction and then use the position sub-vector P i|j After performing relation extraction, the probability distribution output of the entity relationship is obtained, and the entity relationship with the highest probability is selected as the credible triple (s, r, o), and then the relevant context is output through the Transformer decoder;
[0062] S4.4: Use the time extraction layer to extract the time information t from the relevant context and output it separately. Finally, t is fused with (s, r, o) to form a four-tuple (s, r, o, t) and saved in a CSV file.
[0063] S5: Store the quadruple in the graph database to complete the visualization of the time series knowledge graph in the water conservancy field, such as Figure 6 shown.
[0064] S5.1: Based on the definitions of entities in S1.1 and the logic of "object subject - relationship - time - object object", construct the ontology schema in the graph database NebulaGraph;
[0065] S5.2: Based on the CSV files in S4.4, batch fill the knowledge graph quadruple to complete data storage and knowledge graph visualization.
Claims
1. A method for constructing a time series knowledge graph in the field of water conservancy based on the T-ATLOP model, characterized in that: The following steps are involved: S1: Obtain basic water conservancy census data and perform document processing; the basic data includes structured data of the water conservancy census, and the document processing is performed using a large language model; S2: Acquire water conservancy information related data, including water conservancy related event information report data extracted from the websites of various water conservancy departments; S3: Use a two-stage labeling strategy to annotate the time, entity, and relationship of the data in S1 and S2 to obtain a document-level time series dataset in the water conservancy field; S4: performing knowledge extraction on the water conservancy field document-level time series dataset based on the T-ATLOP model to obtain a water conservancy field time series quadruple; S5: Store the quadruple in the graph database to complete the visualization construction of the time series knowledge graph in the water conservancy field.
2. According to claim 1, the method for constructing a time series knowledge graph in the field of water conservancy, step S1 comprises the following steps: S1.1: Define entity classes, attributes, and relationships in the water conservancy field S1.2: Structured data is based on the national water conservancy census data, and the water conservancy information is analyzed and summarized to obtain entity information. S1.3: Considering the diversity of prompts and the coverage of information, a "two-step" prompt strategy is proposed for the construction of Prompt templates in the water conservancy field. The prompt template is generated according to the entity information in S1.
2. S1.4: Return relevant documents using the large language model based on the entity information in S1.2 and the prompt template in S1.
3.
3. The method for constructing a time series knowledge graph in the field of water conservancy according to claim 1 is characterized in that: The step S2 comprises the following steps: S2.1: The data source for this section is the water conservancy news and local water affairs columns on the Ministry of Water Resources website. The web crawler keyword is defined as "water conservancy information"; S2.2: After crawling the page based on the initial URL, parse and retain the title and body text, and then filter out valuable information, such as news events, from the parsed data based on manually formulated rules and logic.
4. According to claim 1, it is characterized in that In the method for constructing a time-series knowledge graph in the water conservancy field, the "two-stage" annotation strategy in step S3 includes the following steps: S3.1: The annotation process is divided into machine-assisted annotation based on hint engineering and heuristic annotation based on general disambiguation rules. S3.2: Hint engineering is divided into three strategies. The first strategy uses delimiters to clearly represent different parts of the input and avoid "hint injection"; The second strategy requires structured output to improve the accuracy and consistency of the output and avoid ambiguity or errors in the output results; the third strategy: few-shot prompt, before asking the model to perform the actual task, provide the model with examples of successfully performing the required task, that is, manually annotate a small number of articles as prompts. S3.3: We then perform heuristic annotation and design several general disambiguation rules to ensure consistency within the annotation guidelines. For example, when annotating entities, we remove all adjectives and only annotate the "entity head." 5. According to claim 1, it is characterized in that The process of implementing knowledge extraction based on the T-ATLOP model in step S4 of the water conservancy field time series knowledge graph construction method is as follows: S4.1: Based on the ATLOP model, add the time perception layer and information fusion layer to construct the T-ATLOP model. S4.2: The input of the T-ATLOP model is sequence-cut and then input into the DeBERTa model in the pre-training layer. DeBERTa uses a dual-vector method of content and position embedding to embed the token at position i in the text using two vectors, H i and P i|j represents it, which respectively represent its content and its relative position to the mark at position j; S4.3: The entity relationship extraction layer is responsible for completing the content sub-vector H i Perform entity extraction and then use the position sub-vector P i|j After performing relation extraction, the probability distribution output of entity relations is obtained, and the entity relation with the highest probability is selected as the credible triple (S, r, o), and the relevant context is output through the Transformer decoder; S4.4: Use the time extraction layer to extract the time information t from the relevant context and output it separately. Finally, t is fused with (s, r, o) to form a four-tuple (s, r, o, t) and saved in a CSV file.
6. According to claim 1, the step S5 of the method for constructing a time series knowledge graph in the water conservancy field comprises the following steps: S5.1: Based on the definitions of entities in S1.1 and the logic of "object subject - relationship - time - object", construct an ontology schema in the graph database NebulaGraph; S5.2: Based on the CSV files in S4.4, batch fill the knowledge graph quadruple to complete data storage and knowledge graph visualization.
Citation Information
Cited By
River network modeling and question-answering method based on time sequence knowledge graph
CN121350276A
River network modeling and question answering method based on time sequence knowledge graph
CN121350276B