Knowledge graph management method and system, computer equipment and storage medium

By introducing extended features and deduplication fields into the knowledge graph management method, and generating unique knowledge IDs, the problem that knowledge graphs in the prior art cannot express complex semantic information is solved, interpretability and comprehensibility are improved, and deduplication of knowledge storage is realized.

CN119940493APending Publication Date: 2025-05-06湖南四方天箭信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411818628.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-11
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

Existing triple-based knowledge representation methods can only express simple semantic relationships and cannot express complex semantic information, resulting in limited interpretability and comprehensibility of the knowledge graph.

Method used

By introducing extended features and deduplication fields into the knowledge graph management method, a unique knowledge ID is generated to judge and store triplets, ensuring the deduplication of data, and supporting the expression of complex semantic information.

Benefits of technology

It improves the interpretability and comprehensibility of the knowledge graph, and at the same time realizes the deduplication of knowledge storage, ensuring the uniqueness of data and the efficiency of retrieval.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119940493A_ABST
    Figure CN119940493A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of knowledge maps, and provides a knowledge map management method and system, computer equipment and a storage medium, and the method comprises the steps: receiving a knowledge writing instruction which carries a to-be-written triple; the triad to be written comprises attributes and / or relationships; judging whether extension features and deduplication fields corresponding to the triad to be written exist in predefined knowledge summary data or not, and if yes, generating a knowledge ID according to the triad to be written, the extension features and the corresponding deduplication fields; and when the knowledge ID corresponding to the to-be-written triad is in a non-storage state, storing the to-be-written triad and the corresponding knowledge ID into a graph database. According to the method, the storage extension features are defined to improve the interpretability and the understandability of the knowledge graph, meanwhile, duplicate removal of knowledge storage can be achieved, and direct retrieval is not affected due to the fact that the extension features are not stored in a splicing mode.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of knowledge graph technology, and in particular, relates to a knowledge graph management method, system, computer device and storage medium. Background Art

[0002] Knowledge graph is a graph-based knowledge representation method that can present entities, attributes, relationships and other elements in a graphical way, so that machines can better understand and process knowledge. Triples are a common representation method of knowledge graphs. Their basic components are "entity-relationship-entity" triples and "entity-attribute name-attribute value" triples, which connect entities through relationships to form a network of knowledge structures. Therefore, the knowledge representation method based on triples is a widely used knowledge representation method that can concisely represent the relationships and attribute information between entities.

[0003] However, the existing triple-based knowledge representation methods also have some shortcomings. Because the triple representation method can only express simple semantic relationships, but cannot express complex semantic information, the interpretability and comprehensibility of the knowledge graph are limited. Summary of the invention

[0004] Based on this, it is necessary to provide a knowledge graph management method, system, computer device and storage medium to address the above-mentioned technical problems, which can improve the interpretability and comprehensibility of the knowledge graph without affecting data retrieval and storage deduplication.

[0005] The present invention provides a knowledge graph management method, comprising:

[0006] receiving a knowledge writing instruction, wherein the knowledge writing instruction carries a triple to be written; the triple to be written includes attributes and / or relations;

[0007] Determine whether there are extended features and duplicate-free fields corresponding to the triple to be written in the predefined knowledge summary data, and if so, generate a knowledge ID according to the triple to be written, the extended features and the corresponding duplicate-free fields;

[0008] When the knowledge ID corresponding to the triple to be written is in an unstored state, the triple to be written and the corresponding knowledge ID are stored in the graph database.

[0009] Wherein, the knowledge graph management method further includes:

[0010] receiving a knowledge deletion instruction, wherein the knowledge deletion instruction carries a triplet to be deleted;

[0011] When the extended features and deduplication fields corresponding to the triple to be deleted exist in the knowledge summary data, the triple to be deleted is deleted from the graph database, and the knowledge ID corresponding to the triple to be deleted is deleted from the stored knowledge IDs;

[0012] When the extended feature or the deduplication field corresponding to the triple to be deleted does not exist in the knowledge summary data, the triple to be deleted is deleted from the graph database.

