Inductive subgraph retrieval completion method and system for entity update knowledge graph

By constructing graph operation functions and using attention aggregation and gated residual connections, subgraphs are dynamically expanded, solving the sparsity and feature loss problems during entity updates in knowledge graphs. This achieves efficient and accurate entity completion, adapting to dynamic entity updates.

CN121365718APending Publication Date: 2026-01-20XI AN JIAOTONG UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511459196.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-13
Publication Date
2026-01-20

AI Technical Summary

Technical Problem

Existing technologies suffer from sparsity issues when dealing with knowledge graphs that update entities, resulting in high computational costs and loss of feature information. Traditional transfer-based completion methods require retraining the model, which is inefficient.

Method used

We adopt an inductive subgraph retrieval and completion method for entity-oriented knowledge graph updates. By constructing graph operation functions, utilizing triplet retrieval, tail neighbor and head neighbor entity retrieval, and combining attention aggregation and gated residual connections, we dynamically expand the subgraph to achieve efficient reasoning.

Benefits of technology

It effectively solves the sparsity problem when updating entities in knowledge graphs, improves reasoning accuracy and efficiency, significantly increases MRR and reasoning speed, and adapts to dynamic entity updates without retraining.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121365718A_ABST
    Figure CN121365718A_ABST
Patent Text Reader

Abstract

The invention discloses an inductive subgraph retrieval completion method and system for entity update knowledge graph, and belongs to the technical field of information, and the method comprises the following steps: constructing a graph operation function, initializing subgraph parameters, obtaining relation representation through attention aggregation, and calculating entity representation by combining message passing and main neighbor aggregation, and updating the representation by using gated residual connection, expanding the sub-graph and performing scoring to complement the triad. Through local sub-graph retrieval and inductive reasoning, the problem of sparsity during dynamic updating of the knowledge graph is solved, complementation efficiency and accuracy are improved, and the method is suitable for an information retrieval and recommendation system.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The application belongs to the field of information technology, and particularly relates to an inductive subgraph retrieval completion method and system for updating a knowledge graph based on entities. BACKGROUND

[0002] As an important carrier of domain knowledge, a knowledge graph can provide rich entity relationships and attribute information, and also provide potential associated context that is difficult to capture directly from the semantic level. The knowledge graph is often used as a knowledge database and widely applied to information retrieval, dialogue systems, recommendation models and the like. However, due to the partiality of the source information content during construction, the constructed knowledge graph often presents a sparse graph relationship, which reduces its usability.

[0003] The knowledge graph completion technology can effectively solve the sparsity problem in the common knowledge graph, thereby promoting the actual performance of the downstream task. The traditional transfer completion method requires that the entity and relationship sets of the graph are determined, while the entity set of the actually used knowledge graph is often dynamically updated. In this case, the traditional transfer completion method often needs to retrain the machine learning model. Based on the inductive assumption of the knowledge graph relationship, the inductive completion method can be effectively applied to the knowledge graph with entity set updates by avoiding the entity semantic dependence. SUMMARY

[0004] The technical problem to be solved by the present application is to provide an inductive subgraph retrieval completion method and system for updating a knowledge graph based on entities, which constructs an expanded subgraph around the source head entity to overcome the high computational cost caused by global graph information, and a double aggregation graph neural network under triple attention is proposed to ensure high inference accuracy, effectively avoiding the feature information loss of the traditional graph neural network on the knowledge graph network structure, thereby solving the technical problems of low efficiency in subgraph retrieval, self-reference relationship dependence and graph structure feature loss in the prior art during completion.

[0005] The application adopts the following technical solutions: The inductive subgraph retrieval completion method for updating a knowledge graph based on entities comprises the following steps: S1, constructing a graph operation function for a to-be-completed graph , including a triple retrieval operation , a tail neighbor entity retrieval operation and a head neighbor entity retrieval operation , wherein, is a known entity set; S2, initializing a subgraph reasoning depth based on a source head entity and a to-be-completed relationship . , head entity set , candidate entity set , retrieval sub Figure Three , tuple set , head entity representation set , and candidate difference entity set ; S3, for the head entity in the acquired subgraph , and the tail entity , the relationship representation thereof is acquired in an attention aggregation manner ; S4, for the aggregated relationship representation, the representation of the current candidate entity is acquired in combination with message passing and main neighbor aggregation ; S5, for the entity whose entity representation exists in the previous reasoning depth , in combination with the current aggregated entity representation , the entity representation in the current depth is acquired through a gated residual connection ; S6, the reasoning depth is incremented , the subgraph and the candidate entity set are expanded , and steps S2 to S5 are repeated until the maximum reasoning step number is reached ; S7, the candidate entity representation is scored through a linear layer , and the entity with the highest score is selected to complete the triple .

