A knowledge graph construction method, device, knowledge graph system and equipment

By generating and updating time-sensitive reasoning knowledge graphs, the problems of knowledge timeliness and dynamic changes in knowledge graphs are solved, efficient query and compatibility of knowledge graphs are realized, and the real-time nature and query efficiency of knowledge graphs are ensured.

CN111984643BActive Publication Date: 2024-09-17LENOVO (BEIJING) LTD

Patent Information

Application Number
CN202010609624.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-29
Publication Date
2024-09-17
Estimated Expiration
2040-09-17

AI Technical Summary

Technical Problem

Existing knowledge graphs cannot effectively handle the timeliness and dynamic changes of knowledge, resulting in the inability to directly answer users' dynamic questions, and adding state dimensions or introducing virtual nodes will affect compatibility and computing efficiency.

Method used

By receiving the basic knowledge graph and inference rule set, a time-sensitive inference knowledge graph is generated, updated at set time intervals, recording the timestamp and rules of the inference data, merging the basic and inference knowledge graphs, and using the Tableau algorithm to determine conflicts and ensure Timeliness and query efficiency of knowledge graph.

Benefits of technology

It achieves timely updates of the knowledge graph, reduces the amount of data processing, improves query efficiency, ensures the compatibility and real-time nature of the knowledge graph, and avoids a large amount of data processing and computational complexity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN111984643B
    Figure CN111984643B
Patent Text Reader

Abstract

The present invention discloses a knowledge graph construction method, device, knowledge graph system and equipment, the method comprising: receiving a basic knowledge graph and storing it in a first storage area, the basic knowledge graph is used to generate a time-effective inference knowledge graph; obtaining an inference rule set, the inference rule set is used to show the rules needed to generate the inference knowledge graph according to the basic knowledge graph; generating an inference knowledge graph according to the basic knowledge graph and the inference rule set, and storing the inference knowledge graph in a second storage area; merging the basic knowledge graph and the inference knowledge graph to obtain a first knowledge graph; updating the inference knowledge graph according to the basic knowledge graph and the inference rule set at every first set time interval to update the first knowledge graph. The embodiment of the present invention fully guarantees the timeliness of the knowledge graph, and only needs to update the inference knowledge graph at set intervals to ensure the timeliness of the knowledge graph, effectively avoiding a large amount of data processing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a knowledge graph construction method, device, knowledge graph system and equipment. Background Art

[0002] At present, knowledge graphs store limited and static knowledge triples, including entity-attribute (or relationship)-entity knowledge triples, and inevitably there is a lack of some knowledge associations. In addition, the current storage technology of knowledge graphs ignores the timeliness of knowledge. However, in the application process of knowledge graphs, it is necessary to apply them to derivative questions containing the facts described in the knowledge graph, resulting in the inability of existing knowledge triples to directly answer user questions. For example: "How old are you this year?" The knowledge base stores someone's birthday, but does not contain the dynamic knowledge "age" related to time. But a person's "age" also increases over time. From this, it can be seen that the existing knowledge graph can no longer meet user needs.

[0003] There are currently two solutions to the above problems: 1. Add the dimension of state to the expression of knowledge triples. That is, in the existing binary relationship, introduce a third relationship parameter: the time axis. For example, the original triple expresses a binary relationship, represented as (e1, r, e2). Then, in the knowledge graph after adding the state dimension, the new binary relationship is expressed as (e1, r, e2; time). For example: According to the rule, a statement is declared in the knowledge base: (Xiao Ming, age, 10, expired_time = 2020.10.01), and a new valid statement is re-declared after the triple expires (the time is after the expiration time expired_time). 2. Introduce virtual nodes to express the timeliness of knowledge triples, but the introduction of virtual nodes will lead to changes in the knowledge base structure itself. Therefore, whether it is the knowledge graph after adding the state dimension or the knowledge graph after introducing virtual nodes, the compatibility with other knowledge graphs is relatively poor, and it is difficult to achieve integration and interoperability between knowledge graphs. On the other hand, since the expression with temporal information is added to ensure the consistency and real-time performance of the knowledge base, the computational complexity and amount of RDF (Resource Description Framework) triples are greatly increased. Neither of the above two solutions can meet the needs of users for knowledge graphs. Summary of the invention

[0004] In order to solve the above-mentioned problems existing in the process of constructing a knowledge graph, the embodiments of the present invention creatively provide a knowledge graph construction method, device, knowledge graph system and processor.