[0013] The knowledge summary data includes attributes and relationship information of the knowledge graph, as well as extended features corresponding to the attributes and the relationship information and / or deduplicated fields corresponding to the extended features.

[0014] The determining whether there are extended features and duplicate removal fields corresponding to the triple to be written in the predefined knowledge summary data specifically includes: when the attributes and / or relations in the triple to be written exist in the knowledge summary data, and the attributes and / or relations have corresponding extended features and duplicate removal fields, determining whether there are extended features and duplicate removal fields corresponding to the triple to be written in the knowledge summary data;

[0015] When the attributes and / or relations in the triple to be written exist in the knowledge summary data, and the attributes and / or relations do not have corresponding extended features or deduplication fields, it is determined that the extended features and deduplication fields corresponding to the triple to be written do not exist in the knowledge summary data.

[0016] The generating of the knowledge ID according to the triple to be written and the corresponding deduplication fields is specifically: generating the knowledge ID corresponding to the triple to be written and the corresponding deduplication fields by using a hash function.

[0017] Wherein, the knowledge graph management method further includes:

[0018] Receive a knowledge query instruction, respond to the knowledge query instruction, perform a knowledge query from the graph database and obtain a knowledge query result.

[0019] The present invention provides a knowledge graph management system, characterized in that it includes:

[0020] A graph application module, configured to receive a knowledge writing instruction, wherein the knowledge writing instruction carries a triple to be written; the triple to be written includes attributes and / or relationships;

[0021] A graph access module, used for determining whether there are extended features and duplicate-free fields corresponding to the triple to be written in the predefined knowledge summary data, and if so, generating a knowledge ID according to the triple to be written, the extended features and the corresponding duplicate-free fields;

[0022] The graph database module is used to store the triple to be written and the corresponding knowledge ID when the knowledge ID corresponding to the triple to be written is in an unstored state.

[0023] Wherein, the knowledge graph management system further includes a distributed filtering module;

[0024] The distributed filtering module is used to store the knowledge ID corresponding to the triple to be written into the ID filtering table, and delete the knowledge ID corresponding to the triple to be deleted from the ID filtering table.

[0025] The present invention also provides a computer device, which includes a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the knowledge graph management method recorded in any one of the above items are implemented.

[0026] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the knowledge graph management method described in any one of the above items.

[0027] The above-mentioned knowledge graph management method, system, computer device and storage medium, when writing knowledge, will determine whether knowledge deduplication is needed based on the deduplication field corresponding to the predefined extended feature. If knowledge deduplication is needed, it will determine whether the triple to be written already exists by generating a unique knowledge ID corresponding to the triple to be written, so as to determine whether the triple to be written needs to be stored, thereby avoiding repeated storage of the same knowledge data. In other words, while defining and storing extended features to improve the interpretability and comprehensibility of the knowledge graph, this method can also achieve deduplication of knowledge storage, and because the extended features are not stored in a splicing manner, they do not affect direct retrieval. BRIEF DESCRIPTION OF THE DRAWINGS

[0028] Figure 1 This is an application environment diagram of a knowledge graph management method in one embodiment.

[0029] Figure 2 It is a structural block diagram of a knowledge graph management system in one embodiment.

[0030] Figure 3 This is a structural block diagram of a knowledge graph management system in another embodiment.

[0031] Figure 4 It is a timing flow chart of a knowledge graph management method in one embodiment. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0033] Knowledge graph is a graph-based knowledge representation method that can present entities, attributes, relationships and other elements in a graphical way, so that machines can better understand and process knowledge. Triples are a common representation method of knowledge graphs. Their basic components are "entity-relationship-entity" triples and "entity-attribute name-attribute value" triples, which connect entities through relationships to form a network of knowledge structures. Therefore, the knowledge representation method based on triples is a widely used knowledge representation method that can concisely represent the relationships and attribute information between entities.