[0006] Preferably, in step S3, the connection relationship therebetween is acquired in an attention aggregation manner to obtain the corresponding representation at the current subgraph depth :

[0007] wherein, is an attention coefficient, is a learnable parameter, respectively represents a query relationship and an embedding dimension, is a LeakyReLU activation function.

[0008] Preferably, the attention coefficient :

[0009] wherein, is a model parameter,​​​​​ for attention hidden layer dimension, for static coefficient.

[0010] Preferably, in step S4, the current candidate entity corresponding representation Specifically: First, by formula Calculate the preliminary representation, wherein, denotes the PNA convergence operation, denotes the conversion operation; Again, by formula Get the final representation, wherein, denotes the PNA convergence function, is the mapping matrix parameter after convergence, The implementation of combines the out-degree information of the message passing head node has been transformed The entire transformation set includes three strategies of amplification , scaling , and keeping .

[0011] Preferably, the three conversion operations are specifically:

[0012]

[0013]

[0014] wherein, , is the embedding vector, , The first half of is the real part, and respectively refer to the second half of the embedding vector as the imaginary part.

[0015] Preferably, the specific calculation of the three strategies in the transformation set is as follows:

[0016]

[0017]

[0018] wherein, is the head entity-relation pair set related to the tail entity at the reasoning depth, is the head entity out-degree information of the node.

[0019] Preferably, in step S5, the current subgraph reasoning depth is obtained by a gated residual connection manner The corresponding representation result is as follows:

[0020] wherein, is the gating coefficient vector at the i-th reasoning depth, is an activation function sigmoid, is an element-wise multiplication, is a layer normalization layer LayerNorm used to normalize the residual connection result. Preferably, the gating coefficient vector at the i-th reasoning depth is as follows:

[0021]

[0022] wherein, is a learnable mapping parameter, is a query relationship embedding of a previous layer.

[0023] Preferably, in step S7, the entity score and the multi-classification loss function are respectively as follows:

[0024] wherein, is a learnable parameter, denotes a representation of an entity, is a highest score result of the model, denotes a true target entity of the query.

[0025] In a second aspect, an embodiment of the present application provides an inductive subgraph retrieval and completion system for updating a knowledge graph with respect to an entity, comprising: a function module, for constructing a graph operation function with respect to a to-be-completed graph , including a triple retrieval operation , a tail neighbor entity retrieval operation and a head neighbor entity retrieval operation , wherein, is a known entity set; a set module, for initializing a subgraph reasoning depth , a head entity set based on a source entity and a to-be-completed relationship ​​​​​Set of candidate entities Search sub Figure Three tuple set Head entity represents a set and the set of candidate difference entities ; The aggregation module, for the already acquired subgraph Head entity in With tail entity The relation representation is obtained by using attention aggregation. ; The entity module, for the aggregated relationship representation, combines message passing and primary neighbor aggregation to obtain the current candidate entities. The representation of For the existence of a previous reasoning depth Entity representation The entity, combined with the current aggregate entity representation The current depth is obtained through gated residual connections. Entity representation below ; Output module, incremental inference depth Expanding subgraph and candidate entity set Repeat the process from set module to entity module until the maximum number of inference steps is reached. The candidate entity is represented by a linear layer. The system scores the data and selects the entity completion triplet with the highest score. .

[0026] Thirdly, a computer device includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described inductive subgraph retrieval and completion method for entity-oriented knowledge graph updates.

[0027] Fourthly, embodiments of the present invention provide a computer-readable storage medium including a computer program, which, when executed by a processor, implements the steps of the above-described inductive subgraph retrieval and completion method for entity-oriented knowledge graph updates.

[0028] Fifthly, a chip includes a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor, when executing the computer program, implements the steps of the above-described inductive subgraph retrieval and completion method for entity-oriented knowledge graph updates.

[0029] In a sixth aspect, an electronic device is provided, which comprises a computer program, and the computer program, when executed by the electronic device, implements the steps of the above-mentioned method for inductive subgraph retrieval completion of entity-oriented knowledge graph updating.

[0030] Compared with the prior art, the present application has at least the following beneficial effects: A method for inductive subgraph retrieval completion of entity-oriented knowledge graph updating effectively solves the sparsity problem during knowledge graph entity updating through dynamic subgraph retrieval and incremental expansion. The graph operation function provides an efficient neighborhood retrieval mechanism, supports dynamic addition and deletion of entities, and ensures the accuracy of the reasoning starting point. The attention aggregation introduces selectivity and focuses on key relationships. The multi-mode message passing enhances the diversity of entity representation. The gated residual connection avoids long path dependence and improves model stability. The differential subgraph expansion reduces redundant computation. The scoring mechanism ensures the completion accuracy. The overall method does not need to be retrained in a dynamic environment, significantly improves the reasoning efficiency and generalization ability, and achieves a 4.6% improvement in MRR and a 3-fold improvement in reasoning speed on the FB15k-237 dataset.