[0005] According to a first aspect of the present invention, a method for constructing a knowledge graph is provided, the method comprising: receiving a basic knowledge graph and storing it in a first storage area, the basic knowledge graph being used to generate a time-sensitive reasoning knowledge graph; obtaining a reasoning rule set, the reasoning rule set being used to show the rules required to generate the reasoning knowledge graph based on the basic knowledge graph; generating the reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set, and storing the reasoning knowledge graph in a second storage area; merging the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; and updating the reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set at every first set time interval to update the first knowledge graph.

[0006] According to one embodiment of the present invention, the method also includes: recording the update timestamp of each inference data in the inference knowledge graph and the inference rule in the inference rule set used to generate the inference knowledge graph; generating an index knowledge graph based on the inference data, the corresponding update timestamp and the inference rule used, and storing it in a third storage area; merging the index knowledge graph into the first knowledge graph to obtain a complete knowledge graph; and judging the validity of the corresponding inference data based on the update timestamp and the inference rule at every second set time interval.

[0007] According to one embodiment of the present invention, judging the validity of corresponding inference data based on the update timestamp and the inference rule includes: determining the basic data in the basic knowledge graph on which the inference data depends according to the inference rule; judging the estimated validity period of the corresponding inference data based on the update timestamp and the basic data on which it depends, the validity period including the effective time and / or expiration time; determining the current time; judging the validity of the corresponding inference data based on the current time and the validity period.

[0008] According to an embodiment of the present invention, the inference rules are described using description logic.

[0009] According to one embodiment of the present invention, after merging the basic knowledge graph and the inference knowledge graph, the method further includes: judging whether the inference knowledge graph and the basic knowledge graph in the complete knowledge graph conflict according to the Tableau algorithm; and issuing a reminder message when it is determined that there is a conflict.

[0010] According to one embodiment of the present invention, all data in the knowledge graph is stored using the Resource Description Framework RDF.

[0011] According to the second aspect of the present invention, a knowledge graph system is also provided, which is constructed according to the above-mentioned knowledge graph construction method, and the knowledge graph system includes: a basic knowledge layer, including basic data and an inference rule set of a basic knowledge graph, the basic knowledge graph is used to generate an inference knowledge graph with timeliness, and the inference rule set is used to show the inference rule set of rules required to generate an inference knowledge graph with timeliness according to the basic knowledge graph; an inference knowledge layer, including inference data of the inference knowledge graph generated according to the basic knowledge graph and the inference rule set; at every first set time interval, the inference knowledge graph is updated according to the basic knowledge graph and the inference rule set to update the first knowledge graph including the basic knowledge graph and the inference knowledge graph.

[0012] According to one embodiment of the present invention, the knowledge graph system also includes: an index knowledge layer, including an index knowledge graph, and the index knowledge graph is generated according to each inference data in the inference knowledge graph, the corresponding update timestamp and the inference rules in the utilized inference rule set.

[0013] According to the third aspect of the present invention, a device for constructing a knowledge graph is also provided, the device comprising: a receiving module, used to receive a basic knowledge graph and store it in a first storage area, the basic knowledge graph is used to generate a timely inference knowledge graph; a rule acquisition module, used to obtain an inference rule set, the inference rule set is used to show the rules required to generate the inference knowledge graph according to the basic knowledge graph; an inference module, used to generate the inference knowledge graph according to the basic knowledge graph and the inference rule set, and store the inference knowledge graph in a second storage area; a merging module, used to merge the basic knowledge graph and the inference knowledge graph to obtain a first knowledge graph; an updating module, used to update the inference knowledge graph according to the basic knowledge graph and the inference rule set at every first set time interval to update the first knowledge graph.

[0014] According to a fourth aspect of the present invention, a processor is also provided, which is used to run a program, wherein when the instructions are executed, the processor is used to execute the above-mentioned knowledge graph construction method.

[0015] According to the fifth aspect of the present invention, a device is also provided, comprising at least one processor, and at least one memory and a bus connected to the processor; wherein the processor and the memory communicate with each other through the bus; and the processor is used to call program instructions in the memory to execute the above-mentioned knowledge graph construction method.

[0016] The embodiments of the present invention provide a knowledge graph construction method, device, knowledge graph system and processor, which generate a timely inference knowledge graph based on the original basic knowledge graph according to the inference rules, store the basic knowledge graph and the inference knowledge graph separately, and update the knowledge graph at set intervals to maintain the timeliness of the knowledge graph. In this way, when using the knowledge graph constructed according to the above method, data with expiration can be directly obtained from the knowledge graph without performing a large number of calculations based on the basic knowledge graph, thereby ensuring the efficiency of data query in the knowledge graph. At the same time, it is only necessary to set a reasonable update time interval to update the inference knowledge graph to ensure the timeliness of the knowledge graph, thereby avoiding a large amount of data processing during the knowledge graph update process.