[0034] However, the existing triple-based knowledge representation methods also have some shortcomings. Specifically, because the triple representation method can only express simple semantic relationships, but cannot express complex semantic information, the interpretability and comprehensibility of the knowledge graph are limited. For example, the age of a person is expressed in a triple as "Zhang San-age-26". According to the attribute triple "Zhang San-age-26", we can only know that Zhang San's age is 26, but we cannot know when this data is from. For another example, taking the relationship triple "Zhang San-position-development engineer" as an example, according to this relationship triple, although we can know that Zhang San is a development engineer, we cannot know when and in what organization Zhang San was a development engineer. In other words, the current triples limit the interpretability and comprehensibility of the knowledge graph to a certain extent.

[0035] In order to solve this problem, the most common traditional approach is to expand triples. That is, since the general storage structure of knowledge graphs is based on triples, in order to store extended triples, in common storage engines (such as JanusGraph), one approach is to store other elements as attributes of attributes or attributes of relationships to achieve the purpose of expansion. For example, for the above triple "Zhang San-Age-26", the stored entity is "Zhang San", the attribute is "Age", and the attribute value is "26". Then, in order to expand this triple, another attribute can be stored on this attribute. The attribute name can be "Record Time" and the attribute value can be "2020". That is, the extended triple can be recorded as "Zhang San-Age-26-2020". For another example, on the relationship triple "Zhang San-Job Position-Development Engineer", if an attribute needs to be expanded and stored, another attribute can be stored on this relationship. The attribute name can be "Job Company" and the attribute value can be "Company A". That is, the extended triple can be recorded as "Zhang San-Job Position-Development Engineer-Company A". It can be seen from this that the so-called extended triple is to expand the knowledge information that needs to be expressed by further adding elements.

[0036] The advantage of extended triples is that they accurately record all the data of the extended triples, and can also perform knowledge queries based on attributes or attributes of attributes, enriching the expressiveness of triples and improving the interpretability and comprehensibility of knowledge graphs. However, they also bring some new problems in the storage and retrieval of knowledge graphs, such as the inability to deduplicate knowledge when storing knowledge. For example, if an extended triple "Zhang San-Age-26-2020" has been stored, if another piece of the same data needs to be stored at this time, because deduplication cannot be performed, two identical attributes will be stored in the knowledge graph.

[0037] In addition to extending the triples, another method is to splice the extended attributes and attribute values ​​together to form a spliced ​​attribute value for storage. Taking the above data as an example, the storage entity is "Zhang San" and the attribute is "age". The attribute value can be expanded by splicing to "attribute value: 26, record time: 2020". The advantage of this method is that attribute storage can be deduplicated, but the ability to directly retrieve attributes and attributes of attributes is lost, that is, attributes or attributes of attributes cannot be directly retrieved. In addition, this method is not suitable for relational storage, because the relationship name and attribute name are generally similar to the table structure of the database, which is pre-defined and generally does not increase automatically with the data.

[0038] Based on this, in order to better store the extended triple data to improve the interpretability and comprehensibility of the knowledge graph, while ensuring that the stored extended triple data can also support deduplication according to user specifications and does not affect data retrieval, an embodiment of the present application provides a knowledge graph management method.

[0039] The knowledge graph management method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown, the application environment involves a terminal 102 and a server 104 .

[0040] Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers. That is, in the embodiment of the present application, the above-mentioned knowledge graph management method can be implemented by the terminal 102, and the above-mentioned knowledge graph management method can also be implemented by the server 104.

[0041] The knowledge graph management method provided in the embodiment of the present application will be described below with reference to the accompanying drawings.

[0042] Figure 2 and Figure 3 A knowledge graph management system is shown. Figure 2 ,The knowledge graph management system includes graph application module, knowledge extraction and storage module, schema (summary) definition module, graph access module, distributed filtering module and graph database module.

[0043] The schema definition module is mainly used to define the attributes and relationships in the knowledge graph. That is, first of all, it is necessary to define which attributes and relationships are in the knowledge graph through the schema definition module. For attributes and relationships that require information expansion, it is necessary to pre-define the attributes that need to be expanded corresponding to these attributes and relationships. In the embodiment of the present application, the attributes that need to be expanded corresponding to the attributes and relationships are called extended features.

