Knowledge graph semantic enhanced embedding optimization method based on dynamic memory network
By constructing a dynamic memory network and a multimodal feature fusion mechanism, the semantic drift and structural changes of knowledge graphs in complex logical queries are solved, achieving efficient and interpretable embedding space optimization and improving the semantic understanding and generalization ability of the model.
Patent Information
- Application Number
- CN202510931312.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-07
- Publication Date
- 2025-10-28
AI Technical Summary
Existing knowledge graphs lack dynamic optimization mechanisms in complex logical queries, making it difficult to adapt to semantic drift and structural changes in multi-step reasoning processes. Furthermore, they lack effective reuse of historical reasoning features, resulting in computational redundancy and reduced generalization ability.
A dynamic memory network is constructed, and hierarchical parsing is performed through a GRU-driven memory update mechanism and a three-layer Transformer encoder. Combined with a multimodal feature fusion mechanism, explicit modeling and dynamic updating of historical logical patterns are achieved, thereby enhancing the semantic expression capability of the embedding space.
It significantly improves the model's semantic understanding and generalization ability for complex logical queries, enhances the interpretability and robustness of the reasoning process, reduces computational overhead, and is suitable for efficient deployment in complex logical question-answering systems.
Smart Images

Figure CN120851200A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of technology, and more particularly to a semantically enhanced embedding optimization method for knowledge graphs based on dynamic memory networks. Background Technology
[0002] With the widespread application of knowledge graphs in tasks such as intelligent question answering and multi-hop reasoning, improving the semantic representation capability of the embedding space has become a key challenge. Traditional static embedding models capture simple relational patterns through a fixed semantic space, but in complex logical queries, they lack dynamic optimization mechanisms and struggle to adapt to semantic drift issues during multi-step reasoning. Furthermore, existing models generally lack effective mechanisms for reusing historical reasoning features, significantly increasing computational redundancy in similar query paths. To address these issues, a solution is urgently needed that can dynamically optimize the embedding space distribution, fuse multimodal features, and support context-aware reasoning to improve the accuracy and efficiency of complex logical queries.
[0003] Existing Complex Logic Query Answering (CLQA) methods primarily rely on static embedding optimization strategies, mapping structured logical queries to low-dimensional representations and performing logical operations within the embedding space to achieve reasoning. These methods generally depend on fixed-structure neural networks to model operations such as projection, intersection, and union. While they can achieve a certain level of reasoning performance within the training data distribution, they exhibit a significant decline in generalization ability when faced with changes in query structure, deeper nesting, or more complex structural combinations. To alleviate these problems, some studies have introduced memory enhancement mechanisms, such as attention retrieval, external memory modules, and historical representation caching, to retain knowledge or patterns from the training process to some extent. However, most of these mechanisms only operate at the semantic level, lacking structural organization of the memory content, making it difficult to effectively model the evolution of complex logical structures. Furthermore, they lack dynamic update capabilities, making it difficult to support adaptive reasoning for novel structures or unseen logical combinations during the testing phase. In addition, existing methods heavily rely on the implicitly encoded structural experience in the model parameters during the reasoning process, resulting in a lack of interpretability and controllability. Therefore, in practical applications, existing technologies still struggle to meet the demands for query reasoning systems with highly complex logical structures, high robustness, and high interpretability.
[0004] In the field of knowledge graph logical query question answering, the semantic representation and structural generalization ability of complex queries have long faced a dual challenge. On the one hand, logical queries are typically characterized by multi-level nesting, complex operator combinations, and frequent structural variations, leading to insufficient expressive power of traditional embedding optimization methods when modeling hierarchical logical structures. On the other hand, models struggle to adapt to unseen structures or logical combinations during the testing phase, lacking the ability to dynamically learn and transfer from historical patterns, severely restricting the generalization and robustness of the inference system. Although some methods have attempted to introduce attention mechanisms or external memory structures to enhance query modeling, most memory mechanisms remain at the implicit semantic level, lacking structured representation and dynamic update capabilities, resulting in poor interpretability and weak adaptability of the inference process. Furthermore, current embedding optimization methods generally rely on the reconstruction or joint training of upstream encoders, increasing the complexity of model deployment and maintenance. Therefore, how to introduce interpretable, structured, and lightweight dynamic memory mechanisms while maintaining encoder structural stability to achieve semantic enhancement and progressive optimization of the embedding space for complex logical queries has become a critical technical problem that urgently needs to be solved. Summary of the Invention
[0005] This invention overcomes the shortcomings of the prior art and provides a semantically enhanced embedding optimization method for knowledge graphs based on dynamic memory networks.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0007] The first aspect of this invention provides a semantically enhanced embedding optimization method for knowledge graphs based on dynamic memory networks, characterized by comprising the following steps:
[0008] A dynamic memory network is constructed, and memory feature representations are generated by embedding and optimizing the dynamic memory network.
[0009] The update behavior of the value vector in the memory slot is controlled by the memory feature representation through a GRU-driven memory update mechanism.
[0010] A three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure;
[0011] A dynamic feature fusion mechanism is constructed to jointly model the basic query embedding, logical structure features and memory retrieval features.
[0012] Furthermore, in the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks, a dynamic memory network is constructed, specifically as follows:
[0013] Obtain the memory key vector and the memory value vector, and perform orthogonal initialization on the memory key vector to ensure that different logical modes are distributed without overlap in the embedding space;
[0014] The memory value vector is used to store the inference context information corresponding to the logical pattern, and is dynamically updated through a gated loop unit to capture long-term dependency features of different query structures.
[0015] Furthermore, in the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks, memory feature representations are generated by embedding and optimizing the dynamic memory network, specifically as follows:
[0016] Obtain the current logical query representation, calculate the similarity between the logical query representation and all memory key vectors through the scaling dot product attention mechanism, and calculate the attention result based on the scaling dot product attention mechanism;
[0017] The attention results are used as weights and applied to the corresponding value vectors to generate memory feature representations, which are dynamically adjusted as the query content changes during the retrieval process.
[0018] Furthermore, in the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks, the update behavior of the value vector in the memory slot is controlled by a GRU-driven memory update mechanism, specifically as follows:
[0019] By introducing GRU, the memory feature representation is input into GRU. The reset gate is used to control the degree of forgetting of old memories and to focus on injecting new structures. The update gate is used to balance the fusion ratio of old and new information and stabilize the learning process.
[0020] Candidate memory representations are generated by combining the current query statistical features with old memories, and the final update is completed through linear combination.
[0021] Furthermore, in the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks, a three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure, specifically:
[0022] A three-layer Transformer encoder is introduced, with each layer employing a multi-head self-attention mechanism. By combining the logical position bias matrix encoding operator priority and variable scope, logical structure features are extracted and used as supplementary information.
[0023] The supplementary information and the memory feature representation are combined in the final embedding representation to perform hierarchical parsing of the query structure.
[0024] Furthermore, in the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks, a dynamic feature fusion mechanism is constructed. This mechanism jointly models the basic query embedding, logical structure features, and memory retrieval features, specifically including:
[0025] A nonlinear fusion function is constructed using a multilayer perceptron, and the contribution ratio of each feature channel is dynamically adjusted according to the nonlinear fusion function through an adaptive weight generation mechanism.
[0026] We jointly model the basic query embedding, logical structure features, and memory retrieval features, and obtain the fused embedding representation through joint modeling.
[0027] Furthermore, the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks also includes:
[0028] The training phase of the dynamic memory network forms a structural memory of high-frequency logical patterns.
[0029] A second aspect of the present invention provides a knowledge graph semantic enhancement embedding optimization system based on dynamic memory networks, including a memory and a processor. The memory includes a knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks. When the knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks is executed by the processor, it implements the steps of any of the knowledge graph semantic enhancement embedding optimization methods based on dynamic memory networks.
[0030] A third aspect of the present invention provides a computer-readable storage medium, including a knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks. When the knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks is executed by the processor, it implements the steps of any of the knowledge graph semantic enhancement embedding optimization methods based on dynamic memory networks.
[0031] This invention addresses the shortcomings of the prior art and has the following beneficial effects:
[0032] This invention constructs a structured dynamic memory network to achieve explicit modeling and dynamic updating of historical logical patterns, effectively capturing nested structures and long-term dependencies in complex logical queries, and significantly improving the model's semantic understanding and generalization ability for diverse structural combinations. Furthermore, this invention employs a multimodal feature fusion mechanism to dynamically integrate basic semantics, logical structure, and memory features, and introduces a gated memory update strategy to achieve progressive optimization of the embedding representation. The memory call path during inference is clear, and optimization behavior is traceable, thereby enhancing the model's interpretability and robustness. The embedding space optimization effect is significant and interpretable. Finally, this invention achieves inference enhancement through an external dynamic memory network module without modifying the original upstream encoder. It has a small percentage of updated parameters, low computational overhead, and is suitable for efficient deployment on various inference platforms, especially for complex logical question-answering systems that require support for structural generalization and real-time response. It possesses lightweight deployment and high-efficiency adaptability. Attached Figure Description
[0033] 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 some embodiments of the present invention. For those skilled in the art, other embodiments can be obtained from these drawings without creative effort.
[0034] Figure 1 The overall flowchart of the knowledge graph semantic enhancement embedding optimization method based on dynamic memory network is shown;
[0035] Figure 2 The system block diagram of a knowledge graph semantic enhancement embedding optimization system based on dynamic memory networks is shown.
[0036] Figure 3 A schematic diagram of the overall framework of the optimization process is shown. Detailed Implementation
[0037] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.
[0038] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0039] like Figure 1 , Figure 3As shown, the first aspect of the present invention provides a semantically enhanced embedding optimization method for knowledge graphs based on dynamic memory networks, characterized by comprising the following steps:
[0040] S102: Construct a dynamic memory network, and generate memory feature representations by embedding and optimizing the dynamic memory network;
[0041] S104: The update behavior of the value vector in the memory slot is controlled by the memory feature representation through the GRU-driven memory update mechanism;
[0042] S106: Introduce a three-layer Transformer encoder to perform hierarchical parsing of the query structure;
[0043] S108: Construct a dynamic feature fusion mechanism to jointly model the basic query embedding, logical structure features and memory retrieval features.
[0044] It should be noted that this invention, by constructing a structured dynamic memory network, achieves explicit modeling and dynamic updating of historical logical patterns, effectively capturing nested structures and long-term dependencies in complex logical queries, and significantly improving the model's semantic understanding and generalization ability for diverse structural combinations. Furthermore, this invention employs a multimodal feature fusion mechanism to dynamically fuse basic semantics, logical structure, and memory features, and introduces a gated memory update strategy to achieve progressive optimization of the embedding representation. The memory call path during inference is clear, and optimization behavior is traceable, thereby enhancing the model's interpretability and robustness. The embedding space optimization effect is significant and interpretable. Finally, this invention achieves inference enhancement through an external dynamic memory network module without modifying the original upstream encoder. The number of updated parameters is small, and the computational overhead is low, making it suitable for efficient deployment on various inference platforms. It is particularly suitable for complex logical question-answering systems that require support for structural generalization and real-time response, possessing lightweight deployment and high-efficiency adaptability.
[0045] First, this invention designs a structured dynamic memory network for explicitly storing and retrieving historical logical patterns. This module employs a key-value pair memory slot structure:
[0046] In step S102, during the construction of the dynamic memory network, memory key vectors and memory value vectors are collected. The memory key vectors are orthogonally initialized to ensure that different logical patterns are distributed without overlap in the embedding space, thereby improving retrieval discrimination. The memory value vectors are used to store the inference context information corresponding to the logical patterns and are dynamically updated through gated recurrent units (GRUs). Compared with traditional implicit representation methods, this design has stronger structural orientation and interpretability, and can effectively capture the long-term dependency features of different query structures.
[0047] In step S102, the generation of memory feature representations by embedding and optimizing the dynamic memory network specifically includes:
[0048] During the embedding optimization process, the current logical query representation is compared with all key vectors in the memory slot to calculate attention weights, thereby achieving semantic matching and dynamic extraction of historical logical patterns:
[0049] A scaling dot product attention mechanism is used to calculate the similarity between the current query representation and all key vectors; the attention result is used as a weight to apply to the corresponding value vector to generate a memory feature representation; the retrieval process can be dynamically adjusted as the query content changes, which enhances the adaptability and generalization ability of the query representation to structural priors.
[0050] In step S104, the update behavior of the value vector in the memory slot is controlled by the GRU-driven memory update mechanism, specifically as follows:
[0051] This invention controls the update behavior of the value vector in the memory slot through a GRU module, achieving progressive learning and selective retention of historical experience:
[0052] The reset gate controls the degree of forgetting of old memories and focuses on injecting new structures (such as nested dissections appearing for the first time); the update gate balances the fusion ratio of old and new information and stabilizes the learning process; candidate memory representations are generated by combining the statistical features of the current query with old memories; the final update is completed through linear combination to ensure that historical memories are not completely replaced, avoid catastrophic forgetting, and form memory retrieval features.
[0053] In step S106, a three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure, specifically as follows:
[0054] To enhance the logical modeling capability of queries, this invention introduces a three-layer Transformer encoder to perform hierarchical parsing of the query structure:
[0055] Each layer employs a multi-head self-attention mechanism, combining logical position bias matrix encoding operator priority and variable scope; the extracted logical structure features serve as supplementary information, working together with the memory module output to contribute to the final embedded representation; this module enhances the model's ability to model complex structural dependencies.
[0056] In step S108, a dynamic feature fusion mechanism is constructed to jointly model the basic query embedding (input by the user), logical structure features, and memory retrieval features. Specifically:
[0057] This invention designs a dynamic feature fusion mechanism to achieve joint modeling of basic query embedding, logical structure features, and memory retrieval features:
[0058] A nonlinear fusion function is constructed using a multilayer perceptron (MLP); the contribution ratio of each feature channel is dynamically adjusted through an adaptive weight generation mechanism; the fused embedding representation more comprehensively expresses the semantic and structural information of the query, effectively improving inference performance and robustness.
[0059] This method also incorporates a progressive embedding optimization mechanism, which can be deployed independently without modifying the upstream encoder. Through the dynamic memory network's update and fusion mechanism, the embedding space is progressively optimized.
[0060] During the training phase, structural memory is formed for high-frequency logical patterns; during the testing phase, the memory can be quickly activated or updated based on the current query, supporting the model to adapt to structural changes in a lightweight manner.
[0061] It's important to note that in the memory layer, key vectors are used to index or label knowledge, while value vectors store the actual information or knowledge representation. When the model needs to utilize the "memory," it generates a query vector, searches the "memory" for relevant information similar to the key vector, and retrieves the corresponding value vector.
[0062] In summary, this invention constructs a structured dynamic memory network to achieve explicit modeling and dynamic updating of historical logical patterns, effectively capturing nested structures and long-term dependencies in complex logical queries, and significantly improving the model's semantic understanding and generalization ability for diverse structural combinations. Furthermore, this invention employs a multimodal feature fusion mechanism to dynamically fuse basic semantics, logical structure, and memory features, and introduces a gated memory update strategy to achieve progressive optimization of the embedding representation. The memory call path during inference is clear, and optimization behavior is traceable, thereby enhancing the model's interpretability and robustness. The embedding space optimization effect is significant and interpretable. Finally, this invention achieves inference enhancement through an external dynamic memory network module without modifying the original upstream encoder. It has a small percentage of updated parameters, low computational overhead, and is suitable for efficient deployment on various inference platforms, especially for complex logical question-answering systems that require support for structural generalization and real-time response. It possesses lightweight deployment and high-efficiency adaptability.
[0063] In addition, this method also includes:
[0064] A hierarchical federated knowledge aggregation architecture is adopted, with local and global layers set up. Edge nodes are set up in the local layer. The edge nodes use differential privacy technology to train subgraphs on the local dataset and upload gradient parameters.
[0065] In the global layer, the central server aggregates gradients to generate a global knowledge graph. It adapts to edge device deployment through a knowledge distillation compression model and uses the knowledge graph schema layer to predict query relevance.
[0066] If the query involves sensitive entity data, irrelevant edge nodes are automatically filtered to reduce the number of edge nodes involved in the calculation.
[0067] Frequently queried subgraphs are cached at edge nodes, and the data with the shortest distance is searched using a consistent hashing algorithm.
[0068] It should be noted that this method fully considers the technical problems of data privacy leakage caused by centralized knowledge graph training and the high network transmission overhead and limited computing power of edge devices during cross-domain queries. Therefore, this technical feature can reduce the risk of privacy leakage and reduce the bandwidth consumption of cross-domain queries.
[0069] In addition, this method also includes:
[0070] Obtain the query data entity, add four-dimensional coordinates (longitude, latitude, altitude, timestamp) to the query data entity, identify hot event clusters (such as regional epidemic outbreaks, emergency events) based on spatiotemporal clustering algorithm, and parse the query data entity through Apache Flink to extract spatiotemporal entity data;
[0071] Determine whether there are contradictory events in the spatiotemporal entity data;
[0072] When a contradictory event is detected in the spatiotemporal entity data, LLM-assisted verification is triggered, and the spatiotemporal entity data is converted into a causal graph query to locate key propagation nodes and generate a visual decision report based on the key propagation nodes.
[0073] When no contradictory events are detected in the spatiotemporal entity data, the queried entity is continuously monitored.
[0074] It should be noted that this method fully considers the technical problems of traditional knowledge graphs neglecting the characteristics of entity evolution over time, which leads to outdated query results and high delays in response to sudden events. Therefore, this distinguishing technical feature is used to improve the response speed to sudden events and the accuracy of spatiotemporal correlation queries.
[0075] In addition, this method also includes:
[0076] A multimodal alignment network is constructed, and graph neural networks (GNN) are used to jointly train text embedding (BERT), image features (ResNet), and temporal sensor data (LSTM) to generate a unified semantic vector space. Entity association weights are dynamically adjusted based on user feedback data (such as click rate and dwell time).
[0077] By combining Large Language Model (LLM) and knowledge graph, user query keywords are extracted through LLM to generate multiple sets of candidate prompt statements (such as "new energy battery fault diagnosis" → "lithium battery thermal runaway detection method").
[0078] By matching subgraphs of the knowledge graph, the semantic similarity between candidate suggestions and historical queries is calculated, and Top-K high-confidence query rewriting schemes are selected.
[0079] Computing resources are dynamically allocated based on query complexity (e.g., number of associated entities > 100), so that simple queries are processed by edge nodes and complex queries are scheduled to the cloud center.
[0080] It should be noted that this method fully considers the fact that existing knowledge graph queries rely on static semantic annotations and cannot dynamically integrate multi-source heterogeneous data such as text, images, and sensors, resulting in cross-modal semantic loss; traditional query optimization does not consider the technical problem of real-time changes in user intent and high response latency. This method aims to optimize cross-modal retrieval accuracy and thus optimize query response time in high-concurrency scenarios.
[0081] like Figure 2 As shown, a second aspect of the present invention provides a knowledge graph semantic enhancement embedding optimization system 4 based on a dynamic memory network, including a memory 41 and a processor 42. The memory 41 includes a knowledge graph semantic enhancement embedding optimization method program based on a dynamic memory network. When the processor 42 executes the knowledge graph semantic enhancement embedding optimization method program based on a dynamic memory network, it performs the following steps:
[0082] A dynamic memory network is constructed, and memory feature representations are generated by embedding and optimizing the dynamic memory network.
[0083] The update behavior of the value vector in the memory slot is controlled by the memory feature representation through a GRU-driven memory update mechanism.
[0084] A three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure;
[0085] A dynamic feature fusion mechanism is constructed to jointly model the basic query embedding, logical structure features and memory retrieval features.
[0086] It should be noted that this invention, by constructing a structured dynamic memory network, achieves explicit modeling and dynamic updating of historical logical patterns, effectively capturing nested structures and long-term dependencies in complex logical queries, and significantly improving the model's semantic understanding and generalization ability for diverse structural combinations. Furthermore, this invention employs a multimodal feature fusion mechanism to dynamically fuse basic semantics, logical structure, and memory features, and introduces a gated memory update strategy to achieve progressive optimization of the embedding representation. The memory call path during inference is clear, and optimization behavior is traceable, thereby enhancing the model's interpretability and robustness. The embedding space optimization effect is significant and interpretable. Finally, this invention achieves inference enhancement through an external dynamic memory network module without modifying the original upstream encoder. The number of updated parameters is small, and the computational overhead is low, making it suitable for efficient deployment on various inference platforms. It is particularly suitable for complex logical question-answering systems that require support for structural generalization and real-time response, possessing lightweight deployment and high-efficiency adaptability.
[0087] First, this invention designs a structured dynamic memory network for explicitly storing and retrieving historical logical patterns. This module employs a key-value pair memory slot structure:
[0088] In constructing the dynamic memory network, memory key vectors and memory value vectors are collected. The memory key vectors are orthogonally initialized to ensure that different logical patterns are distributed without overlap in the embedding space, thereby improving retrieval discrimination. The memory value vectors are used to store the inference context information corresponding to the logical patterns and are dynamically updated through gated recurrent units (GRUs). Compared with traditional implicit representation methods, this design has stronger structural orientation and interpretability, and can effectively capture the long-term dependency features of different query structures.
[0089] Specifically, by embedding and optimizing the dynamic memory network to generate memory feature representations, the following methods are employed:
[0090] During the embedding optimization process, the current logical query representation is compared with all key vectors in the memory slot to calculate attention weights, thereby achieving semantic matching and dynamic extraction of historical logical patterns:
[0091] A scaling dot product attention mechanism is used to calculate the similarity between the current query representation and all key vectors; the attention result is used as a weight to apply to the corresponding value vector to generate a memory feature representation; the retrieval process can be dynamically adjusted as the query content changes, which enhances the adaptability and generalization ability of the query representation to structural priors.
[0092] The update behavior of the value vector in the memory slot is controlled by a GRU-driven memory update mechanism, specifically as follows:
[0093] This invention controls the update behavior of the value vector in the memory slot through a GRU module, achieving progressive learning and selective retention of historical experience:
[0094] The reset gate controls the degree of forgetting of old memories and focuses on injecting new structures (such as nested dissections appearing for the first time); the update gate balances the fusion ratio of old and new information and stabilizes the learning process; candidate memory representations are generated by combining the statistical features of the current query with old memories; the final update is completed through linear combination to ensure that historical memories are not completely replaced, avoid catastrophic forgetting, and form memory retrieval features.
[0095] A three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure, specifically:
[0096] To enhance the logical modeling capability of queries, this invention introduces a three-layer Transformer encoder to perform hierarchical parsing of the query structure:
[0097] Each layer employs a multi-head self-attention mechanism, combining logical position bias matrix encoding operator priority and variable scope; the extracted logical structure features serve as supplementary information, working together with the memory module output to contribute to the final embedded representation; this module enhances the model's ability to model complex structural dependencies.
[0098] A dynamic feature fusion mechanism is constructed to jointly model the basic query embedding (input by the user), logical structure features, and memory retrieval features, specifically as follows:
[0099] This system also designs a dynamic feature fusion mechanism to achieve joint modeling of basic query embedding, logical structure features, and memory retrieval features:
[0100] A nonlinear fusion function is constructed using a multilayer perceptron (MLP); the contribution ratio of each feature channel is dynamically adjusted through an adaptive weight generation mechanism; the fused embedding representation more comprehensively expresses the semantic and structural information of the query, effectively improving inference performance and robustness.
[0101] This system also incorporates a progressive embedding optimization mechanism. This method can be deployed independently without modifying the upstream encoder, and progressively optimizes the embedding space through the update and fusion mechanism of the dynamic memory network.
[0102] During the training phase, structural memory is formed for high-frequency logical patterns; during the testing phase, the memory can be quickly activated or updated based on the current query, supporting the model to adapt to structural changes in a lightweight manner.
[0103] It's important to note that in the memory layer, key vectors are used to index or label knowledge, while value vectors store the actual information or knowledge representation. When the model needs to utilize the "memory," it generates a query vector, searches the "memory" for relevant information similar to the key vector, and retrieves the corresponding value vector.
[0104] In addition, this system also includes:
[0105] A hierarchical federated knowledge aggregation architecture is adopted, with local and global layers set up. Edge nodes are set up in the local layer. The edge nodes use differential privacy technology to train subgraphs on the local dataset and upload gradient parameters.
[0106] In the global layer, the central server aggregates gradients to generate a global knowledge graph. It adapts to edge device deployment through a knowledge distillation compression model and uses the knowledge graph schema layer to predict query relevance.
[0107] If the query involves sensitive entity data, irrelevant edge nodes are automatically filtered to reduce the number of edge nodes involved in the calculation.
[0108] Frequently queried subgraphs are cached at edge nodes, and the data with the shortest distance is searched using a consistent hashing algorithm.
[0109] It should be noted that this method fully considers the technical problems of data privacy leakage caused by centralized knowledge graph training and the high network transmission overhead and limited computing power of edge devices during cross-domain queries. Therefore, this technical feature can reduce the risk of privacy leakage and reduce the bandwidth consumption of cross-domain queries.
[0110] In addition, this system also includes:
[0111] Obtain the query data entity, add four-dimensional coordinates (longitude, latitude, altitude, timestamp) to the query data entity, identify hot event clusters (such as regional epidemic outbreaks, emergency events) based on spatiotemporal clustering algorithm, and parse the query data entity through Apache Flink to extract spatiotemporal entity data;
[0112] Determine whether there are contradictory events in the spatiotemporal entity data;
[0113] When a contradictory event is detected in the spatiotemporal entity data, LLM-assisted verification is triggered, and the spatiotemporal entity data is converted into a causal graph query to locate key propagation nodes and generate a visual decision report based on the key propagation nodes.
[0114] When no contradictory events are detected in the spatiotemporal entity data, the queried entity is continuously monitored.
[0115] It should be noted that this method fully considers the technical problems of traditional knowledge graphs neglecting the characteristics of entity evolution over time, which leads to outdated query results and high delays in response to sudden events. Therefore, this distinguishing technical feature is used to improve the response speed to sudden events and the accuracy of spatiotemporal correlation queries.
[0116] In addition, this system also includes:
[0117] A multimodal alignment network is constructed, and graph neural networks (GNN) are used to jointly train text embedding (BERT), image features (ResNet), and temporal sensor data (LSTM) to generate a unified semantic vector space. Entity association weights are dynamically adjusted based on user feedback data (such as click rate and dwell time).
[0118] By combining Large Language Model (LLM) and knowledge graph, user query keywords are extracted through LLM to generate multiple sets of candidate prompt statements (such as "new energy battery fault diagnosis" → "lithium battery thermal runaway detection method").
[0119] By matching subgraphs of the knowledge graph, the semantic similarity between candidate suggestions and historical queries is calculated, and Top-K high-confidence query rewriting schemes are selected.
[0120] Computing resources are dynamically allocated based on query complexity (e.g., number of associated entities > 100), so that simple queries are processed by edge nodes and complex queries are scheduled to the cloud center.
[0121] It should be noted that this method fully considers the fact that existing knowledge graph queries rely on static semantic annotations and cannot dynamically integrate multi-source heterogeneous data such as text, images, and sensors, resulting in cross-modal semantic loss; traditional query optimization does not consider the technical problem of real-time changes in user intent and high response latency. This method aims to optimize cross-modal retrieval accuracy and thus optimize query response time in high-concurrency scenarios.
[0122] A third aspect of the present invention provides a computer-readable storage medium, including a knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks. When the knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks is executed by the processor, it implements the steps of any of the knowledge graph semantic enhancement embedding optimization methods based on dynamic memory networks.
[0123] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.
[0124] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units. They may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.
[0125] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.
[0126] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0127] Alternatively, if the integrated units of this invention are implemented as software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of this invention, or the parts that contribute to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the methods of the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, ROM, RAM, magnetic disks, or optical disks.
[0128] The above are merely specific embodiments of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.
Claims
1. A semantically enhanced embedding optimization method for knowledge graphs based on dynamic memory networks, characterized in that, Includes the following steps: A dynamic memory network is constructed, and memory feature representations are generated by embedding and optimizing the dynamic memory network. The update behavior of the value vector in the memory slot is controlled by the memory feature representation through a GRU-driven memory update mechanism. A three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure; A dynamic feature fusion mechanism is constructed to jointly model the basic query embedding, logical structure features and memory retrieval features.
2. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks according to claim 1, characterized in that, Constructing a dynamic memory network, specifically: Obtain the memory key vector and the memory value vector, and perform orthogonal initialization on the memory key vector to ensure that different logical modes are distributed without overlap in the embedding space; The memory value vector is used to store the inference context information corresponding to the logical pattern, and is dynamically updated through a gated loop unit to capture long-term dependency features of different query structures.
3. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks according to claim 1, characterized in that, By embedding and optimizing the dynamic memory network, a memory feature representation is generated, specifically as follows: Obtain the current logical query representation, calculate the similarity between the logical query representation and all memory key vectors through the scaling dot product attention mechanism, and calculate the attention result based on the scaling dot product attention mechanism; The attention results are used as weights and applied to the corresponding value vectors to generate memory feature representations, which are dynamically adjusted as the query content changes during the retrieval process.
4. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks according to claim 1, characterized in that, The update behavior of the value vector in the memory slot is controlled by a GRU-driven memory update mechanism, specifically as follows: By introducing GRU, the memory feature representation is input into GRU. The reset gate is used to control the degree of forgetting of old memories and to focus on injecting new structures. The update gate is used to balance the fusion ratio of old and new information and stabilize the learning process. Candidate memory representations are generated by combining the current query statistical features with old memories, and the final update is completed through linear combination.
5. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks according to claim 1, characterized in that, A three-layer Transformer encoder is introduced to perform hierarchical parsing of the query structure, specifically: A three-layer Transformer encoder is introduced, with each layer employing a multi-head self-attention mechanism. By combining the logical position bias matrix encoding operator priority and variable scope, logical structure features are extracted and used as supplementary information. The supplementary information and the memory feature representation are combined in the final embedding representation to perform hierarchical parsing of the query structure.
6. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks according to claim 1, characterized in that, A dynamic feature fusion mechanism is constructed to jointly model the basic query embedding, logical structure features, and memory retrieval features. Specifically, this includes: A nonlinear fusion function is constructed using a multilayer perceptron, and the contribution ratio of each feature channel is dynamically adjusted according to the nonlinear fusion function through an adaptive weight generation mechanism. We jointly model the basic query embedding, logical structure features, and memory retrieval features, and obtain the fused embedding representation through joint modeling.
7. The knowledge graph semantic enhancement embedding optimization method based on dynamic memory network according to claim 1, characterized in that, Also includes: The training phase of the dynamic memory network forms a structural memory of high-frequency logical patterns.
8. A knowledge graph semantic enhancement embedding optimization system based on dynamic memory networks, characterized in that, The system includes a memory and a processor. The memory includes a program for a knowledge graph semantic enhancement embedding optimization method based on a dynamic memory network. When the processor executes the program for the knowledge graph semantic enhancement embedding optimization method based on a dynamic memory network, it implements the steps of the knowledge graph semantic enhancement embedding optimization method based on a dynamic memory network as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, The method includes a knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks. When the processor executes the knowledge graph semantic enhancement embedding optimization method program based on dynamic memory networks, it implements the steps of the knowledge graph semantic enhancement embedding optimization method based on dynamic memory networks as described in any one of claims 1-7.
Citation Information
Cited By
Method and system for improving memory capacity of large model
CN121457526A
Language model reasoning method and device based on hierarchical state memory bank and combined initialization, terminal, medium and product
CN121638477A
Scenic area intelligent question answering and recommendation method based on integration of knowledge graph and large model
CN121880532A
