Method, system, device and storage medium for constructing a federated knowledge graph
By acquiring and classifying and analyzing multi-source heterogeneous data, generating entity files and edge relationship files, the problems of data dispersion and lack of association are solved, and a federated knowledge graph is built to support business expansion.
Patent Information
- Application Number
- CN202210514582.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-12
- Publication Date
- 2025-08-22
- Estimated Expiration
- 2042-05-12
AI Technical Summary
Due to the relatively scattered data and the lack of correlation between data, it is difficult to combine multi-party data to build a knowledge graph.
Obtain multi-source heterogeneous data in the target field, generate multi-source data tables, and determine the graph entities, entity attributes and graph edges through classification analysis, generate entity files and edge relationship files, and finally build a federal knowledge graph.
It realizes effective classification and correlation of multi-source heterogeneous data, and builds a federal knowledge graph containing various types of data to support business personnel to better expand their business.
Smart Images

Figure CN114780752B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of Internet technology, and in particular to a method, system, device and storage medium for constructing a federated knowledge graph. Background Art
[0002] Knowledge graph, known as knowledge domain visualization or knowledge domain mapping map in the library and information science community, is a series of various graphs that display the knowledge development process and structural relationships. In the process of constructing a knowledge graph, it is necessary to identify the entities of various data types and their corresponding relationships. However, in many financial industry application scenarios, due to the lack of a unified knowledge framework, various types of data are relatively scattered and lack connections between data, which makes it difficult to combine data from multiple parties to construct a knowledge graph. Summary of the Invention
[0003] The main purpose of this application is to provide a method, system, device and storage medium for constructing a federated knowledge graph, aiming to solve the technical problem in the existing technology that it is difficult to construct a knowledge graph by combining multiple data due to the relatively scattered types of data and the lack of association between the data.
[0004] To achieve the above objectives, this application provides a method for constructing a federated knowledge graph, which includes:
[0005] Acquire multi-source heterogeneous data in a target domain, and generate multi-source data tables based on the multi-source heterogeneous data;
[0006] Classify and analyze each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes;
[0007] Based on the target graph information, different entity files and edge relationship files are generated;
[0008] Based on the different entity files and edge relationship files, a target federated knowledge graph is constructed.
[0009] Optionally, the step of performing classification analysis on the multi-source data table to obtain target atlas information includes:
[0010] In the multi-source data table, in combination with the business scenario of the current target field, target fields whose query frequencies meet a preset frequency threshold are selected as the different types of graph entities, and entity attributes corresponding to the graph entities are determined;
[0011] Based on each of the graph entities, in the multi-source data table, the target fields associated with the same type of graph entities and the target fields associated with different types of graph entities are selected as the different types of graph edges, and the edge attributes corresponding to each of the graph edges are determined, wherein the graph edges represent the association relationship between the graph entities.
[0012] Optionally, the step of generating different entity files and edge relationship files based on the target graph information includes:
[0013] Generate each entity file according to the target fields corresponding to different graph entities in the target graph information;
[0014] And generating each edge relationship file according to the target fields corresponding to different graph edges in the target graph information.
[0015] Optionally, the step of generating each multi-source data table based on the multi-source heterogeneous data includes:
[0016] The multi-source heterogeneous data are processed by a preset natural language processing method to generate each of the multi-source data tables.
[0017] Optionally, after the step of constructing a target federated knowledge graph based on the different entity files and edge relationship files, the method further includes:
[0018] Constructing a visualization webpage of the target federated knowledge graph;
[0019] Obtaining the target user's operation instructions on the visual webpage;
[0020] Querying the target federated knowledge graph for target return information corresponding to the operation instruction;
[0021] Based on the target return information, visual drawing is performed in the visual webpage using a preset drawing algorithm.
[0022] Optionally, the step of performing visual drawing based on the target return information by using a preset drawing algorithm to obtain a target drawing includes:
[0023] Importing the target return information into a preset force-directed graph layout;
[0024] Dynamically call a drawing function preset in the force-directed graph layout, and draw the target return information based on the drawing function.
[0025] Optionally, the step of drawing the target return information based on the drawing function to obtain the target drawing graph includes:
[0026] If the target return information contains a graph entity, the node is drawn using a preset node style based on the graph entity data;
[0027] If the target return information contains graph edges, the edges are drawn according to a preset edge style based on the number of graph edges between graph entities.
[0028] This application also provides a federated knowledge graph construction system, which is a virtual system and includes:
[0029] An acquisition module, configured to acquire multi-source heterogeneous data and generate multi-source data tables based on the multi-source heterogeneous data;
[0030] an analysis module, configured to classify and analyze each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes;
[0031] A generation module, configured to generate different entity files and edge relationship files based on the target graph information;
[0032] A construction module is used to construct a target federated knowledge graph based on the different entity files and edge relationship files.
[0033] Optionally, the analysis module is further used to:
[0034] In the multi-source data table, in combination with the business scenario of the current target field, target fields whose query frequencies meet a preset frequency threshold are selected as the different types of graph entities, and entity attributes corresponding to the graph entities are determined;
[0035] Based on each of the graph entities, in the multi-source data table, the target fields associated with the same type of graph entities and the target fields associated with different types of graph entities are selected as the different types of graph edges, and the edge attributes corresponding to each of the graph edges are determined, wherein the graph edges represent the association relationship between the graph entities.
[0036] Optionally, the generating module is further configured to:
[0037] Generate each entity file according to the target fields corresponding to different graph entities in the target graph information;
[0038] And generating each edge relationship file according to the target fields corresponding to different graph edges in the target graph information.
[0039] Optionally, the acquisition module is further configured to:
[0040] The multi-source heterogeneous data are processed by a preset natural language processing method to generate each of the multi-source data tables.
[0041] Optionally, the federated knowledge graph construction system is further used to:
[0042] Constructing a visualization webpage of the target federated knowledge graph;
[0043] Obtaining the target user's operation instructions on the visual webpage;
[0044] Querying the target federated knowledge graph for target return information corresponding to the operation instruction;
[0045] Based on the target return information, visual drawing is performed in the visual webpage using a preset drawing algorithm.
[0046] Optionally, the federated knowledge graph construction system is further used to:
[0047] Importing the target return information into a preset force-directed graph layout;
[0048] Dynamically call a drawing function preset in the force-directed graph layout, and draw the target return information based on the drawing function.
[0049] Optionally, the federated knowledge graph construction system is further used to:
[0050] If the target return information contains a graph entity, the node is drawn using a preset node style based on the graph entity data;
[0051] If the target return information contains graph edges, the edges are drawn according to a preset edge style based on the number of graph edges between graph entities.
[0052] The present application also provides a federated knowledge graph construction device, which is a physical device. The federated knowledge graph construction device includes: a memory, a processor, and a federated knowledge graph construction program stored on the memory. The federated knowledge graph construction program is executed by the processor to implement the steps of the above-mentioned federated knowledge graph construction method.
[0053] The present application also provides a storage medium, which is a computer-readable storage medium. A federated knowledge graph construction program is stored on the computer-readable storage medium. The federated knowledge graph construction program is executed by a processor to implement the steps of the above-mentioned federated knowledge graph construction method.
[0054] The present application provides a method, system, device and storage medium for constructing a federated knowledge graph. The present application first obtains multi-source heterogeneous data in a target field, and based on the multi-source heterogeneous data, generates various multi-source data tables, and then classifies and analyzes each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges and edge attributes. Furthermore, based on the target graph information, different entity files and edge relationship files are generated, and then based on the different entity files and edge relationship files, a target federated knowledge graph is constructed. This achieves the goal of classifying and analyzing the data tables corresponding to the multi-source heterogeneous data, selecting different types of graph entities, entity attributes, different types of graph edges and edge attributes corresponding to the graph, thereby generating different entity files and edge relationship files, and constructing a target federated knowledge graph containing various types of data, so that business personnel can better expand their business based on the associated information of the federated knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0056] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without any creative work.
[0057] Figure 1 This is a flowchart of the first embodiment of the method for constructing a federated knowledge graph of this application;
[0058] Figure 2 This is a flowchart of the second embodiment of the method for constructing a federated knowledge graph of this application;
[0059] Figure 3 This is a flowchart of the third embodiment of the method for constructing a federated knowledge graph of this application;
[0060] Figure 4 This is a system framework diagram of the method for building a federated knowledge graph for this application;
[0061] Figure 5 A schematic diagram of a device structure for constructing a federated knowledge graph of a hardware operating environment involved in an embodiment of the present application;
[0062] Figure 6 Schematic diagram of the functional modules of the federated knowledge graph construction device of this application.
[0063] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0064] It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application.
[0065] This application embodiment provides a method for constructing a federated knowledge graph. In the first embodiment of the method for constructing a federated knowledge graph, refer to Figure 1 , the method for constructing a federated knowledge graph includes:
[0066] Step S10, acquiring multi-source heterogeneous data in a target domain, and generating various multi-source data tables based on the multi-source heterogeneous data;
[0067] In this embodiment, it should be noted that the target fields include medical, financial, aerospace and other fields. In this application, the financial field is used as the target field for explanation. The multi-source heterogeneous data is aggregated through a unified knowledge framework for corporate, retail and other data. The corporate data includes data information between companies and data information between companies and individuals.
[0068] Acquire multi-source heterogeneous data in the target field, and generate various multi-source data tables based on the multi-source heterogeneous data. Specifically, obtain the multi-source heterogeneous data such as corporate and retail data required for constructing the map, analyze the corporate and retail data based on a unified knowledge framework and combine NLP (natural language processing) methods to generate various multi-source data tables.
[0069] Step S20: performing classification analysis on each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes;
[0070] In this embodiment, it should be noted that the target graph information is the knowledge graph schema, which limits the format of the data to be added to the knowledge graph, which is equivalent to the data model corresponding to the domain.
[0071] Each of the multi-source data tables is classified and analyzed to obtain target graph information. Specifically, based on the business scenario of the current target field, field information with a higher query frequency in the current business scenario is selected, and then the field information is classified and analyzed, and then based on the classified field information, fields that can meet the conditions for constructing entities are selected as graph entities. Furthermore, based on each of the graph entities, field information used to describe the graph entity is selected in each multi-source data table as entity attributes. In addition, field information that can associate the same graph entity and associate different graph entities is selected in each multi-source data table as graph edges, and field information used to describe the graph edge is selected in each multi-source data table as edge attributes, so as to mine rich association relationships between companies (transactions, investments, etc.), companies and individuals (legal persons, shareholders, directors, supervisors, etc.), and individuals and individuals (children, parents, business, etc.).
[0072] For example, in a financial loan scenario, A is the legal person of Company B, and Company B has the address and creation time. Company B invests in Company C. Then Company B and Company C are set as graph entities, and the creation time and address are the entity attributes of Company B. Company B and Company C are associated as an investment relationship, and the investment relationship is used as the graph edge, and the investment time, investment amount, etc. are used as the edge attributes of the graph edge.
[0073] Step S30, generating different entity files and edge relationship files based on the target graph information;
[0074] In this embodiment, based on the target graph information, different entity files and edge relationship files are generated. Specifically, corresponding fields of different entities are selected to generate entity files for individuals, companies, groups, etc. At the same time, corresponding fields of different edges in the schema are selected to generate edge relationship files for company-company (transaction, group, private equity investment, etc.), company-individual (legal person, shareholder, director, supervisor, etc.), and individual-individual (child, parent, business, etc.).
[0075] Among them, step S30: generating different entity files and edge relationship files based on the target graph information, specifically includes:
[0076] Step S31, generating each entity file according to the target fields corresponding to different graph entities in the target graph information;
[0077] Step S32, and generating each edge relationship file according to the target fields corresponding to different graph edges in the target graph information.
[0078] In this embodiment, specifically, target fields corresponding to different graph entities are selected based on the target graph information to generate entity files such as individuals, companies, and groups respectively. At the same time, target fields corresponding to different graph edges in the target graph information are selected to generate multiple edge relationship files.
[0079] Step S40: construct a target federated knowledge graph based on the different entity files and edge relationship files.
[0080] In this embodiment, it should be noted that the knowledge graph is essentially a semantic network that represents the relationship between entities. The knowledge graph is composed of pieces of knowledge, and each piece of knowledge is represented as an SPO triple (Subject-Predicate-Object), such as: (entity 1, relationship, entity 2), (entity, attribute, attribute value) and other triples. The nodes in the knowledge graph represent entities, and the edges are the association relationships between entities. Furthermore, the nodes and edges can also have corresponding labels, which are the identifiers of the categories corresponding to the nodes and edges.
[0081] Specifically, based on the different entity files and edge relationship files, the nodes, node attributes and node labels required for constructing the graph are determined, as well as the association relationships, relationship attributes and relationship labels between the nodes are determined, and then based on the nodes, node attributes and node labels, as well as the association relationships, relationship attributes and relationship labels between the nodes, a target federated knowledge graph containing associations between companies, companies and individuals, and individuals and individuals is constructed. For example: connect to a machine where a neo4j database is deployed through the Linux ssh command, and then copy different entity files and edge relationship files to the neo4j machine through the Linux scp command, and then use the neo4j stop command to shut down the neo4j service. Further, use the neo4j-admin import command to import the entity files and edge relationship files. After the import is complete, use the neo4j start command to restart neo4j to construct the target federated knowledge graph.
[0082] An embodiment of the present application provides a method for constructing a federated knowledge graph. The embodiment of the present application first obtains multi-source heterogeneous data in a target field, and generates various multi-source data tables based on the multi-source heterogeneous data, and then classifies and analyzes each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes. Furthermore, based on the target graph information, different entity files and edge relationship files are generated, and then based on the different entity files and edge relationship files, a target federated knowledge graph is constructed. This achieves the goal of classifying and analyzing the data tables corresponding to the multi-source heterogeneous data, selecting different types of graph entities, entity attributes, different types of graph edges, and edge attributes corresponding to the graph, thereby generating different entity files and edge relationship files, and constructing a target federated knowledge graph containing various types of data, so that business personnel can better expand their business based on the associated information of the federated knowledge graph.
[0083] Further, refer to Figure 2 Step S20: performing classification analysis on the multi-source data table to obtain target atlas information, specifically including:
[0084] Step S21: In the multi-source data table, based on the business scenario of the current target field, target fields whose query frequencies meet a preset frequency threshold are selected as the different types of graph entities, and entity attributes corresponding to the graph entities are determined;
[0085] Step S22: Based on each of the graph entities, in the multi-source data table, select the target fields associated with the same type of graph entities and the target fields associated with different types of graph entities as the different types of graph edges, and determine the edge attributes corresponding to each of the graph edges, wherein the graph edges represent the association relationship between graph entities.
[0086] In this embodiment, specifically, in combination with the business scenario of the current target field, in the multi-source data table, the target fields whose query frequency in the current business scenario exceeds the preset frequency threshold are selected, and then each of the target fields is classified and analyzed to obtain the classified field information, and then from the classified field information, the field information that meets the entity construction conditions is selected as the graph entity, and further, based on each graph entity, a preset number of field information corresponding to the graph entity is selected as the entity attribute of the graph entity, and further, after determining each graph entity, each multi-source data table is analyzed as a whole, and field information associated with the same graph entity and associated with different graph entities is selected as the graph edge, that is, the graph edge is used to characterize the association relationship between entities, and then a preset number of field information corresponding to the graph edge is selected as the edge attribute of the graph entity.
[0087] The embodiment of the present application adopts the above-mentioned scheme, that is, in the multi-source data table, combined with the business scenario of the current target field, each target field whose query frequency meets the preset frequency threshold is selected as the different types of graph entities, and the entity attributes corresponding to each of the graph entities are determined, and then based on each of the graph entities, in the multi-source data table, each target field associated with the same type of graph entity and associated with different types of graph entities is selected as the different types of graph edges, and the edge attributes corresponding to each of the graph edges are determined, wherein the graph edges represent the association relationship between graph entities, realize the aggregation of various types of data, determine the entities in combination with the business scenario of the current target field, and analyze the association between entities, so that a federated knowledge graph can be constructed based on the association relationship between entities and each of them.
[0088] Further, refer to Figure 3 Based on the first embodiment of the present application, in another embodiment of the present application, after the step of constructing the target federated knowledge graph based on the different entity files and edge relationship files, the method further includes:
[0089] Step A10: constructing a visualization webpage of the target federated knowledge graph;
[0090] In this embodiment, it should be noted that before constructing the visualization webpage, the developer encapsulates the query statement of the target federated knowledge graph into a function interface so that the user can call the interface to obtain data in the target federated knowledge graph when clicking on the front-end (visualization webpage). For example, for node query, the name of a specific node is passed in from the outside to query all nodes with a distance of 1 from the central node, and the results are returned after classification according to the edge relationship type. For graph algorithm query, the names of several nodes are passed in from the outside to generate a query statement, execute graph algorithms such as community discovery, shortest path, and node similarity, and return the execution results.
[0091] Step A20, obtaining the target user's operation instructions on the visual webpage;
[0092] In this embodiment, it should be noted that the operation instructions include single-click, double-click, right-click and other operation instructions.
[0093] Step A30, querying the target federated knowledge graph for target return information corresponding to the operation instruction;
[0094] In this embodiment, it should be noted that different operation instructions return different data. For example, when the target user performs a single-click instruction, the single-click coordinate location is detected and determined to be within a node or on an edge, thereby obtaining the corresponding field information of the node or edge in the target federated knowledge graph. When the target user performs a double-click instruction, the double-click coordinate location is detected and determined to be within a node. If the double-click coordinate location is within a node, the node is expanded. In other words, all nodes within a distance of 1 from the node are obtained in the target federated knowledge graph, and the returned results are classified according to the edge relationship type between the nodes.
[0095] Step A40: Based on the target return information, visual drawing is performed in the visual webpage using a preset drawing algorithm.
[0096] In this embodiment, it should be noted that the preset drawing algorithm includes a force-directed graph layout algorithm. The force-directed graph layout algorithm is to treat the node as an electric charge, calculate the combined force of attraction and repulsion through calculation of each node, and then use this combined force to move the position of the node.
[0097] Step A40: Based on the target return information, a preset rendering algorithm is used to perform visual rendering to obtain a target rendering image, specifically including:
[0098] Step A41, importing the target return information into a preset force-directed graph layout;
[0099] Step A42: dynamically call a drawing function preset in the force-directed graph layout, and draw the target return information based on the drawing function.
[0100] In this embodiment, specifically, a force-directed graph layout is created, and a drawing function is set in the force-directed graph layout, and then the target return information is imported into the force-directed graph layout. Based on the drawing function, the target return information is visualized, and the coordinate position of the node is dynamically adjusted in combination with a preset mechanical simulation model.
[0101] Step A42: drawing the target return information based on the drawing function to obtain the target drawing graph specifically includes:
[0102] Step A421: If the target returned information contains a graph entity, draw nodes using a preset node style based on the graph entity data;
[0103] Step A422: If the target returned information contains graph edges, edge drawing is performed according to a preset edge style based on the number of graph edges between graph entities.
[0104] In this embodiment, specifically, when the target return information contains a graph entity, when drawing a node (graph entity), the color, highlight and other styles of the node drawing are controlled according to the type of the graph entity. For example, the arc function is used to control the 2D Canvas state machine. The graph entities include personal and company entities. The graph entity corresponding to the individual and the picture entity corresponding to the company can be drawn in different colors.
[0105] Furthermore, when the target return information contains graph edges, when drawing the edges (graph edges), different drawing methods are used according to the number of edges between the nodes. The specific drawing process is: in the case of a single edge between nodes, a connecting line is drawn according to the preset edge style field, for example: the lineTo function is used to control the 2D Canvas state machine for drawing; in the case of multiple edges between nodes, the first edge is drawn using the single-edge method, and the remaining edges are drawn using the preset connecting line drawing method, and the quadraticCurveTo method is used to draw the Bezier quadratic curve. For example, A and B are friends and have a trading relationship. A straight line can be used to draw the edge corresponding to the friend relationship, and a curve can be used to draw the edge corresponding to the trading relationship.
[0106] The embodiment of the present application adopts the above-mentioned scheme, that is, constructs a visualization webpage of the target federated knowledge graph, and then obtains the operation instructions of the target user on the visualization webpage. Furthermore, the target return information corresponding to the operation instruction is queried in the target federated knowledge graph, and then based on the target return information, a preset drawing algorithm is used to perform visualization drawing in the visualization webpage, thereby realizing visualization drawing of the knowledge graph, lowering the threshold for business personnel to use this type of technology, so that even business personnel with a shallow technical foundation can quickly and conveniently use the federated knowledge graph to expand their business.
[0107] Further, refer to Figure 4 , Figure 4 This is a system framework diagram of the federated knowledge graph construction method of this application. Specifically, data from different data sources (multi-source heterogeneous data) are collected to generate multiple data tables (multi-source data tables). Based on each multi-source data table, NLP technology is used to extract graph entities and the association relationships between graph entities, and then multiple entity files and edge relationship files are generated. Based on each entity file and edge relationship file, the target federated knowledge graph is constructed through the neo4j graph database, and the target federated knowledge graph is stored. The interface function corresponding to the query statement is designed, and then the user clicks on the front-end page to trigger the corresponding interface function to obtain the target return data corresponding to the target federated knowledge graph, and then the target return data is visualized.
[0108] Reference Figure 5 , Figure 5 It is a schematic diagram of the structure of the federated knowledge graph construction device of the hardware operating environment involved in the embodiment of the present application.
[0109] like Figure 5 As shown, the federated knowledge graph construction device may include: a processor 1001, such as a CPU, a memory 1005, and a communication bus 1002. Communication bus 1002 is used to connect and communicate between processor 1001 and memory 1005. Memory 1005 may be a high-speed RAM memory or a non-volatile memory, such as a disk storage device. Memory 1005 may also be a storage device independent of processor 1001.
[0110] Optionally, the federated knowledge graph construction device may also include a rectangular user interface, a network interface, a camera, an RF (Radio Frequency) circuit, a sensor, an audio circuit, a WiFi module, and the like. The rectangular user interface may include a display and an input submodule such as a keyboard. Optionally, the rectangular user interface may also include a standard wired interface and a wireless interface. The network interface may optionally include a standard wired interface and a wireless interface (such as a WiFi interface).
[0111] Those skilled in the art will understand that Figure 5 The structure of the federated knowledge graph construction device shown in the figure does not constitute a limitation on the federated knowledge graph construction device, and may include more or fewer components than shown in the figure, or a combination of certain components, or a different arrangement of components.
[0112] like Figure 5 As shown, memory 1005, a computer storage medium, may include an operating system, a network communication module, and a federated knowledge graph construction program. The operating system is a program that manages and controls the hardware and software resources of the federated knowledge graph construction device and supports the operation of the federated knowledge graph construction program and other software and / or programs. The network communication module is used to enable communication between the various components within memory 1005, as well as communication with other hardware and software in the federated knowledge graph construction system.
[0113] exist Figure 5 In the federated knowledge graph construction device shown, the processor 1001 is used to execute the federated knowledge graph construction program stored in the memory 1005 to implement the steps of the federated knowledge graph construction method described in any one of the above items.
[0114] The specific implementation of the federal knowledge graph construction device of this application is basically the same as the embodiments of the above-mentioned federal knowledge graph construction method, and will not be repeated here.
[0115] In addition, please refer to Figure 6 , Figure 6 This is a functional module diagram of the federated knowledge graph construction device of the present application. The present application also provides a federated knowledge graph construction system, which includes:
[0116] An acquisition module, configured to acquire multi-source heterogeneous data and generate multi-source data tables based on the multi-source heterogeneous data;
[0117] an analysis module, configured to classify and analyze each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes;
[0118] A generation module, configured to generate different entity files and edge relationship files based on the target graph information;
[0119] A construction module is used to construct a target federated knowledge graph based on the different entity files and edge relationship files.
[0120] Optionally, the analysis module is further used to:
[0121] In the multi-source data table, in combination with the business scenario of the current target field, target fields whose query frequencies meet a preset frequency threshold are selected as the different types of graph entities, and entity attributes corresponding to the graph entities are determined;
[0122] Based on each of the graph entities, in the multi-source data table, the target fields associated with the same type of graph entities and the target fields associated with different types of graph entities are selected as the different types of graph edges, and the edge attributes corresponding to each of the graph edges are determined, wherein the graph edges represent the association relationship between the graph entities.
[0123] Optionally, the generating module is further configured to:
[0124] Generate each entity file according to the target fields corresponding to different graph entities in the target graph information;
[0125] And generating each edge relationship file according to the target fields corresponding to different graph edges in the target graph information.
[0126] Optionally, the acquisition module is further configured to:
[0127] The multi-source heterogeneous data are processed by a preset natural language processing method to generate each of the multi-source data tables.
[0128] Optionally, the federated knowledge graph construction system is further used to:
[0129] Constructing a visualization webpage of the target federated knowledge graph;
[0130] Obtaining the target user's operation instructions on the visual webpage;
[0131] Querying the target federated knowledge graph for target return information corresponding to the operation instruction;
[0132] Based on the target return information, visual drawing is performed in the visual webpage using a preset drawing algorithm.
[0133] Optionally, the federated knowledge graph construction system is further used to:
[0134] Importing the target return information into a preset force-directed graph layout;
[0135] Dynamically call a drawing function preset in the force-directed graph layout, and draw the target return information based on the drawing function.
[0136] Optionally, the federated knowledge graph construction system is further used to:
[0137] If the target return information contains a graph entity, the node is drawn using a preset node style based on the graph entity data;
[0138] If the target return information contains graph edges, the edges are drawn according to a preset edge style based on the number of graph edges between graph entities.
[0139] The specific implementation of the federated knowledge graph construction system of this application is basically the same as the various embodiments of the above-mentioned federated knowledge graph construction method, and will not be repeated here.
[0140] An embodiment of the present application provides a storage medium, which is a computer-readable storage medium, and the computer-readable storage medium stores one or more programs, and the one or more programs can also be executed by one or more processors to implement the steps of the federated knowledge graph construction method described in any one of the above items.
[0141] The specific implementation of the computer-readable storage medium of this application is basically the same as the embodiments of the above-mentioned federated knowledge graph construction method, and will not be repeated here.
[0142] The above are only preferred embodiments of the present application and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly applied in other related technical fields, are also included in the patent processing scope of the present application.
Claims
1. A method for constructing a federated knowledge graph, characterized in that: The method for constructing a federated knowledge graph includes: Acquire multi-source heterogeneous data in a target domain, and generate multi-source data tables based on the multi-source heterogeneous data; Classify and analyze each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes; Based on the target graph information, different entity files and edge relationship files are generated; Building a target federated knowledge graph based on the different entity files and edge relationship files; After the step of constructing a target federated knowledge graph based on the different entity files and edge relationship files, the method further includes: Constructing a visualization webpage of the target federated knowledge graph; Obtaining the target user's operation instructions on the visual webpage; Querying the target federated knowledge graph for target return information corresponding to the operation instruction; Based on the target return information, performing visual drawing on the visual webpage using a preset drawing algorithm; The step of querying the target federated knowledge graph for target return information corresponding to the operation instruction includes: When the target user issues a single-click instruction, the click coordinate position is detected to determine whether the click coordinate position is within a node or on an edge; if it is within a node or on an edge, the field information corresponding to the node or edge is obtained in the target federated knowledge graph; When the target user double-clicks, the double-click coordinate position is detected to determine whether the double-click coordinate position is within the node; if the double-click coordinate position is within the node, the node is expanded and the result is returned after classification according to the relationship type of the edges between the nodes; The step of performing visual drawing based on the target return information by using a preset drawing algorithm to obtain a target drawing includes: Importing the target return information into a preset force-directed graph layout; Dynamically calling a drawing function preset in the force-directed graph layout, and drawing the target return information based on the drawing function; The step of drawing the target return information based on the drawing function includes: If the target return information contains a graph entity, the node is drawn using a preset node style based on the graph entity data; If the target returned information contains a graph edge, the edge is drawn according to a preset edge style based on the number of graph edges between graph entities; The step of drawing edges according to a preset edge style based on the number of graph edges between graph entities includes: In the case of a single edge between graph entities, a connection line is drawn according to the preset edge style field; In the case of multiple edges between graph entities, the first edge is drawn using the preset edge style field to draw the connection line, and the remaining edges are drawn using the preset connection line drawing method.
2. The method for constructing a federated knowledge graph according to claim 1, wherein: The step of classifying and analyzing each of the multi-source data tables to obtain target atlas information includes: In the multi-source data table, in combination with the business scenario of the current target field, target fields whose query frequencies meet a preset frequency threshold are selected as the different types of graph entities, and entity attributes corresponding to the graph entities are determined; Based on each of the graph entities, in the multi-source data table, the target fields associated with the same type of graph entities and the target fields associated with different types of graph entities are selected as the different types of graph edges, and the edge attributes corresponding to each of the graph edges are determined, wherein the graph edges represent the association relationship between the graph entities.
3. The method for constructing a federated knowledge graph according to claim 1, wherein: The step of generating different entity files and edge relationship files based on the target graph information includes: Generate each entity file according to the target fields corresponding to different graph entities in the target graph information; And generating each edge relationship file according to the target fields corresponding to different graph edges in the target graph information.
4. The method for constructing a federated knowledge graph according to claim 1, wherein: The step of generating each multi-source data table based on the multi-source heterogeneous data includes: The multi-source heterogeneous data are processed by a preset natural language processing method to generate each of the multi-source data tables.
5. A federated knowledge graph construction system, characterized by: The federated knowledge graph construction system includes: An acquisition module, configured to acquire multi-source heterogeneous data and generate multi-source data tables based on the multi-source heterogeneous data; an analysis module, configured to classify and analyze each of the multi-source data tables to obtain target graph information, wherein the target graph information includes different types of graph entities, entity attributes, different types of graph edges, and edge attributes; A generation module, configured to generate different entity files and edge relationship files based on the target graph information; A construction module, configured to construct a target federated knowledge graph based on the different entity files and edge relationship files; After constructing the target federated knowledge graph based on the different entity files and edge relationship files, the method further includes: Constructing a visualization webpage of the target federated knowledge graph; Obtaining the target user's operation instructions on the visual webpage; Querying the target federated knowledge graph for target return information corresponding to the operation instruction; Based on the target return information, performing visual drawing on the visual webpage using a preset drawing algorithm; The target return information corresponding to the operation instruction in the target federated knowledge graph includes: When the target user issues a single-click instruction, the click coordinate position is detected to determine whether the click coordinate position is within a node or on an edge; if it is within a node or on an edge, the field information corresponding to the node or edge is obtained in the target federated knowledge graph; When the target user double-clicks, the double-click coordinate position is detected to determine whether the double-click coordinate position is within the node; if the double-click coordinate position is within the node, the node is expanded and the result is returned after classification according to the relationship type of the edges between the nodes; The visual drawing is performed based on the target return information by using a preset drawing algorithm to obtain a target drawing diagram, which includes: Importing the target return information into a preset force-directed graph layout; Dynamically calling a drawing function preset in the force-directed graph layout, and drawing the target return information based on the drawing function; Drawing the target return information based on the drawing function includes: If the target return information contains a graph entity, the node is drawn using a preset node style based on the graph entity data; If the target returned information contains a graph edge, the edge is drawn according to a preset edge style based on the number of graph edges between graph entities; Drawing edges according to a preset edge style based on the number of graph edges between graph entities includes: In the case of a single edge between graph entities, a connection line is drawn according to the preset edge style field; In the case of multiple edges between graph entities, the first edge is drawn using the preset edge style field to draw the connection line, and the remaining edges are drawn using the preset connection line drawing method.
6. A federated knowledge graph construction device, characterized in that: The federated knowledge graph construction device includes: a memory, a processor, and a federated knowledge graph construction program stored in the memory. The federated knowledge graph construction program is executed by the processor to implement the steps of the federated knowledge graph construction method as described in any one of claims 1 to 4.
7. A storage medium, wherein the storage medium is a computer-readable storage medium, characterized in that: The computer-readable storage medium stores a federated knowledge graph construction program, and the federated knowledge graph construction program is executed by a processor to implement the steps of the federated knowledge graph construction method as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Knowledge graph construction method and system based on multi-source heterogeneous data, and terminal
CN113157930A