[0044] refer to Figure 3, the functions provided by the schema definition module include visualization operation page, schema operation interface, graph database modeling and schema storage. Among them, the visualization operation page is a page provided to users for modeling, and users can add and define schema data such as attributes, relationships, and extended features in the visualization page. The schema operation interface is mainly used to interact with the graph access module, such as providing the graph access module with user-defined schema data through the schema operation interface. Graph database modeling is mainly used to convert user-defined schema data into library table modification statements corresponding to the graph database module, and execute the schema construction of graph data so that the graph database module can store knowledge data. At the same time, in order to prevent the loss of user-defined schema data, the schema definition module will also save a copy of the user-defined schema data, that is, the schema definition module also has a schema storage function. It should be noted that schema data is knowledge summary data, including the attributes and relationship information of the knowledge graph, and the extended features corresponding to the attributes and the relationship information and / or the deduplication fields corresponding to the extended features, which is similar to the table structure, while knowledge data refers to the specific data to be stored, that is, the data in the table.

[0045] The knowledge extraction and storage module is used to generate knowledge data, and the graph application module is used to provide applications or software for operations such as adding, deleting, modifying, and querying the knowledge graph. Figure 2 As shown, the knowledge extraction and storage module and the graph application module both operate the data in the knowledge graph through the graph access module.

[0046] Specifically, when receiving a storage operation for newly added knowledge data, if the graph access module receives a triple that needs to be written, it needs to generate a unique identifier (such as a knowledge ID) for the triple in combination with the schema data in the schema definition module, and verify it in the distributed filtering module based on this identifier to determine whether the triple needs to be stored. In other words, if it is determined through verification that the extended triple data needs to be stored, it is stored in the knowledge graph, that is, stored in the graph database module, and it also needs to be recorded in the distributed filtering; if the triple data does not need to be stored, it is directly filtered.

[0047] The graph access module is mainly used to provide external operation interfaces such as adding, deleting, modifying and querying graph data. Figure 3, the graph access module includes functions such as schema loading, triple data processing, and graph database operation. Among them, the schema loading function is mainly used to obtain user-defined schema data from the schema definition module and synchronize schema data changes regularly. The triple data processing function is mainly used to handle matters related to triples. Specifically, it is necessary to generate a knowledge ID for the triple written by the user and its characteristics, combined with the user-defined schema data, using a hash function, and before executing storage, first go to the distributed filtering module to verify the knowledge ID to determine whether the knowledge ID exists. If it exists, it means that the current knowledge has been stored and storage is not executed. Otherwise, storage is executed and the knowledge ID is sent to the distributed filtering module for storage. After deletion, the knowledge ID needs to be sent to the distributed filtering module for deletion. The query is to forward the query statement to the graph database for query execution, and forward the knowledge query result to the graph application. The graph database operation function is mainly responsible for executing the corresponding graph database operation. It can shield the differences in the underlying graph database and provide a standard operation interface to the outside world.

[0048] Specifically, when a query operation is received, the graph access module directly forwards the query request to the graph database, obtains the result and returns it. When a delete operation is received, the extended triple to be deleted is deleted directly in the graph database. After the deletion is successful, a unique identifier (such as a knowledge ID) is generated for the deleted triple in combination with the defined schema data, and the identifier is deleted in the distributed filtering. Operations such as modification / update are a combination of deletion and storage, and the principle is the same, so I will not go into details.

[0049] like Figure 3 As shown, the distributed filtering module mainly includes knowledge ID data records, verification interface and deletion interface, etc. It is mainly used to determine whether a knowledge ID has been stored. It is necessary to record the currently stored knowledge ID and provide query, deletion and other interfaces to the outside world. The query interface returns whether the knowledge ID already exists, and the deletion interface deletes the knowledge ID in the record.