[0031] Further, the importance of different triplets is dynamically weighted through the attention mechanism, improving the discriminability of relationship representation. The LeakyReLU activation function prevents gradient vanishing, and the learnable parameters enhance the model adaptability. The aggregation related to the query ensures the relevance of the completion process and reduces noise interference. Experiments show that this attention mechanism can effectively capture potential associations in sparse graphs, improving the MRR index by about 2.3%.

[0032] Further, the introduction of entity in-degree integrates graph structure information into the attention mechanism, making the model pay more attention to highly connected entities (hot entities) and improving the weight of important relationships. The exponential transformation function enhances the sensitivity of the weight and avoids the numerical overflow problem of the traditional sigmoid function in high-density graphs. This design achieves improvement on the WN18RR dataset, and significantly improves the stability of simultaneous training.

[0033] Further, PNA convergence balances the contributions of different entities through various transformation strategies, avoiding information loss in traditional aggregation. The diversity of conversion operations supports the processing of symmetric, asymmetric and complex relationships, enhancing the model generalization.

[0034] Further, TransE is suitable for processing asymmetric relations, DistMult can effectively model symmetric relations, and RotatE captures multi-relation interaction through complex space operation. The three operations cover most knowledge graph relation types. Users can select appropriate operations according to the characteristics of the graph relations to solve the poor adaptability of traditional single conversion operations. The virtual-real separation calculation of RotatE further improves the modeling accuracy of asymmetric relations and enhances the adaptability of the model to complex graphs.

[0035] Further, the logarithmic operation alleviates the feature imbalance problem caused by the large difference in entity out-degree, making the transformation result more stable. Through set size normalization, the consistency of the transformation strategy under different subgraph scales is ensured. The magnification strategy strengthens the influence of important neighbors, the scaling strategy weakens the interference of noise neighbors, and the maintenance strategy guarantees the integrity of the basic features. The three strategies cooperatively optimize the contribution of neighbor features, improving the discriminability and reliability of entity representation.

[0036] Further, the sigmoid gate dynamically adjusts the weight of the historical representation and the current aggregated representation, avoiding the short path forgetting problem of the long short-term memory network, and highlighting the importance of short path relationship patterns. Layer normalization standardizes the results, alleviates gradient disappearance, and accelerates model convergence. Element-wise multiplication realizes fine-grained fusion of features, ensuring the continuity and integrity of entity representation. Compared with ordinary residual connection, this method can more accurately control feature transmission, reduce the interference of special features in long paths, and improve the generalization ability of the model.

[0037] Further, the gate coefficient calculation integrates multi-dimensional information, and the relationship to be completed ensures that the gate is fitted to the completion target, and the combination of historical and current representations guarantees the coherence of features. The learnable parameters adapt to different graph data, improving the flexibility of the gate. This calculation method enables the gate to dynamically adjust the feature fusion ratio, effectively integrating new features while retaining useful historical features, avoiding feature redundancy or loss, and providing key support for the accuracy of entity representation.

[0038] Further, the linear scoring function calculation is efficient, and the learnable parameters adapt to different entity feature distributions, ensuring the accuracy of the score. The loss function effectively distinguishes positive and negative samples through the difference between the highest score and the real entity score and exponential summation, alleviating the class imbalance problem. Compared with cross-entropy loss, this function is more sensitive to difficult samples, improving the completion ability of the model for edge entities, while reducing the computational complexity through ln operation, balancing training efficiency and model performance.

[0039] It can be understood that the beneficial effects of the above-mentioned second to sixth aspects can be referred to the related description in the first aspect, which will not be repeated here.

[0040] In summary, the application effectively solves the sparsity problem of knowledge graph entity dynamic update by inductive subgraph retrieval and completion; differential subgraph expansion is adopted to avoid redundant calculation, attention aggregation introduces structural information, message passing supports multi-mode relationship, and gated residual connection enhances stability.

[0041] The technical solutions of the application will be further described in detail below with reference to the drawings and embodiments. BRIEF DESCRIPTION OF DRAWINGS

[0042] Figure 1 A flowchart of the application is shown in Figure 1. Figure 2 An algorithm retrieval process example on an actual common sense knowledge graph is shown in Figure 2. Figure 3 A schematic diagram of a computer device provided by an embodiment of the application is shown in Figure 3. Figure 4 A block diagram of a chip according to an embodiment of the application is shown in Figure 4.