[0017] It should be understood that the teachings of the present invention are not required to achieve all of the beneficial effects described above, but specific technical solutions can achieve specific technical effects, and other embodiments of the present invention can also achieve beneficial effects not mentioned above. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood by reading the detailed description below with reference to the accompanying drawings. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, in which:

[0019] In the drawings, the same or corresponding reference numerals represent the same or corresponding parts.

[0020] Figure 1 A schematic diagram of the implementation process of a method for constructing a knowledge graph according to an embodiment of the present invention is shown;

[0021] Figure 2 A schematic diagram of the composition structure of a knowledge graph system according to an embodiment of the present invention is shown;

[0022] Figure 3 A schematic diagram of the composition structure of a specific application example of a knowledge graph system according to an embodiment of the present invention is shown;

[0023] Figure 4 A schematic diagram of a flowchart for determining the validity of inference data according to an embodiment of the present invention is shown;

[0024] Figure 5 A schematic diagram showing the composition structure of a knowledge graph construction device according to an embodiment of the present invention is shown;

[0025] Figure 6 A schematic diagram of the structure of a device according to an embodiment of the present invention is shown. DETAILED DESCRIPTION

[0026] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and are not intended to limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to fully convey the scope of the present invention to those skilled in the art.

[0027] It should be noted that the knowledge graph in the embodiment of the present invention can be a variety of types of knowledge graphs. The knowledge graph refers to a knowledge base used to enhance the search engine function, which is intended to describe various entities or concepts and their relationships in the real world. It constitutes a huge semantic network diagram, where nodes represent entities or concepts, and edges are composed of attributes or relationships. In order to facilitate the specific description of the embodiment of the present invention, the embodiment of the present invention is described in detail by taking the expression and storage of all data in the knowledge graph using RDF (Resource Description Framework) as an example. For example, many complex connections between entities are represented in the form of triples such as [entity, attribute, attribute value], [entity 1, relationship, entity 2]. For example: [Xiao Li, father and daughter, lucky star], [Meng Meng, teacher and student, Professor Lin], [Xiao Hong, birthplace, Shanghai], [Xiao Hong, birth time, August 2010], etc. However, the knowledge graph in the embodiment of the present invention can also be represented and stored in other forms, and the embodiment of the present invention does not specifically limit this.

[0028] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments.

[0029] Figure 1 A schematic diagram of the implementation process of a method for constructing a knowledge graph according to an embodiment of the present invention is shown.

[0030] refer to Figure 1 , a method for constructing a knowledge graph according to an embodiment of the present invention at least includes the following operation flow: operation 101, receiving a basic knowledge graph and storing it in a first storage area, the basic knowledge graph is used to generate a time-effective reasoning knowledge graph; operation 102, obtaining a reasoning rule set, the reasoning rule set is used to show the rules required to generate the reasoning knowledge graph according to the basic knowledge graph; operation 103, generating a reasoning knowledge graph according to the basic knowledge graph and the reasoning rule set, and storing the reasoning knowledge graph in a second storage area; operation 104, merging the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; operation 105, updating the reasoning knowledge graph according to the basic knowledge graph and the reasoning rule set at every first set time interval to update the first knowledge graph.

[0031] In operation 101, a basic knowledge graph is received and stored in a first storage area, and the basic knowledge graph is used to generate a time-effective reasoning knowledge graph.

[0032] In one embodiment of the present invention, the basic knowledge graph refers to a collection of static factual knowledge, such as: [Xiao Ming, gender, male], [Xiao Ming, birthday, February 6, 2000], [Xiao Hong, graduated from Xingfu Middle School], [Xiao Hong, graduation date, June 2011]. This type of knowledge has a common feature, that is, it is impossible to directly determine the answer to a time-sensitive question based on this type of knowledge. For example: "How old is Xiao Ming?", "When did Xiao Hong graduate?".

[0033] In operation 102, an inference rule set is obtained, where the inference rule set is used to show the rules needed to generate an inference knowledge graph based on the basic knowledge graph.

[0034] In one embodiment of the present invention, the inference rules are described using description logic. Description logic is a formalized knowledge expression method based on logic. Description logic defines concepts, relationships, entities, and a series of operators for describing and constraining entity relationships.