[0050] The graph database module is mainly used to store graph data. In some embodiments, the graph database can be JanusGraph, NebulaGraph, Neo4j or other graph databases, which can be selected according to actual needs, and the embodiments of this application do not make any restrictions on this.

[0051] Figure 4 A schematic diagram of an interactive sequential process of a knowledge graph management method is shown, including steps S1-S15. Figure 4The knowledge graph management method provided in the embodiment of the present application is described. The knowledge graph management method provided in the embodiment of the present application mainly includes four stages, namely definition, knowledge writing (ie, adding new knowledge), knowledge deletion and knowledge query.

[0052] like Figure 4 As shown, the definition phase includes steps S1-S3.

[0053] Step S1: The schema definition module obtains the schema data defined by the user.

[0054] Step S2: The schema definition module sends the schema data to the graph database module and saves it successfully.

[0055] Step S3: The schema definition module stores the schema data. The purpose of this step is to prevent the loss of user-defined schema data.

[0056] Specifically, before writing, deleting and querying knowledge, you first need to define the schema data (i.e., knowledge summary data) through the schema definition module. In an embodiment of the present application, the schema data includes the attributes of the knowledge graph, the relationship schema (relationship information), and the extended features corresponding to the attributes and the relationship schema (i.e., the attributes of the attributes, the attributes of the relationships) and the deduplication fields corresponding to the extended features. Taking the triple "Zhang San-Work Unit-Company A" as an example, extended feature 1 is (start time: 2019) and extended feature 2 is (end time: 2022). You can define "start time" as a deduplication field, or you can define other fields as deduplication fields, such as position. Although this feature is not in the current triple, it may be in other triples, so it can also be defined as a deduplication field. The extended feature can be understood as the feature attached to the actual storage of the triple (similar to the specific data in the database), the deduplication field can be understood as a definition (similar to the database table structure definition), and the deduplication of the field means that when two triples are the same and the extended feature values ​​corresponding to the deduplication fields are also the same, the two triplets are considered to be the same triplet, and will be overwritten during storage, retaining only one triplet.

[0057] That is to say, the schema definition module can obtain the schema data defined by the user in response to the user's definition operation, and then send the obtained user-defined schema data to the graph database module for storage by calling the graph storage interface corresponding to the graph database module. At the same time, the schema definition module will also store the obtained schema data. For example, if the user defines an "age" attribute, and defines this attribute as having extended features such as "recording time" and "storage time", then the specific knowledge data saved is "Zhang San-Age-26-2020-November 2023".

[0058] like Figure 4 As shown, the knowledge writing stage includes steps S4-S8.

[0059] Step S4: The graph application module sends the received knowledge writing instruction to the graph access module, where the knowledge writing instruction carries the triples to be written; the triples to be written include attributes and / or relationships.

[0060] Specifically, when the user has a need to write knowledge, he can enter the knowledge data to be written in the interactive interface provided by the graph application module and issue instructions to write knowledge, so that the graph application module can receive the knowledge writing instruction carrying the knowledge data to be written, that is, the triples to be written. Then, the graph application module sends the received triples to be written to the graph access module by calling the storage interface corresponding to the graph access module, so that the graph access module can write knowledge.

[0061] It can be understood that, based on actual storage requirements, the triplet to be written may be an extended triplet including extended features, or may be a triplet not including extended features.

[0062] Step S5: The graph access module obtains schema data from the schema definition module.

[0063] Step S6: The graph access module determines whether deduplication needs to be performed based on the schema data and the triples to be written, and generates a corresponding knowledge ID if deduplication needs to be performed.

[0064] Step S7: The distributed filtering module determines whether the knowledge ID exists. If the knowledge ID exists, the execution ends. If the knowledge ID does not exist, the execution continues to S8.

[0065] Step S8: The graph database module stores the triples to be written.

[0066] Specifically, after the graph access module receives the triple to be written, it first obtains the defined schema data from the schema definition module, that is, obtains attributes, relationship information, extended features, and deduplication features.