[0043] In the figures, 60 is a computer device, 61 is a processor, 62 is a memory, 63 is a computer program, 600 is an electronic device, 610 is a processing unit, 620 is a storage unit, 6201 is a random access storage unit, 6202 is a cache storage unit, 6203 is a read-only storage unit, 6204 is a program / utility, 6205 is a program module, 630 is a bus, 640 is a display unit, 650 is an input / output interface, 660 is a network adapter, and 700 is an external device. DETAILED DESCRIPTION

[0044] The technical solutions in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are only some of the embodiments of the application, rather than all the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the scope of protection of the application.

[0045] In the description of the application, it should be understood that the terms “include” and “contain” indicate the presence of described features, whole, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, whole, steps, operations, elements, components and / or sets thereof.

[0046] It should also be understood that the terms used in the specification of the application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification and the appended claims of the application, unless the context clearly indicates otherwise, the singular forms “a”, “an” and “the” are intended to include the plural forms.

[0047] It should be further understood that the term "and / or" used in the specification and the appended claims of the application, means any combination of one or more of the associated listed items and all possible combinations, and includes these combinations, for example, A and / or B, can represent: A exists alone, A and B exist together, B exists alone, the three cases. In addition, the character " / " in the application generally represents that the front and rear associated objects are in an "or" relationship.

[0048] It should be understood that although the terms first, second, third, etc. may be used in embodiments of the application to describe certain ranges, etc., these ranges should not be limited to these terms. These terms are only used to distinguish one predetermined range from another. For example, the first predetermined range can also be referred to as the second predetermined range, and similarly, the second predetermined range can also be referred to as the first predetermined range, without departing from the scope of embodiments of the application.

[0049] Depending on the context, the word "if" as used herein can be interpreted to mean "when" or "while" or "in response to determining" or "in response to detecting". Similarly, the phrase "if it is determined" or "if (a stated condition or event) is detected" can be interpreted to mean "when it is determined" or "in response to determining" or "when (a stated condition or event) is detected" or "in response to detecting (a stated condition or event)".

[0050] Various structural diagrams according to the disclosed embodiments of the application are shown in the accompanying drawings. These drawings are not drawn to scale, in which certain details are exaggerated for the purpose of clarity and certain details can be omitted. The shapes of various regions, layers and their relative sizes and positional relationships shown in the drawings are only exemplary, and in actuality, they can deviate due to manufacturing tolerances or technical limitations, and a person skilled in the art can additionally design regions / layers with different shapes, sizes and relative positions according to actual needs.

[0051] The application provides an inductive subgraph retrieval completion method for entity updating knowledge graph, constructs triple, neighbor retrieval and other operation functions; initializes parameters based on source entity and relationship to be completed; obtains relationship representation through attention aggregation; obtains entity representation by combining multi-conversion operation and PNA aggregation; optimizes representation through gated residual connection; expands subgraph to maximum depth through difference; and selects optimal entity completion through linear scoring. The system is correspondingly split into five modules to realize the process, which can adapt to entity dynamic update without retraining, and balance efficiency and accuracy.

[0052] Referring to Figure 1 The inductive subgraph retrieval completion method for entity updating knowledge graph comprises the following steps: S1, for the graph to be completed Construct the following for a known set of entities The graph manipulation functions performed meet the subgraph retrieval inference requirements: Triplet search operation

[0053] Tail neighbor entity retrieval operation

[0054] Head Neighbor Entity Retrieval Operation

[0055] S2, For the source entity of the input Relationship to be completed Initialize subgraph inference depth Initialize the header entity set Initialize the candidate entity set Initialize the search sub Figure Three tuple set Initialize the header entity to represent the set Set of candidate differential entities ; S3, For the already acquired subgraph Head entities with connection relationships With tail entity The attention aggregation method is used to obtain the connection relationships between them. At the current subgraph depth The following correspondence indicates :

[0056] in, Attention coefficient For learnable parameters, These represent the query relationship and the embedded dimension, respectively. This is the LeakyReLU activation function.

[0057] Based on the original settings of the graph attention neural network technology, the leakage rate is set to... ;calculate The aim is to make aggregated values ​​and queries Strongly correlated, and This refers to pointwise vector multiplication. Assuming different triples have varying importance in message passing, and considering that applying attention scaling to each relation within the triple can effectively introduce selectivity, the attention coefficient is calculated using the following formula. :

[0058] in, is the model parameter, is the attention hidden layer dimension. In practice, multi-head attention is adopted to enhance selectivity. is the static coefficient, denotes the entity in subgraph in-degree. To address the challenge of different distribution graphs for the same relationship type, a random attention mask mechanism is introduced in training. For each relationship , has probability of being masked as 0. In implementation, we ensure that each entity retains at least one unmasked relationship to maintain training correctness.

[0059] S4, for the aggregated relationship representation result, combine message passing and principal neighbor aggregation (PNA, hereinafter referred to as PNA) to obtain the current candidate entity corresponding representation , denotes the PNA convergence operation:

