Knowledge graph construction method and system based on hypergraph model
By constructing a knowledge graph based on the hypergraph model, the problem of difficulty in expressing complex business relationships and space-time relationships in the existing technology is solved, and stronger knowledge graph expression and reasoning capabilities are achieved.
Patent Information
- Application Number
- CN202311732930.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-15
- Publication Date
- 2025-06-17
AI Technical Summary
The existing knowledge graphs have shortcomings in expressing complex business relationships and space-time relationships, especially the triple representation method is difficult to fully reflect the complex relationships between real entities, resulting in limited expression and reasoning capabilities of the graph.
A hypergraph model is used to build a hypergraph model of the previous and current moments of material data, and connect it in the time dimension to generate a knowledge graph. The method includes generating a hyperedge set and a node set, and building a hypergraph model through an entity triplet.
It enhances the space-time relationship of the knowledge graph, and can more fully reflect complex business relationships and space-time information, thereby improving the expression and reasoning capabilities of the graph.
Smart Images

Figure CN120163218A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of knowledge graphs, and particularly relates to a method and system for constructing a knowledge graph based on a hypergraph model. Background Art
[0002] First of all, the emergence of knowledge graphs has changed the traditional knowledge acquisition mode, enabling knowledge engineering to be transformed into mining data and extracting knowledge. Knowledge facts can be extracted from structured data, semi-structured data, and unstructured data, and through knowledge fusion and processing, a complete knowledge graph can be finally obtained. Therefore, in the construction and expression of the graph, it is crucial how to integrate knowledge facts into the knowledge graph completely.
[0003] In existing knowledge graphs, the triple-based representation method has been widely used, and its unique data structure can well express its entities and the association relationships between entities. However, with the complexity of business, its simple representation of the relationships between entities cannot be fully reflected. For example, in the knowledge graph Freebase, more than one-third of the entities and 60% of the relationships cannot be expressed in the form of triples. Using the traditional data structure method has the following problems: 1. It simplifies the representation of the business descriptiveness and spatio-temporal relationality of data stored in the knowledge graph, and cannot reflect the graph nodes with intermediate connectivity in business descriptions; 2. For hyper-relation data connecting more than two entities, a large amount of its high-order structure information will be lost, ultimately resulting in limited expression and reasoning capabilities of the graph. Summary of the Invention
[0004] To overcome the deficiencies of the above-mentioned prior art, this application proposes a method for constructing a knowledge graph based on a hypergraph model, including:
[0005] Construct a hypergraph model of the previous moment and a hypergraph model of the current moment of the material data based on the inherent attributes and label attributes of the material data;
[0006] Construct a knowledge graph based on the hypergraph model of the current moment in combination with the hypergraph model of the previous moment.
[0007] Preferably, the construction of the hypergraph model of the current moment includes:
[0008] Generate a hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment; the hyperedge set includes: attribute hyperedges and data hyperedges;
[0009] Obtain the entity nodes at both ends of the attribute hyperedges based on the attribute hyperedges in the hyperedge set, and generate a node set;
[0010] Construct a hypergraph model of the current moment through entity triples based on the hyperedge set and the node set.
[0011] Preferably, generating the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment includes:
[0012] Based on the material data at the current moment, determining the entity nodes of the material data;
[0013] Extracting the required inherent attributes from the inherent attributes of the entity nodes, and connecting the same required inherent attributes of pairwise entity nodes among all entity nodes as attribute hyperedges;
[0014] Using the distance-based clustering K-means algorithm, clustering the data with the same type of label attributes inside each entity node, and then combining the clustered data through data hyperedges;
[0015] Generating a hyperedge set based on the attribute hyperedges among all entity nodes and the data hyperedges in all entity nodes.
[0016] Preferably, during the generation of the hyperedge set, a divide-and-conquer strategy is adopted to generate it through multiple worker threads.
[0017] Preferably, constructing a knowledge graph based on the hypergraph model at the current moment in combination with the hypergraph model constructed at the previous moment includes:
[0018] Connecting the hypergraph model at the current moment and the hypergraph model constructed at the previous moment in the time dimension to obtain the constructed knowledge graph.
[0019] Based on the same inventive concept, the present application also provides a knowledge graph construction system based on a hypergraph model, including: a hypergraph model construction module and a knowledge graph construction module;
[0020] The hypergraph model construction module is used to construct the hypergraph model at the previous moment and the hypergraph model at the current moment of the material data based on the inherent attributes and label attributes of the material data;
[0021] The knowledge graph construction module is used to construct a knowledge graph based on the hypergraph model at the current moment in combination with the hypergraph model at the previous moment.
[0022] Preferably, the construction of the hypergraph model at the current moment by the hypergraph model construction module includes:
[0023] Generating the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment; the hyperedge set includes: attribute hyperedges and data hyperedges;
[0024] Based on the attribute hyperedges in the hyperedge set, obtaining the entity nodes at both ends of the attribute hyperedges to generate a node set;
[0025] Based on the hyperedge set and the node set, construct a hypergraph model at the current moment through entity triples.
[0026] Preferably, the hypergraph model construction module generates the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment, including:
[0027] Based on the material data at the current moment, determine the entity nodes of the material data;
[0028] Extract the required inherent attributes from the inherent attributes of the entity nodes, and connect the same required inherent attributes of the pairwise entity nodes among all entity nodes as attribute hyperedges;
[0029] Adopt the distance-based clustering K-means algorithm to cluster the data with the same type of label attributes inside each entity node, and then combine the clustered data through data hyperedges;
[0030] Generate a hyperedge set based on the attribute hyperedges among all entity nodes and the data hyperedges in all entity nodes.
[0031] Preferably, during the generation of the hyperedge set of the hypergraph model construction module, a divide-and-conquer strategy is adopted to generate it through multiple worker threads.
[0032] Preferably, the knowledge graph construction module is specifically used for:
[0033] Connect the hypergraph model at the current moment and the hypergraph model at the previous moment in the time dimension to obtain the constructed knowledge graph.
[0034] Compared with the closest prior art, the beneficial effects of the present application are as follows:
[0035] The present application provides a method and system for constructing a knowledge graph based on a hypergraph model, including: constructing a hypergraph model at the previous moment and a hypergraph model at the current moment of material data based on the inherent attributes and label attributes of the material data; constructing a knowledge graph based on the hypergraph model at the current moment combined with the hypergraph model at the previous moment; the inherent attributes and label attributes of the material data in the present application not only reflect the explicit business description of the material data, but also reflect the intermediate business description of the material data; combining the hypergraph models of the two moments to generate a knowledge graph, enhancing the spatio-temporal relationship in the knowledge graph. Description of the Drawings
[0036] Figure 1 It is a schematic flowchart of a method for constructing a knowledge graph based on a hypergraph model provided by the present application;
[0037] Figure 2Schematic diagram of clustering material data using the distance-based clustering K-means algorithm provided by this application;
[0038] Figure 3 Schematic diagram of the hyperedge set construction process provided by this application;
[0039] Figure 4 Structure diagram of the hypergraph model provided by this application;
[0040] Figure 5 Schematic diagram of a knowledge graph construction system based on a hypergraph model provided by this application. Detailed implementation manners
[0041] The following further elaborates on the detailed implementation manners of this application with reference to the accompanying drawings.
[0042] Embodiment 1:
[0043] A knowledge graph construction method based on a hypergraph model provided by this application is as Figure 1 shown and includes:
[0044] Step 1: Based on the inherent attributes and label attributes of the material data, construct the hypergraph model of the previous moment and the hypergraph model of the current moment of the material data;
[0045] Step 2: Based on the hypergraph model of the current moment in combination with the hypergraph model of the previous moment, construct a knowledge graph.
[0046] Specifically, Step 1 includes:
[0047] The material data includes two major business systems: the project management system and the line loss management system;
[0048] The project management system mainly includes: project public information, individual projects, contracts, enterprise names, the WBS system, purchase orders, etc.;
[0049] The line loss management system mainly includes: electricity consumers, distribution areas, transformers, lines, etc.;
[0050] The hypergraph model of the current moment is constructed as follows:
[0051] Step S1: Based on the inherent attributes and label attributes of the material data, construct a hyperedge set, specifically as follows:
[0052] Step S11: Based on the material data of the current moment, determine the entity nodes of the material data, and the data in the project management system or the line loss management system are entity nodes;
[0053] Extract the required intrinsic attributes from the intrinsic attributes of entity nodes in the project management system, and connect the same required intrinsic attributes of pairwise entity nodes among all entity nodes as attribute hyperedges; for example: the first party / second party in a contract, the contract is an entity node, and the first party / second party are intrinsic attributes; the enterprise name of an enterprise, the enterprise is an entity node, and the enterprise name is an intrinsic attribute; the enterprise names between two enterprises can be used as the required intrinsic attributes and used as attribute hyperedges; similarly, the adopted equipment in a purchase order and the project name of a single project can be used as the required intrinsic attributes and used as attribute hyperedges;
[0054] Step S12: Extract the required intrinsic attributes from the intrinsic attributes of entity nodes in the line loss management system, and connect the same required intrinsic attributes of pairwise entity nodes among all entity nodes as attribute hyperedges; for example: based on the name of the electricity customer and the power supply customer in the substation area, refine it into an attribute hyperedge between two entities. The electricity customer is an entity node, the name is an intrinsic attribute, the substation area is an entity node, and the power supply customer is an intrinsic attribute;
[0055] Step S13: According to the business personnel, define the data in each entity node as different label attributes. For example: project public information can be divided into central projects, self-built projects, procurement projects, and technology projects; contracts can be divided into general contracting types and subcontracting types; the enterprise list can be divided into large enterprises, medium-large enterprises, medium-sized enterprises, small and medium-sized enterprises, and micro enterprises; when the business personnel define the label attributes of the data in each entity node, as Figure 2 shown, use the distance-based clustering K-means algorithm to cluster the data with the same type of label attributes inside each entity node, and then combine the clustered data through data hyperedges;
[0056] Step S2: Based on parallel computing, construct a hyperedge set related to material data in multiple paths, as Figure 3 shown, specifically as follows:
[0057] Step S21: Take the process of constructing the hyperedge set as a task unit. To ensure the calculation speed, the divide-and-conquer strategy is used in this method to decompose the large task into small tasks for parallel execution, thereby improving the utilization rate and performance of the CPU;
[0058] Step S22: Take the intrinsic attribute of each entity node as a sub-task, and take each label attribute defined by the business personnel as a sub-task;
[0059] Step S23: Construct a thread pool specifically designed for decomposing tasks. Each working thread in it has a "double-ended queue" to maintain tasks. When a thread executes its own task, it obtains it from the head of the queue; when stealing the tasks of other threads, it obtains it from the tail of the queue to avoid task conflicts;
[0060] Step S3: Form a node set according to the hyperedge set, and at the same time combine the time information to construct a hypergraph model at the current moment; specifically as follows:
[0061] Step S31: Based on the attribute hyperedges in the hyperedge set, obtain the entity nodes at both ends of the attribute hyperedges to generate a node set;
[0062] Step S32: Based on the hyperedge set and the node set, construct a hypergraph model at the current moment through entity triples;
[0063] The structure diagram of the hypergraph model is as Figure 4 shown;
[0064] Hyperedge: <Object State>, is transformed into a triple [Project System State]<Object State>[Project Public Information], where [Project System State] and [Project Public Information] are the entity nodes of this hyperedge;
[0065] The construction method of the hypergraph model at the previous moment is the same as that of the hypergraph model at the current moment. The construction method of the hypergraph model at the previous moment is constructed based on the inherent attributes and label attributes of the material data at the previous moment, which will not be elaborated here; the inherent attributes and label attributes of this application not only reflect the explicit business description of the material data, but also reflect the intermediate business description of the material data.
[0066] Specifically, step 2 includes:
[0067] To ensure the coherence of the timeline, the two hypergraph models are linked by edges in the time dimension to form a two-layer spatio-temporal hypergraph model, that is, a knowledge graph; at the same time, according to requirements, a knowledge graph can also be constructed for the project management system and line loss management system of the material data; this application combines the hypergraph models of two moments, enhancing the spatio-temporal relationship of the knowledge graph, and at the same time, according to requirements, a knowledge graph can be constructed for some data in the material data, increasing the selection range of constructing the knowledge graph.
[0068] Embodiment 2:
[0069] Based on the same inventive concept, this application also provides a method for constructing a knowledge graph based on a hypergraph model as Figure 5 shown, including: a hypergraph model construction module and a knowledge graph construction module;
[0070] The hypergraph model construction module is used to construct the hypergraph model at the previous moment and the hypergraph model at the current moment of the material data based on the inherent attributes and label attributes of the material data;
[0071] The knowledge graph construction module is used to construct a knowledge graph based on the hypergraph model at the current moment combined with the hypergraph model at the previous moment.
[0072] Preferably, the construction of the hypergraph model at the current moment by the hypergraph model construction module includes:
[0073] Based on the inherent attributes and label attributes of the material data at the current moment, generating a hyperedge set of the material data; the hyperedge set includes: attribute hyperedges and data hyperedges;
[0074] Based on the attribute hyperedges in the hyperedge set, obtaining the entity nodes at both ends of the attribute hyperedges and generating a node set;
[0075] Based on the hyperedge set and the node set, constructing the hypergraph model at the current moment through entity triples.
[0076] Preferably, the hypergraph model construction module generates the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment, including:
[0077] Based on the material data at the current moment, determining the entity nodes of the material data;
[0078] Extracting the required inherent attributes from the inherent attributes of the entity nodes, and connecting the same required inherent attributes of every two entity nodes among all entity nodes as attribute hyperedges;
[0079] Using the distance-based clustering K-means algorithm to cluster the data with the same type of label attributes inside each entity node, and then combining the clustered data through data hyperedges;
[0080] Generating a hyperedge set based on the attribute hyperedges among all entity nodes and the data hyperedges in all entity nodes.
[0081] Preferably, during the generation of the hyperedge set by the hypergraph model construction module, a divide-and-conquer strategy is adopted to generate it through multiple worker threads.
[0082] Preferably, the knowledge graph construction module is specifically used for:
[0083] Connecting the hypergraph model at the current moment and the hypergraph model at the previous moment in the time dimension to obtain the constructed knowledge graph.
[0084] Those skilled in the art should understand that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk memories, CD-ROMs, optical memories, etc.) containing computer-usable program codes.
[0085] This application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to embodiments of the present application. It should be understood that each flow and / or block in the flowchart and / or block diagram, as well as the combination of flows and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, such that the instructions executed by the processor of the computer or other programmable data processing devices generate a means for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a means for implementing the functions specified in one block or multiple blocks.
[0086] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction means that implements the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a means for implementing the functions specified in one block or multiple blocks.
[0087] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, so that the instructions executed on the computer or other programmable device provide steps for implementing the functions specified in the process Figure 1 one process or multiple processes and / or blocks Figure 1 a means for implementing the functions specified in one block or multiple blocks.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application rather than to limit the scope of its protection. Although the present application has been described in detail with reference to the above embodiments, those of ordinary skill in the art should understand that after reading the present application, various changes, modifications, or equivalent replacements can still be made to the specific implementation manners of the application. However, these changes, modifications, or equivalent replacements are all within the scope of the protection of the pending claims of the application.
Claims
1. A method for constructing a knowledge graph based on a hypergraph model, characterized in that, Including: Construct the hypergraph model of the previous moment and the hypergraph model of the current moment of the material data based on the inherent attributes and label attributes of the material data; Construct a knowledge graph based on the hypergraph model of the current moment combined with the hypergraph model of the previous moment.
2. The method according to claim 1, characterized in that, The construction of the hypergraph model of the current moment includes: Generate the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment; the hyperedge set includes: attribute hyperedges and data hyperedges; Based on the attribute hyperedges in the hyperedge set, obtain the entity nodes at both ends of the attribute hyperedges and generate a node set; Based on the hyperedge set and the node set, construct the hypergraph model of the current moment through entity triples.
3. The method according to claim 2, characterized in that, The generating the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment includes: Based on the material data at the current moment, determine the entity nodes of the material data; Extract the required inherent attributes from the inherent attributes of the entity nodes, and connect the same required inherent attributes of pairwise entity nodes among all entity nodes as attribute hyperedges; Adopt the distance-based clustering K-means algorithm to cluster the data with the same type of label attributes inside each entity node, and then combine the clustered data through data hyperedges; Generate a hyperedge set based on the attribute hyperedges between all entity nodes and the data hyperedges in all entity nodes.
4. The method according to claim 3, characterized in that, During the generation of the hyperedge set, a divide-and-conquer strategy is adopted to generate it through multiple worker threads.
5. The method according to claim 1, characterized in that, The constructing a knowledge graph based on the hypergraph model of the current moment combined with the constructed hypergraph model of the previous moment includes: Connect the hypergraph model of the current moment and the hypergraph model of the previous moment in the time dimension to obtain the constructed knowledge graph.
6. A system for constructing a knowledge graph based on a hypergraph model, characterized in that, Including: A hypergraph model construction module and a knowledge graph construction module; The hypergraph model construction module is used to construct the hypergraph model of the previous moment and the hypergraph model of the current moment of the material data based on the inherent attributes and label attributes of the material data; The knowledge graph construction module is used to construct a knowledge graph based on the hypergraph model of the current moment combined with the hypergraph model of the previous moment.
7. The system according to claim 6, characterized in that, The construction of the hypergraph model of the current moment by the hypergraph model construction module includes: Generate the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment; the hyperedge set includes: attribute hyperedges and data hyperedges; Based on the attribute hyperedges in the hyperedge set, obtain the entity nodes at both ends of the attribute hyperedges and generate a node set; Based on the hyperedge set and the node set, construct the hypergraph model of the current moment through entity triples.
8. The system according to claim 7, characterized in that, The hypergraph model construction module generates the hyperedge set of the material data based on the inherent attributes and label attributes of the material data at the current moment, including: Based on the material data at the current moment, determine the entity nodes of the material data; Extract the required inherent attributes from the inherent attributes of the entity nodes, and connect the same required inherent attributes of pairwise entity nodes among all entity nodes as attribute hyperedges; Using the distance-based clustering K-means algorithm, after clustering the data with the same type of label attributes inside each of the entity nodes, the clustered data is combined through data hyperedges; Based on the attribute hyperedges between all entity nodes and the data hyperedges in all entity nodes, a hyperedge set is generated.
9. The system according to claim 8, characterized in that, During the generation of the hyperedge set of the hypergraph model construction module, a divide-and-conquer strategy is adopted to generate it through multiple worker threads.
10. The system according to claim 6, characterized in that, The knowledge graph construction module is specifically used for: In the time dimension, the hypergraph model at the current moment and the hypergraph model at the previous moment are connected to obtain the constructed knowledge graph.