[0035] For example, the logical rule statement for a person's age is as follows:

[0036]

[0037] Among them, "Xiaoming" is a definition of "Xiaoming" for easier recognition by computers. Here, according to Xiaoming's birthday and the current time, using Rule 1, the current time minus Xiaoming's birthday can get Xiaoming's age, which can be expressed as [Xiaoming, age, 20]. According to the above logical rule Rule 1, it is easy to obtain a time-sensitive reasoning knowledge based on the knowledge in the basic knowledge graph. In this way, by performing similar reasoning, several reasoning knowledge can be obtained to form a reasoning knowledge graph.

[0038] In operation 103, an inference knowledge graph is generated according to the basic knowledge graph and the inference rule set, and the inference knowledge graph is stored in the second storage area.

[0039] For example, the basic knowledge graph includes several basic knowledge, such as [Xiao Ming, birthday, February 6, 2000], etc., and the inference rule set includes several inference rules, such as Rule 1 in operation 102. It should be noted that the number of basic knowledge and the number of inference rules can be the same or different, and the two can correspond one to one. It is also possible to infer a basic knowledge according to different inference rules to obtain different inference knowledge. Or use an inference rule to infer each basic knowledge in multiple basic knowledge and obtain corresponding inference knowledge. Of course, any other suitable method can also be used to obtain inference knowledge based on basic knowledge and inference rules. And all the inference knowledge obtained is stored in the second storage area as a complete inference knowledge graph.

[0040] The inference rules of the inference knowledge graph usually involve the time of change. For example, CurrentDate(?thisYear) in Rule1 represents the current time. The data of ?thisYear will change in real time, but the inference knowledge obtained from it does not necessarily change in real time. The inference knowledge can change at a certain time node. It only needs to be re-reasoned and updated after a certain time interval to ensure the timeliness of the inference knowledge. Therefore, the inference knowledge graph is stored in the second storage area, separately from the basic knowledge graph, to facilitate regular or irregular updates of the inference knowledge. In this way, when updating the inference knowledge, it is only necessary to traverse each inference knowledge of the inference knowledge graph in the second storage area, detect its timeliness and update it, without traversing each basic knowledge in the basic knowledge graph for timeliness detection and update. The amount of data processing is effectively reduced, thereby improving the processing efficiency of the knowledge graph.

[0041] In operation 104, the basic knowledge graph and the inference knowledge graph are merged to obtain a first knowledge graph.

[0042] In one embodiment of the present invention, merging the basic knowledge graph and the reasoning knowledge graph is a simple combination process, which uses all the knowledge included in the two as a complete knowledge graph for other modules or users to call. For example, when determining the question raised by the user through voice input or other means, the intelligent robot can traverse all the knowledge in the basic knowledge graph and the reasoning knowledge graph, or query and determine the result of the question from the first knowledge graph obtained by merging the basic knowledge graph and the reasoning knowledge graph according to certain query rules.

[0043] In one embodiment of the present invention, after merging the basic knowledge graph and the inference knowledge graph, it is also determined whether the inference knowledge graph and the basic knowledge graph in the complete knowledge graph conflict according to the Tableau algorithm; when it is determined that there is a conflict, a reminder message is issued.

[0044] For example, after merging the basic knowledge graph and the reasoning knowledge graph, the knowledge in the first knowledge graph as a whole may have conflicts between knowledge such as satisfiability and inclusion. For example, a periodic meeting schedule [new product quality meeting, cycle, 10 days] is declared in the basic knowledge graph. At this time, if there is a rule declaration in the reasoning rule set, for example: the new product quality meeting is held 7 days before the product is released. Using the reasoning rules, the corresponding reasoning knowledge obtained by reasoning based on the relevant knowledge in the basic knowledge graph may conflict in time with the periodic meeting schedule in the basic knowledge graph. In the embodiment of the present invention, the reasoning rules described by description logic are used. Description logic is a decidable subset of first-order logic, and Tableau calculus is a proof wheel of one-section logic. Therefore, a Tableau algorithm suitable for the present invention can be constructed based on description logic and Tableau calculus to determine the reasoning problem of the knowledge graph.

[0045] It should be noted that the timing for judging whether the inference knowledge graph and the basic knowledge graph in the complete knowledge graph conflict can be immediately after the basic knowledge graph and the inference knowledge graph are merged to obtain the first knowledge graph; it can also be after each update of the first knowledge graph in the following operation 105, and it can also be judged separately after the first knowledge graph is merged and each time the first knowledge graph is updated. When a conflict is determined in any knowledge graph, a reminder message is issued. Therefore, according to the reminder message issued, the inference rules and the relevant basic knowledge in the basic knowledge graph can be checked to improve the knowledge graph.