[0060] wherein, adopt the conversion operation implementation of classical embedding method, including TransE, DistMult, RotatE three optional operation modes, for input embedding and , the specific implementation of these operations is as follows:

[0061]

[0062]

[0063] wherein, , is the embedding vector, , the first half of the real part, and respectively, the second half of the embedding vector is the imaginary part.

[0064] finally, combined with PNA, the current subgraph reasoning depth the next candidate entity denotes acquisition:

[0065] wherein, denotes the PNA convergence function, These are the parameters of the converged mapping matrix.

[0066] The specific implementation is as follows:

[0067] in, This represents a vector concatenation operation, and it also incorporates the message passing header node. Out-degree information Transformed The complete set of transformations Including magnification Scaling ,Keep The three strategies and their corresponding calculation methods are as follows:

[0068]

[0069]

[0070] S5. For cases where there is a previous inference depth Corresponding entity representation Combined with the current aggregated entity representation Get the current subgraph inference depth for the target entity. The following correspondence represents the result. :

[0071] in, For learnable mapping parameters, Embedded for the preceding query relationship. The activation function is sigmoid. For element-wise multiplication, LayerNorm is used to normalize residual connection results.

[0072] S6, Incremental Reasoning Deployment Collect new triplet Obtain a new set of candidate differential entities. Expand the set of candidate entities , Expanding subgraph Repeat steps S2 to S5 until... Reaching the set maximum number of reasoning steps ; An example of the subgraph retrieval expansion process is as follows: Figure 2 As shown.

[0073] S7. Candidate entities obtained through linear layer pairs Corresponding representation Get entity rating Select the entity with the highest entity score to obtain the complete triplet. .

[0074] Special final candidate entity set The score for entities that do not appear in the text is set to .

[0075] During the model training phase, a multi-class loss function is used to optimize the model scoring results. and The calculation methods are as follows:

[0076] in, For learnable parameters, Entity The expression, This is the highest score result from the model. Refers to the actual target entity being queried.

[0077] In another embodiment of the present invention, an inductive subgraph retrieval and completion system for entity-updated knowledge graphs is provided. This system can be used to implement the above-mentioned inductive subgraph retrieval and completion method for entity-updated knowledge graphs. Specifically, the inductive subgraph retrieval and completion system for entity-updated knowledge graphs includes a function module, a set module, an aggregation module, an entity module, and an output module.

