Knowledge graph construction method, data query method, device, equipment and medium
By acquiring entity lifecycle information and matching it with documents, a knowledge graph is constructed, which solves the problem that existing technologies cannot fully represent the entity lifecycle and achieves accurate representation and management at different stages.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING BAIDU NETCOM SCI & TECH CO LTD
- Filing Date
- 2021-11-23
- Publication Date
- 2026-04-24
AI Technical Summary
In existing technologies, knowledge graphs built based on entity attributes cannot fully represent different stages of an entity's lifecycle, resulting in the inability to accurately represent different values of the same attribute, which affects entity management and understanding of related documents.
By acquiring the lifecycle information of entities, including multiple fields, and matching it with relevant documents, the association between fields and documents is established, a knowledge graph is constructed, and then the different values of the same attribute are represented at different stages.
It enables accurate representation at different stages of an entity's lifecycle, improving the ability to manage entities and understand related documents.
Smart Images

Figure CN114064925B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and more particularly to knowledge graph technology. More specifically, this disclosure provides a method for constructing a knowledge graph, a data query method, an apparatus, an electronic device, and a storage medium. Background Technology
[0002] Knowledge graphs can visualize complex knowledge domains through data mining, information processing, and image rendering, providing practical and valuable references for related research. In related technologies, knowledge graphs can be constructed based on the attributes of entities. Summary of the Invention
[0003] This disclosure provides a method for constructing a knowledge graph, a data query method, an apparatus, a device, and a storage medium.
[0004] According to the first aspect, a method for constructing a knowledge graph is provided. The method includes: obtaining lifecycle information of an entity, wherein the lifecycle information includes M fields, where M is an integer greater than or equal to 1; matching the M fields with N documents to obtain a first association relationship of the M fields, wherein the first association relationship of each field is the association relationship between each field and at least one of the N documents, where the N documents are documents related to the entity, and N is an integer greater than or equal to 1; and constructing a knowledge graph based on the first association relationship of the M fields.
[0005] According to the second aspect, a data query method is provided, the method comprising: obtaining target lifecycle information of a target entity, wherein the target lifecycle information includes H fields, where H is an integer greater than or equal to 1; querying the H fields in a knowledge graph to obtain at least one document that is associated with the H fields, wherein the knowledge graph is constructed using the method provided in this disclosure.
[0006] According to a third aspect, a knowledge graph construction apparatus is provided, the apparatus comprising: a first acquisition module for acquiring lifecycle information of an entity, wherein the lifecycle information includes M fields, where M is an integer greater than or equal to 1; a first matching module for matching the M fields with N documents to obtain a first association relationship of the M fields, wherein the first association relationship of each field is the association relationship between each field and at least one of the N documents, where the N documents are documents related to the entity, and N is an integer greater than or equal to 1; and a construction module for constructing a knowledge graph based on the first association relationship of the M fields.
[0007] According to a fourth aspect, a data query apparatus is provided, the apparatus comprising: a second acquisition module for acquiring target lifecycle information of a target entity, wherein the target lifecycle information includes H fields, where H is an integer greater than or equal to 1; and a query module for querying the H fields in a knowledge graph to obtain at least one document that is associated with the H fields, wherein the knowledge graph is constructed using the apparatus provided according to this disclosure.
[0008] According to a fifth aspect, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform a method provided according to the present disclosure.
[0009] According to a sixth aspect, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods provided in this disclosure.
[0010] According to a seventh aspect, a computer program product is provided, comprising a computer program that, when executed by a processor, implements the method provided in this disclosure.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0013] Figure 1 This is an exemplary system architecture diagram illustrating a knowledge graph construction method and / or data query method applicable to an embodiment of this disclosure;
[0014] Figure 2 This is a flowchart of a method for constructing a knowledge graph according to an embodiment of the present disclosure;
[0015] Figure 3 This is a flowchart of a method for constructing a knowledge graph according to another embodiment of the present disclosure;
[0016] Figure 4 This is a schematic diagram of a knowledge graph according to an embodiment of the present disclosure;
[0017] Figure 5 This is a flowchart of a data query method according to an embodiment of the present disclosure;
[0018] Figure 6A This is a schematic diagram of the output of a data query method according to an embodiment of the present disclosure;
[0019] Figure 6B This is a schematic diagram of the output of a data query method according to another embodiment of the present disclosure;
[0020] Figure 7 This is a block diagram of a knowledge graph construction apparatus according to an embodiment of the present disclosure;
[0021] Figure 8 This is a block diagram of a data query apparatus according to an embodiment of the present disclosure; and
[0022] Figure 9 This is a block diagram of an electronic device according to an embodiment of the present disclosure, to which a knowledge graph construction method and / or data query method can be applied. Detailed Implementation
[0023] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0024] A knowledge graph of an entity can be constructed based on its own attributes. For example, a knowledge graph of a transformer can be constructed based on its attributes (such as rated power and production date).
[0025] However, knowledge graphs built based on the attributes of entities themselves cannot establish a profile of the entire lifecycle of an entity from a macro perspective, which is not conducive to entity management or understanding of standard documents related to entities.
[0026] Furthermore, the same attribute of an entity may have different values at different stages of its lifecycle. Therefore, a knowledge graph built solely based on the entity's attributes cannot represent different values of the same attribute. For example, the reserve oil level of a transformer may have different values during the procurement and maintenance phases. A knowledge graph built based on transformer attributes cannot accurately represent that the reserve oil level has two different values.
[0027] Figure 1 This is a schematic diagram of an exemplary system architecture according to an embodiment of the present disclosure, showing a method for constructing a knowledge graph and / or a method for querying data that can be applied. It should be noted that... Figure 1The examples shown are merely examples of system architectures that can be applied to the embodiments of this disclosure, in order to help those skilled in the art understand the technical content of this disclosure, but do not mean that the embodiments of this disclosure cannot be used in other devices, systems, environments or scenarios.
[0028] like Figure 1 As shown, the system architecture 100 according to this embodiment may include terminal devices 101, 102, and 103, a network 104, and a server 105. The network 104 serves as a medium for providing a communication link between the terminal devices 101, 102, and 103 and the server 105. The network 104 may include various connection types, such as wired and / or wireless communication links, etc.
[0029] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Terminal devices 101, 102, and 103 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.
[0030] Server 105 can be a server that provides various services, such as a backend management server that supports websites browsed by users using terminal devices 101, 102, and 103 (for example only). The backend management server can analyze and process data such as received user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal devices.
[0031] It should be noted that one of the knowledge graph construction methods and / or data query methods provided in this disclosure embodiment can generally be executed by server 105. Correspondingly, the knowledge graph construction apparatus and / or data query apparatus provided in this disclosure embodiment can generally be located in server 105. The knowledge graph construction methods and / or data query methods provided in this disclosure embodiment can also be executed by a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105. Correspondingly, the knowledge graph construction apparatus and / or data query apparatus provided in this disclosure embodiment can also be located in a server or server cluster that is different from server 105 and capable of communicating with terminal devices 101, 102, 103 and / or server 105.
[0032] Figure 2 This is a flowchart of a method for constructing a knowledge graph according to an embodiment of the present disclosure.
[0033] like Figure 2 As shown, the knowledge graph construction method 200 may include operations S210 to S230.
[0034] In operation S210, obtain the lifecycle information of the entity.
[0035] In this embodiment of the disclosure, the lifecycle information includes M fields, where M is an integer greater than or equal to 1.
[0036] In this embodiment of the disclosure, the entity may be a transformer.
[0037] For example, the M fields include at least one of the following: general standards, planning and design, performance requirements, basic rules, raw material selection, component selection, equipment performance evaluation, equipment economic evaluation, equipment operation, maintenance and inspection, maintenance testing, testing methods, and decommissioning and scrapping. The M fields can characterize the transformer's life cycle information, such as the transformer's design and development, ordering and manufacturing supervision, handover and acceptance, operation and maintenance, maintenance testing, and decommissioning and reuse.
[0038] Those skilled in the art will understand that the entity can also be other devices, such as a generator. Of course, different entities can have different lifecycle information.
[0039] In operation S220, M fields are matched with N documents to obtain the first association relationship of the M fields.
[0040] In this embodiment of the disclosure, the first association relationship of each field is the association relationship between each field and at least one of N documents, where N documents are documents related to the entity and N is an integer greater than or equal to 1.
[0041] For example, documents can be international standards, national standards, industry standards, and enterprise standards. Documents can also be design manuals, design specifications, and so on.
[0042] In this embodiment of the disclosure, the following operations may be performed for each of the M fields.
[0043] For example, each field can be matched against N documents.
[0044] In some examples, the following operations can be performed for each of the N documents.
[0045] In one example, each field can be matched against each document. For instance, the "device operation" field mentioned above can be matched against each document (such as industry standard documents, user manuals, etc.) to determine if there are any content fragments related to "device operation" in each document.
[0046] In one example, in response to determining that the i-th document contains a content fragment related to each field, the i-th document can be considered a document that successfully matches each field, where i = 1, ..., N. For instance, taking i = 1 as an example, if the i-th document (i.e., the first document) states "the equipment needs an oil change after 15 days of operation," then the first document can be considered to contain a content fragment related to "equipment operation," and thus can be considered a document that successfully matches "equipment operation." Furthermore, the related content fragment can be exactly the same as the field "equipment operation," or it can be a content fragment with the same semantic meaning as the field; for example, "equipment working" can be a content fragment with the same semantic meaning as "equipment operation."
[0047] In one example, in response to determining that there is no content fragment in the i-th document that is related to each field, the i-th document is considered a document that fails to match each field. For example, taking i=2 as an example, if the i-th document (i.e., the second document) does not contain a content fragment that is exactly the same or semantically the same as "device operation", then it can be considered that there is no content fragment related to "device operation" in the second document.
[0048] For example, based on at least one document out of N documents that successfully matches each field, at least one first sub-association can be obtained for each field.
[0049] In one example, the first sub-association of each field is the association between each field and one of the N documents.
[0050] For example, in the example above, the first document can be considered a document that successfully matches "Device Operation". Then, the association between "Device Operation" and this first document can be obtained, which can be considered a first sub-association of "Device Operation".
[0051] For example, the first association of each field can be obtained based on at least one first sub-association of each field.
[0052] In operation S230, a knowledge graph is constructed based on the first association relationship of M fields.
[0053] In this embodiment of the disclosure, M first nodes can be generated based on M fields.
[0054] For example, 13 first nodes can be generated based on the 13 fields mentioned above.
[0055] In this embodiment of the disclosure, N second nodes can be generated based on N documents.
[0056] For example, a second node can be generated based on each standard document related to the transformer.
[0057] In this embodiment of the disclosure, an edge connecting the first node and the second node is established based on the first association relationship of M fields to construct a knowledge graph.
[0058] For example, based on the association between the field "Device Operation" and the first document, an edge can be established connecting the first node corresponding to "Device Operation" and the second node corresponding to the first document. Similar operations can be used to establish other edges connecting the first and second nodes to construct the knowledge graph.
[0059] Through the embodiments of this disclosure, a knowledge graph is constructed based on the lifecycle of documents and entities, enabling the knowledge graph to represent different values of the same attribute at different stages of the entity's lifecycle.
[0060] Figure 3 This is a flowchart of a method for constructing a knowledge graph according to another embodiment of the present disclosure.
[0061] like Figure 3 As shown, with Figure 2 The method shown is different; the knowledge graph construction method 300 may include operations S310 to S320 as described above, as well as operations S330 and S340. Operation S340 may be executed before operation S330.
[0062] In operation S310, obtain the lifecycle information of the entity.
[0063] In operation S320, M fields are matched with N documents to obtain the first association relationship of the M fields.
[0064] Those skilled in the art will understand that operations S310 and S320 in method 300 are the same as or similar to operations S210 to S220 in method 200, and will not be described again here.
[0065] In operation S340, K entities are matched with N documents to obtain the second association relationship of the K entities.
[0066] In this embodiment of the disclosure, the second association relationship of each entity is the association relationship between each entity and at least one of the N documents.
[0067] For example, the K entities can be 50kV transformers, 110kV transformers, and 200kV transformers, etc.
[0068] In this embodiment of the disclosure, the following operations may be performed for each of the K entities.
[0069] For example, matching each entity with N documents.
[0070] In some examples, the following operations can be performed for each of the N documents.
[0071] In one example, each entity is matched against each document. For instance, an entity like "110kV transformer" can be matched against each document (such as a standard document) to determine if any content related to "110kV transformer" exists in each document.
[0072] In one example, in response to determining that a content fragment related to the name of each entity exists in the j-th document, the j-th document is considered a document that successfully matches each entity, where j = 1, ..., N. For example, taking j = 1 as an example, if the j-th document (i.e., the first document) states "110kV transformer, the oil needs to be changed after 15 days of operation," then the first document can be considered to contain a content fragment related to 110kV transformer, and thus can be considered a document that successfully matches 110kV transformer. Furthermore, the related content fragment can be a content fragment that is exactly the same as the entity's name (110kV transformer), or it can be a content fragment with the same semantic meaning as the entity (e.g., "110 kV transformer" can be a content fragment with the same semantic meaning as "110kV transformer").
[0073] In one example, in response to determining that there is no content fragment in the j-th document that is related to the name of each entity, the j-th document is considered a document that fails to match each entity. For example, taking j=2 as an example, if the j-th document (i.e., the second document) does not contain any content fragment that is exactly the same or semantically the same as 110kV transformer, then it can be considered that there is no content fragment related to 110kV transformer in the second document.
[0074] For example, based on at least one document out of N documents that successfully matches each entity, at least one second sub-association is obtained for each entity.
[0075] In some examples, the second sub-association of each entity is the association between that entity and one of the N documents.
[0076] For example, the first document can be considered a document that has been successfully matched with the 110kV transformer. Then, the association between the 110kV transformer and the first document can be obtained as a second sub-association of the 110kV transformer.
[0077] For example, the second association of each entity is obtained based on at least one second sub-association of each entity.
[0078] In operation S330, a knowledge graph is constructed based on the first association relationship of M fields.
[0079] In this embodiment of the disclosure, a knowledge graph can be constructed based on the first association relationship of M fields and the second association relationship of K entities.
[0080] For example, M first nodes can be generated based on M fields.
[0081] In one example, 13 first nodes can be generated based on the 13 fields mentioned above.
[0082] For example, N second nodes can be generated based on N documents.
[0083] In one example, a second node can be generated based on each standard document related to the transformer.
[0084] For example, K third nodes can be generated based on K entities.
[0085] In one example, three third nodes can be generated based on the 50kV transformer, 110kV transformer, and 200kV transformer mentioned above.
[0086] For example, an edge connecting the first node and the second node can be established based on the first association relationship of M fields.
[0087] In one example, based on the association between "Device Operation" and the first document, an edge can be established connecting the first node corresponding to "Device Operation" and the second node corresponding to the first document. Similar operations are used to establish other edges connecting the first and second nodes to construct the knowledge graph.
[0088] For example, based on the second association relationship of N entities, an edge connecting the second node and the third node can be established to construct a knowledge graph.
[0089] In one example, based on the association between the 110kV transformer and the first document described above, an edge can be established between the third node corresponding to the 110kV transformer and the second node corresponding to the first document. Similar operations are used to establish other edges connecting the third and second nodes to construct the knowledge graph.
[0090] Other embodiments of operation S330 can be referred to, for example... Figure 2 The embodiments relating to operation S230 are not described in detail herein.
[0091] Through the embodiments disclosed herein, the association between entities and documents can be established, and a knowledge graph can be constructed based on entities, documents, and the lifecycle of entities.
[0092] Figure 4 This is a schematic diagram of a knowledge graph according to another embodiment of the present disclosure.
[0093] like Figure 4 As shown, this knowledge graph includes a first node 411 and a first node 412. The first node 411 can correspond to "equipment operation". The first node 412 can correspond to "retirement and scrapping".
[0094] It should be noted that, Figure 4 The two first nodes shown are merely examples; in other examples, the knowledge graph may include any number of first nodes.
[0095] like Figure 4 As shown, the knowledge graph also includes second node 421, second node 422, and second node 423. Second node 421 corresponds to a national standard, second node 422 corresponds to an industry standard, and second node 423 corresponds to a corporate standard.
[0096] like Figure 4 As shown, the knowledge graph also includes third nodes 431, 432, and 433. Third node 431 corresponds to a 50kV transformer, third node 432 corresponds to a 110kV transformer, and third node 433 corresponds to a 200kV transformer.
[0097] For example, based on the association between "equipment operation" and national standards, an edge E441 can be established between the first node 411 corresponding to "equipment operation" and the second node 421 corresponding to the national standards. Similar operations can be used to establish other edges connecting the first and second nodes to construct a knowledge graph.
[0098] For example, based on the association between the 110kV transformer and the national standard, an edge E442 can be established between the third node 432 corresponding to the 110kV transformer and the second node 421 corresponding to the national standard. Similar operations are used to establish other edges connecting the third and second nodes to construct a knowledge graph.
[0099] Figure 5 This is a flowchart of a data query method according to an embodiment of the present disclosure.
[0100] like Figure 5 As shown, the data query method 500 may include operations S510 to S520.
[0101] When operating S510, obtain the target lifecycle information of the target entity.
[0102] In this embodiment of the disclosure, the target lifecycle information includes H fields, where H is an integer greater than or equal to 1.
[0103] For example, H can be less than or equal to M.
[0104] For example, the target entity could be a transformer. In one example, the target entity could be a 110kV transformer.
[0105] In operation S520, H fields are queried in the knowledge graph to obtain at least one document that is related to the H fields.
[0106] In this embodiment of the disclosure, the knowledge graph is utilized using, for example... Figure 2 or Figure 3 It was constructed using the method described above.
[0107] For example, H=1, the target lifecycle information is "equipment operation", and the target entity is a 110kV transformer. At least the first document mentioned above can be obtained.
[0108] Through the embodiments of this disclosure, documents of a target entity at different stages of its lifecycle can be easily retrieved.
[0109] Figure 6A This is a schematic diagram of the output of a data query method according to an embodiment of the present disclosure.
[0110] like Figure 6A As shown, the target entity obtained is a 110kV transformer, and the target lifecycle information of this target entity is "equipment operation".
[0111] For a 110kV transformer, querying the "equipment operation" field in the knowledge graph can yield results such as... Figure 6A The output is shown below. Figure 6A As shown, the output includes a second node 621 corresponding to the national standard and a second node 622 corresponding to the industry standard. The output also includes a third node 632 corresponding to the target entity.
[0112] It should be noted that the output may only contain the second node 621 of the corresponding national standard and the second node 622 of the corresponding industry standard. For a more intuitive display of the output results, as shown below... Figure 6A As shown, a third node 632 corresponding to the target entity (or a node corresponding to the "Device Operation" field) and the corresponding edge E642 can be added to the output.
[0113] It should be noted that, Figure 6A The second node 621 in the example can be, for example Figure 4 The second node 421 and the second node 622 in the table can be, for example... Figure 4 The second node 422 and the third node 632 in the table can be, for example... Figure 4The third node is 432. The edge E642 connecting the second node 621 and the second node 632 can be, for example... Figure 4 Edge E442 in the middle.
[0114] Figure 6B This is a schematic diagram of the output of a data query method according to another embodiment of the present disclosure.
[0115] like Figure 6B As shown, the target entity obtained is a 110kV transformer, and the target lifecycle information of this target entity is "equipment operation" and "retirement and scrapping".
[0116] For a 110kV transformer, querying the "Equipment Operation" field in the knowledge graph yields the output, which includes the second node 621 of the corresponding national standard and the second node 622 of the corresponding industry standard. For a 110kV transformer, in, for example... Figure 4 Searching for the field "retirement and scrapping" in the knowledge graph yields the second node 623 corresponding to the enterprise standard. The output also includes the third node 632 corresponding to the target entity.
[0117] It should be noted that the output may only contain the second node 621 of the corresponding national standard, the second node 622 of the corresponding industry standard, and the second node 623 of the corresponding enterprise standard. To display the output results more intuitively, as shown below... Figure 6B As shown, a third node 632 corresponding to the target entity can be added to the output (or a node corresponding to the fields "Equipment Operation" and "Retirement and Scrapping"), as well as the corresponding edge E642, etc.
[0118] It should be noted that, Figure 6B The second node 621 in the example can be, for example Figure 4 The second node 421 and the second node 622 in the table can be, for example... Figure 4 The second node 422 and the second node 623 in the table can be, for example... Figure 4 The second node 423 and the third node 632 in the table can be, for example... Figure 4 The third node is 432. The edge E642 connecting the second node 621 and the second node 632 can be, for example... Figure 4 Edge E442 in the middle.
[0119] Figure 7 This is a block diagram of a knowledge graph construction apparatus according to an embodiment of the present disclosure.
[0120] like Figure 7 As shown, the knowledge graph construction device 700 may include a first acquisition module 710, a first matching module 720, and a construction module 730.
[0121] The first acquisition module 710 is used to acquire the lifecycle information of an entity, wherein the lifecycle information includes M fields, where M is an integer greater than or equal to 1.
[0122] The first matching module 720 is used to match the above M fields with N documents to obtain the first association relationship of the above M fields. The first association relationship of each field is the association relationship between each field and at least one of the above N documents. The above N documents are documents related to the above entity, and N is an integer greater than or equal to 1.
[0123] Module 730 is used to construct a knowledge graph based on the first association relationship of the above M fields.
[0124] In some embodiments, the device 700 further includes: a second matching module, configured to match K entities with the N documents to obtain a second association relationship of the K entities, wherein the second association relationship of each entity is the association relationship between each entity and at least one of the N documents; wherein the construction module includes: a construction submodule, configured to construct the knowledge graph based on the first association relationship of the M fields and the second association relationship of the K entities.
[0125] In some embodiments, the first matching module is further configured to perform related operations for each of the M fields through the following sub-modules: a first matching sub-module, configured to match each of the M fields with the N documents; a first obtaining sub-module, configured to obtain at least one first sub-association relationship for each of the M fields based on at least one document among the N documents that successfully matches each of the M fields, wherein the first sub-association relationship for each field is the association relationship between each field and one document among the N documents; and a second obtaining sub-module, configured to obtain the first association relationship for each of the M fields based on at least one first sub-association relationship for each field.
[0126] In some embodiments, the first matching submodule is further configured to perform related operations for each of the N documents through the following units: a first matching unit, configured to match each field with each document; a first obtaining unit, configured to, in response to determining that there is a content fragment related to each field in the i-th document, to regard the i-th document as a document that has successfully matched each field; or a second obtaining unit, configured to, in response to determining that there is no content fragment related to each field in the i-th document, to regard the i-th document as a document that has failed to match each field, where i is an integer greater than or equal to 1.
[0127] In some embodiments, the second matching module is further configured to perform related operations for each of the K entities through the following sub-modules: a second matching sub-module, configured to match each entity with the N documents; a third obtaining sub-module, configured to obtain at least one second sub-association relationship for each entity based on at least one document among the N documents that successfully matches each entity, wherein the second sub-association relationship of each entity is the association relationship between the entity and one document among the N documents; and a fourth obtaining sub-module, configured to obtain the second association relationship of each entity based on at least one second sub-association relationship of each entity.
[0128] In some embodiments, the second matching module is further configured to perform related operations for each of the N documents by means of the following units: a second matching unit, configured to match each entity with each document; a third obtaining unit, configured to, in response to determining that there is a content fragment related to the name of each entity in the j-th document, regard the j-th document as a document that has been successfully matched with each entity; or a fourth obtaining unit, configured to, in response to determining that there is no content fragment related to the name of each entity in the j-th document, regard the j-th document as a document that has failed to be matched with each entity, wherein j is an integer greater than or equal to 1.
[0129] In some embodiments, the above M fields include at least one of the following fields: general standards, planning and design, performance requirements, basic rules, raw material selection, component selection, equipment performance evaluation, equipment economic evaluation, equipment operation, maintenance and inspection, maintenance test, test method, and decommissioning and scrapping.
[0130] In some embodiments, the above-mentioned construction module includes: a first generation submodule, used to generate M first nodes based on M fields; a second generation submodule, used to generate N second nodes based on N documents; and an establishment submodule, used to establish edges connecting the first nodes and the second nodes based on the first association relationship of the above-mentioned M fields, so as to construct the above-mentioned knowledge graph.
[0131] In some embodiments, the above-mentioned construction submodule includes: a first generation unit, configured to generate M first nodes based on the M fields; a second generation unit, configured to generate N second nodes based on the N documents; a third generation unit, configured to generate K third nodes based on the K entities; a first establishment unit, configured to establish edges connecting the first nodes and the second nodes based on the first association relationship of the M fields; and a second establishment unit, configured to establish edges connecting the second nodes and the third nodes based on the second association relationship of the N entities, so as to construct the knowledge graph.
[0132] Figure 8 This is a block diagram of a data query apparatus according to an embodiment of the present disclosure.
[0133] like Figure 8 As shown, the data query 800 may include a second acquisition module 810 and a query module 820.
[0134] The second acquisition module 810 is used to acquire the target lifecycle information of the target entity, wherein the target lifecycle information includes H fields, where H is an integer greater than or equal to 1.
[0135] The query module 820 is used to query the above H fields in the knowledge graph and obtain at least one document that is related to the above H fields.
[0136] For example, the knowledge graph mentioned above is based on, for example Figure 7 The device shown is constructed.
[0137] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0138] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0139] Figure 9 A schematic block diagram of an example electronic device 900 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0140] like Figure 9 As shown, device 900 includes a computing unit 901, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 902 or a computer program loaded from storage unit 908 into random access memory (RAM) 903. RAM 903 may also store various programs and data required for the operation of device 900. The computing unit 901, ROM 902, and RAM 903 are interconnected via bus 904. Input / output (I / O) interface 905 is also connected to bus 904.
[0141] Multiple components in device 900 are connected to I / O interface 905, including: input unit 906, such as keyboard, mouse, etc.; output unit 907, such as various types of monitors, speakers, etc.; storage unit 908, such as disk, optical disk, etc.; and communication unit 909, such as network card, modem, wireless transceiver, etc. Communication unit 909 allows device 900 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0142] The computing unit 901 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 901 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the various methods and processes described above, such as knowledge graph construction methods and / or data query methods. For example, in some embodiments, the knowledge graph construction methods and / or data query methods can be implemented as computer software programs tangibly contained in a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program can be loaded and / or installed on device 900 via ROM 902 and / or communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the knowledge graph construction methods and / or data query methods described above can be performed. Alternatively, in other embodiments, the computing unit 901 may be configured, by any other suitable means (e.g., by means of firmware), to perform knowledge graph construction methods and / or data query methods.
[0143] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0144] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0145] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0146] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0147] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0148] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
[0149] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0150] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for constructing a knowledge graph, comprising: Obtain the lifecycle information of the entity, wherein the lifecycle information includes M fields, where M is an integer greater than or equal to 1, and the M fields include at least one of the following fields: general standards, planning and design, performance requirements, basic rules, raw material selection, component selection, equipment performance evaluation, equipment economic evaluation, equipment operation, maintenance and inspection, maintenance test, test method, and decommissioning and scrapping. The M fields are matched with N documents to obtain the first association relationship of the M fields, wherein the first association relationship of each field is the association relationship between each field and at least one of the N documents, and the N documents are documents related to the entity, and N is an integer greater than or equal to 1; Matching K entities with N documents yields a second association relationship for the K entities, wherein the second association relationship for each entity is the association relationship between each entity and at least one of the N documents; Based on the M fields, generate M first nodes; Based on the N documents, generate N second nodes; Based on the K entities, generate K third nodes; Based on the first association relationship of the M fields, establish an edge connecting the first node and the second node; and Based on the second association relationship of the N entities, an edge is established connecting the second node and the third node to construct the knowledge graph.
2. The method according to claim 1, wherein, The step of matching the M fields with the N documents to obtain the first association relationship of the M fields includes: For each of the M fields, perform the following operations: Match each field with the N documents; Based on at least one document from the N documents that successfully matches each field, at least one first sub-association is obtained for each field, wherein the first sub-association for each field is the association between each field and one document from the N documents; and The first association relationship of each field is obtained based on at least one first sub-association relationship of each field.
3. The method according to claim 2, wherein, The step of matching each field with the N documents includes: For each of the N documents, perform the following operations: Match each field with each document; In response to determining that a content fragment related to each field exists in the i-th document, the i-th document is considered a document that successfully matches each field; or In response to determining that no content fragment related to each field exists in the i-th document, the i-th document is treated as a document that fails to match each field. Where i is an integer greater than or equal to 1.
4. The method according to claim 1, wherein, The step of matching K entities with N documents to obtain the second association relationship for each of the K entities includes: For each of the K entities, perform the following operations: Match each entity with the N documents; Based on at least one document from the N documents that successfully matches each entity, at least one second sub-association is obtained for each entity, wherein the second sub-association for each entity is the association between that entity and one of the N documents; and The second association relationship of each entity is obtained based on at least one second sub-association relationship of each entity.
5. The method according to claim 4, wherein, The step of matching each entity with the N documents includes: For each of the N documents, perform the following operations: Match each entity with each document; In response to determining that a content fragment related to the name of each entity exists in the j-th document, the j-th document is considered a document that successfully matches each entity; or In response to determining that no content fragment related to the name of each entity exists in the j-th document, the j-th document is treated as a document that fails to match each entity. Where j is an integer greater than or equal to 1.
6. A data query method, comprising: Obtain the target lifecycle information of the target entity, wherein the target lifecycle information includes H fields, where H is an integer greater than or equal to 1; By querying the H fields in the knowledge graph, at least one document that is associated with the H fields is obtained. The knowledge graph is constructed using the method described in any one of claims 1 to 5.
7. A knowledge graph construction apparatus, comprising: The first acquisition module is used to acquire the life cycle information of an entity, wherein the life cycle information includes M fields, where M is an integer greater than or equal to 1, and the M fields include at least one of the following fields: general standards, planning and design, performance requirements, basic rules, raw material selection, component selection, equipment performance evaluation, equipment economic evaluation, equipment operation, maintenance and inspection, maintenance test, test method, and decommissioning and scrapping. The first matching module is used to match the M fields with N documents to obtain the first association relationship of the M fields, wherein the first association relationship of each field is the association relationship between each field and at least one of the N documents, and the N documents are documents related to the entity, and N is an integer greater than or equal to 1; The second matching module is used to match K entities with N documents to obtain a second association relationship of the K entities, wherein the second association relationship of each entity is the association relationship between each entity and at least one document among the N documents; The construction module is used to construct a knowledge graph based on the first association relationship of the M fields. The building module includes: A submodule is constructed to build the knowledge graph based on the first association relationships of the M fields and the second association relationships of the K entities. The construction sub-module includes: The first generation unit is used to generate M first nodes based on the M fields; The second generation unit is used to generate N second nodes based on the N documents; The third generation unit is used to generate K third nodes based on the K entities; The first establishing unit is configured to establish an edge connecting the first node and the second node based on the first association relationship of the M fields; and The second establishment unit is used to establish an edge connecting the second node and the third node based on the second association relationship of the N entities, so as to construct the knowledge graph.
8. The apparatus according to claim 7, wherein, The first matching module is also used to perform related operations for each of the M fields through the following sub-modules: The first matching submodule is used to match each field with the N documents; The first obtaining submodule is used to obtain at least one first sub-association relationship for each field based on at least one document in the N documents that successfully matches each field, wherein the first sub-association relationship for each field is the association relationship between each field and one document in the N documents; as well as The second obtaining submodule is used to obtain the first association relationship of each field based on at least one first sub-association relationship of each field.
9. The apparatus according to claim 8, wherein, The first matching submodule is further configured to perform relevant operations for each of the N documents through the following units: The first matching unit is used to match each field with each document; The first obtaining unit is configured to, in response to determining that there is a content fragment in the i-th document that is related to each field, regard the i-th document as a document that successfully matches each field; or The second obtaining unit is configured to, in response to determining that there is no content fragment in the i-th document that is related to each field, classify the i-th document as a document that fails to match each field. Where i is an integer greater than or equal to 1.
10. The apparatus according to claim 7, wherein, The second matching module is also used to perform relevant operations for each of the K entities through the following sub-modules: The second matching submodule is used to match each entity with the N documents; The third obtaining submodule is used to obtain at least one second sub-association relationship for each entity based on at least one document that successfully matches each entity among the N documents, wherein the second sub-association relationship of each entity is the association relationship between the entity and one document among the N documents; as well as The fourth submodule is used to obtain the second association relationship of each entity based on at least one second sub-association relationship of each entity.
11. The apparatus according to claim 10, wherein, The second matching module is further configured to perform relevant operations for each of the N documents through the following units: The second matching unit is used to match each entity with each document; The third obtaining unit is configured to, in response to determining that a content fragment related to the name of each entity exists in the j-th document, regard the j-th document as a document that successfully matches each entity; or The fourth obtaining unit is configured to, in response to determining that there is no content fragment in the j-th document related to the name of each entity, classify the j-th document as a document that fails to match each entity. Where j is an integer greater than or equal to 1.
12. A data query device, comprising: The second acquisition module is used to acquire the target lifecycle information of the target entity, wherein the target lifecycle information includes H fields, where H is an integer greater than or equal to 1; The query module is used to query the H fields in the knowledge graph to obtain at least one document that is associated with the H fields. The knowledge graph is constructed using the apparatus according to any one of claims 7 to 11.
13. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1 to 6.
14. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 6.
15. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1 to 6.
Citation Information
Patent Citations
Information pushing method and device and electronic equipment
CN112883248A
Knowledge graph construction method and device
CN113342990A