[0046] In operation 105 , at every first set time interval, the inference knowledge graph is updated according to the basic knowledge graph and the inference rule set to update the first knowledge graph.

[0047] The process of updating the inference knowledge graph according to the basic knowledge graph and the inference rule set is essentially the process of regenerating the inference knowledge graph according to the basic knowledge graph and the inference rule set. Returning to reference operation 103, performing similar operation steps can complete the updating of the inference knowledge graph.

[0048] In one embodiment of the present invention, the first set time may be a fixed duration, such as 2 hours, 1 day, 2 days, one week, 15 days, etc. It may also be a set update time point, for example, when the knowledge graph system is applied to an intelligent robot or an intelligent customer service system, the first set time may be set to the time when the intelligent robot or the intelligent customer service system is restarted each time, without setting a specific time interval for updating the inference knowledge graph.

[0049] In one embodiment of the present invention, the update timestamp of each inference data in the generated inference knowledge graph and the inference rule in the inference rule set used are also recorded; an index knowledge graph is generated based on the inference data, the corresponding update timestamp and the inference rule used, and stored in a third storage area; and the index knowledge graph is merged into the first knowledge graph to obtain a complete knowledge graph; and at every second set time interval, the validity of the corresponding inference data is judged based on the update timestamp and the inference rule.

[0050] In one embodiment of the present invention, the following operating steps are used to determine the validity of corresponding reasoning data based on the update timestamp and the reasoning rules: determine the basic data in the basic knowledge graph on which the reasoning data depends according to the reasoning rules; determine the estimated validity period of the corresponding reasoning data based on the update timestamp and the basic data on which it depends, and the validity period includes the effective time and / or expiration time; determine the current time; and determine the validity of the corresponding reasoning data based on the current time and the validity period.

[0051] For example, referring back to operations 101 to 103, based on the basic knowledge [Xiaoming, birthday, February 6, 2000] and the inference rule Rule1, when the inference knowledge graph is first generated or updated on June 6, 2020, the inference knowledge [Xiaoming, age, 20] is generated. Then the inference data [Xiaoming, age, 20] here is updated on June 6, 2020, and the inference rule used is Rule1. Based on the inference data, the corresponding update timestamp and the inference rule used, the inference data in the generated index knowledge graph can be simplified according to the pre-set naming rules. For example: [Xiaoming, age, 20] is described as "Age".

[0052] According to the data in the index knowledge graph, it can be determined that the inference data [Xiaoming, age, 20] is generated based on Rule 1 and the basic knowledge [Xiaoming, birthday, February 6, 2000], and the update time is June 6, 2020. According to the basic data [Xiaoming, birthday, February 6, 2000], it can be determined that the expiration time of the inference knowledge [Xiaoming, age, 20] is February 5, 2021. If the current time is June 30, 2020, the inference data [Xiaoming, age, 20] is valid data.

[0053] Similarly, based on the above knowledge graph construction method, an embodiment of the present invention further provides a knowledge graph system, and the knowledge graph system is constructed according to the above knowledge graph construction method, such as Figure 2The knowledge graph system 20 includes: a basic knowledge layer 201, including basic data and an inference rule set of a basic knowledge graph, the basic knowledge graph is used to generate an inference knowledge graph with timeliness, and the inference rule set is used to show the inference rule set of rules that need to be used to generate an inference knowledge graph with timeliness based on the basic knowledge graph; an inference knowledge layer 202, including inference data of an inference knowledge graph generated based on the basic knowledge graph and the inference rule set; at every first set time interval, the inference knowledge graph is updated based on the basic knowledge graph and the inference rule set to update the first knowledge graph including the basic knowledge graph and the inference knowledge graph.

[0054] In one embodiment of the present invention, the knowledge graph system also includes an index knowledge layer, the index knowledge layer includes an index knowledge graph, and the index knowledge graph is generated according to each inference data in the inference knowledge graph, the corresponding update timestamp and the inference rule in the inference rule set used.

[0055] Figure 3 A schematic diagram of the composition structure of a specific application example of a knowledge graph system according to an embodiment of the present invention is shown. Figure 3 , the knowledge graph system includes a basic knowledge layer 301, a reasoning knowledge layer 302 and an index knowledge layer 303.

