Temporal knowledge graph federated collaborative optimization method, system, device and storage medium
Through the federated collaborative optimization method of temporal knowledge graph based on causal inference, causal features are accessed and labeled in real time, which solves the conflicts and update efficiency problems of temporal knowledge graph in dynamic scenarios, and realizes efficient and explainable knowledge management and decision support, which is suitable for intelligent decision-making in fields such as finance and medical care.
Patent Information
- Application Number
- CN202511121310.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-12
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2045-08-12
AI Technical Summary
Existing temporal knowledge graph systems have problems such as rough temporal conflict resolution, low model update efficiency, and lack of explainability when dealing with dynamically changing knowledge conflicts. In particular, they lack an effective federated collaborative optimization mechanism in a multi-source heterogeneous data environment, making it difficult to balance local knowledge characteristics with global model consistency.
A causal inference-based federated collaborative optimization method for temporal knowledge graphs is adopted. By real-time access to multi-domain heterogeneous data streams, spatiotemporal alignment and causal feature extraction are performed to generate enhanced knowledge units with causal tags. Multi-dimensional causal analysis is used to calculate the conflict score between new and old knowledge. A hierarchical aggregation strategy is used to update the entity embedding layer and the relationship prediction layer. Natural language queries for counterfactual conditions are parsed to generate counterfactual impact reports.
It achieves improved quality of intelligent decision-making in dynamic scenarios, solves the update lag and semantic thinness problems of traditional knowledge graphs through real-time data access and causal feature labeling, ensures the accurate integration and efficient updating of knowledge, provides explainable causal reasoning support, and meets the predictive decision-making needs in high-risk fields such as finance and healthcare.
Abstract
Description
Technical Field
[0001] The present invention relates to the field of knowledge graph technology, and specifically to a time-series knowledge graph federated collaborative optimization method, a time-series knowledge graph federated collaborative optimization system, a computer device, and a computer-readable storage medium. Background Art
[0002] With the advent of the big data era, knowledge graphs, as a structured knowledge representation method, have been widely used in fields such as intelligent decision-making, information retrieval, and knowledge management. In particular, temporal knowledge graphs, by introducing the time dimension, can better represent dynamically evolving knowledge systems, providing intelligent systems with richer semantic understanding capabilities.
[0003] Existing methods for building decision models in big data environments typically use a multi-source heterogeneous data fusion approach, including sensor time series data, expert rule bases, and prior knowledge of device causal relationships. This approach constructs a standardized training dataset, uses causal discovery algorithms to extract explicit causal relationships from historical data, and combines this with prior knowledge from device manuals to generate an interpretable knowledge graph. This approach improves the accuracy and interpretability of decision models to a certain extent.
[0004] However, existing temporal knowledge graph systems are still insufficient in handling dynamically changing knowledge conflicts. Specifically, the following key issues still exist in dynamic scenarios:
[0005] First, existing systems are too crude when handling temporal conflicts, relying primarily on simple substitutions of chronological order and failing to effectively handle complex causal relationships. In particular, when new and old knowledge conflict, the lack of intelligent decision-making mechanisms based on causal inference leads to low-quality knowledge updates and may even introduce erroneous information.
[0006] Secondly, traditional knowledge graph models suffer from inefficient updates. Existing incremental learning methods typically require full data transmission to a central server, which not only incurs significant communication overhead but also potentially raises data privacy concerns. This is particularly true in environments with multi-source, heterogeneous data, where the lack of an effective federated collaborative optimization mechanism makes it difficult to balance local knowledge characteristics with global model consistency.
[0007] Finally, existing knowledge graph reasoning systems lack deep explainability, especially when answering counterfactual questions such as "What would have happened if event X hadn't occurred?" These types of questions require the system to be able to perform causal inference rather than simple correlation analysis, but existing technologies still have limited support in this area.
[0008] In summary, there is an urgent need for a temporal knowledge graph optimization method that can effectively resolve temporal conflicts, improve model updating efficiency and support counterfactual reasoning to meet the needs of intelligent decision-making in a dynamic knowledge environment. Summary of the Invention
[0009] In view of this, in order to solve the technical problems of existing knowledge graph systems in dynamic scenarios, such as rough temporal conflict resolution, low model update efficiency and lack of explainability of reasoning, the purpose of the present invention is to propose a temporal knowledge graph federated collaborative optimization method based on causal inference, aiming to enhance dynamic adaptability and thus improve the quality of intelligent decision-making in dynamic knowledge environments.
[0010] Based on the above objectives, in a first aspect, the present invention provides a method for federated collaborative optimization of a temporal knowledge graph based on causal inference, which comprises the following steps:
[0011] Access multi-domain heterogeneous data streams in real time and perform spatiotemporal alignment operations on the heterogeneous data streams;
[0012] Extracting causal features from the heterogeneous data stream to generate enhanced knowledge units with causal tags;
[0013] Calculate the conflict scores between new and old knowledge based on multi-dimensional causal analysis, implement conflict resolution and version management through a decision tree mechanism, and output a time-series knowledge graph with historical traceability;
[0014] Among distributed nodes, node weights are dynamically allocated based on knowledge entropy, and a hierarchical aggregation strategy is used to update the entity embedding layer and relationship prediction layer to output a global optimization model.
[0015] Parse natural language queries containing counterfactual conditions, extract causal subgraphs from temporal knowledge graphs, perform intervention calculations, and generate counterfactual impact reports.
[0016] Preferably, the spatiotemporal alignment operation includes:
[0017] Normalize heterogeneous timestamps to UTC format according to ISO 8601 standard;
[0018] Resolve geographic location into latitude and longitude and geographic entity ID through GIS service;
[0019] When spatiotemporal logic conflicts are detected, dynamic calibration is performed based on the data source credibility weights and causal characteristics.
[0020] Preferably, the extraction of the causal features includes:
[0021] Perform Granger causality test on time series relationships to screen significant associations;
[0022] For the relationship pairs that pass the test, the Do operator intervention effect quantification is performed;
[0023] The Granger correlation coefficient and the Do intervention effect value were combined to obtain the causal confidence score Sc;
[0024] The causal strength and transmission chain are marked based on the causal confidence score Sc.
[0025] Preferably, the enhanced knowledge unit with causal labeling is a quadruple<e, r, o, [t, causality_flag]> , the timestamp t and the causality flag causality_flag are encapsulated together in a single array slot; where:
[0026] e, r, o, are standard knowledge graph triple elements;
[0027] t is the timestamp in ISO 8601 format;
[0028] causality_flag is a structured dictionary containing the following fields:
[0029] strength: strength classification based on causal confidence score Sc;
[0030] confidence: causal confidence score Sc;
[0031] chain: compressed causal propagation chain list.
[0032] Preferably, the conflict resolution based on multi-dimensional causal analysis includes:
[0033] The time series correlation of the change in the old-new relationship is calculated by Granger test;
[0034] The Do operator intervention effect is used to quantify the difference in causal impact of the new and old relationships on the target object;
[0035] The fusion is configured according to the domain weights to generate the causal confidence score Sc;
[0036] Intelligent diversion is achieved based on a dynamic threshold θ: when Sc>θ, old knowledge is automatically replaced and the causal chain is marked, while retaining historical snapshots to support retrospective auditing; when Sc≤θ, the original valid knowledge is retained and manual review is triggered;
[0037] The version management includes:
[0038] Convert the replaced knowledge into historical snapshots, storing the causal chain and expiration time;
[0039] Add a version identifier to the time series knowledge graph, where the version identifier includes update time information and the number of causal conflict resolutions;
[0040] Provides a timestamp-based historical status rollback interface.
[0041] Preferably, the hierarchical aggregation strategy includes:
[0042] The entity embedding layer is aggregated using the FedAvg algorithm;
[0043] The relationship prediction layer uses a causal-sensitive learning rate to perform local gradient updates and globally aggregates the encrypted relationship prediction layer gradients.
[0044] The gradient of the entity embedding layer is transmitted in plain text, the gradient of the relationship prediction layer is transmitted after homomorphic encryption, and the global optimization model is output.
[0045] Preferably, the generation of the counterfactual impact report includes:
[0046] Parse natural language queries and extract entities, target relations, and counterfactual conditions;
[0047] Backtrack the propagation path from the causal tag field of the temporal knowledge graph;
[0048] Construct a minimum causal diagram containing intervention variable X, target variable Y and confounding variable Z;
[0049] Calculate the intervention probability P(Y|do(X)) of the baseline scenario based on historical data regression;
[0050] Generate intervention probability P(Y|do(¬X)) of counterfactual scenarios through virtual environment simulation;
[0051] Calculate the causal influence Delta Y = P(Y|do(X)) - P(Y|do(¬X)) and append the confidence interval;
[0052] The counterfactual impact report includes: quantitative indicators and data traceability of the baseline scenario and counterfactual scenario, statistical significance identification of causal impact, and a visual causal evidence chain decision tree;
[0053] The causal subgraph extraction includes:
[0054] Traverse the causality_flag.chain field backward from the target variable Y to locate the complete causal path;
[0055] Determine the intervention variable X based on the counterfactual condition and screen the confounding variable Z connecting X and Y;
[0056] Remove the edges with confidence Sc≤θ to generate a minimum causal graph with time series labels;
[0057] Outputs a structured subgraph, including intervention variables, target variables, confounding variables, and confidence of the evidence chain.
[0058] On the other hand, the present invention also provides a temporal knowledge graph federated collaborative optimization system based on causal inference, which includes:
[0059] A dynamic data source module is used to access multi-domain heterogeneous data streams in real time, perform spatiotemporal alignment operations on the heterogeneous data streams, extract causal features from the heterogeneous data streams, and generate enhanced knowledge units with causal tags;
[0060] The causal-driven incremental update module calculates the conflict score between new and old knowledge based on multi-dimensional causal analysis, implements conflict resolution and version management through a decision tree mechanism, and outputs a time-series knowledge graph with historical traceability;
[0061] The federated collaborative fine-tuning module is used to dynamically allocate node weights among distributed nodes based on knowledge entropy, update the entity embedding layer and relationship prediction layer using a hierarchical aggregation strategy, and output a global optimization model;
[0062] The counterfactual reasoning engine is used to parse natural language queries containing counterfactual conditions, extract causal subgraphs from the temporal knowledge graph, perform intervention calculations, and generate counterfactual impact reports.
[0063] In another aspect of the present invention, a computer device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, any of the above-mentioned methods for federated collaborative optimization of temporal knowledge graphs based on causal inference is executed.
[0064] In another aspect of the present invention, a computer-readable storage medium is provided, which stores computer program instructions, and when the computer program instructions are executed, the method for federated collaborative optimization of temporal knowledge graphs based on causal inference described above is implemented.
[0065] Compared with the existing technology, the present invention significantly improves the application effect of temporal knowledge graphs in dynamic scenarios by introducing causal inference mechanism and federated collaborative optimization strategy.
[0066] Specifically, the time series knowledge graph federation collaborative optimization method and system of the present invention have the following beneficial effects:
[0067] (1) This invention constructs an enhanced knowledge unit with temporal association and causal semantics through real-time data access, spatiotemporal alignment, and causal feature tagging, solving the problems of delayed updates and thin semantics in traditional knowledge graphs in dynamic scenarios. Based on the conflict decision-making mechanism of multi-dimensional causal analysis and federated optimization weighted by knowledge entropy, it achieves accurate integration and efficient update of key knowledge while protecting data privacy, overcoming the pain points of knowledge fragmentation and inefficient update in distributed environments. Through the counterfactual reasoning engine, natural language queries are converted into computable causal intervention models, generating decision reports with interpretable evidence chains, enabling the system to not only answer "what happened" but also deduce "what would happen if it did not happen", providing intelligent support with both timeliness, accuracy, and interpretability for predictive decision-making in high-risk fields such as finance and healthcare. The entire technical solution forms a closed loop from dynamic knowledge acquisition, collaborative optimization to causal reasoning, realizing a qualitative change in the knowledge management system from passive response to active cognition.
[0068] (2) Real-time access and spatiotemporal alignment break through the hysteresis of traditional batch processing, enabling the standardized integration of dynamic data such as financial policies and medical guidelines within seconds, eliminating logical conflicts caused by time zone / regional differences, and supporting minute-level responses in scenarios such as risk warnings; through the ISO 8601 standard, the mandatory unified time expression eliminates the time ambiguity caused by time zone or format differences in multi-source data such as financial transactions and medical records, and builds a reliable time benchmark for subsequent causal analysis; through dynamic verification of data source credibility weights (such as central bank data weight > social media) and causal characteristics (such as policies must precede market reactions), spatiotemporal logical contradictions are automatically identified and corrected (such as the time of event occurrence is earlier than the monitoring time), ensuring the rigor of spatiotemporal deduction of knowledge graphs in scenarios such as financial supervision.
[0069] (3) Causal feature extraction converts raw data into enhanced knowledge units with strength tags and propagation chains, solving the defect of traditional knowledge graphs that only record static associations, providing explainable causal basis for incremental updates, and avoiding the accidental deletion of historical valid knowledge; screening statistically significant associations from the time series dimension through Granger causality test, effectively filtering out the pseudo-correlations generated by noise data, and providing high-quality candidate causal pairs for subsequent analysis; using the Do operator to intervene and calculate the true causal effect between quantitative variables, breaking through the limitation of traditional statistical methods that cannot distinguish between correlation and causality, ensuring the analytical reliability of high-risk scenarios such as medical side effect inference and financial policy impact assessment; integrating time series statistical intensity and intervention effect values to derive a comprehensive causal confidence score, and marking the causal strength level (strong / weak / none) and propagation path accordingly, so that the knowledge unit not only records "whether it is related" but also reveals "how it is causally related", providing explainable and quantifiable causal semantic support for counterfactual reasoning and incremental updates.
[0070] (4) Structured causal labels directly support the counterfactual reasoning engine to construct a minimal causal subgraph, enabling the system to answer the decision-making question of "what if event X did not occur", achieving a transition from passive response to active cognition.
[0071] (5) Based on the multi-dimensional causal scoring of Granger temporal correlation and Do operator intervention effect, the essential causes of knowledge conflicts can be scientifically distinguished (such as true conflicts caused by policy iterations vs. pseudo conflicts caused by data noise), avoiding the accidental deletion of effective historical knowledge by traditional time coverage mechanisms, and ensuring the integrity of core knowledge in scenarios such as financial risk control and medical diagnosis.
[0072] (6) The decision tree mechanism realizes automatic diversion through dynamic thresholds. Strong causal conflicts are updated immediately and weak conflicts are transferred to manual review, which greatly reduces the frequency of manual intervention and achieves a balance between automatic updating of strong causal knowledge and manual review of edge cases. It avoids the efficiency bottleneck of traditional full manual review and prevents the automatic deletion of key historical solutions.
[0073] (7) The replaced knowledge is stored as a historical snapshot containing a causal chain and time stamp, forming a complete chain of evidence of knowledge change, making key decision-making processes such as financial policy adjustments or medical plan iterations auditable; precise version control of the knowledge graph state is achieved through version identification (update time t + conflict resolution times c), supporting the rapid positioning of the knowledge state at a specific point in time; the timestamp-based rollback interface allows the system to trace back any historical version and verify the knowledge evolution logic, which not only meets the regulatory compliance requirements for process traceability, but also provides technical support for knowledge error correction and case review, and builds a full-cycle management system for knowledge from generation, update to elimination, providing a transparent and reliable knowledge evolution framework for decision-making processes in high-risk areas.
[0074] (8) The timestamp and causal tag are encapsulated into a compact array structure design, which achieves lossless embedding of temporal information and causal semantics while retaining the compatibility of traditional knowledge graph triples, so that dynamic data such as financial transactions and medical records can be traced in time series and deduced along the causal chain; the strength classification (such as strong / weak causality) and confidence score (Sc) in the causal tag dictionary form a double verification mechanism, providing a quantitative basis for knowledge update decisions and avoiding the interference of low-confidence causal relationships on risk control models or diagnostic systems.
[0075] (9) Based on the dynamic allocation of weights based on knowledge entropy, the updates of nodes with high information entropy are aggregated first, breaking through the limitation of traditional federated learning that aggregates data equally according to the amount of data, and improving the model's accuracy in capturing dynamics in key areas.
[0076] (10) The hierarchical aggregation strategy uses the standard FedAvg to maintain stability in the entity embedding layer and applies a causal-sensitive learning rate to the relationship prediction layer, so that high-value causal chains obtain higher training weights, strengthen the weight update of high-confidence causal chains, achieve rapid convergence of hot knowledge, and improve the model's accuracy in capturing key relationships; through the hierarchical security strategy of gradient homomorphic encryption at the relationship layer and plaintext transmission at the entity layer, the optimal balance between privacy protection and computational efficiency is achieved.
[0077] (11) Through natural language parsing and causal subgraph extraction, fuzzy hypothetical problems are transformed into computable causal intervention models, enabling the system to quantitatively assess the impact of events that have not occurred (such as the potential consequences of policy adjustments or medical interventions); based on causal labeling and intervention calculations of the time-series knowledge graph, a structured report containing baseline values, counterfactual values and impact is generated, breaking through the limitations of the traditional black box model's lack of interpretability and providing a transparent and traceable chain of evidence for decision-making; through virtual environment simulation and confounding variable control, the scientific nature and reliability of counterfactual reasoning are ensured, meeting the high requirements for decision-making rigor and auditability in fields such as financial risk control and medical diagnosis. DETAILED DESCRIPTION
[0078] The technical solutions of the present invention will be described clearly and completely below with reference to specific embodiments. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without inventive effort are also within the scope of protection of the present invention.
[0079] Example 1
[0080] This embodiment provides a method for federated collaborative optimization of a temporal knowledge graph based on causal inference. The specific implementation steps are as follows:
[0081] First, it connects to heterogeneous data streams from multiple domains in real time and performs spatiotemporal alignment on them. This spatiotemporal alignment consists of three sub-steps: normalizing heterogeneous timestamps to UTC format according to the ISO 8601 standard; parsing geographic locations into latitude and longitude and geographic entity IDs using GIS services; and, when spatiotemporal logical conflicts are detected, dynamically aligning them based on the data source credibility weights and causal characteristics. For example, when the timestamps of the same event from different data sources deviate, the system assigns different weights based on the historical accuracy of each data source and, combined with causal chain analysis of the event, automatically adjusts the timestamp to the most reasonable value.
[0082] Secondly, causal features are extracted from heterogeneous data streams to generate enhanced knowledge units with causal labels. The extraction of causal features includes: performing Granger causality test on time series relationship pairs to screen significant associations; performing Do operator intervention effect quantification on relationship pairs that pass the test; fusing Granger correlation coefficient and Do intervention effect value to obtain causal confidence score Sc; marking causal strength and propagation chain based on causal confidence score Sc. The generated enhanced knowledge unit with causal label is a four-tuple<e, r, o, [t, causality_flag]> , where the timestamp t and the causality flag causality_flag are encapsulated in a single array slot. e, r, and o are standard knowledge graph triples; t is a timestamp in ISO 8601 format; causality_flag is a structured dictionary containing the following fields: strength is a strength rating based on the causal confidence score Sc; confidence is the causal confidence score Sc; and chain is a compressed list of causal propagation chains.
[0083] The third step is to calculate the conflict score between new and old knowledge based on multi-dimensional causal analysis. Conflict resolution and version management are implemented through a decision tree mechanism, resulting in a time-series knowledge graph with historical traceability. Conflict resolution in multi-dimensional causal analysis includes: calculating the temporal correlation of changes in new and old relationships through the Granger test; quantifying the causal impact differences between new and old relationships on the target object through the Do operator intervention effect; generating a causal confidence score Sc by configuring and fusion based on domain weights; and implementing intelligent diversion based on a dynamic threshold θ: when Sc>θ, old knowledge is automatically replaced and the causal chain is marked, while retaining historical snapshots to support retrospective auditing. When Sc≤θ, the original valid knowledge is retained and manual review is triggered. Version management includes converting replaced knowledge into historical snapshots, storing the causal chain and expiration time; adding a version identifier to the time-series knowledge graph, which includes update time information and the number of causal conflict resolutions; and providing a timestamp-based historical state rollback interface.
[0084] In the fourth step, node weights are dynamically assigned across distributed nodes based on knowledge entropy. A hierarchical aggregation strategy is used to update the entity embedding layer and the relationship prediction layer, outputting a global optimization model. This strategy includes: using the FedAvg algorithm for aggregation in the entity embedding layer; using a causal-sensitive learning rate for local gradient updates in the relationship prediction layer; and globally aggregating the encrypted relationship prediction layer gradients. The entity embedding layer gradients are transmitted in plaintext, while the relationship prediction layer gradients are transmitted after homomorphic encryption, and the global optimization model is output.
[0085] Finally, the natural language query containing counterfactual conditions is parsed, and the causal subgraph is extracted from the temporal knowledge graph. Intervention calculations are performed to generate a counterfactual impact report. The generation of the counterfactual impact report involves parsing the natural language query to extract entities, target relationships, and counterfactual conditions; tracing the propagation path from the causal tag fields in the temporal knowledge graph; constructing a minimal causal graph containing the intervention variable X, the target variable Y, and the confounding variable Z; calculating the intervention probability P(Y|do(X)) for the baseline scenario based on historical data regression; generating the intervention probability P(Y|do(¬X)) for the counterfactual scenario through virtual environment simulation; and calculating the causal impact Delta Y = P(Y|do(X)) - P(Y|do(¬X)) with confidence intervals. The counterfactual impact report includes quantitative metrics and data provenance for the baseline and counterfactual scenarios, statistical significance indicators for the causal impact, and a visualization of the causal evidence chain decision tree.
[0086] The causal subgraph extraction includes:
[0087] Traverse the causality_flag.chain field backward from the target variable Y to locate the complete causal path;
[0088] Determine the intervention variable X based on the counterfactual condition and screen the confounding variable Z connecting X and Y;
[0089] Remove the edges with confidence Sc≤θ to generate a minimum causal graph with time series labels;
[0090] Outputs a structured subgraph, including intervention variables, target variables, confounding variables, and confidence of the evidence chain.
[0091] In a preferred embodiment, the system processes data streams from both the financial and social media sectors. Financial data includes transaction timestamps and geographic locations, while social media data includes posting times and IP addresses. The system first converts financial transaction times from different time zones to UTC format and resolves social media IP addresses into geographic coordinates using a GIS service. When a spatiotemporal conflict is detected between a financial transaction and a related social media post, the system dynamically adjusts the social media data timestamp based on a 0.9 credibility weight for the financial data source and a 0.7 credibility weight for the social media data, taking into account the causal relationship between the two, to ensure spatiotemporal consistency.
[0092] In the causal feature extraction phase, the system performs Granger causality test on the temporal relationship between "stock price fluctuation" and "social media sentiment" and obtains a p-value of 0.03, a significance level of 0.05, confirming that there is a significant correlation between the two. Subsequently, the intervention effect is quantified by the Do operator, and the intervention effect value is calculated to be 0.65. By combining the Granger correlation coefficient 0.72 and the intervention effect value 0.65, the causal confidence score Sc is obtained as 0.68. Based on this score, the system marks the causal strength as "medium strength" and records the propagation chain from "social media sentiment" to "stock price fluctuation".
[0093] The system generates an enhanced knowledge unit example as <"Company X stock", "price change", "+5%", ["2023-06-15T14:30:00Z", {"strength": "medium strength", "confidence": 0.68, "chain": ["social media positive sentiment", "investor confidence boost"]}]}.
[0094] When the system detects a conflict between new knowledge and old knowledge, such as a discrepancy in the price prediction of a certain company's stock, the system calculates the temporal correlation of the change in the relationship between the new and old knowledge through Granger test as 0.75, and quantifies the causal impact difference of the new and old relationship on stock price prediction through the Do operator as 0.22. According to the weight configuration of 0.8 in the financial field and 0.2 in the social media field, the causal confidence score Sc is generated as 0.73. Since the Sc value is greater than the preset dynamic threshold θ = 0.7, the system automatically replaces the old stock price prediction knowledge while retaining the historical snapshot to support backtracking audit. The system converts the replaced old prediction into a historical snapshot, stores the causal chain of "social media sentiment change" and the invalidation time of 2023-06-15T14:30:00Z, and adds a version identifier "V2.3-20230615-CF12" to the temporal knowledge graph, indicating that it is the 2.3 version on June 15, 2023, and has completed 12 causal conflict resolutions.
[0095] In the federated learning phase, the system dynamically allocates weights based on the knowledge entropy of each node, with the financial node obtaining a weight of 0.6 and the social media node obtaining a weight of 0.4. The entity embedding layer uses the FedAvg algorithm to aggregate the embedding vectors of the two nodes; the relationship prediction layer uses a causally sensitive learning rate for local gradient update, and the learning rate is dynamically adjusted according to the causal confidence. The entity embedding layer gradient of the financial node is transmitted in plaintext, while the relationship prediction layer gradient is transmitted after homomorphic encryption, ensuring the security of the sensitive financial relationship prediction model.
[0096] Finally, when the user submits the counterfactual query "How would the stock price of a certain company change if it did not release positive quarterly reports?", the system parses the entity "a certain company", the target relationship "stock price change", and the counterfactual condition "did not release positive quarterly reports". The system backtracks the propagation path from the causal label field of the time series knowledge graph and constructs a minimal causal graph containing the intervention variable X = "quarterly report release", the target variable Y = "stock price change", and the confounding variable Z = "overall market trend". Based on historical data regression, the intervention probability P(Y|do(X)) = 0.85 of the baseline scenario is calculated, indicating that the probability of stock price rising after releasing positive reports is 85%. Through virtual environment simulation, the intervention probability P(Y|do(¬X)) = 0.35 of the counterfactual scenario is generated, indicating that the probability of stock price rising without releasing positive reports is 35%. The causal impact Delta Y = 0.85 - 0.35 = 0.5 is calculated, with a confidence interval of [0.42, 0.58], indicating that positive reports have a 50% causal impact on stock price rising. The counterfactual impact report generated by the system includes quantitative indicators and data provenance of the baseline scenario and the counterfactual scenario, statistical significance of the causal impact (p < 0.01), and visual causal evidence chain decision tree, clearly showing the complete causal path from report release to stock price change.
[0097] Embodiment Two
[0098] The embodiment provides a time series knowledge graph federated collaborative optimization system for causal inference, comprising:
[0099] A dynamic data source module is configured to access multiple field heterogeneous data streams in real time, perform spatio-temporal alignment operation on the heterogeneous data streams, and extract causal features in the heterogeneous data streams to generate enhanced knowledge units with causal labels.
[0100] A causal-driven incremental update module is configured to calculate new and old knowledge conflict scores based on multi-dimensional causal analysis, realize conflict resolution and version management through a decision tree mechanism, and output a time series knowledge graph with historical traceability.
[0101] A federated collaborative fine-tuning module is configured to dynamically allocate node weights based on knowledge entropy among distributed nodes, update entity embedding layers and relationship prediction layers using a hierarchical aggregation strategy, and output a globally optimized model.
[0102] A counterfactual reasoning engine is configured to parse natural language queries containing counterfactual conditions, extract causal subgraphs from the time series knowledge graph, and perform intervention calculation to generate a counterfactual impact report.
[0103] The system achieves accurate modeling and inference of complex causal relationships through multi-level data processing and knowledge fusion: the dynamic data source module breaks through the hysteresis of traditional batch processing, captures multi-domain data streams in real time (such as financial policies or medical guideline updates), and actively marks causal chains (such as "policy release → market fluctuations") to provide predictive support for the system; the causal-driven incremental update module replaces mechanical time coverage with a causal decision tree (Granger test + Do calculus), intelligently distinguishes true / false conflicts, retains historical valid knowledge (such as old medical plans as reference versions), and avoids accidental deletion of key information; the federated collaborative fine-tuning module realizes privacy and security collaboration of distributed nodes (hospitals / banks) through a knowledge entropy weighting mechanism, while ensuring domain characteristics and eliminating the resource black hole and compliance risks of centralized training; the counterfactual reasoning engine breaks through the limitations of the decision-making black box, builds a virtual sandbox to perform intervention calculations, and generates auditable prediction reports.
[0104] The dynamic data source module is used to access heterogeneous data streams in multiple fields in real time, including social media data streams, IoT sensor data, financial transaction records, medical health records, and meteorological and environmental monitoring data. The dynamic data source module is equipped with an adaptive sampling mechanism that can dynamically adjust the sampling frequency according to the importance of the data and give priority to high-value information. It achieves high throughput processing of 100,000+ / second through a distributed message queue (Kafka), and has a built-in spatiotemporal alignment engine (ISO 8601 timestamp normalization algorithm) and a causal feature extractor (based on the Transformer causal relationship detection model), outputting enhanced quadruple<e, r, o, [t, causality_flag]> Serves as a basis for downstream processing.
[0105] Incoming heterogeneous data streams are processed by the spatiotemporal alignment engine. This unit employs a multi-level time normalization algorithm to convert timestamps from different time zones and sampling frequencies to UTC standard time, and applies sliding window technology to segment the data. For spatial alignment, the system uses Geographic Information System (GIS) mapping technology to convert spatial information from different coordinate systems into a unified geographic reference framework, enabling precise spatial positioning and association of data.
[0106] In a preferred embodiment, the spatiotemporal alignment engine also integrates an anomaly detection mechanism that automatically identifies and corrects spatiotemporal tagging anomalies through statistical models to ensure data quality. This mechanism, using a locality-sensitive hashing algorithm, can verify spatiotemporal consistency on large-scale data sets within millisecond response times.
[0107] The causal feature extractor is responsible for extracting causal features from aligned heterogeneous data streams. This module first applies natural language processing techniques to identify causal keywords and semantic patterns from text data. These include explicit causal tags such as "lead to," "cause," and "due to," as well as semantic structures that imply implicit causal relationships. For time series data, the module employs Granger causality tests and dynamic Bayesian network analysis to identify temporal dependencies between variables. For image and video data, the system uses deep learning models to extract visual causal cues, such as object interactions and sequences of state changes.
[0108] The extracted causal features are used to generate enhanced knowledge units with causal labels. Each knowledge unit contains multidimensional attributes such as entity information, relationship type, spatiotemporal labeling, causal direction, causal strength, and uncertainty measures. The system assigns a globally unique identifier to each knowledge unit and establishes a reverse link to the original data source to ensure traceability.
[0109] In a preferred embodiment, the enhanced knowledge unit also includes semantic level tags, which enables the system to express and reason about causal relationships at different levels of abstraction, from specific event causality to abstract concept causality.
[0110] The system's incremental update module calculates conflict scores between new and old knowledge based on multi-dimensional causal analysis. This module first constructs a feature vector, encompassing dimensions such as temporal consistency, spatial correlation, semantic similarity, data source reliability, and causal strength. It then applies a weighted cosine similarity algorithm to calculate the degree of conflict between knowledge units, generating a conflict score between 0 and 1, where 0 indicates complete compatibility and 1 indicates severe conflict.
[0111] Conflict resolution and version management are implemented through a decision tree mechanism. Based on conflict scores and pre-set rules, the system automatically selects a handling strategy, including merging, overwriting, preserving parallel versions, or manual intervention. For each knowledge update, the system maintains a complete modification history, recording the change content, timestamp, data source, and processing basis, forming a time-series knowledge graph with historical traceability. This graph not only represents the current state of knowledge but also preserves the knowledge evolution path, supporting point-in-time queries on historical knowledge states.
[0112] The federated collaborative fine-tuning module includes the following federated architecture:
[0113] The federated architecture of the federated collaborative fine-tuning module consists of a parameter aggregation server and distributed edge nodes, which achieve dynamic optimization through layered collaboration and security protocols; the parameter aggregation server dynamically calculates node weights based on knowledge entropy, and the edge nodes perform local processing and calculate gradient updates. Specifically:
[0114] The parameter aggregation server further includes:
[0115] Knowledge entropy calculation engine: receives the local knowledge graph update uploaded by each node and calculates the node weight;
[0116] Hierarchical aggregator: Entity embedding layer performs FedAvg aggregation, relation prediction layer: decrypts encrypted gradients and then performs weighted aggregation;
[0117] Version controller: records the global model version number and metadata contributed by participating nodes.
[0118] The distributed edge nodes further include:
[0119] Causal Feature Extractor: extracts relational causal strength from local knowledge graph update data;
[0120] Layered trainer: The entity embedding layer performs regular backpropagation (plaintext gradients), and the relation prediction layer applies a causal-sensitive learning rate to calculate the gradients;
[0121] Secure communication agent: homomorphically encrypt the relational layer gradients and transmit the entity layer gradients in plain text.
[0122] In a distributed environment, the federated collaborative fine-tuning module uses a dynamic weighting mechanism based on knowledge entropy. Each distributed node calculates its node weight based on metrics such as the information entropy of its stored knowledge, update frequency, and query hit rate. Nodes with higher information entropy, more active updates, and higher query hit rates receive greater weights and play a more important role in global knowledge fusion.
[0123] The system's hierarchical aggregation strategy consists of two phases: updating the entity embedding layer and the relationship prediction layer. The entity embedding layer employs an incremental learning approach, computing embeddings only for newly added or changed entities and integrating them with existing embeddings through an attention mechanism. The relationship prediction layer utilizes a graph neural network model to capture high-order connectivity patterns between entities and continuously optimizes relationship prediction accuracy through reinforcement learning. The results of these two updates are then jointly optimized to produce a globally optimized model.
[0124] In a preferred embodiment, the global optimization model also includes an adaptive learning rate adjustment mechanism, which dynamically adjusts the learning parameters according to the rate of change of the knowledge graph, increases the learning rate during periods of rapid knowledge change, and reduces the learning rate during stable periods to avoid overfitting.
[0125] The system's counterfactual reasoning engine parses natural language queries containing counterfactual conditions. This module first uses a semantic parser to convert natural language into structured query expressions, identifying entities, relations, time ranges, and counterfactual conditions in the query. It then extracts the causal subgraph relevant to the query from the temporal knowledge graph, including direct causal relationships and indirect causal paths.
[0126] The system then performs intervention calculations on the extracted causal subgraphs, simulating system state changes under counterfactual conditions. Based on a structural causal model, the calculations modify specific variable values through do-calculus operations and assess the propagation of the intervention effects through the causal network through probabilistic reasoning. Finally, the system generates a counterfactual impact report, including the scope and intensity of the impact, uncertainty assessment, and visualization results.
[0127] In a preferred embodiment, the counterfactual impact report also includes a multi-scenario comparative analysis, which assists decision makers in understanding various possibilities and their consequences by displaying the differences in results under different intervention strategies side by side.
[0128] Through the collaborative work of the above components and processes, the system achieves accurate modeling, dynamic updating and intelligent inference of complex causal relationships, providing a powerful tool for decision support and knowledge discovery in multiple fields.
[0129] Third embodiment
[0130] An embodiment of the present invention further provides a computer device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the method of any one of the above embodiments is implemented.
[0131] The computer device includes a processor and a memory, and may also include an input system and an output system. The processor, memory, input system, and output system may be connected via a bus or other means. The input system may receive input digital or character information and generate signal inputs for the method of the present invention. The output system may include a display device such as a display screen.
[0132] As a non-volatile computer-readable storage medium, the memory can be used to store non-volatile software programs, non-volatile computer executable programs and modules, such as program instructions / modules corresponding to the embodiment method of the present application. The memory may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of the method of the present invention, etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory may optionally include a memory remotely located relative to the processor, and these remote memories may be connected to the local module via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0133] In some embodiments, the processor may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor is generally used to control the overall operation of the computer device. In this embodiment, the processor is used to run the program code stored in the memory or process data. The processors of the multiple computer devices of the computer device of this embodiment execute various functional applications and data processing of the server by running the non-volatile software programs, instructions and modules stored in the memory, that is, implementing the steps of the above-mentioned method embodiment.
[0134] Fourth embodiment
[0135] An embodiment of the present invention further provides a computer-readable storage medium storing computer program instructions, which implement the method of any one of the above embodiments when executed.
[0136] It should be understood that, in the absence of mutual conflict, all embodiments, features and advantages described above for the method according to the present invention are also applicable to the system, device and storage medium of the present invention.
[0137] It will also be appreciated by those skilled in the art that the various exemplary logic blocks, modules, circuits and algorithmic steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given of the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0138] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope of the embodiments disclosed in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless expressly limited to the singular.
[0139] It should be understood that, as used herein, the singular form "a" or "an" is intended to include the plural form as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations of one or more of the items listed in association. The serial numbers of the embodiments disclosed in the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.
[0140] Those skilled in the art should understand that the discussion of any of the above embodiments is merely illustrative and is not intended to imply that the scope of the disclosure of the embodiments of the present invention is limited to these examples. Within the spirit of the embodiments of the present invention, the technical features of the above embodiments or different embodiments may be combined, and there are many other variations of different aspects of the above embodiments of the present invention, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention shall be included within the scope of protection of the embodiments of the present invention.
Claims
1. A method for federated collaborative optimization of temporal knowledge graphs based on causal inference, characterized by: The following steps are involved: Access multi-domain heterogeneous data streams in real time and perform spatiotemporal alignment operations on the heterogeneous data streams; Extract the causal features in the heterogeneous data stream and generate enhanced knowledge units with causal tags, which are quadruple<e, r, o, [t, causality_flag]> , the timestamp t and the causality flag causality_flag are encapsulated together in a single array slot; where: e, r, o, are standard knowledge graph triple elements; t is the timestamp in ISO 8601 format; causality_flag is a structured dictionary containing the following fields: strength: strength classification based on causal confidence score Sc; confidence: causal confidence score Sc; chain: compressed causal propagation chain list; Calculate the conflict scores between new and old knowledge based on multi-dimensional causal analysis, implement conflict resolution and version management through a decision tree mechanism, and output a time-series knowledge graph with historical traceability; The calculation of the new and old knowledge conflict score based on multi-dimensional causal analysis includes: The time series correlation of the change in the old-new relationship is calculated by Granger test; The Do operator intervention effect is used to quantify the difference in causal impact of the new and old relationships on the target object; The fusion is configured according to the domain weights to generate the causal confidence score Sc; Intelligent diversion is achieved based on a dynamic threshold θ: when Sc>θ, old knowledge is automatically replaced and the causal chain is marked, while retaining historical snapshots to support retrospective auditing; when Sc≤θ, the original valid knowledge is retained and manual review is triggered; The version management includes: Convert the replaced knowledge into historical snapshots, storing the causal chain and expiration time; Add a version identifier to the time series knowledge graph, where the version identifier includes update time information and the number of causal conflict resolutions; Provides a timestamp-based historical status rollback interface; Among distributed nodes, node weights are dynamically allocated based on knowledge entropy, and a hierarchical aggregation strategy is used to update the entity embedding layer and relationship prediction layer to output a global optimization model. The hierarchical aggregation strategy includes: The entity embedding layer is aggregated using the FedAvg algorithm; The relationship prediction layer uses a causal-sensitive learning rate to perform local gradient updates and globally aggregates the encrypted relationship prediction layer gradients. The entity embedding layer gradient is transmitted in plain text, the relationship prediction layer gradient is transmitted after homomorphic encryption, and the global optimization model is output; Parse natural language queries containing counterfactual conditions, extract causal subgraphs from temporal knowledge graphs, perform intervention calculations, and generate counterfactual impact reports.
2. The method for federated collaborative optimization of temporal knowledge graphs based on causal inference according to claim 1 is characterized in that: The spatiotemporal alignment operation includes: Normalize heterogeneous timestamps to UTC format according to ISO 8601 standard; Resolve geographic location into latitude and longitude and geographic entity ID through GIS service; When spatiotemporal logic conflicts are detected, dynamic calibration is performed based on the data source credibility weights and causal characteristics.
3. The method for federated collaborative optimization of temporal knowledge graphs based on causal inference according to claim 1 is characterized in that: The extracting causal features from the heterogeneous data stream includes: Perform Granger causality test on time series relationships to screen significant associations; For the relationship pairs that pass the test, the Do operator intervention effect quantification is performed; The Granger correlation coefficient and the Do intervention effect value were combined to obtain the causal confidence score Sc; The causal strength and transmission chain are marked based on the causal confidence score Sc.
4. The method for federated collaborative optimization of temporal knowledge graphs based on causal inference according to claim 1 is characterized in that: Generating a counterfactual impact report includes: Parse natural language queries and extract entities, target relations, and counterfactual conditions; Backtrack the propagation path from the causal tag field of the temporal knowledge graph; Construct a minimum causal diagram containing intervention variable X, target variable Y and confounding variable Z; Calculate the intervention probability P(Y|do(X)) of the baseline scenario based on historical data regression; Generate intervention probability P(Y|do(¬X)) of counterfactual scenarios through virtual environment simulation; Calculate the causal influence Delta Y = P(Y|do(X)) - P(Y|do(¬X)) and append the confidence interval; The counterfactual impact report includes: quantitative indicators and data traceability of the baseline scenario and counterfactual scenario, statistical significance identification of causal impact, and a visual causal evidence chain decision tree; The causal subgraph extraction includes: Traverse the causality_flag.chain field backward from the target variable Y to locate the complete causal path; Determine the intervention variable X based on the counterfactual condition and screen the confounding variable Z connecting X and Y; Remove the edges with confidence Sc≤θ to generate a minimum causal graph with time series labels; Outputs a structured subgraph, including intervention variables, target variables, confounding variables, and confidence of the evidence chain.
5. A temporal knowledge graph federated collaborative optimization system based on causal inference, characterized by: include: A dynamic data source module is used to access heterogeneous data streams in multiple fields in real time and perform spatiotemporal alignment operations on the heterogeneous data streams; And extract the causal features in the heterogeneous data stream to generate enhanced knowledge units with causal tags, which are four tuples<e, r, o, [t, causality_flag]> , the timestamp t and the causal flag causality_flag are encapsulated together in a single array slot; where: e, r, o, are standard knowledge graph triple elements; t is the timestamp in ISO 8601 format; causality_flag is a structured dictionary containing the following fields: strength: strength classification identifier based on causal confidence score Sc; confidence: causal confidence score Sc; chain: compressed causal propagation chain list; The causal-driven incremental update module calculates the conflict score of new and old knowledge based on multi-dimensional causal analysis, implements conflict resolution and version management through a decision tree mechanism, and outputs a time-series knowledge graph with historical traceability; the calculation of the conflict score of new and old knowledge based on multi-dimensional causal analysis includes: calculating the temporal correlation of the change in the new and old relationship through the Granger test; quantifying the causal impact difference of the new and old relationship on the target object through the Do operator intervention effect; generating a causal confidence score Sc by configuring the fusion according to the domain weight; realizing intelligent diversion based on the dynamic threshold θ: when Sc>θ, the old knowledge is automatically replaced and the causal chain is marked, while retaining historical snapshots to support retrospective auditing; when Sc≤θ, the original valid knowledge is retained and manual review is triggered; the version management includes: converting the replaced knowledge into a historical snapshot, storing the causal chain and expiration time; adding a version identifier to the time-series knowledge graph, wherein the version identifier includes update time information and the number of causal conflict resolutions; providing a timestamp-based historical state rollback interface; The federated collaborative fine-tuning module is used to dynamically allocate node weights among distributed nodes based on knowledge entropy, update the entity embedding layer and the relationship prediction layer using a hierarchical aggregation strategy, and output a global optimization model. The hierarchical aggregation strategy includes: using the FedAvg algorithm to aggregate the entity embedding layer; using the causal-sensitive learning rate to perform local gradient updates on the relationship prediction layer, and globally aggregating the encrypted relationship prediction layer gradients; transmitting the entity embedding layer gradients in plain text, and transmitting the relationship prediction layer gradients after homomorphic encryption, and outputting the global optimization model. The counterfactual reasoning engine is used to parse natural language queries containing counterfactual conditions, extract causal subgraphs from the temporal knowledge graph, perform intervention calculations, and generate counterfactual impact reports.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method for federated collaborative optimization of temporal knowledge graphs based on causal inference according to any one of claims 1 to 4 is executed.
7. A computer-readable storage medium storing computer program instructions, which, when executed, implement the causal inference-based temporal knowledge graph federated collaborative optimization method described in any one of claims 1 to 4.
Citation Information
Patent Citations
Event information enhancement and deduction prediction method combined with knowledge graph
CN120197710A
Intelligent question and answer method based on knowledge graph
CN120297415A