[0067] Then, the graph access module will search the defined schema data to see whether the attributes and relationships in the triples to be written correspond to the definition of extended features, and whether there are deduplication fields in the extended features. That is, the graph access module determines whether deduplication needs to be performed based on the schema data and the triples to be written. If there are no extended features for the attributes and relationships of the triples to be written, or there are extended features but the extended features do not have corresponding deduplication fields, then the graph access module determines that deduplication is not required and can directly store the triples to be written in the graph database module. If there are extended features for the attributes and relationships of the triples to be written, and the extended features have corresponding deduplication fields, then the graph access module determines that deduplication is required, and then the graph access module generates a unique hash string as the knowledge ID based on the triples to be written and the deduplication fields in the corresponding extended features, combined with the corresponding values. That is, the knowledge ID can be generated by a hash function.

[0068] For example, take the knowledge data "Zhang San-age-26-2020-2023 November" as an example. Since the storage time "November 2023" is publicly known and available information, it is generally not a deduplication field in the extended feature. Therefore, the field corresponding to the knowledge data that needs to generate the knowledge ID is "Zhang San-age-26-2020". In other words, if the knowledge ID corresponding to the knowledge data "Zhang San-age-26-2020-2023 November" needs to be generated, the storage time "November 2023" is data that does not need to be involved in the generation of the knowledge ID.

[0069] Next, the graph access module uses the knowledge ID to verify in the distributed filtering module. That is, the graph access module sends the generated knowledge ID to the distributed filtering module, and the distributed filtering module verifies based on the knowledge ID. In the embodiment of the present application, verification refers to the distributed filtering module determining whether the knowledge ID already exists. For example, the distributed filtering module can compare the currently received knowledge ID with the stored knowledge ID to determine whether the same knowledge ID exists. If the same knowledge ID exists, it means that the currently received knowledge ID already exists, otherwise it means that the currently received knowledge ID does not exist. If the distributed filtering module verifies that the received knowledge ID already exists, it means that this piece of knowledge data to be written has been stored in the graph, and it can be directly skipped and not stored. In other words, if the distributed filtering module feeds back to the graph access module that the knowledge ID exists, then the graph access module no longer stores the received triples to be written. If the distributed filtering module verifies that the received knowledge ID does not exist, it means that this piece of knowledge data to be written is a new piece of knowledge data, and then storage can continue. That is, the distributed filtering module can feedback to the graph access module that the knowledge ID does not exist, and then the graph access module will send the triples to be written to the graph database for storage.

[0070] In addition, for the knowledge ID that is determined to be non-existent, in order to improve the accuracy of subsequent verification, the distributed filtering module also needs to save this knowledge ID. In some embodiments, the distributed filtering module can maintain an ID filtering table. The knowledge ID that needs to be saved can be added to the ID filtering table, and the knowledge ID that no longer needs to be saved is deleted from the ID filtering table. That is to say, when the distributed filtering module receives the knowledge ID corresponding to the triple to be written, if the ID filtering table does not contain the knowledge ID corresponding to the triple to be written, the knowledge ID corresponding to the triple to be written is stored in the ID filtering table; when the distributed filtering module receives the knowledge ID corresponding to the triple to be deleted, if the ID filtering table has stored the knowledge ID corresponding to the triple to be deleted, the knowledge ID corresponding to the triple to be deleted is deleted from the ID filtering table.

[0071] It can be seen that in the knowledge writing stage, because it is determined whether knowledge deduplication is needed based on the deduplication field corresponding to the user-defined extended feature, and if knowledge deduplication is needed, a unique knowledge ID corresponding to the knowledge data is generated to determine whether the data to be written already exists, so as to determine whether the triples to be written need to be stored, thereby avoiding repeated storage of the same knowledge data, and realizing knowledge deduplication when the extended triples are defined and stored. The way of storing extended triples in the embodiment of the present application is to define the attributes of attributes, define the attributes of relationships, etc., so there is no problem of being unable to retrieve directly.