[0056] The basic knowledge layer 301 is factual knowledge in a certain field, which describes the recognized concepts and relationships in the field and stores general static knowledge. It can be described and stored using general specifications, for example, using the resource description framework RDF for description and storage. The basic knowledge layer 301 includes a core layer knowledge base and a logic rule base. The core layer knowledge base includes a basic knowledge graph, and the logic rule base includes a reasoning rule set.

[0057] The reasoning knowledge layer 302 contains triples generated using logical rules, which are new knowledge generated based on the basic knowledge graph and reasoning rule set stored in the basic knowledge layer 301.

[0058] The index knowledge layer 303 stores the metadata of the reasoning knowledge layer 302, and can also be considered as a supplement to the information of the reasoning knowledge layer 302. Each reasoning data of the reasoning knowledge layer 302 has information about the state information of the reasoning data and the reasoning rules used in the index knowledge layer. The state information can be the generation or update time. The reasoning data triples of the reasoning knowledge layer 302 do not directly store their own state information, but the external index knowledge layer 303 stores their state information and the reasoning rules used.

[0059] Under the control of the control module 304 of the knowledge graph system, the reasoning module 305 performs reasoning operations based on the basic knowledge layer 301 .

[0060] For example, the logic rule base in the basic knowledge layer 301 defines the inference rule statement about a person's age:

[0061]

[0062] The meaning expressed by Rule2 is "Moli's age is generated based on Jasmine's birthday and the set time thisYear", and the final conclusion is: How old is Jasmine at the set time thisYear, where the set time thisYear can be the current time or any other time. Assume that the reasoning module 304 can obtain a new triple [Moli, age, 18] on May 6, 2020 based on Rule1 and the relevant basic data [Moli, birthday, 20020520] in the basic knowledge layer 301. The new triple will be stored in the reasoning knowledge layer 302, and the reasoning rule Rule2 used by the new triple and the generation time May 6, 2020 will be stored in the index knowledge layer 303. In addition, the reasoning knowledge layer can also store information such as the expected expiration time of the reasoning knowledge. For example: In Rule1, the variable (?thisYear) will change when the year changes, so the expected expiration time is the moment when (?thisYear) changes.

[0063] Under the control of the control module 304, the consistency check module 306 merges the knowledge of the basic knowledge layer 301 and the inference knowledge layer 301, and uses the Tableau algorithm to check the inclusiveness of the knowledge as a whole, and determines that the knowledge does not contain conflicting statements. For example, a periodic meeting schedule is declared in the knowledge base. At this time, if a newly added rule statement overlaps with the existing meeting time in time, it will cause a time conflict.

[0064] Under the control of the control module 304, the utility analysis module 307 determines the validity of the inference data. The utility analysis module 307 checks the timestamp and inference rule corresponding to each inference data in the index knowledge layer 303. When the variables supporting the inference rule change, the corresponding inference data becomes invalid. Figure 4 illustrate.

[0065] Figure 4 The following is a flowchart of determining the validity of inference data in an embodiment of the present invention. Take a device update as an example, where the device is named monlty. The device update rule monltyUpdate is described as follows:

[0066]

[0067] The rule is specifically described as follows: "Update the operating system version of the mobile phone between the 7th and 10th of each month". When any variable in the variable set {? phone,? os,? currentDay} on the left changes, the reasoning data is regenerated and the reasoning knowledge graph is updated. In addition, any change in the variable set {? phone,? os,? currentDay} on the left may also cause the previously exported updatingOS to become invalid. During analysis, the priority index for the reasoning data update is generated based on dimensions such as the validity time of the reasoning data and the number of variable changes. After being sorted by the utility index, it is returned to the control module 304.

[0068] refer to Figure 4 , determining the validity of inference data includes at least the following operation procedures:

[0069] Operation 401 : timingly starting the utility analysis module 307 .

[0070] Operation 402 , scanning the index knowledge graph of the index knowledge layer 303 .

[0071] Operation 403: Obtain inference rules and basic data.

[0072] For example, the corresponding inference rules and basic data can be determined by scanning any index data in the index knowledge layer 307. The corresponding inference rules and basic data can be obtained from the basic knowledge layer 301.

[0073] In operation 404, the timeliness of the inference data is determined.

[0074] Operation 405 , determining whether the data is invalid. If not, executing operation 401 to wait for the timing to start the determination program and determine again; if yes, executing operation 406 .

[0075] In operation 406 , the control module collects and updates.

[0076] For example, in operation 405 , each time the current reasoning data is found to be invalid, a reminder message is sent to the control module, and the corresponding reasoning data information is sent to the control module 304 , so that the control module 304 controls the reasoning module 305 to update the corresponding reasoning data.