[0078] Among them, the function module is for the map to be completed. Construct graph manipulation functions, including triplet retrieval operations. Tail neighbor entity retrieval operation Head neighbor entity retrieval operation ,in, Given a set of entities; Collection module, based on source entity Relationship to be completed Initialize subgraph inference depth Head entity set { Set of candidate entities Search sub Figure Three tuple set Head entity represents a set and the set of candidate difference entities ; The aggregation module, for the already acquired subgraph Head entity in With tail entity The relation representation is obtained by using attention aggregation. ; entity module, for the aggregated relational representation, combining message passing and main neighbor aggregation to obtain current candidate entity representations for the existence of a previous reasoning depth entity representation , combining the current aggregated entity representation , obtaining the entity representation under the current depth through a gated residual connection ; output module, incrementing the reasoning depth , expanding the subgraph and candidate entity set , repeating the set module to the entity module until the maximum reasoning step number is reached , scoring the candidate entity representations through a linear layer , selecting the highest scoring entity to complete the triple .

[0079] The application provides a terminal device, which comprises a processor and a memory, the memory is used for storing a computer program, the computer program comprises program instructions, and the processor is used for executing the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components and the like, which are the computing core and control core of the terminal, and are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions to implement a corresponding method flow or a corresponding function. The processor in the embodiment of the application can be used for the operation of the inductive subgraph retrieval completion method for updating the entity-oriented knowledge graph, and the operation comprises the following steps: for the to-be-completed graph , constructing a graph operation function, comprising a triple retrieval operation , a tail neighbor entity retrieval operation and a head neighbor entity retrieval operation , wherein ​The known entity set is obtained based on the source entity and the relationship to be completed , initialize the subgraph reasoning depth , the head entity set { , the candidate entity set , search sub Figure Three , the tuple set , the head entity representation set and the candidate difference entity set ; for the head entity and the tail entity in the obtained subgraph , the relationship representation is obtained by using attention aggregation ; for the aggregated relationship representation, the representation of the current candidate entity is obtained by combining message passing and main neighbor aggregation ; for the entity with the previous reasoning depth entity representation , the entity representation at the current depth is obtained by combining the current aggregated entity representation through a gated residual connection ; increment the reasoning depth , expand the subgraph and the candidate entity set , repeat the steps until the maximum reasoning step number is reached ; score the candidate entity representation by a linear layer , and select the entity with the highest score to complete the triple .

[0080] Please refer to Figure 3 , the terminal device is a computer device, the computer device 60 of the embodiment includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61, which implements the method for estimating the concentration of radioactive iodine species in the post-accident containment when executed by the processor 61, to avoid repetition, which will not be described here. Alternatively, the computer program 63 is executed by the processor 61 to implement the functions of each model / unit in the inductive subgraph retrieval and completion system for updating the knowledge graph based on entities of the embodiment, to avoid repetition, which will not be described here.

[0081] The computer device 60 can be a desktop computer, a notebook, a palm computer, and a cloud server, etc. The computer device 60 can include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art can understand that Figure 3The computer device 60 is merely an example and does not constitute a limitation on the computer device 60, which can include more or fewer components than shown, or combine some components, or have different components, such as the computer device can also include an input / output device, a network access device, a bus, etc.

[0082] The processor 61 can be a central processing unit (CPU), and can also be other general-purpose processors, graphics processing units (GPUs), tensor processing units (TPUs), digital signal processors (DSPs), application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gates or transistor logic, discrete hardware components, etc. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor.

[0083] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or a memory of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device 60.

[0084] Further, the memory 62 can include both an internal storage unit and an external storage device of the computer device 60. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.

[0085] Please refer to Figure 4 , the terminal device is an electronic device 600, which is in the form of a general-purpose computing device. The components of the electronic device can include but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different platform components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.

[0086] The storage unit stores program codes which can be executed by the processing unit 610, so that the processing unit 610 performs the steps according to various exemplary embodiments of the present application described in the above method part of the present specification. For example, the processing unit 610 can perform the steps as shown in FIG. 6. Figure 1

[0087] The storage unit 620 can include a readable medium in the form of a volatile storage unit, such as a random access memory (RAM) 6201 and / or a cache memory 6202, and can further include a read-only memory (ROM) 6203.

[0088] The storage unit 620 can further include a program / utility 6204 having a set of programs / modules 6205, including but not limited to: an operating system, one or more application programs, other program modules, and program data, each or a combination thereof, which can include implementation of a network environment.

[0089] The bus 630 can represent one or more of several types of bus structures, including a storage unit bus or bus controller, a peripheral bus, a graphics acceleration port, a processing unit bus, or a local bus using any of a variety of bus architectures.

[0090] The electronic device 600 can also communicate with one or more external devices 700 such as a keyboard or pointing device, a Bluetooth device, etc.; user interfaces and / or peripheral devices such as a joystick, game pad, satellite dish, scanner, or the like; and / or one or more devices that enable

[0091] Example 4 ​The present application further provides a storage medium, specifically a computer readable storage medium, which is a memory device in the terminal device, and is used to store programs and data. It can be understood that the computer readable storage medium herein can include the built-in storage medium in the terminal device, and of course can include the expansion storage medium supported by the terminal device, and can be any tangible medium containing or storing programs, which can be used by or in combination with an instruction execution system, device or apparatus. The computer readable storage medium provides a storage space, which stores the operating system of the terminal. Moreover, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be noted that more specific examples of the computer readable storage medium include an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical fiber, a portable compact disk read-only memory, an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0092] The computer readable storage medium further includes a data signal carried in baseband or propagated as a carrier wave, in which readable program codes are borne. Such a propagated data signal can take various forms, including but not limited to electro-magnetic signal, optical signal or any suitable combination of the above. The readable storage medium can also be any readable medium other than the readable storage medium, which can send, propagate or transmit programs for use by or in combination with an instruction execution system, device or apparatus. The program codes contained on the readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, radio frequency, etc., or any suitable combination of the above.

[0093] The program codes for executing the operation of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" language or similar programming languages. The program codes can be executed entirely on the user computing device, partially on the user device, as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case involving a remote computing device, the remote computing device can be connected to the user computing device through any kind of network, including local area network or wide area network, or can be connected to an external computing device (for example, connected through the Internet by using an Internet service provider).

[0094] The one or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the inductive subgraph retrieval completion method for entity-oriented updating of the knowledge graph in the above embodiments. The one or more instructions stored in the computer readable storage medium are loaded and executed by the processor to implement the following steps: For the to-be-completed graph , a graph operation function is constructed, including a triple retrieval operation , a tail neighbor entity retrieval operation , and a head neighbor entity retrieval operation , wherein, is a set of known entities; based on a source entity and a to-be-completed relationship , an initial subgraph reasoning depth , a set of head entities , a set of candidate entities , a set of retrieved triples Figure Three , a set of head entity representations , and a set of candidate difference entities ; for a head entity and a tail entity in the obtained subgraph , a relationship representation thereof is obtained using an attention aggregation method ; for the aggregated relationship representation, a representation of the current candidate entity is obtained by combining message passing and main neighbor aggregation ; for an entity with a previous reasoning depth entity representation , a representation of the entity at the current depth is obtained by combining the current aggregated entity representation and a gate residual connection ; the reasoning depth is incremented , the subgraph and the set of candidate entities are expanded , and the steps are repeated until the maximum reasoning step number is reached ; the candidate entity representation is scored by a linear layer, and the entity with the highest score is selected to complete the triple .

[0095] The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a blockchain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.​

[0096] In order to make the purposes, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the claimed present application, but only represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative labor fall within the scope of protection of the present application.

[0097] In the case of setting the maximum subgraph depth to 6, the proposed method and the previous directed subgraph message passing completion method achieve average reciprocal ranking index results of 0.435 and 0.374 respectively on the high-density knowledge graph FB15k-237 using the same equipment, which shows a significantly higher reasoning accuracy. The reasoning time of the two methods is about 1.5 seconds and 4.5 seconds respectively on a subgraph with a depth of 3, and the proposed method model has a significant improvement in reasoning speed.

[0098] The experimental results prove the effectiveness of the method compared with recent methods on three common sense knowledge graphs FB15k-237, WN18RR and NELL-995. Among them, the proposed method on FB15k-237 with entity updates achieves 4.6%, 1.3% and 9.6% improvements in MRR (average reciprocal rank), (Hits@1) first hit rate and (His@10) top 10 hit rate, respectively, and 4.3%, 4.1% and 2.2% improvements in the traditional case without entity updates, while the training time is shortened by about 50% compared with the near-level model achieving the same performance on the validation set.

[0099] The present application is applied to the subgraph data of FB15k-237 containing newly added entities, wherein the training set contains 1594 entities, 180 relationships and 4245 triples, and the test set contains 1093 entities not seen during training, 180 relationships, and the model needs to predict 411 missing triples on the basis of the existing 1993 triples. The model embedding size is set to 32, the maximum subgraph depth is set to 8, the attention head is set to 4, the attention random mask probability is set to 0.1, the inter-layer dropout probability is set to 0.15, and the learning rate is set to , the training batch size is 64, the deep learning optimization algorithm is AdamW, 981 entity ranges on the training set are used to verify the triplets to select the optimal model under different training periods, the GPU device Nvidia RTX4090 is used to train the model for about 3 minutes and 37 seconds, and finally the average reciprocal ranking index result of 0.478 is obtained on the 411 triplets in the test, and the first 1 hit rate and the first 10 hit rate are 0.386 and 0.629 respectively In summary, the present application is an inductive subgraph retrieval and completion method and system for updating the entity knowledge graph, which takes into account the efficiency and accuracy of the completion. Subgraph differential retrieval avoids redundant calculation, and the inference speed is significantly improved. The gating residual connection and attention mechanism ensure that the structural features are not lost. Multiple conversion operations adapt to various relationships. Without retraining, it can cope with dynamic entity updates, and the MRR and hit rate are improved on the FB15k-237 graph, the training time is shortened by 50%, providing high-quality graph support for downstream tasks such as information retrieval and recommendation, and having high application value.

[0100] Those skilled in the art can clearly understand that, for the convenience and brevity of description, only the division of the above functional units and modules is exemplified, and in actual application, the above functions can be completed by different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated in one processing unit, or each unit can be physically present separately, or two or more units can be integrated in one unit. The above integrated unit can be realized in the form of hardware or software function unit. In addition, the specific names of each functional unit and module are only for easy distinction, and do not limit the protection scope of the application. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, which will not be described here.

[0101] In the above embodiments, the description of each embodiment has its own emphasis, and the parts not described or recorded in a certain embodiment can be referred to the related description of other embodiments.

[0102] Those skilled in the art can realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether the functions are executed in hardware or software depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0103] In the embodiments of the present application, it should be understood that the disclosed apparatus / terminal and method can be implemented in other manners. For example, the embodiments of the apparatus / terminal described above are merely schematic, and the division of the modules or units is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections between the units can be indirect couplings or communication connections through some interfaces, devices or units, and can be electrical, mechanical or in other forms.