[0072] like Figure 4As shown, the knowledge deletion phase includes steps S9-S11.

[0073] Step S9: The graph application module sends the received knowledge deletion instruction to the graph access module, and the knowledge deletion instruction carries the triples to be deleted.

[0074] Specifically, when the user has a need to delete knowledge, he can enter the knowledge data to be deleted in the interactive interface provided by the graph application module and issue an instruction to delete the knowledge, so that the graph application module can receive the knowledge deletion instruction carrying the knowledge data to be deleted, that is, the triples to be deleted. Then, the graph application module sends the received triples to be deleted to the graph access module by calling the deletion interface corresponding to the graph access module, so that the graph access module can delete the knowledge.

[0075] Step S10: The graph access module notifies the graph database module to delete the triples to be deleted.

[0076] Specifically, after the graph access module receives the knowledge data to be deleted, it goes to the graph database module to perform the deletion. That is, the graph access module sends the triples to be deleted to the graph database module, and the graph database module deletes the triples to be deleted.

[0077] Step S11: When the graph access module determines that there is an existing knowledge ID corresponding to the triple to be deleted, it notifies the distributed filtering module to delete the knowledge ID corresponding to the triple to be deleted.

[0078] Specifically, after the deletion is successful, in order to prevent the corresponding knowledge ID of the triple to be deleted from being stored in the distributed filtering module and affecting the deduplication of knowledge writing, the graph access module also needs to obtain the defined schema data to check whether the deleted knowledge data has the definition of extended features, and whether there are deduplication fields in the extended features. Similarly, for the triples to be deleted that have extended feature fields and contain deduplication fields in the extended feature fields, it is necessary to generate a knowledge ID based on the deleted triples and the corresponding feature data. Then, the knowledge ID is sent to the distributed filtering module, instructing the deletion of the knowledge ID in the distributed filtering module, thereby ensuring the accuracy of the knowledge ID and improving the accuracy of deduplication.

[0079] like Figure 4 As shown, the knowledge query stage includes steps S12-S15.

[0080] Step S12: The graph application module sends the received knowledge query instruction to the graph access module.

[0081] Step S13: The graph access module sends the knowledge query instruction to the graph database module.

[0082] Step S14: The graph database module performs knowledge query in response to the knowledge query instruction and feeds back the knowledge query result to the graph access module.

[0083] Step S15: The graph access module returns the acquired knowledge query results to the graph application module.

[0084] Specifically, when querying data, the graph access module only forwards the query request and returns the knowledge data (i.e., knowledge query results) queried by the graph database module to the graph application module. It can be understood that in the knowledge query stage, the graph access module plays the role of an intermediary communication.

[0085] In some embodiments, in addition to knowledge writing, knowledge deletion and knowledge query, knowledge updating is also included. It can be understood that updating is to change the stored knowledge data, so updating is a combination of deletion and storage logic. Therefore, the processing logic of knowledge updating can specifically refer to the processing flow of knowledge writing and knowledge deletion. The principle is the same, and the embodiments of this application will not be repeated here.

[0086] In addition, in some embodiments, each module in the above-mentioned knowledge graph management system can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules. Based on this understanding, the present invention implements all or part of the processes in the knowledge graph management method recorded in the above-mentioned embodiments, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned knowledge graph management method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form.

[0087] In one embodiment, a computer device is provided, which may be a server, including a processor, a memory and a network interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a knowledge graph management method is implemented. Exemplarily, the computer program can be divided into one or more modules, one or more modules are stored in the memory, and are executed by the processor to complete the present invention. One or more modules can be a series of computer program instruction segments that can perform specific functions, and the instruction segments are used to describe the execution process of the computer program in the computer device.

[0088] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc. The processor is the control center of a computer device, and uses various interfaces and lines to connect various parts of the entire computer device.