[0077] Operation 407, end.

[0078] The knowledge graph construction method, device, knowledge graph system and processor of the embodiment of the present invention generate a timely inference knowledge graph based on the original basic knowledge graph according to the inference rules, store the basic knowledge graph and the inference knowledge graph separately, and update the knowledge graph at set intervals to maintain the timeliness of the knowledge graph. In this way, when using the knowledge graph constructed according to the above method, data with expiration can be directly obtained from the knowledge graph without performing a large number of calculations based on the basic knowledge graph, thereby ensuring the efficiency of data query in the knowledge graph. At the same time, it is only necessary to set a reasonable update time interval to update the inference knowledge graph to ensure the timeliness of the knowledge graph, avoiding a large amount of data processing during the knowledge graph update process.

[0079] Further, based on the above knowledge graph construction method, an embodiment of the present invention also provides a knowledge graph construction device, Figure 5 The following is a schematic diagram showing the composition structure of a knowledge graph construction device according to an embodiment of the present invention. Figure 5 The device 50 includes: a receiving module 501, which is used to receive a basic knowledge graph and store it in a first storage area, where the basic knowledge graph is used to generate a time-sensitive reasoning knowledge graph; a rule acquisition module 502, which is used to acquire a reasoning rule set, where the reasoning rule set is used to show the rules needed to generate a reasoning knowledge graph based on the basic knowledge graph; a reasoning module 503, which is used to generate a reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set, and store the reasoning knowledge graph in a second storage area; a merging module 504, which is used to merge the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; an updating module 505, which is used to update the reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set at every first set time interval to update the first knowledge graph.

[0080] Furthermore, based on the knowledge graph construction method as described above, an embodiment of the present invention also provides a processor, which is used to run a program, wherein when the instruction is executed, the processor performs at least the following operation steps: operation 101, receiving a basic knowledge graph and storing it in a first storage area, the basic knowledge graph is used to generate a timely reasoning knowledge graph; operation 102, obtaining an inference rule set, the inference rule set is used to show the rules needed to generate an inference knowledge graph based on the basic knowledge graph; operation 103, generating an inference knowledge graph based on the basic knowledge graph and the inference rule set, and storing the inference knowledge graph in a second storage area; operation 104, merging the basic knowledge graph and the inference knowledge graph to obtain a first knowledge graph; operation 105, updating the inference knowledge graph based on the basic knowledge graph and the inference rule set at every first set time interval to update the first knowledge graph.

[0081] In addition, an embodiment of the present invention further provides a device, Figure 6 FIG. 1 is a schematic diagram showing the composition structure of a device according to an embodiment of the present invention. Figure 6 The device 60 includes at least one processor 601, at least one memory 602 and a bus 603 connected to the processor 601; wherein the processor 601 and the memory 602 communicate with each other through the bus 603; the processor 601 is used to call the program instructions in the memory 602, and at least perform the following operation steps: operation 101, receiving a basic knowledge graph and storing it in a first storage area, the basic knowledge graph is used to generate a time-effective reasoning knowledge graph; operation 102, obtaining a reasoning rule set, the reasoning rule set is used to show the rules required to generate a reasoning knowledge graph based on the basic knowledge graph; operation 103, generating a reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set, and storing the reasoning knowledge graph in a second storage area; operation 104, merging the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; operation 105, updating the reasoning knowledge graph based on the basic knowledge graph and the reasoning rule set at every first set time interval to update the first knowledge graph.

[0082] It should be noted that the above description of the embodiments of the apparatus, processor, and device for constructing the knowledge graph is different from the above description of the apparatus, processor, and device for constructing the knowledge graph. Figures 1 to 4 The construction method of the knowledge graph shown is similar to the description of the knowledge graph system embodiment, and has the same Figures 1 to 4 The knowledge graph construction method shown in the figure has similar beneficial effects to the knowledge graph system embodiment, so it will not be described in detail. For technical details not disclosed in the embodiments of the knowledge graph construction device, processor, etc. of the present invention, please refer to the aforementioned Figures 1 to 4 The knowledge graph construction method and the description of the knowledge graph system embodiment shown in the figure can be understood, and will not be repeated here to save space.

[0083] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0084] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0085] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0086] In addition, all functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0087] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM), magnetic disks or optical disks, etc., various media that can store program codes.

[0088] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.

