Knowledge graph fusion method and device
By establishing virtual links in the knowledge graph and merging objects, the problems of low efficiency and high cost of knowledge graph fusion in the existing technology are solved, and efficient graph fusion is achieved.
Patent Information
- Application Number
- CN202410985329.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-23
- Publication Date
- 2024-11-12
AI Technical Summary
The existing knowledge graph fusion methods have problems of excessive consumption of time resources and storage resources, resulting in low fusion efficiency and high cost.
Create a virtual link relationship between objects in different graphs through a pre-set link dictionary, and merge the virtually connected objects into new objects according to the fusion configuration, thereby fusing the graph into a logical new graph, reducing storage space consumption and nodes communication between the two.
It greatly improves the fusion efficiency of knowledge graphs, reduces time and storage costs, and reduces data redundancy and communication consumption between nodes.
Smart Images

Figure CN118940825A_ABST
Abstract
Description
[0001] This application is a divisional application of the invention patent application with application number 2024102008745 filed on February 23, 2024, and entitled “A method and device for fusion of knowledge graphs”. Technical Field
[0002] One or more embodiments of the present specification relate to the field of knowledge graphs, and in particular, to a method and device for fusing knowledge graphs. Background Art
[0003] The knowledge graph describes entities and their relationships in the objective world in the form of a structured language network, providing a way to organize and manage the massive amount of information in the objective world. At present, knowledge graphs are widely used in many fields such as natural language processing, machine learning, data mining, and recommendation systems. In actual production scenarios, different business lines often have different knowledge graphs. Some cross-business line business reasoning often needs to be based on the fusion of knowledge graphs of different business lines. Existing solutions for integrating knowledge graphs often consume too much time and storage resources.
[0004] Therefore, in order to improve the fusion efficiency of knowledge graphs and reduce the time and storage resources consumed in performing fusion, a new knowledge graph fusion method is needed. Summary of the invention
[0005] One or more embodiments of this specification describe a method and device for fusing knowledge graphs, which can greatly improve the fusion efficiency of different knowledge graphs, reduce the time cost and storage cost consumed in fusing different knowledge graphs, and solve the shortcomings of the existing technology.
[0006] According to a first aspect, a knowledge graph fusion method is provided, comprising:
[0007] Establishing a virtual link relationship between a first object in the first graph and a second object in the second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object;
[0008] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, and the first graph and the second graph are fused into the third graph through the association of the third object.
[0009] In a possible implementation manner, the correspondence between the first object and the second object includes a correspondence between an identifier of the first object and an identifier of the second object, and a correspondence between an object type of the first object and an object type of the second object.
[0010] In a possible implementation, the method further includes adding a corresponding relationship between the third object in the first graph and the fourth object in the second graph in the link dictionary, so as to construct a virtual link relationship between the third object and the fourth object; and / or,
[0011] The corresponding relationship between the first object and the second object is deleted in the link dictionary.
[0012] In a possible implementation, the fusion configuration includes attribute fusion rules;
[0013] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0014] A third object is generated, and attributes of the third object are obtained according to the attribute fusion rule, the attributes of the first object and the attributes of the second object.
[0015] In a possible implementation, the object fusion configuration includes an inbound and outbound edge fusion rule;
[0016] Based on a preset object fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0017] The out-edge and in-edge of the third object are obtained according to the out-edge and in-edge of the first object in the first graph, the out-edge and in-edge of the second object in the second graph, and the out-edge and in-edge fusion rule.
[0018] In a possible implementation, the fusion configuration further includes a type fusion rule, wherein the type fusion rule indicates a first type to which the first object belongs, a second type to which the second object belongs, and a target type of a fused object of the first type of object and the second type of object;
[0019] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0020] The type of the third object is set to the target type.
[0021] In a possible implementation manner, the first graph and the second graph are stored in a plurality of partition nodes, and the partition index field of the first graph is the same as the partition index field of the second graph;
[0022] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0023] In at least one partition node, the initiator corresponding to the first graph merges the first object and the second object into a third object through a local merge operation based on a preset fusion configuration.
[0024] In a possible implementation manner, the first graph and the second graph are stored in a plurality of partition nodes, and the partition index field of the first graph is different from the partition index field of the second graph;
[0025] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0026] In at least one partition node, the initiator corresponding to the first graph merges the first object and the second object into a third object through a remote merge operation based on a preset fusion configuration.
[0027] In a possible implementation manner, the first graph and the second graph are stored in a plurality of partition nodes, and the partition index field of the first graph is different from the partition index field of the second graph;
[0028] Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including:
[0029] The initiator corresponding to the first graph reorders the second graph in the cache of each partition node according to the partition index field of the second graph to obtain a reordered backup corresponding to the cache of the second graph in each partition node;
[0030] In at least one partition node, based on a preset fusion configuration and the reordered backup, the first object and the second object are merged into a third object through a local merge operation.
[0031] In a possible implementation, the method further includes updating the reordered backup in response to addition or deletion of an object in the second graph.
[0032] According to a second aspect, a knowledge graph fusion device is provided, the device comprising:
[0033] A link unit configured to establish a virtual link relationship between a first object in the first graph and a second object in the second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object;
[0034] The combining unit is configured to fuse the first object and the second object having a virtual connection relationship into a third object based on a preset fusion configuration, and fuse the first graph and the second graph into the third graph through the association of the third object.
[0035] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed in a computer, the computer is caused to execute the method described in the first aspect.
[0036] According to a fourth aspect, a computing device is provided, including a memory and a processor, wherein an executable code is stored in the memory, and when the processor executes the executable code, the method described in the first aspect is implemented. By using one or more of the methods, devices, computing devices, and storage media in the above aspects, the fusion efficiency of different knowledge graphs can be greatly improved, and the time cost and storage cost consumed by fusion of different knowledge graphs can be reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0038] Figure 1 A schematic diagram of a scenario of integrating knowledge graph is shown;
[0039] Figure 2 A schematic diagram showing a fusion solution of a knowledge graph;
[0040] Figure 3 A schematic diagram showing the establishment of virtual links between objects in different graphs provided in an embodiment of this specification;
[0041] Figure 4 A schematic diagram showing the fusion of objects in different graphs provided in an embodiment of this specification;
[0042] Figure 5 A flow chart showing a method for fusing knowledge graphs provided in an embodiment of this specification;
[0043] Figure 6 A schematic diagram showing a link dictionary provided by an embodiment of this specification;
[0044] Figure 7 A schematic diagram showing object attribute fusion provided by an embodiment of this specification;
[0045] Figure 8 A schematic diagram showing object type fusion provided by an embodiment of this specification;
[0046] Fig. 9 A schematic diagram showing a local merge object provided by an embodiment of this specification;
[0047] Fig.10 A schematic diagram showing a remote merge object provided by an embodiment of this specification;
[0048] Fig.11 A schematic diagram showing a reordering backup in a node cache provided by an embodiment of this specification is shown;
[0049] Fig.12 A structural diagram of a knowledge graph fusion device provided in an embodiment of this specification is shown. DETAILED DESCRIPTION
[0050] The solution provided in this specification is described below in conjunction with the accompanying drawings.
[0051] As mentioned above, the knowledge graph describes entities and their relationships in the objective world in the form of a structured semantic graph. Its basic component is usually an "entity-relationship-entity" triple. Entities are connected to each other through relationships to form a network of knowledge structures. It provides a way to organize and manage massive amounts of information in the objective world. At present, knowledge graphs are widely used in many fields such as natural language processing, machine learning, data mining, and recommendation systems. In actual production scenarios, for example, different business fields often have different knowledge graphs. Business reasoning across business fields often needs to be based on the fusion of knowledge graphs in different business fields. Through cross-domain graph fusion, the problems of data silos and data sparsity in different business fields can be effectively solved. Figure 1 A schematic diagram of a scenario integrating knowledge graph is shown. Figure 1 As shown, for example, the payment medium map is mainly used to save the relationship between users and medium entities such as WI FI or POI (Point of Interest), and the capital flow map is mainly used to save the network and links of capital transactions or capital flows between users. If you want to find the capital links of the associated users of the medium based on the illegal media you have already obtained, you hope to first merge the payment medium map and the capital flow map into a comprehensive map that includes both the relationship between users and medium entities and the capital transaction links between users, and then implement the search from the medium entity to the capital transaction link on the comprehensive map. However, the existing solutions for integrating knowledge graphs often have the problem of consuming too much time and storage resources.
[0052] In order to clearly illustrate the advantages of the method for fusing knowledge graphs provided in this specification, the following is a brief introduction to existing knowledge graph fusion solutions and their existing problems. Figure 2 A schematic diagram of a knowledge graph fusion solution is shown. Figure 2As shown, for example, business graph A is stored in service node 1, and business graph B is stored in service node 2. Usually, the data of business graph A and business graph B need to be read into, for example, service node 3 for fusion. This solution has the following problems: On the one hand, a large amount of data transmission is required between different nodes during the fusion process, which generates a large amount of communication consumption between nodes, making the knowledge graph fusion take a long time and the knowledge graph fusion efficiency is low. On the second aspect, for example, in the graph fusion process in service node 3, it is often necessary to merge the table storage structure of business graph A and business graph B into the table storage structure of a new fused graph. In this process, a large amount of data redundancy and additional consumption of storage space may be generated, making the computational cost and storage cost of the fused knowledge graph high.
[0053] In order to solve the above technical problems, the embodiments of this specification provide a method for fusing knowledge graphs. The core idea is to establish virtual link relationships between different objects in different graphs according to a pre-set link dictionary, and then merge different objects in different graphs with virtual link relationships into new objects according to a pre-set fusion configuration, and fuse different graphs into a new graph based on the new objects. Figure 3 FIG. 1 is a schematic diagram showing a method of establishing virtual links between objects in different graphs provided in an embodiment of this specification. Figure 3 As shown, for example, there are two knowledge graphs of different business lines, business graph A and business graph B. For example, first, a virtual connection relationship can be established between object a in business graph A and an object in business graph B according to a preset link dictionary. Figure 4 A schematic diagram showing the fusion of objects in different graphs provided in the embodiments of this specification is shown. Figure 4 As shown, for example, Figure 3On the basis of establishing a virtual connection between object a in business graph A and object b in business graph B, object a and object b are fused into object c according to a pre-set fusion configuration. For example, the properties of object c can be obtained by combining the properties of object a and object b, and the outgoing edges and incoming edges of object c can include the outgoing edges and incoming edges of object a and object b. Since the outgoing edges and incoming edges of object c include outgoing edges and / or incoming edges connected to other nodes in business graph A, and also include outgoing edges and / or incoming edges connected to other nodes in business graph B, object c can be both a part of business graph A and a part of business graph B, and further, business graph A and business graph B can be connected into a new fused graph through object c. This method has the following advantages: First, by establishing a virtual link between different objects in the two knowledge graphs, and merging different objects with virtual link relationships into new objects, the original two knowledge graphs are connected into a logically fused graph through the new objects. Since the new fusion graph is essentially a logical fusion graph, there is no need to establish a table storage structure of the fusion graph on other nodes, which can greatly reduce the consumption of storage space and eliminate the large amount of data redundancy often caused by field redundancy in the process of fusion of table structures of different knowledge graphs, thus reducing the computational cost and storage cost of the fusion knowledge graph. Second, through this method, the object data in the fusion graph belonging to the original knowledge graph is still stored on the original storage node and does not need to be moved to other nodes for data fusion, thus greatly reducing the amount of data transmission between nodes, reducing the communication consumption between nodes, and greatly improving the fusion efficiency of the knowledge graph.
[0054] A knowledge graph fusion method provided by an embodiment of this specification is described in detail below. Figure 5 A flow chart of a knowledge graph fusion method provided in an embodiment of this specification is shown. Figure 5 As shown, the method comprises at least the following steps:
[0055] Step S501, establishing a virtual link relationship between a first object in a first graph and a second object in a second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object;
[0056] Step S503: Based on a preset fusion configuration, the first object and the second object having a virtual connection relationship are fused into a third object, and the first graph and the second graph are fused into the third graph through the association of the third object.
[0057] First, in step S501, a virtual link relationship between a first object in the first graph and a second object in the second graph is established according to a preset link dictionary, and a corresponding relationship between the first object and the second object in the link dictionary. In this step, a virtual link relationship between the first object in the first graph and the second object in the second graph can be established according to the corresponding relationship between the first object and the second object included in the link dictionary. In different embodiments, the specific types of the first graph and the second graph may be different, and the specific businesses used may also be different, which is not limited in this specification. In one embodiment, the first graph may be, for example, a payment medium graph, which is mainly used to save the relationship between the user and the media entity such as WI FI or POI (Point of Interest), and the second graph may be, for example, a fund flow graph, which is used to save the network and link of fund transactions or fund flows between users.
[0058] The object may be an entity in the knowledge graph, or an entity object. The first object and the second object may be entity objects in the first graph and the second graph, respectively. In different embodiments, the entity objects included in the knowledge graph may be different according to the different knowledge graphs, and the specific types of the first object and the second object may also be different. In one embodiment, the correspondence between the first object and the second object may be predetermined and added to the link dictionary. In different specific embodiments, the specific manner of determining the correspondence between the first object and the second object may be different, and this specification does not limit this. In one embodiment, for example, the correspondence between the first object and the second object may be determined according to the type and / or attribute of the first object and the second object. For example, in the above example where the first graph is a payment medium graph and the second graph is a capital flow graph, for example, the correspondence between the first object and the second object may be determined according to the first object in the payment medium graph, whose type is a user object, and whose "name" attribute is "Zhang San", and the second object in the capital flow graph, whose type is a user object, and whose "name" attribute is also "Zhang San". In another example, for example, the correspondence between the first object and the second object can be determined based on the first object in the payment medium map, whose type is a user object and whose "name" attribute is "Zhang San", and the second object in the capital flow map, whose type is a user object and whose "name" attribute is "Zhang San".
[0059] In different embodiments, the specific form of the correspondence between the first object and the second object stored in the link dictionary may be different. In one embodiment, the correspondence between the first object and the second object may include a correspondence between an identifier of the first object and an identifier of the second object, and a correspondence between an object type of the first object and an object type of the second object. Figure 6 FIG. 2 is a schematic diagram showing a link dictionary provided in an embodiment of this specification. Figure 6 As shown, the link dictionary includes, for example, the correspondence between an object of type H with ID 01 in the first graph and an object of type I with ID 04 in the second graph. In actual production scenarios, for example, the virtual connection relationship between objects in the first graph and the second graph can be one or more. Therefore, the virtual connection relationship between objects in the first graph and the second graph in the link dictionary can be one or more. For example, Figure 6 As shown, the link dictionary also includes the correspondence between the object with ID 02 of type H in the first graph and the object with ID 05 of type I in the second graph.
[0060] In addition, in actual production scenarios, the fusion relationship of knowledge graphs often changes with the development of the business. In order to solve this problem, the virtual link relationship between objects in different knowledge graphs can be modified. To this end, the correspondence between objects in the link dictionary can also be added or deleted after pre-setting, so as to be used to update or set new virtual link relationships based on the updated link dictionary in subsequent steps. Therefore, in one embodiment, the correspondence between the third object in the first graph and the fourth object in the second graph can be added to the link dictionary to construct a virtual link relationship between the third object and the fourth object; and / or, the correspondence between the first object and the second object is deleted in the link dictionary.
[0061] Thereafter, in step S503, based on the preset fusion configuration, the first object and the second object having a virtual connection relationship can be fused into a third object, and the first map and the second map can be fused into the third map through the association of the third object. In this step, the first object and the second object can be fused into the third object according to the fusion configuration for the object. Since the fused third object is respectively associated with the first map and the second map, the first map and the second map can be fused into the third map through the third object.
[0062] In different embodiments, the specific content included in the fusion configuration may be different. In one embodiment, the fusion configuration may include attribute fusion rules. Furthermore, a third object may be generated, and the attributes of the third object may be obtained according to the attribute fusion rules, the attributes of the first object, and the attributes of the second object. In different specific embodiments, the specific attribute fusion rules adopted may be different according to the differences in the specific attributes of the first object and the second object, and this specification does not limit this. In a specific embodiment, the attribute fusion rules may, for example, be to add the exclusive attributes in the attributes of the first object (such as the attributes that the second object does not have) to the attributes of the third object; and, to add the exclusive attributes in the attributes of the second object (such as the attributes that the first object does not have) to the attributes of the third object; and, to merge the attributes that are common to the first object and the second object or have common semantics and add them to the attributes of the third object. Figure 7 FIG. 2 is a schematic diagram showing the object attribute fusion provided by the embodiment of this specification. Figure 7 As shown, for example, object 1 (first object) has a proprietary attribute 1 that object 2 does not have, object 2 (second object) has a proprietary attribute 2 that object 1 does not have, and the name attribute of object 1 and the name attribute of object 2 have common semantics. Therefore, the proprietary attribute 1 and the proprietary attribute 2 can be directly added to the attributes of object 3, and the name attribute and the name attribute can be merged (for example, the attribute name after the merger can be name or name, or other names) and added to the attributes of object 3. In different examples, for example, the formats of the original name attribute and the name attribute can also be different, and the format of the merged attribute can be determined according to the format of the original name attribute, or the format of the name attribute, or other formats. In one example, for example, the format of the original name attribute is, for example, "John Smith", and the format of the original name attribute is, for example, "Smith, John". The format of the merged attribute can be, for example, "John Smith", "Smith, John" or other preset formats.
[0063] In one embodiment, the fusion configuration may also include an in-out edge fusion rule. Furthermore, the out-edge and in-edge of the third object may be obtained based on the in-out edge fusion rule, the out-edge and in-edge of the first object in the first graph, and the out-edge and in-edge of the second object in the second graph. In different specific embodiments, the specific in-out edge fusion rules adopted may be different, and this specification does not limit this. In a specific embodiment, the attribute fusion rule may, for example, be to use all out-edges and in-edges of the first object and the second object as the out-edges and in-edges of the third object.
[0064] In one embodiment, the fusion configuration may further include a type fusion rule. The type fusion rule may indicate a first type to which the first object belongs, a second type to which the second object belongs, and a target type of a fusion object of the first type of object and the second type of object. Furthermore, the type of the third object may be set to the target type. Figure 8 FIG. 2 is a schematic diagram showing the object type fusion provided in the embodiment of this specification. Figure 8 As shown, the type fusion rule indicates, for example, that an object of type H (eg, a user type in the first graph) and an object of type I (eg, a user type in the second graph) can be merged into an object of type K (eg, a merged user type).
[0065] In actual production scenarios, knowledge graphs are often divided into different partitions and saved in multiple nodes, or partitioned on multiple nodes. In order to improve the efficiency of knowledge graph fusion, in one embodiment, different knowledge graphs can be partitioned in the same multiple nodes. In a specific embodiment, the first graph and the second graph can be saved in multiple partition nodes, and the partition index field of the first graph is the same as the partition index field of the second graph. Thus, in at least one partition node, the initiator corresponding to the first graph, based on the pre-set fusion configuration, merges the first object and the second object into a third object through a local merge operation. Fig. 9 A schematic diagram of local merged objects in a node provided by an embodiment of this specification is shown. For example, knowledge graph A and knowledge graph B are both stored in the same multiple partition nodes, such as partition node 1, partition node 2 and partition node 3, and the index fields based on which the two are partitioned are the same, for example, both are f1. Since the partition index fields of knowledge graph A and knowledge graph B are the same, objects with the same values of the index fields in both can be allocated to the same storage node for storage. For example, the partition index fields in knowledge graph A and knowledge graph B are both platform payment accounts, then the objects in knowledge graph A and knowledge graph B with the same platform payment account are stored in the same partition node, although the IDs of these objects in their respective knowledge graphs may be different. In order to further ensure that the first object and the second object are stored in the same node, in an example, the corresponding relationship between the first object and the second object can also be determined in advance based on the values of the partition index fields of the first object and the second object. For example, it can be determined whether there is a corresponding relationship between the first object and the second object based on whether the values of the partition index fields are the same. Since the first object and the second object are actually stored in the same node, the first object and the second object can be merged into a third object by local merging inside the storage node according to the fusion configuration. In this way, local merging can be used to achieve knowledge graph fusion. Due to the high efficiency of local merging execution, the efficiency of knowledge graph fusion can be further improved.
[0066] In some production scenarios, the partition fields of the first map and the second map may be different. Therefore, in another embodiment, the first map and the second map may be stored in multiple partition nodes, and the partition index field of the first map is different from the partition index field of the second map. In at least one partition node, the initiator corresponding to the first map can merge the first object and the second object into a third object through a remote merge operation based on a pre-set fusion configuration. Fig.10 A schematic diagram of remote merging objects between nodes provided by an embodiment of this specification is shown. Fig.10As shown, for example, knowledge graph A and knowledge graph B are both stored in the same multiple partition nodes, such as partition node 1, partition node 2, and partition node 3. Since the partition index fields of knowledge graph A and knowledge graph B are different, namely f1 and f2, respectively. The first object and the second object are usually assigned to different storage nodes for storage. The first object and the second object can be fused into a third object through remote merging according to the fusion configuration.
[0067] In the case where the partition fields of the first graph and the second graph are different, in addition to merging the first object and the second object into a third object through remote merging, one of the knowledge graphs can also be reordered in the cache of the storage node, and the object can be fused with the other knowledge graph based on the reordered graph in the cache. Therefore, in another embodiment, the first graph and the second graph can be stored in multiple partition nodes, and the partition index field of the first graph and the partition index field of the second graph are different. The initiator corresponding to the first graph can reorder the second graph in the cache of each partition node according to the partition index field of the first graph, and obtain the reordered backup corresponding to the cache of the second graph in each partition node; in at least one partition node, based on the pre-set fusion configuration and the reordered backup, the first object and the second object are fused into a third object through a local merge operation. Fig.11 FIG. 2 is a schematic diagram showing a node cache reordering backup provided by an embodiment of this specification. Fig.11 As shown, for example, knowledge graph A and knowledge graph B are both stored in the same multiple partition nodes, such as partition node 1, partition node 2, and partition node 3. For example, since the partition index fields of knowledge graph A and knowledge graph B are different, namely f1 and f2 respectively, the first object and the second object are usually assigned to different storage nodes for storage. For example, if the business party corresponding to knowledge graph A wishes to merge knowledge graph A and knowledge graph B, then, for example, in the caches in partition nodes 1, partition node 2, and partition node 3, knowledge graph B can be reordered according to the f1 index field to obtain a reordered backup of knowledge graph B in the caches of each node. Since the partition index field of the reordered backup of knowledge graph B in the cache is the same as the partition index field of knowledge graph A. Therefore, the first object and the second object in the reordered backup can be in the same node, so that the first object and the second object can be merged into a third object through local merging within the storage node according to the fusion configuration. In this way, on the basis of reordering backup, local merging can be used to achieve knowledge graph fusion, thereby improving the knowledge graph fusion efficiency when the partition index fields of the two knowledge graphs to be fused are different, especially when the number of virtual link relationships between the two knowledge graphs to be fused is large.
[0068] In other production scenarios, objects in different graphs may change, such as adding new objects to a graph or deleting existing objects from a graph. In order to make the reordered backup in the cache match the changed graph, the reordered backup may be updated according to the change status of the object when the object in the graph changes. In one embodiment, the reordered backup is updated in response to the addition or deletion of an object in the second graph. For example, in the reordered backup, the objects added or deleted in the second graph are inserted or deleted.
[0069] In addition, in the embodiment where there are multiple virtual link relationships between the first graph and the second graph, the objects corresponding to the multiple virtual links in the first graph and the second graph can be fused according to the fusion configuration to obtain multiple fused objects, and the first graph and the second graph can be fused into a third graph through the association of the multiple fused objects. The fusion method of each fused object can refer to the fusion method of the third object, which will not be repeated here.
[0070] On the other hand, corresponding to the above method process, the embodiment of this specification also discloses a knowledge graph fusion device. Fig.12 The structure diagram of a knowledge graph fusion device provided by the embodiment of this specification is shown. Fig. 9 As shown, the device 1200 includes:
[0071] The target acquisition unit 1201 is configured to establish a virtual link relationship between a first object in the first graph and a second object in the second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object;
[0072] The feature determination unit 1202 is configured to, based on a preset fusion configuration, fuse the first object and the second object having a virtual connection relationship into a third object, and fuse the first graph and the second graph into the third graph through the association of the third object.
[0073] Another aspect of the embodiments of the present specification provides a computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute any one of the above methods.
[0074] On the other hand, the embodiments of the present specification provide a computing device, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, any one of the above methods is implemented.
[0075] It should be understood that the descriptions such as “first” and “second” in this article are only used to distinguish similar concepts for the sake of simplicity of description and do not have any other limiting effect.
[0076] Although one or more embodiments of the present specification provide method operation steps as described in the embodiments or flow charts, more or less operation steps may be included based on conventional or non-creative means. The order of steps listed in the embodiments is only one way of executing the order of many steps and does not represent a unique execution order. When the device or terminal product in practice is executed, it can be executed in sequence or in parallel according to the method shown in the embodiments or the drawings (for example, a parallel processor or a multi-threaded processing environment, or even a distributed data processing environment). The term "include", "comprise" or any other variant thereof is intended to cover non-exclusive inclusion, so that the process, method, product or equipment including a series of elements includes not only those elements, but also includes other elements that are not clearly listed, or also includes elements inherent to such process, method, product or equipment. In the absence of more restrictions, it is not excluded that there are other identical or equivalent elements in the process, method, product or equipment including the elements.
[0077] For the convenience of description, the above devices are described in various modules according to their functions. Of course, when implementing one or more of the present specification, the functions of each module can be implemented in the same or more software and / or hardware, or the module implementing the same function can be implemented by a combination of multiple sub-modules or sub-units, etc. The device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0078] Those skilled in the art should be aware that one or more embodiments of the present specification may be provided as a method, system or computer program product. Therefore, one or more embodiments of the present specification may take the form of a complete hardware embodiment, a complete software embodiment or an embodiment combining software and hardware. Moreover, one or more embodiments of the present specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0079] One or more embodiments of this specification may be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. One or more embodiments of this specification may also be practiced in distributed computing environments where tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules may be located in local and remote computer storage media, including storage devices.
[0080] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples without contradiction.
[0081] The above description is only an example of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. For those skilled in the art, one or more embodiments of this specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this specification shall be included in the scope of the claims.
Claims
1. A knowledge graph fusion method, comprising: Establishing a virtual link relationship between a first object in the first graph and a second object in the second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object; Based on a preset object fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, and the first graph and the second graph are fused into a third graph through the association of the third object, wherein the outgoing edges and incoming edges of the third object include the outgoing edges and incoming edges of the first object and the second object, and the object data in the third graph belonging to the first graph is still stored on the original storage node of the first graph, and the object data in the second graph is still stored on the original storage node of the second graph.
2. The method according to claim 1, wherein: The correspondence between the first object and the second object includes a correspondence between an identifier of the first object and an identifier of the second object, and a correspondence between an object type of the first object and an object type of the second object.
3. The method according to claim 1 further comprises: adding a corresponding relationship between a third object in the first graph and a fourth object in the second graph in the link dictionary, so as to construct a virtual link relationship between the third object and the fourth object; and / or The corresponding relationship between the first object and the second object is deleted in the link dictionary.
4. The method according to claim 1, wherein: The object fusion configuration includes attribute fusion rules; Based on a preset object fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including: A third object is generated, and attributes of the third object are obtained according to the attribute fusion rule, the attributes of the first object and the attributes of the second object.
5. The method according to claim 4, wherein: The fusion configuration further includes a type fusion rule, the type fusion rule indicating a first type to which the first object belongs, a second type to which the second object belongs, and a target type of a fused object of the first type of object and the second type of object; Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including: The type of the third object is set to the target type.
6. The method according to claim 1, wherein: The first graph and the second graph are stored in a plurality of partition nodes, and a partition index field of the first graph is the same as a partition index field of the second graph; Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including: In at least one partition node, the initiator corresponding to the first graph merges the first object and the second object into a third object through a local merge operation based on a preset fusion configuration.
7. The method according to claim 1, wherein: The first graph and the second graph are stored in a plurality of partition nodes, and a partition index field of the first graph is different from a partition index field of the second graph; Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including: In at least one partition node, the initiator corresponding to the first graph merges the first object and the second object into a third object through a remote merge operation based on a preset fusion configuration.
8. The method according to claim 1, wherein: The first graph and the second graph are stored in a plurality of partition nodes, and a partition index field of the first graph is different from a partition index field of the second graph; Based on a preset fusion configuration, a first object and a second object having a virtual connection relationship are fused into a third object, including: The initiator corresponding to the first graph reorders the second graph in the cache of each partition node according to the partition index field of the first graph to obtain a reordered backup of the second graph corresponding to the cache of each partition node; In at least one partition node, based on a preset fusion configuration and the reordered backup, the first object and the second object are merged into a third object through a local merge operation.
9. The method according to claim 8 further includes updating the reordered backup in response to the addition or deletion of objects in the second graph.
10. A knowledge graph fusion device, comprising: A link unit configured to establish a virtual link relationship between a first object in the first graph and a second object in the second graph according to a preset link dictionary, wherein the link dictionary includes a corresponding relationship between the first object and the second object; A fusion unit is configured to, based on a preset fusion configuration, fuse a first object and a second object that have a virtual connection relationship into a third object, and fuse the first graph and the second graph into a third graph through the association of the third object, wherein the outgoing edges and incoming edges of the third object include the outgoing edges and incoming edges of the first object and the second object, and the object data in the third graph belonging to the first graph is still stored on the original storage node of the first graph, and the object data in the second graph is still stored on the original storage node of the second graph.
11. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 10.
12. A computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
Chinese traveling domain knowledge map construction method and system
CN106777274A
Knowledge graph data fusion method and system
CN113792159A
Knowledge graph and affair graph fusion method, device and system
CN114417004A
Knowledge graph data fusion method and system
CN115952862A
Method and device for fusing knowledge graph data
CN117235285A