[0104] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the embodiments.

[0105] In addition, each functional unit in the various embodiments of the present application can be integrated into a processing unit, or each unit can be a physically independent unit, or two or more units can be integrated into a unit. The integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

[0106] The integrated module / unit, if implemented in the form of a software functional unit and sold or used as an independent product, can be stored in a computer readable storage medium. Based on such understanding, all or part of the flow of the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the computer program can be stored in a computer readable storage medium. When the processor executes the computer program, the steps of each method embodiment described above can be implemented. The computer program includes computer program code, which can be in the form of source code, object code, executable file or some intermediate form. The computer readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the computer readable medium can include or exclude content according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0107] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One means for functionally implementing the steps in one or more flow or blocks

[0108] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the function specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One means for functionally implementing the steps in one or more flow or blocks

[0109] The computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart block or blocks. Figure One one or more flow or blocks Figure One Figure One means for functionally implementing the steps in one or more flow or blocks

[0110] The above merely provides the technical idea of the present application, and cannot be used to limit the protection scope of the present application. Any modification made according to the technical idea of the present application, on the basis of the technical solutions, falls within the protection scope of the claims of the present application.

Claims

1. An inductive subgraph retrieval completion method for updating a knowledge graph towards an entity, characterized in that, The method comprises the following steps: S1, for a to-be-completed graph , constructing a graph operation function, including a triple search operation , a tail neighbor entity search operation , and a head neighbor entity search operation , wherein, is a known entity set; S2, based on source entity and to-be-completed relations , initialize subgraph reasoning depth , head entity set { , to-be-selected entity set , retrieve subgraph triple set , head entity representation set and to-be-selected difference entity set ; S3, for the acquired sub-graph head entity and tail entity , the relation representation is acquired in an attention aggregation manner ; S4, for the post-aggregation relationship representation, acquire the current candidate entity in combination with message passing and main neighbor aggregation representation ; S5, for the existence of the previous reasoning depth entity representation of the entity, in combination with the current aggregated entity representation , the entity representation at the current depth is obtained through a gated residual connection ;​ S6, incrementing the reasoning depth , expanding sub-graphs and the set of candidate entities , repeating steps S2 to S5 until a maximum number of reasoning steps is reached ; S7、through the linear layer to the entity representation to be selected scored, the highest scoring entity completes the triple . 2.The method of claim 1, wherein, In step S3, the attention aggregation method is used to obtain the connection relationship therebetween At the current subgraph depth The following corresponding representation : where, is an attention coefficient, is a learnable parameter, respectively represent the query relation and embedding dimension, is a LeakyReLU activation function. 3.The method of claim 2, wherein, Attention coefficient : wherein, is a model parameter, is an attention hidden layer dimension, is a static coefficient. 4.The method of claim 1, wherein, In step S4, the current candidate entity is acquired Corresponding representation Specifically: First a preliminary representation is computed by the formula wherein, represents a PNA convergence operation, represents a conversion operation; The final representation is obtained by the formula where, represents the PNA convergence function, is the post-convergence mapping matrix parameter, The implementation combines the message passing head node out-degree information has been transformed The entire set of transformations includes three strategies: magnification scaling , and preservation .

5. The method of claim 4, wherein the method further comprises: The three conversion operations are specifically: wherein , is an embedding vector, , the first half of the embedding vector is a real part, and the second half of the embedding vector is an imaginary part, respectively. 6.The method of claim 4, wherein, Transform set The specific calculations for the three strategies are as follows: wherein, is the number of head entities related to the tail entity is the out-degree information of the head entity.

7. The method of claim 1, wherein, In step S5, the current subgraph reasoning depth is obtained by a gated residual connection manner The following corresponding representation result is: wherein, is the gating coefficient vector at reasoning depth, is the activation function sigmoid, is the element-wise multiplication, is the layer normalization layer LayerNorm for normalizing the residual connection result. 8.The method of claim 7, wherein, No. Gating coefficient vector at inference depth for: wherein, is a learnable mapping parameter, is a previous layer query relation embedding. 9.The method of claim 1, wherein, In step S7, the entity score and the multi-class loss function are respectively: wherein, are learnable parameters, refers to an entity representation, is the highest scoring result of the model, refers to the true target entity of the query.

10. An inductive subgraph retrieval completion system for updating a knowledge graph towards an entity, characterized in that, comprising: a function module, for constructing a graph operation function, including a triple search operation , a tail neighbor entity search operation , and a head neighbor entity search operation , wherein , wherein is a set of known entities; collection module, based on source entity and to-be-completed relations , initialize subgraph reasoning depth , head entity collection { , to-be-selected entity collection , search subgraph triple collection , head entity representation collection and to-be-selected difference entity collection ; aggregating the modules, for the head entity in the acquired subgraph and the tail entity , a relation representation is acquired in an attention aggregation manner ;​ entity module, for the aggregated relational representation, combining message passing and main neighbor aggregation to obtain the current candidate entity representation of the entity , for the existence of the previous reasoning depth entity representation of the entity, combined with the current aggregated entity representation , through the gated residual connection to obtain the entity representation under the current depth ;​ Output module, incremental inference depth Expanding subgraph and candidate entity set Repeat the process from set module to entity module until the maximum number of inference steps is reached. The candidate entity is represented by a linear layer. The system scores the data and selects the entity completion triplet with the highest score. .