[0089] The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A method for constructing a knowledge graph, the method comprising: Receiving a basic knowledge graph and storing it in a first storage area, wherein the basic knowledge graph is used to generate a time-effective reasoning knowledge graph; The basic knowledge graph refers to a collection of static factual knowledge; Obtaining an inference rule set, wherein the inference rule set is used to show the rules required to generate the inference knowledge graph according to the basic knowledge graph; Generate the inference knowledge graph according to the basic knowledge graph and the inference rule set, and store the inference knowledge graph in a second storage area; Merging the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; At every first set time interval, the inference knowledge graph is updated according to the basic knowledge graph and the inference rule set to update the first knowledge graph.

2. The method according to claim 1, further comprising: Recording the update timestamp of each inference data in the inference knowledge graph and the inference rule in the inference rule set used to generate the inference knowledge graph; Generate an index knowledge graph based on the inference data, the corresponding update timestamp and the utilized inference rules, and store it in a third storage area; Merge the index knowledge graph into the first knowledge graph to obtain a complete knowledge graph; At every second set time interval, the validity of the corresponding inference data is judged according to the update timestamp and the inference rule.

3. The method according to claim 2, wherein judging the validity of the corresponding inference data according to the update timestamp and the inference rule comprises: According to the inference rule, determining the basic data in the basic knowledge graph on which the inference data depends; Determine the estimated validity period of the corresponding inference data according to the update timestamp and the basic data on which it depends, wherein the validity period includes an effective time and / or an expiration time; Determine the current time; The validity of the corresponding inference data is determined based on the current time and the validity period.

4. According to the method of claim 2, the inference rule is described using description logic.

5. The method according to claim 2, after merging the basic knowledge graph and the reasoning knowledge graph, the method further comprises: According to the Tableau algorithm, determine whether the inference knowledge graph and the basic knowledge graph in the complete knowledge graph conflict; When a conflict is determined, a reminder message is issued.

6. According to the method described in any one of claims 1 to 5, all data in the knowledge graph is stored using the Resource Description Framework (RDF).

7. A knowledge graph system, wherein the knowledge graph system is constructed according to the knowledge graph construction method according to any one of claims 1 to 6, and the knowledge graph system comprises: The basic knowledge layer includes basic data and inference rule sets of the basic knowledge graph, wherein the basic knowledge graph is used to generate an inference knowledge graph with timeliness, and the inference rule set is used to show the inference rule set of rules required to generate an inference knowledge graph with timeliness according to the basic knowledge graph; the basic knowledge graph refers to a collection of static factual knowledge; An inference knowledge layer, including inference data of the inference knowledge graph generated according to the basic knowledge graph and the inference rule set; At every first set time interval, the inference knowledge graph is updated according to the basic knowledge graph and the inference rule set to update the first knowledge graph including the basic knowledge graph and the inference knowledge graph.

8. The knowledge graph system according to claim 7, further comprising: The index knowledge layer includes an index knowledge graph, wherein the index knowledge graph is generated according to each inference data in the inference knowledge graph, a corresponding update timestamp and an inference rule in the utilized inference rule set.

9. A device for constructing a knowledge graph, the device comprising: A receiving module, used to receive a basic knowledge graph and store it in a first storage area, wherein the basic knowledge graph is used to generate a time-sensitive reasoning knowledge graph; The basic knowledge graph refers to a collection of static factual knowledge; A rule acquisition module, used to acquire an inference rule set, wherein the inference rule set is used to show the rules needed to generate the inference knowledge graph according to the basic knowledge graph; An inference module, used for generating the inference knowledge graph according to the basic knowledge graph and the inference rule set, and storing the inference knowledge graph in a second storage area; A merging module, used for merging the basic knowledge graph and the reasoning knowledge graph to obtain a first knowledge graph; An updating module is used to update the inference knowledge graph at a first set time interval according to the basic knowledge graph and the inference rule set to update the first knowledge graph.

10. A device comprising at least one processor, and at least one memory and bus connected to the processor; wherein: The processor and the memory communicate with each other via the bus; The processor is used to call the program instructions in the memory to execute the knowledge graph construction method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Construction method and device of human object attribute classification knowledge graph

    CN108182245A

  • Data reasoning method, device, server and medium based on knowledge map

    CN109299283A

  • Insurance industry knowledge graph question and answer system construction method and device

    CN110019844A

  • Semantic reasoning method and device based on a knowledge graph and electronic equipment e

    CN110597992A

  • Enterprise association relationship construction method and system

    CN110781246A

Cited By

  • Incremental knowledge graph dynamic updating method and system based on influence domain recognition

    CN121787546A