[0089] The memory can be used to store computer programs and / or modules. The processor implements various functions of the computer device by running or executing the computer programs and / or modules stored in the memory and calling the data stored in the memory. The memory can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; the data storage area can store data created according to the use of the device, etc. In addition, the memory can include a high-speed random access memory, and can also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0090] Those skilled in the art will appreciate that the computer device structure shown in this embodiment is merely a partial structure related to the solution of the present invention, and does not constitute a limitation on the computer device to which the present invention is applied. The specific computer device may include more or fewer components, or combine certain components, or have a different arrangement of components.

[0091] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the knowledge graph management method described in any of the above embodiments is implemented.

[0092] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the knowledge graph management method described in any of the above embodiments is implemented.

[0093] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0094] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0095] The above embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A knowledge graph management method, characterized in that: include: receiving a knowledge writing instruction, wherein the knowledge writing instruction carries a triple to be written; the triple to be written includes attributes and / or relations; Determine whether there are extended features and duplicate-free fields corresponding to the triple to be written in the predefined knowledge summary data, and if so, generate a knowledge ID according to the triple to be written, the extended features and the corresponding duplicate-free fields; When the knowledge ID corresponding to the triple to be written is in a non-stored state, the triple to be written and the corresponding knowledge ID are stored in the graph database.

2. The method according to claim 1, characterized in that The method further comprises: receiving a knowledge deletion instruction, wherein the knowledge deletion instruction carries a triplet to be deleted; When the extended features and deduplication fields corresponding to the triple to be deleted exist in the knowledge summary data, the triple to be deleted is deleted from the graph database, and the knowledge ID corresponding to the triple to be deleted is deleted from the stored knowledge IDs; When the extended feature or the deduplication field corresponding to the triple to be deleted does not exist in the knowledge summary data, the triple to be deleted is deleted from the graph database.

3. The method according to claim 1, characterized in that The knowledge summary data includes attributes and relationship information of the knowledge graph, as well as extended features corresponding to the attributes and the relationship information and / or deduplicated fields corresponding to the extended features.

4. The method according to claim 1, characterized in that: The determining whether there are extended features and duplicate removal fields corresponding to the triple to be written in the predefined knowledge summary data specifically includes: when the attributes and / or relations in the triple to be written exist in the knowledge summary data, and the attributes and / or relations have corresponding extended features and duplicate removal fields, determining that there are extended features and duplicate removal fields corresponding to the triple to be written in the knowledge summary data; When the attributes and / or relations in the triple to be written exist in the knowledge summary data, and the attributes and / or relations do not have corresponding extended features or deduplication fields, it is determined that the extended features and deduplication fields corresponding to the triple to be written do not exist in the knowledge summary data.

5. The method according to claim 1, characterized in that The generating of the knowledge ID according to the triple to be written and the corresponding deduplication field is specifically: generating the knowledge ID corresponding to the triple to be written and the corresponding deduplication field by using a hash function.

6. The method according to claim 1, characterized in that The method further comprises: Receive a knowledge query instruction, respond to the knowledge query instruction, perform a knowledge query from the graph database and obtain a knowledge query result.

7. A knowledge graph management system, characterized in that: include: A graph application module, configured to receive a knowledge writing instruction, wherein the knowledge writing instruction carries a triple to be written; the triple to be written includes attributes and / or relationships; A graph access module, used for determining whether there are extended features and duplicate-free fields corresponding to the triple to be written in the predefined knowledge summary data, and if so, generating a knowledge ID according to the triple to be written, the extended features and the corresponding duplicate-free fields; The graph database module is used to store the triple to be written and the corresponding knowledge ID when the knowledge ID corresponding to the triple to be written is in an unstored state.

8. The system according to claim 7, characterized in that Also includes a distributed filtering module; The distributed filtering module is used to store the knowledge ID corresponding to the triple to be written into the ID filtering table, and delete the knowledge ID corresponding to the triple to be deleted from the ID filtering table.

9. A computer device comprising a processor and a memory, wherein the memory stores a computer program, wherein: The processor is used to implement the knowledge graph management method described in any one of claims 1 to 6 when executing the computer program.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the knowledge graph management method described in any one of claims 1 to 6 is implemented.