A knowledge graph construction method and related device
By associating target data with time-series information to generate node data and constructing a knowledge graph, the problem that existing graph databases cannot support multi-scenario layering and time-series analysis in network security analysis is solved. This enables multi-scenario layered network security analysis and time-series analysis, improving the efficiency and accuracy of data analysis.
Patent Information
- Application Number
- CN202211411360.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-11
- Publication Date
- 2026-01-02
- Estimated Expiration
- 2042-11-11
AI Technical Summary
Existing graph databases cannot support multi-scenario layering and time-series analysis in cybersecurity analysis, resulting in incomplete analysis.
By acquiring target data from a predefined scenario, including entity data, attribute data, and relationship data, and associating it with time-series information, node data is generated and stored to construct a knowledge graph.
It enables multi-scenario layered network security analysis, allowing data to be analyzed from different dimensions and levels, and to view graph changes and trends in a timely and efficient manner. It supports time-series analysis and graph similarity techniques to improve the effectiveness of business strategies.
Smart Images

Figure CN115712733B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of data management, and in particular to a knowledge graph construction method and related equipment. BACKGROUND
[0002] The mainstream graph databases on the market include Neo4j graph, JanusGraph graph, HugeGraph graph, etc. The Neo4j graph is a high-performance, NOSQL static graph database, but does not support dynamic graphs. The JanusGraph graph supports real-time analysis and traversal of large graphs, but does not support time series. The HugeGraph graph is an easy-to-use, efficient and universal open source graph database that supports the fast import of more than 10 billion vertices and edges, but does not support multi-scene layering.
[0003] In the Neo4j graph, the network asset situation in different time periods cannot be obtained. In the JanusGraph graph, real-time analysis and traversal can be performed, but the data in different time periods cannot be reflected. The HugeGraph graph supports fast import and query of vertices and edges, but does not support multi-scene layering.
[0004] Network security needs to be analyzed from multiple levels of network space and needs to analyze network asset security from various scene dimensions, such as IP network assets, domain name network assets, network segment assets, and Web service information leakage. However, the current graph databases do not support multi-scene layering, reducing the analysis dimensions and leading to incomplete network security analysis. SUMMARY
[0005] Therefore, the present application provides a knowledge graph construction method and related equipment to solve the problem that the existing graph databases are static, cannot time series, do not support multi-scene layering and cannot meet the requirements of network security analysis.
[0006] To achieve one or part or all of the above purposes or other purposes, the present application provides a knowledge graph construction method, which includes: obtaining target data of a preset scene, wherein the target data at least includes one of entity data, attribute data and relationship data;
[0007] Associating the target data with time series information according to a preset rule of the corresponding data type to generate node data and store the node data.
[0008] Constructing a knowledge graph based on the stored node data.
[0009] Optionally, the step of associating the target data with time series information according to a preset rule of the corresponding data type includes:
[0010] When the target data comprises the entity data, a universal unique identifier of the entity data is associated with the timing information to obtain target entity data.
[0011] Optionally, the step of associating the target data with the timing information according to the preset rule of the corresponding data type, generating node data and storing, comprises:
[0012] When the target data comprises the relationship data, it is judged whether there is a relationship type block under the preset scene;
[0013] If there is no relationship type block under the preset scene, a relationship type block corresponding to the preset scene is created, and the relationship data and the timing information are added to the created relationship type block;
[0014] If there is a relationship type block under the preset scene, it is found whether the relationship type block contains historical relationship data corresponding to the relationship data;
[0015] If the relationship type block contains historical relationship data corresponding to the relationship data, the relationship type block is updated based on the relationship data and the timing information;
[0016] If the relationship type block does not contain historical relationship data corresponding to the relationship data, the relationship data and the timing information are added to the relationship type block.
[0017] Optionally, the step of associating the target data with the timing information according to the preset rule of the corresponding data type, generating node data and storing, comprises:
[0018] When the target data comprises the attribute data, it is judged whether there is an attribute type block under the preset scene;
[0019] If there is no attribute type block under the preset scene, an attribute type block corresponding to the preset scene is created, and the attribute data and the timing information are added to the created attribute type block;
[0020] If there is an attribute type block under the preset scene, it is found whether the attribute type block contains historical attribute data corresponding to the attribute data;
[0021] If the attribute type block contains historical attribute data corresponding to the attribute data, the attribute type block is updated based on the attribute data and the timing information;
[0022] If the attribute type block does not contain historical attribute data corresponding to the attribute data, the attribute data and the timing information are added to the attribute type block.
[0023] Optionally, the step of associating the target data with time sequence information according to a preset rule corresponding to a data type, generating node data, and storing, comprises:
[0024] When the target data comprises the entity data, it is determined whether there is an entity type block under the preset scene;
[0025] If there is no entity type block under the preset scene, an entity type block corresponding to the preset scene is created, and the target entity data with time sequence information is added to the created entity type block;
[0026] If there is an entity type block under the preset scene, it is determined whether the entity type block contains an entity value corresponding to the target entity data;
[0027] If the entity type block does not contain the entity value corresponding to the target entity data, the entity value corresponding to the target entity data is added to the entity type block.
[0028] Optionally, when the target data comprises the entity data, the method further comprises:
[0029] It is determined whether a main scene of the preset scene exists;
[0030] If the main scene of the preset scene does not exist, a main scene of the preset scene and a sub-scene of the preset scene are created;
[0031] If the main scene of the preset scene exists, it is determined whether a sub-scene of the preset scene exists;
[0032] If the sub-scene of the preset scene does not exist, the sub-scene of the preset scene is created;
[0033] If the sub-scene of the preset scene exists, it is determined whether the sub-scene of the preset scene is associated with the target entity data;
[0034] If the sub-scene of the preset scene is not associated with the target entity data, the sub-scene of the preset scene is added to be associated with the target entity data.
[0035] Optionally, the step of constructing a knowledge graph based on the stored node data comprises:
[0036] According to the HASH value of the target data, the definition of each type block of the target data in the mapping table of the split table is determined.
[0037] In a second aspect, the present application provides a knowledge graph construction device, the device comprises:
[0038] The data receiving device is used to acquire target data of a preset scene, wherein the target data at least includes one of entity data, attribute data and relationship data.
[0039] The time sequence association module is used to associate the target data with time sequence information according to a preset rule of a corresponding data type, generate node data and store the node data.
[0040] The graph generating module is used to construct a knowledge graph based on the stored node data.
[0041] In a third aspect, the present application provides an electronic device, comprising a processor, a memory and a bus, the memory stores machine readable instructions executable by the processor, when the electronic device is running, the processor and the memory communicate through the bus, and the machine readable instructions are executed by the processor to perform the steps of the knowledge graph construction method described above.
[0042] In a fourth aspect, the present application provides a computer readable storage medium, the computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the knowledge graph construction method described above.
[0043] The embodiment of the present application has the following beneficial effects:
[0044] By acquiring target data of a preset scene, wherein the target data at least includes one of entity data, attribute data and relationship data; associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data; and constructing a knowledge graph based on the stored node data, the time dimension is added to the knowledge graph data, so that the constructed knowledge graph can use time sequence analysis technology and graph similarity technology to analyze the change and trend of the graph structure over time, so that key information is mastered. And the preset scene is set, which can realize the effect of supporting multiple scenes. By supporting multiple scenes and multiple levels, data can be analyzed from different dimensions and different levels, which is helpful to improve business strategy. It is beneficial to timely and efficiently view the change and trend of the graph in each time period and evaluate the change. BRIEF DESCRIPTION OF DRAWINGS
[0045] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor based on these drawings.
[0046] Among them:
[0047] Figure 1 is a flowchart of a knowledge graph construction method provided by an embodiment of the present application;
[0048] Figure 2 is a flowchart of another knowledge graph construction method provided by an embodiment of the present application;
[0049] Figure 3 is a flowchart of another knowledge graph construction method provided by an embodiment of the present application;
[0050] Figure 4 is a flowchart of another knowledge graph construction method provided by an embodiment of the present application;
[0051] Figure 5 is a flowchart of another knowledge graph construction method provided by an embodiment of the present application;
[0052] Figure 6 is a structural schematic diagram of a knowledge graph construction device provided by an embodiment of the present application;
[0053] Figure 7 is a structural schematic diagram of an electronic device provided by an embodiment of the present application;
[0054] Figure 8 is a structural schematic diagram of a storage medium provided by an embodiment of the present application. DETAILED DESCRIPTION
[0055] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the scope of protection of the present application.
[0056] As shown in Figure 1 , the present application provides a knowledge graph construction method, comprising:
[0057] S101, obtaining target data of a preset scene, wherein the target data at least includes one of entity data, attribute data and relationship data;
[0058] Illustratively, after obtaining the data, i.e., the target data of the preset scene, the data type is identified, and the data type includes entity data, attribute data and relationship data.
[0059] S102, associating the target data with time sequence information according to a preset rule of the corresponding data type, generating node data and storing;
[0060] For example, for different types of data, a corresponding preset method is selected to associate the target data with time-series information and store it in a tree-like directory.
[0061] For example, the target data can be stored in a tree-like directory using a graph-cell approach, with MySQL as the underlying storage medium.
[0062] S103. Construct a knowledge graph based on the stored node data.
[0063] By acquiring target data from a preset scenario, wherein the target data includes at least one of entity data, attribute data, and relation data; associating the target data with time-series information according to preset rules for the corresponding data type to generate and store node data; and constructing a knowledge graph based on the stored node data. By adding a time dimension to the knowledge graph data, the constructed knowledge graph can utilize time-series analysis and graph similarity techniques to analyze the changes and trends in the graph structure over time, thereby grasping key information. Setting preset scenarios allows for multi-scenario support, enabling data analysis from different dimensions and levels, which helps improve business strategies. It facilitates timely and efficient viewing of graph changes and trends across different time periods, and allows for evaluation of changes.
[0064] In one possible implementation, the step of associating the target data with time-series information according to a preset rule for the corresponding data type includes:
[0065] When the target data includes the entity data, the universally unique identifier of the entity data is associated with the time-series information to obtain the target entity data.
[0066] For example, the same entity data may be contained in different scenarios and at different times. Considering multiple aspects and dimensions, such as universality, reusability, bandwidth, and server resource consumption, the entity data is stored in an entity type block using Base64 string encryption.
[0067] For example, scenarios and time sequences only need to be associated with the universally unique identifier (UUID) of the entity type block, which greatly increases reusability and reduces bandwidth and server resource consumption caused by data transmission.
[0068] In one possible implementation, such as Figure 2 As shown, the step of associating the target data with time-series information and storing it in a tree-structured directory includes:
[0069] S201. When the target data includes the relation data, determine whether there is a relation type block under the preset scenario;
[0070] S202, if the relationship type block under the preset scene does not exist, creating the relationship type block corresponding to the preset scene, and adding the relationship data and the time sequence information to the created relationship type block;
[0071] S203, if the relationship type block under the preset scene exists, searching whether the historical relationship data corresponding to the relationship data is contained in the relationship type block;
[0072] S204, if the historical relationship data corresponding to the relationship data is contained in the relationship type block, updating the relationship type block based on the relationship data and the time sequence information;
[0073] S205, if the historical relationship data corresponding to the relationship data is not contained in the relationship type block, adding the relationship data and the time sequence information to the relationship type block.
[0074] For example, the relationship between entities corresponding to the relationship data is set under each scene, such as the relationship between entity A and entity B under scene A is R1, and the relationship between entity A and entity B under scene B is R2.
[0075] For example, when the target data includes the relationship data, it is judged whether the relationship type block corresponding to the preset scene exists, and if the relationship type block corresponding to the preset scene does not exist, the relationship type block corresponding to the preset scene is created. If the relationship type block corresponding to the preset scene exists, it is first judged whether the relationship between the entities corresponding to the relationship data exists in the relationship type block. If the relationship between the entities corresponding to the relationship data does not exist in the relationship type block, the relationship between the two entities is added in the relationship type block. If the relationship between the entities corresponding to the relationship data exists in the relationship type block, the time information corresponding to the existing relationship is compared with the time sequence information. If the time information and the time sequence information are consistent, the existing relationship is not changed. If the time information and the time sequence information are inconsistent, the relationship type block is updated based on the relationship data and the time sequence information.
[0076] In a possible implementation, as shown in Figure 3 The step of associating the target data with the time sequence information according to the preset rule of the corresponding data type, generating node data and storing, includes:
[0077] S301, when the target data includes the attribute data, it is judged whether the attribute type block under the preset scene exists;
[0078] S302, if the attribute type block under the preset scene does not exist, creating the attribute type block corresponding to the preset scene, and adding the attribute data and the time sequence information to the created attribute type block;
[0079] S303, if the attribute type block under the preset scene exists, searching whether the historical attribute data corresponding to the attribute data is contained in the attribute type block;
[0080] S304, if the historical attribute data corresponding to the attribute data is contained in the attribute type block, updating the attribute type block based on the attribute data and the time sequence information;
[0081] S305, if the historical attribute data corresponding to the attribute data is not contained in the attribute type block, adding the attribute data and the time sequence information to the attribute type block.
[0082] For example, the attribute data and the relationship data have similar characteristics. Since the attribute is not constant in different scenes, the attribute is set for each scene. For example, the attribute level of entity A under scene A is L1, and the attribute level of entity A under scene B is L2.
[0083] For example, when the target data includes the attribute data, it is judged whether the attribute type block corresponding to the preset scene exists. If the attribute type block corresponding to the preset scene does not exist, the attribute type block corresponding to the preset scene is created. If the attribute type block corresponding to the preset scene exists, it is first judged whether the attribute value corresponding to the attribute data exists in the attribute type block. If the attribute value corresponding to the attribute data does not exist in the attribute type block, the attribute value is added in the attribute type block. If the attribute value corresponding to the attribute data exists in the attribute type block, the time information corresponding to the existing attribute value is compared with the time sequence information. If the time information and the time sequence information are consistent, the existing attribute value is not changed. If the time is inconsistent, the attribute type block is updated based on the attribute data and the time sequence information.
[0084] In a possible implementation, as shown in Figure 4 The step of associating the target data with the time sequence information according to the preset rule of the corresponding data type, generating node data and storing, includes:
[0085] S401, when the target data includes the entity data, it is judged whether the entity type block under the preset scene exists;
[0086] S402, if the entity type block under the preset scene does not exist, creating the entity type block corresponding to the preset scene, and adding the target entity data with time sequence information to the created entity type block;
[0087] S403, if the entity type block under the preset scene exists, searching whether the entity value corresponding to the target entity data is contained in the entity type block;
[0088] S404, if the entity value corresponding to the target entity data is not contained in the entity type block, adding the entity value corresponding to the target entity data to the entity type block.
[0089] For example, when the entity type block does not exist, the entity type block is created through a preset rule. For example, the method for creating a storage entity type domain name table in mysql is: prefix+entity type+type Hash=table name, i.e. LA_Exu_Entity_49, LA_Exu_ is a prefix, Entity represents an entity type, and the identification UUID prefix of the domain name in the entity type is defined as 49. If the entity type block exists, it is judged whether the entity value exists. If not, the entity value is written into the data entity block.
[0090] In a possible implementation, when the target data includes the entity data, the method further includes:
[0091] judging whether the main scene of the preset scene exists;
[0092] if the main scene of the preset scene does not exist, creating the main scene of the preset scene and the sub-scene of the preset scene;
[0093] if the main scene of the preset scene exists, judging whether the sub-scene of the preset scene exists;
[0094] if the sub-scene of the preset scene does not exist, creating the sub-scene of the preset scene;
[0095] if the sub-scene of the preset scene exists, judging whether the sub-scene of the preset scene is associated with the target entity data;
[0096] if the sub-scene of the preset scene is not associated with the target entity data, adding the association between the sub-scene of the preset scene and the target entity data.
[0097] Exemplarily, when the scene is stored, a main scene table and a sub-scene table are stored respectively, the main scene table includes: main scene name, belonging user name, self UUID, creation time, and change time; and the sub-scene table includes: sub-scene name, belonging main scene UUID, self UUID, creation time, and change time.
[0098] In a possible implementation, the step of constructing the knowledge graph based on the tree directory includes:
[0099] The definition of each type of block of the target data in the mapping table of the sub-table is determined according to a HASH value of the target data.
[0100] Exemplarily, a HASH value of a unique MD5 encryption mode is generated according to a graph path, a graph name, and a sub-graph name created by a user, the definition of each type of block of the target data in the mapping table of the sub-table is determined according to a HASH value of the target data, and the uniqueness of the value is ensured.
[0101] In a possible implementation, in the storage process of the entity data, an entity data table is stored, and the entity data table includes: entity type UUID, entity value, self UUID, creation time, and modification time.
[0102] The types of entities are uniformly present in an entity type table, and the entity type table includes: self-increment ID, entity type name, and entity UUID.
[0103] In a possible implementation, in the storage process of the attribute data, an attribute data table is stored, and the attribute data table includes: belonging entity UUID, attribute name, attribute value storage UUID, creation time, and modification time.
[0104] In a possible implementation, in the storage process of the relationship data, a relationship data table is stored, and the relationship data table includes: source entity UUID, target entity UUID, belonging scene UUID, creation time, and modification time.
[0105] Exemplarily, when the constructed graph is queried, since the graph is stored in the tree directory, the graph needs to be opened according to a path, a main scene name, and a sub-scene name to obtain UUID and tree node information level by level. All reading, partial reading, and reading according to a parent unit are performed.
[0106] In a possible implementation, as Figure 5 shown, when the target data simultaneously includes at least two of the entity data, the attribute data, and the relationship data, after the target data is judged, different types of data are processed in parallel, do not interfere with each other, avoid conflicts, and meanwhile, parallel processing is helpful to improve the efficiency of data storage and graph generation.
[0107] In a possible implementation, as shown in Figure 6 The present application provides a knowledge graph construction device, which comprises:
[0108] a data receiving device 201 configured to acquire target data of a preset scene, wherein the target data comprises at least one of entity data, attribute data and relationship data;
[0109] a time sequence association module 202 configured to associate the target data with time sequence information according to a preset rule of a corresponding data type, generate node data and store the node data;
[0110] a graph generating module 203 configured to construct a knowledge graph based on the stored node data.
[0111] In a possible implementation, as shown in Figure 7 The present application provides an electronic device 300, which comprises a memory 310, a processor 320 and a computer program 311 stored in the memory 310 and executable on the processor 320. When the processor 320 executes the computer program 311, the following steps are implemented: acquiring target data of a preset scene, wherein the target data comprises at least one of entity data, attribute data and relationship data; associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data; and constructing a knowledge graph based on the stored node data.
[0112] In a possible implementation, as shown in Figure 8 The present application provides a computer readable storage medium 400, which stores a computer program 411. When the computer program 411 is executed by a processor, the following steps are implemented: acquiring target data of a preset scene, wherein the target data comprises at least one of entity data, attribute data and relationship data; associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data; and constructing a knowledge graph based on the stored node data.
[0113] The computer storage medium of the embodiments of the present application can adopt any combination of one or more computer readable media. The computer readable medium can be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may, for example, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or apparatus, or any combination thereof. More specific examples (non-exhaustive list) of the computer readable storage medium include an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, the computer readable storage medium can be any tangible medium that contains or stores a program that can be used by or in connection with an instruction execution system, apparatus or device.
[0114] The computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave, in which computer readable program code is embodied. Such propagated data signals can take a wide variety of forms, including but not limited to electro-magnetic signals, optical signals, or any suitable combination thereof. Computer readable signal medium can also be any computer readable medium that is not a storage medium, that is capable of storing the program for use by or in connection with the instruction execution system, apparatus or device.
[0115] The program code contained on the computer readable medium can be transmitted using any suitable medium, including but not limited to wireless, wire line, optical fiber cable, RF, etc., or any suitable combination of the above.
[0116] The computer program code for carrying out operations of the present application can be written in one or more programming languages or combinations of languages including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages such as "C" or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments of the present application, electronic mail (email) can be utilized as the
[0117] Those skilled in the art should understand that the modules or steps of the present application described above can be realized by general computing devices, which can be centralized on a single computing device or distributed on a network composed of multiple computing devices, and optionally, they can be realized by program codes executable by the computing devices, so that they can be stored in storage devices and executed by the computing devices, or they can be respectively manufactured into individual integrated circuit modules, or multiple modules or steps among them can be manufactured into a single integrated circuit module to realize. Thus, the present application is not limited to any specific combination of hardware and software.
[0118] It is noted that the above merely describes the preferred embodiments of the present application and the principles of the applied technology. Those skilled in the art will understand that the present application is not limited to the specific embodiments described above, and various obvious changes, re-adjustments and substitutions can be made by those skilled in the art without departing from the scope of the present application. Therefore, although the present application has been described in detail through the above embodiments, the present application is not limited to the above embodiments, and more other equivalent embodiments can be included without departing from the concept of the present application, and the scope of the present application is determined by the appended claims.
[0119] The above only discloses the preferred embodiments of the present application, and of course cannot limit the scope of the rights of the present application, so equivalent changes made according to the claims of the present application are still within the scope of the present application.
Claims
1. A method for constructing a knowledge graph, characterized in that, The method comprises the following steps: acquiring target data of a preset scene, wherein the target data comprises at least one of entity data, attribute data and relationship data; associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data; constructing a knowledge graph based on the stored node data; wherein the step of associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data comprises: when the target data comprises the relationship data, determining whether there is a relationship type block under the preset scene; if there is no relationship type block under the preset scene, creating a relationship type block corresponding to the preset scene, and adding the relationship data and time sequence information to the created relationship type block; if there is a relationship type block under the preset scene, determining whether the relationship type block contains historical relationship data corresponding to the relationship data; if the relationship type block contains historical relationship data corresponding to the relationship data, updating the relationship type block based on the relationship data and the time sequence information; if the relationship type block does not contain historical relationship data corresponding to the relationship data, adding the relationship data and time sequence information to the relationship type block; wherein the step of associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data comprises: when the target data comprises the attribute data, determining whether there is an attribute type block under the preset scene; if there is no attribute type block under the preset scene, creating an attribute type block corresponding to the preset scene, and adding the attribute data and time sequence information to the created attribute type block; if there is an attribute type block under the preset scene, determining whether the attribute type block contains historical attribute data corresponding to the attribute data; if the attribute type block contains historical attribute data corresponding to the attribute data, updating the attribute type block based on the attribute data and the time sequence information; if the attribute type block does not contain historical attribute data corresponding to the attribute data, adding the attribute data and time sequence information to the attribute type block; wherein the step of associating the target data with time sequence information according to a preset rule of a corresponding data type, generating node data and storing the node data comprises: when the target data comprises the entity data, determining whether there is an entity type block under the preset scene; if there is no entity type block under the preset scene, creating an entity type block corresponding to the preset scene, and adding target entity data with time sequence information to the created entity type block; if there is an entity type block under the preset scene, determining whether the entity type block contains an entity value corresponding to the target entity data; if the entity type block does not contain an entity value corresponding to the target entity data, adding the entity value corresponding to the target entity data to the entity type block. 2.The knowledge graph construction method of claim 1, wherein, the step of associating the target data with time sequence information according to a preset rule of a corresponding data type comprises: When the target data comprises the entity data, a universal unique identifier of the entity data is associated with the timing information to obtain target entity data. 3.The knowledge graph construction method of claim 2, wherein, When the target data comprises the entity data, the method further comprises: determining whether a main scene of the preset scene exists; if the main scene of the preset scene does not exist, creating the main scene of the preset scene and a sub-scene of the preset scene; if the main scene of the preset scene exists, determining whether the sub-scene of the preset scene exists; if the sub-scene of the preset scene does not exist, creating the sub-scene of the preset scene; if the sub-scene of the preset scene exists, determining whether the sub-scene of the preset scene is associated with the target entity data; if the sub-scene of the preset scene is not associated with the target entity data, adding the association between the sub-scene of the preset scene and the target entity data. 4.The knowledge graph construction method of claim 1, wherein, The step of constructing the knowledge graph based on the stored node data comprises: determining definitions of each type of block of the target data in a mapping table of a split table according to a HASH value of the target data.
5. A knowledge graph construction apparatus, characterized by comprising: The device comprises: a data receiving device configured to obtain target data of a preset scene, wherein the target data comprises at least one of entity data, attribute data and relationship data; a timing association module configured to associate the target data with timing information according to a preset rule of a corresponding data type, generate node data and store the node data; a graph generation module configured to construct a knowledge graph based on the stored node data; The timing association module is specifically configured to: when the target data comprises the relationship data, determine whether a relationship type block under the preset scene exists; if the relationship type block under the preset scene does not exist, create a relationship type block corresponding to the preset scene, and add the relationship data and timing information to the created relationship type block; if the relationship type block under the preset scene exists, determine whether the relationship type block contains historical relationship data corresponding to the relationship data; if the relationship type block contains the historical relationship data corresponding to the relationship data, update the relationship type block based on the relationship data and the timing information; if the relationship type block does not contain the historical relationship data corresponding to the relationship data, add the relationship data and timing information to the relationship type block. The time sequence association module is specifically configured to: when the target data comprises the attribute data, determine whether there is an attribute type block under the preset scene; if there is no attribute type block under the preset scene, create an attribute type block corresponding to the preset scene, and add the attribute data and time sequence information to the created attribute type block; if there is an attribute type block under the preset scene, determine whether the attribute type block contains historical attribute data corresponding to the attribute data; if the attribute type block contains the historical attribute data corresponding to the attribute data, update the attribute type block based on the attribute data and the time sequence information; and if the attribute type block does not contain the historical attribute data corresponding to the attribute data, add the attribute data and the time sequence information to the attribute type block. The time sequence association module is specifically configured to: when the target data comprises the entity data, determine whether there is an entity type block under the preset scene; if there is no entity type block under the preset scene, create an entity type block corresponding to the preset scene, and add target entity data with time sequence information to the created entity type block; if there is an entity type block under the preset scene, determine whether the entity type block contains an entity value corresponding to the target entity data; if the entity type block does not contain the entity value corresponding to the target entity data, add the entity value corresponding to the target entity data to the entity type block.
6. An electronic device, comprising: The computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the knowledge graph construction method in any one of claims 1 to 4. The computer readable storage medium stores a computer program, and the computer program is executed by the processor to perform the steps of the knowledge graph construction method in any one of claims 1 to 4.
7. A computer readable storage medium characterized in that,
Citation Information
Patent Citations
Semantic and knowledge graph analysis method, platform and device based on dynamic ontology
CN113326381A
A time sequence diagram-based public security knowledge graph generation method for generic perception data
CN114036318A