A data management method based on knowledge graph, related equipment and medium

Through the data management method based on knowledge graphs, the relationship map between resource data is constructed, which solves the complex problem of ER relationship modeling design in the existing technology, and improves the efficiency and flexibility of data management.

CN113934729BActive Publication Date: 2025-03-25PINGAN INT SMART CITY TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111224839.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-20
Publication Date
2025-03-25
Estimated Expiration
2041-10-20

AI Technical Summary

Technical Problem

In the data management, the ER relationship modeling design is too complex, so it is impossible to design a complete and scalable ER relationship model in advance, which makes the data management less efficient.

Method used

Using a data management method based on knowledge graph, we use resource data and its metadata to construct triple data, and build target knowledge graphs based on user query instructions to show the relationship between resource data.

Benefits of technology

This method does not require designing relationship tables in advance, simplifies the data management process, improves data management efficiency, and makes data management more flexible and scalable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113934729B_ABST
    Figure CN113934729B_ABST
Patent Text Reader

Abstract

The embodiment of the present application discloses a data management method based on a knowledge graph, related equipment and medium, and relates to the field of big data technology. The method may include: obtaining multiple resource data, and obtaining at least one metadata corresponding to each resource data, and constructing at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; receiving a data query instruction submitted by a user client, and querying the triple data set to be queried indicated by the data query instruction; determining the entities and relationships corresponding to each triple data according to each triple data in the triple data set, and constructing a target knowledge graph for the data query instruction according to the entities and relationships. The embodiment of this method helps to improve the efficiency of data management. The present invention relates to blockchain technology, such as data can be written into a blockchain for use in scenarios such as data forensics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of big data technology, and in particular to a data management method, related equipment and medium based on knowledge graph. Background Art

[0002] With the advent of the big data era, data management is becoming more and more important in life. Various data play an important role in the business management process, and the amount of data is getting larger and larger. The goal is to manage data mainly based on relational databases to store data. Relational tables are designed for data in advance according to the three paradigms of the database, and entity-relationship diagrams (ER diagrams) are modeled. In practice, it is found that due to the complexity of ER relationship modeling design, it is impossible to design a complete and scalable ER relationship model in advance, which makes subsequent use and changes difficult, making data management inefficient. Therefore, how to improve the efficiency of data management has become an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present application provide a data management method, related equipment and medium based on a knowledge graph, which help to improve the efficiency of data management.

[0004] On the one hand, an embodiment of the present application discloses a data management method based on a knowledge graph, the method comprising:

[0005] Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data, each metadata including a metadata item and metadata content corresponding to the metadata item;

[0006] Construct at least one triplet of data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item;

[0007] receiving a data query instruction submitted by a user client, and querying the at least one triple data set to be queried indicated by the data query instruction;

[0008] According to each triple data in the triple data set, the entities and relationships corresponding to each triple data are determined, and a target knowledge graph for the data query instruction is constructed according to the entities and the relationships.

[0009] On the other hand, an embodiment of the present application discloses a data management device based on a knowledge graph, the device comprising:

[0010] An acquisition unit, configured to acquire a plurality of resource data and acquire at least one metadata corresponding to each resource data in the plurality of resource data, wherein each metadata includes a metadata item and metadata content corresponding to the metadata item;

[0011] A processing unit, configured to construct at least one triplet of data for each resource data according to each resource data, a metadata item corresponding to each metadata, and metadata content corresponding to the metadata item;

[0012] A receiving unit, configured to receive a data query instruction submitted by a user client, and query the at least one triple data set to be queried indicated by the data query instruction;

[0013] The processing unit is also used to determine the entities and relationships corresponding to each triple data in the triple data set, and to construct a target knowledge graph for the data query instruction based on the entities and the relationships.

[0014] In another aspect, an embodiment of the present application provides an electronic device, the electronic device comprising a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to perform the following steps:

[0015] Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data, each metadata including a metadata item and metadata content corresponding to the metadata item;

[0016] Construct at least one triplet of data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item;

[0017] Receiving a data query instruction submitted by a user client, and querying the at least one triple data set to be queried indicated by the data query instruction;

[0018] The entities and relationships corresponding to each triple data in the triple data set are determined, and a target knowledge graph for the data query instruction is constructed based on the entities and the relationships.

[0019] In another aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the computer program instructions are used to perform the following steps:

[0020] Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data, each metadata including a metadata item and metadata content corresponding to the metadata item;

[0021] Construct at least one triplet of data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item;

[0022] Receiving a data query instruction submitted by a user client, and querying the at least one triple data set to be queried indicated by the data query instruction;

[0023] The entities and relationships corresponding to each triple data in the triple data set are determined, and a target knowledge graph for the data query instruction is constructed based on the entities and the relationships.

[0024] In another aspect, the present application discloses a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the above-mentioned data management method based on the knowledge graph.

[0025] In the embodiment of the present application, the data management device can obtain multiple resource data, and obtain at least one metadata corresponding to each resource data in the multiple resource data, and construct at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; receive the data query instruction submitted by the user client, and query the triple data set to be queried indicated by the data query instruction from at least one triple data; determine the entities and relationships corresponding to each triple data according to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction according to the entities and relationships. Thus, the management of data is achieved by constructing a knowledge graph based on metadata to display the relationship between each resource data, which helps to improve the efficiency of data management. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0027] Figure 1 It is a schematic diagram of the effect of a data management system based on a knowledge graph provided in an embodiment of the present application;

[0028] Figure 2 It is a flowchart of a data management method based on a knowledge graph provided in an embodiment of the present application;

[0029] Figure 3 This is a schematic diagram of the effect of a knowledge graph provided in an embodiment of the present application;

[0030] Figure 4 This is a schematic diagram of the effect of a knowledge graph provided in an embodiment of the present application;

[0031] Figure 5 This is a schematic diagram of the effect of a knowledge graph provided in an embodiment of the present application;

[0032] Figure 6 This is a schematic diagram of the effect of a knowledge graph provided in an embodiment of the present application;

[0033] Figure 7 It is a flowchart of another data management method based on knowledge graph provided in an embodiment of the present application;

[0034] Figure 8 This is a schematic diagram of the effect of a target knowledge graph display interface provided in an embodiment of the present application;

[0035] Fig. 9 It is a structural schematic diagram of a data management device based on a knowledge graph provided in an embodiment of the present application;

[0036] Fig.10 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0038] The present application provides a data management solution based on a knowledge graph, which can obtain multiple resource data and at least one metadata corresponding to each resource data in the multiple resource data, and construct at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; receive a data query instruction submitted by a user client, and query the triple data set to be queried indicated by the data query instruction from at least one triple data; determine the entities and relationships corresponding to each triple data according to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction according to the entities and relationships. This solution realizes the management of metadata by constructing a knowledge graph based on metadata to display the relationship between each resource data, without the need to design a relationship table for metadata in advance and model an entity-relationship diagram (ER diagram), thereby helping to improve the efficiency of metadata management.

[0039] The metadata in this application, also known as intermediary data or relay data, is data about data, mainly information describing data properties, and is used to support functions such as indicating storage location, historical data, resource search, and file records.

[0040] The technical solution of the present application can be used in an electronic device, which can be a terminal, a server, or other devices for determining strategies based on knowledge graphs, which is not limited by the present application. The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld devices or portable devices, tablet devices, multi-processor systems, microprocessor-based systems, set-top boxes, programmable consumer electronic devices, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0041] In a possible implementation, the technical solution of the present application can be applied to a data management system based on a knowledge graph, see Figure 1 , Figure 1It is a schematic diagram of the effect of a data management system based on a knowledge graph provided in an embodiment of the present application. The data management system based on the knowledge graph may include the above-mentioned electronic device and a user client. The electronic device can be used to obtain multiple resource data and at least one metadata corresponding to each resource data, and construct corresponding triple data according to at least one metadata; it is also used to obtain a triple data set when receiving a data query instruction submitted by a user client, and construct a corresponding target knowledge graph according to the triple data set, and can return the constructed target knowledge graph to the user client so that the user client can display the target knowledge graph. The user client can be used to submit a data query instruction to the above-mentioned electronic device in response to a data query operation of a target object, and receive the target knowledge graph returned by the electronic device to display the target knowledge graph. Thus, the management of metadata is achieved by displaying the relationship between each resource data through the knowledge graph, which helps to improve the efficiency of data management.

[0042] Based on the above description, the present application embodiment proposes a data management method based on knowledge graph. Figure 2 , Figure 2 1 is a flow chart of a data management method based on a knowledge graph provided in an embodiment of the present application. The method can be executed by the electronic device mentioned above. The method can include steps S201-S204.

[0043] S201: Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data.

[0044] The resource data may be data generated during business, technical implementation, management, etc., such as some documents, data tables, documents, etc., which are not limited here. The metadata corresponding to the resource data may be data used to describe the resource data, and each resource data corresponds to at least one metadata.

[0045] Each metadata includes a metadata item and metadata content corresponding to the metadata item. That is to say, a metadata can be composed of a metadata item and metadata content. For example, to obtain at least one metadata corresponding to a table data, the at least one metadata corresponding to the table data can be {creator: Zhang San; creation date: 2021-xx-xx; fields: F1, F2, F3; storage address: C:\oracle}, then in the at least one metadata corresponding to the table data, "creator", "creation date", "field", and "storage address" can all be referred to as metadata items of the corresponding metadata, and "Zhang San", "2021-xx-xx", "F1", "F2", "F3", and "C:\oracle" are referred to as metadata contents corresponding to the corresponding metadata items. Optionally, there may be multiple metadata contents corresponding to the same metadata item.

[0046] In a possible implementation manner, at least one metadata corresponding to each resource data has a corresponding metadata type, and the metadata type may be technical metadata, business metadata, or management metadata.

[0047] Among them, the technical metadata is data used to describe the concepts, relationships, and rules related to resource data in the technical field, mainly including feature descriptions of data structure and data processing. Common technical metadata include: fields, storage locations, data models, database tables, field lengths, ETL scripts, SQL scripts, interface programs, data relationships, etc.; business metadata is data used to describe the concepts, relationships, and rules related to resource data in the business field. Common business metadata include: business definitions, business terms, business rules, business indicators, etc.; management metadata is data used to describe the concepts, relationships, and rules related to resource data in the management field. Common management metadata include: data owners, data quality responsibilities, data security levels, etc.

[0048] In a possible implementation, at least one metadata corresponding to each resource data is obtained, and the acquisition can be performed based on a pre-constructed target metadata acquisition scheme. The target metadata acquisition scheme can be used to indicate which resource data metadata is obtained, and can also indicate which metadata items correspond to metadata, and can also be used to obtain metadata from which data sources or databases, without limitation here. Optionally, when constructing a metadata acquisition scheme, an initial metadata acquisition scheme can be constructed according to metadata requirements, and the initial metadata acquisition scheme can be submitted to the review client for review. If the review is passed, the initial metadata acquisition scheme is used as the target metadata acquisition scheme. If the review is not passed, the initial metadata is adjusted and submitted for review again until the review is passed, and the initial metadata acquisition scheme is used as the target metadata acquisition scheme. Optionally, when obtaining at least one metadata corresponding to each resource data according to the target metadata acquisition scheme, the multiple metadata can be manually collected according to the target metadata acquisition scheme, or the multiple metadata can be automatically obtained from the data source indicated by the target metadata acquisition scheme through an API or other interface. In some scenarios, when the multiple metadata are automatically obtained from the data source indicated by the target metadata acquisition solution through an API or other interface, the multiple metadata can be obtained once every certain period of time to update the obtained metadata and maintain the real-time nature of the obtained metadata.

[0049] S202: Construct at least one triplet of data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item.

[0050] The triple data may include a first entity, a relationship, and a second entity. The triple data may be represented as {first entity, relationship, second entity}. In some scenarios, the triple data may also be represented as {entity, attribute, attribute value}. This is not limited here.

[0051] In a possible implementation, at least one triple data for each resource data is constructed according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item, including the following steps: determining each resource data as a first entity, and determining the metadata content corresponding to the metadata item as a second entity, and determining the relationship between the first entity and the second entity according to the metadata item corresponding to each metadata; constructing at least one triple data for each resource data according to the first entity, the second entity, and the relationship between the first entity and the second entity.

[0052] Wherein, each resource data is determined as a first entity, and the first entity can be represented by a unique code or data name corresponding to the resource data; the metadata content corresponding to the metadata item is determined as a second entity, and the second entity can be represented by a unique code or content text corresponding to the metadata content; the relationship between the first entity and the second entity is determined according to the metadata item corresponding to each metadata, and the relationship between the first entity and the second entity can be represented by a unique code or project name corresponding to the metadata item. The unique code can be a unique code corresponding to each resource data, metadata item, and metadata content, and the code can be composed of numbers, letters, or characters, which is not limited here. The data name can be the name corresponding to the resource data; the content text is the text corresponding to the metadata content in the metadata; the project name is the name corresponding to the metadata item in the metadata.

[0053] For example, the name of the resource data is "2021 Employee Information Statistics Table", and in at least one metadata corresponding to the resource data "2021 Employee Information Statistics Table", there is a metadata item with the item name "Storage Address", and the metadata content of the metadata item "Storage Address" is "C:\oracle", then the first entity can be expressed as "2021 Employee Information Statistics Table", the second entity can be expressed as "C:\oracle", and the relationship between the first entity and the second entity can be expressed as "storage address", and the resulting triple data for the resource data "2021 Employee Information Statistics Table" is {2021 Employee Information Statistics Table, storage address, C:\oracle"}.

[0054] It is understandable that for each metadata of each resource data, a triple data can be constructed, in which the first entity is the resource data, the second entity is the metadata content of the metadata, and the relationship is the metadata item of the metadata. Thus, at least one triple data corresponding to each resource data can be obtained.

[0055] In a possible implementation, if the triple data is constructed based on the metadata items of resource data, technical metadata, and the metadata content corresponding to the metadata items of technical metadata, that is, the triple data is constructed based on the resource data and the technical metadata of the resource data, then the triple data is technical triple data. If the triple data is constructed based on the metadata items of resource data, business metadata, and the metadata content corresponding to the metadata items of business metadata, that is, the triple data is constructed based on the resource data and the business metadata of the resource data, then the triple data is business triple data. If the triple data is constructed based on the metadata items of resource data, management metadata, and the metadata content corresponding to the metadata items of management metadata, that is, the triple data is constructed based on the resource data and the management metadata of the resource data, then the triple data is management triple data. In this way, different categories of triple data such as technical triple data, business triple data, and management triple data can be obtained, so that a triple data set can be obtained according to the category of the triple data later.

[0056] In a possible implementation, after obtaining at least one triple data for each resource object, the at least one triple data of each resource object can be stored in the blockchain, that is, the at least one triple data of each resource object is processed on the blockchain. Among them, the at least one triple data of each resource object can be processed on the blockchain in the form of content evidence, hash evidence, link evidence, privacy evidence, shared privacy evidence, etc., which are not limited here. In this way, the security of the data can be improved and the data can be prevented from being tampered with.

[0057] S203: Receive a data query instruction submitted by a user client, and query a set of triple data to be queried indicated by the data query instruction from at least one triple data.

[0058] The user client is any client that submits a data query instruction. The user client is logged in to an account corresponding to the target object. The user client can submit a data query instruction to the electronic device in response to a data query operation of the target object. The data query operation can be a touch operation on a control for indicating a query for a triple data set, or a voice instruction for indicating a query for a triple data set, which is not limited here.

[0059] The data query instruction may be an instruction for querying a set of triple data to be queried, and the set of triple data to be queried is a set of at least one triple data that needs to be queried as indicated by the data query instruction.

[0060] In a possible implementation, the query data query instruction carries identification information for indicating the set of triple data to be queried. The identification information can be used to indicate which triple data each triple data in the set of triple data to be queried is. When querying the set of triple data to be queried indicated by the data query instruction from at least one triple data, at least one triple data indicated by the identification information can be obtained from the at least one triple data. For example, the identification information can identify the category of each triple data in the triple data set to be queried. For example, if the category of the triple data is technical triple data, business triple data, and management triple data, then a triple data set belonging to the category of the triple data indicated by the identification information can be queried from at least one triple data; for another example, the identification information can also identify the type of resource data corresponding to the first entity in each triple data in the triple data set to be queried. If the type of the resource data is a receipt, a form, a document, etc., then a triple data set corresponding to the type of resource data indicated by the identification information can be queried from at least one triple data. The identification information can also identify other information, which is not limited here.

[0061] In a possible implementation, the data query refers to carrying the permission information of the target object and the identification information used to indicate the set of triple data to be queried. Then querying the set of triple data to be queried indicated by the data query instruction from at least one triple data may include the following steps: detecting whether the permission information of the target object carried by the data query instruction indicates that the target object has the permission to query the set of triple data indicated by the identification information; if the detection result is that the permission information indicates that the target object has the permission to query the set of triple data indicated by the identification information, then querying the set of triple data to be queried indicated by the data query instruction from at least one triple data. Among them, the target object is the object corresponding to the account logged in in the user client, and the target object has corresponding permission information, which is used to indicate which triple data the target object has the permission to query, that is, which triple data the target object can query. The detection result is the result obtained by detecting whether the permission information of the target object carried by the data query instruction indicates that the target object has the permission to query the triple data set indicated by the identification information. The detection result can be that the permission information indicates that the target object has the permission to query the triple data set indicated by the identification information, or the permission information indicates that the target object does not have the permission to query the triple data set indicated by the identification information. If the detection result is that the permission information indicates that the target object has the permission to query the triple data set indicated by the identification information, then the triple data set to be queried indicated by the data query instruction is queried from at least one triple data, that is, the triple data set indicated by the identification information is queried from at least one triple data.

[0062] Optionally, if the detection result is that the permission information indicates that the target object does not have the permission to query the triple data set indicated by the query identification information, a prompt message can be generated and sent to the user client corresponding to the target object to prompt that the target object does not have the query permission. The prompt message can be text information that prompts the target object that does not have the query permission. This can prevent the triple data set from being obtained by an object that does not have permission, improve the privacy and security of the data, and avoid data leakage.

[0063] Optionally, the permission information can be determined according to the object group to which the target object belongs. The object group can be divided according to the object's responsibilities, positions, departments and other information. There can be at least one object under each object group, and each object group has corresponding permission information. Therefore, the permission information of the target object can be determined by determining the object group to which the target object belongs, and determining the permission information corresponding to the object group to which the target object belongs as the permission information of the target object.

[0064] S204. Determine the entities and relationships corresponding to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction based on the entities and relationships.

[0065] The entity may include the first entity and the second entity in each triple data in the triple data set, and the relationship may be a relationship in each triple data in the triple data set. The target knowledge graph may be a knowledge graph formed according to each triple data in the queried triple data set, and the target knowledge graph includes a plurality of vertices and edges connecting the plurality of vertices. For example, the first entity and the second entity in the triple data may be determined as corresponding vertices, and the relationship in the triple data may be determined as an edge between the vertices corresponding to the first entity and the second entity in the triple data.

[0066] In a possible implementation, determining entities and relationships corresponding to each triple data in a triple data set, and constructing a target knowledge graph for a data query instruction based on the entities and relationships, may include the following steps: determining the first entity in each triple data in the triple data set as a first vertex, and determining the second entity in each triple data in the triple data set as a second vertex; determining an edge between a first vertex and a second vertex based on a relationship between the first entity and the second entity in each triple data in the triple data set; merging the same vertices in the first vertex and the second vertex to obtain a first target vertex; and constructing a target knowledge graph for the data query instruction based on the first vertex, the second vertex, the first target vertex, and the edges between each vertex.

[0067] Among them, the first vertex is a vertex determined according to the first entity in the triple data, the second vertex is a vertex determined according to the second entity in the triple data, and the edge between the first vertex and the second vertex can be determined according to the relationship in the corresponding triple data. It can be understood that each triple data in the triple data set has a corresponding first vertex, a second vertex and an edge, that is, if the triple data set includes multiple triple data, the triple data set corresponds to multiple first vertices, each first vertex corresponds to a second vertex (i.e., multiple second vertices), and an edge between each first vertex and the corresponding second vertex (i.e., multiple edges).

[0068] The first target vertex is obtained by merging the same vertices between each first vertex and each second vertex corresponding to the triple data set. That is, if the first vertex corresponding to a triple data set is the same as the second vertex corresponding to another triple data set, the first vertex can be merged with the second vertex corresponding to the other triple data set. The merging of the same vertices can be to merge the same vertices into the same vertex in the knowledge graph. Therefore, by merging the same vertices in the first vertex and the second vertex, the various resource data can be associated, which is conducive to determining the relationship between the various resource data.

[0069] For example, see Figure 3 , Figure 3 It is a schematic diagram of the effect of a knowledge graph provided by an embodiment of the present application. If there is a triple data A{document A, upstream document, document B} and another triple data B{document B, creator, Zhang San}, the first entity "document A" in the triple data A is determined as a first vertex, the second entity "document B" in the triple data A is determined as the second vertex corresponding to the first vertex, and the relationship "upstream document" in the triple data A is determined as the relationship between the first vertex and the second vertex corresponding to the first vertex; the first entity "table B" in the triple data B is determined as another first vertex, the second entity "Zhang San" in the triple data B is determined as the second vertex corresponding to the other first vertex, and the relationship "creator" in the triple data B is determined as the relationship between the other first vertex and the second vertex corresponding to the other first vertex. It can be seen that the second vertex corresponding to the second entity of triple data A and the first vertex corresponding to the first entity of triple data B are both "Document B". Then the same vertices corresponding to the two triple data can be merged to obtain the first target vertex, that is, the knowledge graph including triple data A and triple data B can be obtained as follows Figure 3 As shown, Figure 3 301 in the figure is the first target vertex after the merging process.

[0070] In a possible implementation, entities and relationships corresponding to each triple data in a triple data set are determined, and a target knowledge graph for data query instructions is constructed based on the entities and relationships. The following steps may also be included: determining the first entity in each triple data in the triple data set as the first vertex, and determining the second entity in each triple data in the triple data set as the second vertex; determining the edge between the first vertex and the second vertex based on the relationship between the first entity and the second entity in each triple data in the triple data set; merging the same vertices in each second vertices to obtain a second target vertex; and constructing a target knowledge graph for the data query instruction based on the first vertex, the second vertex, the second target vertex, and the edges between each vertex.

[0071] The descriptions of the first vertex and the second vertex are the same as the above descriptions of the first vertex and the second vertex, and are not repeated here.

[0072] The second target vertex is obtained by merging the same vertices between the second vertices corresponding to the triple data set. That is, if the second vertex corresponding to one triple data is the same as the second vertex corresponding to another triple data, the two second vertices can be merged. By merging the same vertices among the second vertices, the metadata content of each resource data can be associated, which is conducive to determining the relationship between the attributes of each resource data.

[0073] For example, see Figure 4 , Figure 4 It is a schematic diagram of the effect of a knowledge graph provided by an embodiment of the present application. If there is a triple data C {document A, creator, Zhang San} and another triple data D {document B, creator, Zhang San}, the first entity "document A" in the triple data C is determined as a first vertex, the second entity "Zhang San" in the triple data C is determined as the second vertex corresponding to the first vertex, and the relationship "creator" in the triple data C is determined as the relationship between the first vertex and the second vertex corresponding to the first vertex; the first entity "document B" in the triple data D is determined as another first vertex, the second entity "Zhang San" in the triple data D is determined as the second vertex corresponding to the other first vertex, and the relationship "creator" in the triple data D is determined as the relationship between the other first vertex and the second vertex corresponding to the other first vertex. It can be seen that the second vertex corresponding to the second entity of triple data C and the second vertex corresponding to the second entity of triple data D are both "Zhang San". Then the same second vertices corresponding to the two triple data can be merged to obtain the second target vertex, that is, the knowledge graph including triple data C and triple data D can be obtained as follows Figure 4 As shown, Figure 4 401 in the figure is the second target vertex after the merging process.

[0074] In a possible implementation, the entities and relationships corresponding to each triple data in the triple data set are determined, and a target knowledge graph for the data query instruction is constructed based on the entities and relationships. The following steps may also be included: determining the first entity in each triple data in the triple data set as the first vertex, and determining the second entity in each triple data in the triple data set as the second vertex; determining the edge between the first vertex and the second vertex based on the relationship between the first entity and the second entity in each triple data in the triple data set; merging the same vertices in each first vertices to obtain a third target vertex; and constructing a target knowledge graph for the data query instruction based on the first vertex, the second vertex, the third target vertex, and the edges between each vertex.

[0075] The descriptions of the first vertex and the second vertex are the same as the above descriptions of the first vertex and the second vertex, and are not repeated here.

[0076] The third target vertex is obtained by merging the same vertices between the first vertices corresponding to the triple data set. That is, if the first vertex corresponding to one triple data set is the same as the first vertex corresponding to another triple data set, the two first vertices can be merged. By merging the same vertices among the first vertices, it is possible to avoid the existence of multiple first vertices corresponding to the same resource data in the obtained knowledge graph.

[0077] For example, see Figure 5 , Figure 5It is a schematic diagram of the effect of a knowledge graph provided by an embodiment of the present application. If there is a triple data E{document A, storage address, C:\oracle} and another triple data F{document A, creator, Zhang San}, the first entity "document A" in the triple data E is determined as a first vertex, the second entity "C:\oracle" in the triple data E is determined as the second vertex corresponding to the first vertex, and the relationship "storage address" in the triple data E is determined as the relationship between the first vertex and the second vertex corresponding to the first vertex; the first entity "document A" in the triple data F is determined as another first vertex, the second entity "Zhang San" in the triple data F is determined as the second vertex corresponding to the other first vertex, and the relationship "creator" in the triple data F is determined as the relationship between the other first vertex and the second vertex corresponding to the other first vertex. It can be seen that the first vertex corresponding to the first entity of triple data E and the first vertex corresponding to an entity of triple data F are both "Document A". Then the same first vertices corresponding to the two triple data can be merged to obtain the third target vertex, that is, the knowledge graph including triple data E and triple data F can be obtained as follows Figure 5 As shown, Figure 5 501 in the figure is the third target vertex after the merging process.

[0078] In a possible implementation, after obtaining the first vertex, the second vertex, and the edge between the first vertex and the second vertex in each triple data in the triple data set, the first target vertex, the second target vertex, and the third target vertex can also be obtained, and then the target knowledge graph for the data query instruction can be constructed according to the first vertex, the second vertex, the first target vertex, the second target vertex, the third target vertex, and the edges between each vertex. In other words, the same vertices in multiple vertices (including each first vertex and each second vertex) corresponding to each triple data in the triple data set can be merged at the same time. Optionally, the first target vertex and the second target vertex can also be obtained, or the first target vertex and the third target vertex can be obtained, or the second target vertex and the third target vertex can be obtained, and there is no limitation here.

[0079] For example, see Figure 6 , Figure 6This is a schematic diagram of the effect of a knowledge graph provided by an embodiment of the present application. If there is a triple data A{document A, upstream document, document B}, triple data B{document B, creator, Zhang San}, triple data C{document A, creator, Zhang San}, triple data E{document A, storage address, C:\oracle}, if the first target vertex, the second target vertex and the third target vertex in the above multiple triple data are obtained, and then the target knowledge graph for the data query instruction is constructed according to each first vertex, second vertex, first target vertex, second target vertex, third target vertex and the edges between each vertex, such as Figure 6 As shown, Figure 6 601 is a first target vertex, 602 is a second target vertex, and 603 is a third target vertex.

[0080] It can be understood that the first entity in each triple data in the triple data set is determined as the first vertex, and the second entity in each triple data in the triple data set is determined as the second vertex, and based on the relationship between the first entity and the second entity in each triple data in the triple data set, the edge between the first vertex and the second vertex is determined, which is equivalent to, for each resource data, determining the resource data as the first vertex, determining the metadata content of the metadata corresponding to the resource data as the second vertex, and determining the metadata item of the metadata corresponding to the resource data as the edge between the first vertex and the second vertex.

[0081] By adopting the embodiment of the present application, it is possible to obtain multiple resource data and at least one metadata corresponding to each resource data in the multiple resource data, and to construct at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; receive a data query instruction submitted by a user client, and query the triple data set to be queried indicated by the data query instruction from at least one triple data; determine the entities and relationships corresponding to each triple data according to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction according to the entities and relationships. Thus, data management is achieved by constructing a knowledge graph based on metadata to display the relationship between each resource data, which helps to improve the efficiency of data management.

[0082] See also Figure 7 , Figure 7 It is a flow chart of another data management method based on knowledge graph provided in an embodiment of the present application, which can be executed by the above electronic device. The method may include the following steps.

[0083] S701: Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data.

[0084] For the description of step S701, reference may be made to the description of step S201, which will not be repeated here.

[0085] In a possible implementation, if the resource data includes first resource data and second resource data, the embodiment of the present application may also include obtaining a data source identifier carried in the first resource data, the data source identifier is used to indicate the acquisition location of the data in the first resource data; when the data source identifier is used to indicate the data in the second resource data, the first metadata corresponding to the data source identifier is determined from at least one metadata corresponding to the first resource data. In this way, the metadata used to indicate the source of the data in each resource data can be obtained, so as to facilitate the subsequent tracing of each resource data.

[0086] The first resource data may be any resource data among the multiple resource data obtained, the second resource data may be any resource data among the multiple resource data obtained except the first resource data, and the data in the second resource data is the data source of the first resource data. The data source identifier is used to indicate the acquisition location of the data in the first resource data. If the acquisition location of part of the data in the first resource data is the second resource data, the data source identifier of the first resource data may indicate the data in the second resource data, that is, part of the data in the first resource data is derived from the data in the second resource data.

[0087] The first metadata is the metadata of the object with the data source identification in at least one metadata corresponding to the first resource data. The metadata of the object with the data source identification can be the metadata content of the metadata corresponding to the data source identification. If the data source identification is used to indicate the data in the second resource data, the metadata content of the first metadata is the second resource data. Then, the metadata content including the metadata of the second resource data is determined from at least one resource data of the first resource data as the first metadata for the first resource data. Optionally, it can also be determined from at least one metadata corresponding to the first resource data that the metadata content includes the second resource data, and the project name of the metadata project is used to indicate the metadata of the data source. As the first metadata for the first resource data, the project name used to indicate the data source can be "data source", "data acquisition source", "upstream data", etc., which is not limited here. For example, the data source identification of table S is used to indicate the data in table R, then the first metadata corresponding to the data source identification is determined from at least one metadata corresponding to table S, and the first metadata is {data source, table R}.

[0088] Optionally, if the data source identifier carried by the first resource data is empty or the first resource data does not carry the data source identifier, it can indicate that the data in the first resource data does not come from other resource data, and thus there is no need to determine the first metadata corresponding to the first resource data.

[0089] Optionally, the present application may also directly determine the metadata of the project name used to indicate the data source from at least one metadata of the resource data as the first metadata, such as the project name is "data source", "data acquisition source", "upstream data", etc., which is not limited here. That is, the corresponding first metadata is not determined by the data source identifier, but directly determined according to the metadata item of at least one metadata of the first resource data.

[0090] In a possible implementation, the resource data includes first table-type resource data and second table-type resource data, and the embodiment of the present application may further include, when it is detected that both the first table-type resource data and the second table-type resource data include a target field, obtaining second metadata corresponding to the target field from at least one metadata corresponding to the first table-type resource data, and obtaining third metadata corresponding to the target field from at least one metadata corresponding to the second table-type resource data. Thus, by determining the same fields among the fields included in each table-type resource data, it is possible to facilitate the subsequent determination of the data relationship of each field of each table-type resource data.

[0091] The first table resource data may be any table resource data among the multiple resource data obtained, the second table resource data may be any table resource data among the multiple resource data obtained except the first table resource data, and both the first table resource data and the second table resource data include the target field. The table resource data may be table resource data, which includes multiple fields. Usually, each column of data in each table resource data may correspond to a field. For example, in a table resource data, each column of data is used to represent "staff name", "position", "age" and "gender", then "user name", "position", "age" and "gender" may represent a field respectively.

[0092] The target field is the same field in the first table resource data and the second table resource data. The second metadata is the metadata corresponding to the target field in at least one metadata corresponding to the first table resource data. The third metadata is the metadata corresponding to the target field in at least one metadata corresponding to the second table resource data. The metadata corresponding to the target field can be metadata whose metadata content is the field name or unique field code of the target field, and the metadata content of the second metadata and the third metadata are both the field name or unique field code of the target field. Optionally, it can also be determined from at least one metadata of the first table resource data that the metadata content includes the target field, and the item name of the metadata item is used to represent the metadata of the field information, as the above-mentioned second metadata for the first table resource data, and it can be determined from at least one metadata of the second table resource data that the metadata content includes the target field, and the item name of the metadata item is used to represent the metadata of the field information, as the above-mentioned third metadata for the second table resource data. The item name used to represent the field information can be "field information", "field type", "contained fields", etc., which are not limited here. For example, table S includes the field "staff name" and table R also includes the field "staff name", then the second metadata {field, staff name} corresponding to the field "staff name" is determined from at least one metadata corresponding to table S, and the third metadata {field, staff name} corresponding to the field "staff name" is determined from at least one metadata corresponding to table R.

[0093] S702: Determine each resource data as a first entity, determine metadata content corresponding to the metadata item as a second entity, and determine a relationship between the first entity and the second entity according to the metadata item corresponding to each metadata.

[0094] S703: Construct at least one triple data for each resource data according to the first entity, the second entity, and the relationship between the first entity and the second entity.

[0095] Among them, for the relevant description of steps S702-S703, reference can be made to the relevant description of steps S202-203, and no further details are given here.

[0096] In a possible implementation, for the first metadata of the first resource data, the first resource data is determined as the first entity, the metadata content in the first metadata is determined as the second entity, and the relationship is determined according to the metadata items in the first metadata, thereby obtaining triple data corresponding to the first metadata. For the second resource data, the second resource data can be determined as the first entity in the triple data corresponding to any metadata corresponding to the second resource data. For example, if the first metadata for table S is {data source, table R}, then the triple data corresponding to the first metadata is {table S, data source, table R}. For table R, table R can be determined as the first entity in the triple data corresponding to any metadata corresponding to table R.

[0097] In a possible implementation, corresponding triple data can be constructed for the second metadata of the first table-type resource data, and corresponding triple data can be constructed for the third metadata of the second table-type resource data. Specifically, the first table-type resource data is determined as the first entity, the metadata content in the second metadata is determined as the second entity, and the relationship is determined according to the metadata items in the second metadata, thereby obtaining the triple data corresponding to the second metadata. The second table-type resource data is determined as the first entity, the metadata content in the third metadata is determined as the second entity, and the relationship is determined according to the metadata items in the first metadata, thereby obtaining the triple data corresponding to the third metadata. For example, the second metadata corresponding to table S is {field, staff name}, then the triple data corresponding to the second metadata corresponding to table S is {table S, field, staff name}, and the third metadata corresponding to table R is {field, staff name}, then the triple data corresponding to the third metadata corresponding to table S is {table R, field, staff name}.

[0098] S704: Receive a data query instruction submitted by a user client, and query a set of triple data to be queried indicated by the data query instruction from at least one triple data.

[0099] S705. Determine the entities and relationships corresponding to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction based on the entities and relationships.

[0100] Among them, the relevant description of steps S704-S705 can refer to the relevant description of steps S203-S204, and will not be repeated here.

[0101] In a possible implementation, the corresponding first metadata is determined for the above-mentioned first resource data, and the metadata content of the first metadata is the second resource data. Then, the first entity corresponding to the second resource data can be determined as the corresponding first vertex, and the second entity corresponding to the metadata content included in the first metadata can be determined as the corresponding second vertex. In addition, the first entity corresponding to the first resource data included in the first metadata can be determined as another first vertex, and the edge between the first vertex and the second vertex corresponding to the first metadata can be determined based on the relationship in the first metadata.

[0102] Then, the same vertices in the first vertex and the second vertex are merged to obtain the first target vertex, which can be the first vertex corresponding to the second resource data and the second vertex corresponding to the first metadata. Merge the first vertex corresponding to the second resource data and the second vertex corresponding to the first metadata to obtain the first target vertex. In this way, an edge can be established between the vertex corresponding to the first resource data and the vertex corresponding to the second resource data. The relationship between the first resource data and the second resource object is that the data source of the first resource data is the second resource object. If the above operation is performed for each resource object, the data source of each resource data can be determined and reflected in the knowledge graph, thereby realizing the traceability of the data in the resource data.

[0103] In a possible implementation, the corresponding second metadata is determined for the above-mentioned first table-type resource data, and the corresponding third metadata is determined for the second table-type resource data. The metadata content of the second metadata is the same as the metadata content of the third metadata, and the metadata content is the target field. Then, the second entity corresponding to the metadata content included in the second metadata can be determined as the corresponding second vertex, and the second entity corresponding to the metadata content included in the third metadata can be determined as another second vertex. And the first entity corresponding to the first table-type resource data included in the second metadata can be determined as a first vertex, and the edge between the first vertex and the second vertex corresponding to the second metadata is determined based on the relationship in the second metadata, and the first entity corresponding to the second table-type resource data included in the third metadata is determined as another first vertex, and the edge between the first vertex and the second vertex corresponding to the third metadata is determined based on the relationship in the third metadata.

[0104] Then, the same vertices in each second vertex are merged to obtain the second target vertex and the first target vertex. The second vertex corresponding to the second metadata and another second vertex corresponding to the third metadata are merged to obtain the second target vertex. In this way, the vertex corresponding to the target field in the first table resource data and the vertex corresponding to the target field in the second table resource data can be merged, which is conducive to discovering the association relationship between the target fields included in the first table resource and the second table resource. If the above operation is performed for each table resource object, the relationship between the fields in the data source of each resource data and the fields of other resource data can be determined and reflected in the knowledge graph, thereby realizing the discovery of the relationship between the fields in the table resource data.

[0105] In a possible implementation, after the target knowledge graph is constructed, the target knowledge graph may be returned to the user client so that the user client can display the target knowledge graph. For example, see Figure 8 , Figure 8 Schematic diagram of the effect of a target knowledge graph display interface provided by an embodiment of the present application. Figure 8 The target knowledge graph display interface shown includes a graph type selection area as shown in 801 , a search area as shown in 802 , and a knowledge graph display area as shown in 803 .

[0106] Among them, the graph type selection area can be used to select what kind of knowledge graph to obtain, such as the entire metadata graph, the business metadata graph, the technical metadata graph, and the management metadata graph. The entire metadata graph is a knowledge graph constructed based on all triple data, the business metadata graph is a knowledge graph constructed based on business triple data, the technical metadata graph is a knowledge graph constructed based on technical triple data, and the management metadata graph is a knowledge graph constructed based on management triple data. Then, when the user client detects that the corresponding control is clicked, a data query instruction can be submitted to the electronic device, and the identification information carried in the data query instruction can be used to indicate that each triple data in the triple data set to be queried is the type of the corresponding triple data. For example, if the target object clicks the control used to indicate the query of the business metadata graph, the user client submits a data query instruction to the electronic device, and the identification information carried in the data query instruction can be used to indicate that each triple data in the triple data set to be queried is a business triple data.

[0107] The graph display area may be an area for displaying a target knowledge graph sent by an electronic device. The received target knowledge graph may be displayed in the target knowledge graph area. The search area may be used to search for any vertex in the knowledge graph, so as to quickly locate the position of the searched vertex in the knowledge graph from the target knowledge graph.

[0108] By adopting the embodiment of the present application, it is possible to obtain multiple resource data and at least one metadata corresponding to each resource data in the multiple resource data, and to construct at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; receive the data query instruction submitted by the user client, and query the triple data set to be queried indicated by the data query instruction from at least one triple data; determine the entities and relationships corresponding to each triple data according to each triple data in the triple data set, and construct a target knowledge graph for the data query instruction according to the entities and relationships. In this way, data management is achieved by constructing a knowledge graph based on metadata to display the relationship between each resource data, which helps to improve the efficiency of data management.

[0109] See also Fig. 9 , Fig. 9 is a schematic diagram of the structure of a data management device based on a knowledge graph provided in an embodiment of the present application. Optionally, the data management device based on a knowledge graph can be provided in the above-mentioned electronic device. Fig. 9 As shown, the data management device based on the knowledge graph described in this embodiment may include:

[0110] The acquisition unit 901 is used to acquire multiple resource data and acquire at least one metadata corresponding to each resource data in the multiple resource data, where each metadata includes a metadata item and metadata content corresponding to the metadata item;

[0111] Processing unit 902, configured to construct at least one triplet of data for each resource data according to each resource data, a metadata item corresponding to each metadata, and metadata content corresponding to the metadata item;

[0112] The receiving unit 903 is configured to receive a data query instruction submitted by a user client, and query the at least one triple data set to be queried indicated by the data query instruction;

[0113] The processing unit 902 is also used to determine the entities and relationships corresponding to each triple data in the triple data set, and to construct a target knowledge graph for the data query instruction based on the entities and the relationships.

[0114] In one implementation, the triple data includes a first entity, a relationship, and a second entity; the processing unit 902 is specifically configured to:

[0115] Determine each resource data as a first entity, determine the metadata content corresponding to the metadata item as a second entity, and determine the relationship between the first entity and the second entity according to the metadata item corresponding to each metadata;

[0116] At least one triple data for each resource data is constructed according to the first entity, the second entity, and the relationship between the first entity and the second entity.

[0117] In one implementation, the processing unit 902 is specifically configured to:

[0118] Determine a first entity in each triple data in the triple data set as a first vertex, and determine a second entity in each triple data in the triple data set as a second vertex;

[0119] Determine an edge between the first vertex and the second vertex based on a relationship between the first entity and the second entity in each triple data in the triple data set;

[0120] Merge the same vertices among the first vertex and the second vertex to obtain a first target vertex;

[0121] The target knowledge graph for the data query instruction is constructed according to the first vertex, the second vertex, the first target vertex and the edges between the vertices.

[0122] In one implementation, the resource data includes first resource data and second resource data. The processing unit 902 is further configured to:

[0123] Obtaining a data source identifier carried in the first resource data, wherein the data source identifier is used to indicate an acquisition location of data in the first resource data;

[0124] When the data source identifier is used to indicate data in the second resource data, determining first metadata corresponding to the data source identifier from at least one metadata corresponding to the first resource data;

[0125] Determine that a first entity corresponding to the second resource data is the first vertex, and determine that a second entity corresponding to metadata content included in the first metadata is the second vertex;

[0126] The processing unit 902 is specifically used for:

[0127] The first vertex corresponding to the second resource data and the second vertex corresponding to the first metadata are merged to obtain the first target vertex.

[0128] In one implementation, the processing unit 902 is specifically configured to:

[0129] Determine a first entity in each triple data in the triple data set as a first vertex, and determine a second entity in each triple data in the triple data set as a second vertex;

[0130] Determine an edge between the first vertex and the second vertex based on a relationship between the first entity and the second entity in each triple data in the triple data set;

[0131] Merge the same vertices among the second vertices to obtain a second target vertex;

[0132] The target knowledge graph for the data query instruction is constructed according to the first vertex, the second vertex, the second target vertex and the edges between the vertices.

[0133] In one implementation, the resource data includes first table resource data and second table resource data; the processing unit 902 is further configured to:

[0134] When it is detected that both the first table resource data and the second table resource data include a target field, second metadata corresponding to the target field is obtained from at least one metadata corresponding to the first table resource data, and third metadata corresponding to the target field is obtained from at least one metadata corresponding to the second table resource data;

[0135] Determine that the second entity corresponding to the metadata content in the second metadata is a second vertex, and determine that the second entity corresponding to the metadata content in the third metadata is another second vertex;

[0136] The processing unit 902 is specifically used for:

[0137] The second vertex corresponding to the second metadata and the other second vertex corresponding to the third metadata are merged to obtain the second target vertex.

[0138] In one implementation, the data query instruction carries the permission information of the target object and the identification information for indicating the triple data set to be queried; the processing unit 902 is specifically used to:

[0139] Detecting whether the permission information of the target object carried by the data query instruction indicates that the target object has permission to query the triple data set indicated by the identification information;

[0140] If the detection result is that the permission information indicates that the target object has the permission to query the triple data set indicated by the identification information, then the triple data set to be queried indicated by the data query instruction is queried from the at least one triple data.

[0141] See also Fig.10 , Fig.10 1 is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device described in this embodiment includes: a processor 1001 and a memory 1002. Optionally, the electronic device may also include a network interface 1003 or a power supply module and other structures. The processor 1001, the memory 1002 and the network interface 1003 may exchange data.

[0142] The processor 1001 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.

[0143] The network interface 1003 may include an input device and / or an output device, for example, the input device may be a control panel, a microphone, a receiver, etc., and the output device may be a display screen, a transmitter, etc., which are not listed here. For example, in an embodiment of the application, the network interface may include a receiver and a transmitter.

[0144] The memory 1002 may include a read-only memory and a random access memory, and provide program instructions and data to the processor 1001. A portion of the memory 1002 may also include a non-volatile random access memory. When the processor 1001 calls the program instructions, it is used to execute:

[0145] Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data, each metadata including a metadata item and metadata content corresponding to the metadata item;

[0146] Construct at least one triplet of data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item;

[0147] receiving a data query instruction submitted by a user client, and querying the at least one triple data set to be queried indicated by the data query instruction;

[0148] According to each triple data in the triple data set, the entities and relationships corresponding to each triple data are determined, and a target knowledge graph for the data query instruction is constructed according to the entities and the relationships.

[0149] In one implementation, the triple data includes a first entity, a relationship, and a second entity; the processor 1001 is specifically configured to:

[0150] Determine each resource data as a first entity, determine the metadata content corresponding to the metadata item as a second entity, and determine the relationship between the first entity and the second entity according to the metadata item corresponding to each metadata;

[0151] At least one triple data for each resource data is constructed according to the first entity, the second entity, and the relationship between the first entity and the second entity.

[0152] In one implementation, the processor 1001 is specifically configured to:

[0153] Determine a first entity in each triple data in the triple data set as a first vertex, and determine a second entity in each triple data in the triple data set as a second vertex;

[0154] Determine an edge between the first vertex and the second vertex based on a relationship between the first entity and the second entity in each triple data in the triple data set;

[0155] Merge the same vertices among the first vertex and the second vertex to obtain a first target vertex;

[0156] The target knowledge graph for the data query instruction is constructed according to the first vertex, the second vertex, the first target vertex and the edges between the vertices.

[0157] In one implementation, the resource data includes first resource data and second resource data, and the processor 1001 is further configured to:

[0158] Obtaining a data source identifier carried in the first resource data, wherein the data source identifier is used to indicate an acquisition location of data in the first resource data;

[0159] When the data source identifier is used to indicate data in the second resource data, determining first metadata corresponding to the data source identifier from at least one metadata corresponding to the first resource data;

[0160] Determine that a first entity corresponding to the second resource data is the first vertex, and determine that a second entity corresponding to metadata content included in the first metadata is the second vertex;

[0161] The processor 1001 is specifically configured to:

[0162] The first vertex corresponding to the second resource data and the second vertex corresponding to the first metadata are merged to obtain the first target vertex.

[0163] In one implementation, the processor 1001 is specifically configured to:

[0164] Determine a first entity in each triple data in the triple data set as a first vertex, and determine a second entity in each triple data in the triple data set as a second vertex;

[0165] Determine an edge between the first vertex and the second vertex based on a relationship between the first entity and the second entity in each triple data in the triple data set;

[0166] Merge the same vertices among the second vertices to obtain a second target vertex;

[0167] The target knowledge graph for the data query instruction is constructed according to the first vertex, the second vertex, the second target vertex and the edges between the vertices.

[0168] In one implementation, the resource data includes first table resource data and second table resource data; the processor 1001 is further configured to:

[0169] When it is detected that both the first table resource data and the second table resource data include a target field, second metadata corresponding to the target field is obtained from at least one metadata corresponding to the first table resource data, and third metadata corresponding to the target field is obtained from at least one metadata corresponding to the second table resource data;

[0170] Determine that the second entity corresponding to the metadata content in the second metadata is a second vertex, and determine that the second entity corresponding to the metadata content in the third metadata is another second vertex;

[0171] The processor 1001 is specifically configured to:

[0172] The second vertex corresponding to the second metadata and the other second vertex corresponding to the third metadata are merged to obtain the second target vertex.

[0173] In one implementation, the data query instruction carries the permission information of the target object and the identification information for indicating the triple data set to be queried; the processor 1001 is specifically configured to:

[0174] Detecting whether the permission information of the target object carried by the data query instruction indicates that the target object has permission to query the triple data set indicated by the identification information;

[0175] If the detection result is that the permission information indicates that the target object has the permission to query the triple data set indicated by the identification information, then the triple data set to be queried indicated by the data query instruction is queried from the at least one triple data.

[0176] Optionally, when the program instructions are executed by the processor, other steps of the method in the above embodiment may also be implemented, which will not be repeated here.

[0177] The present application also provides a computer-readable storage medium, which stores a computer program. The computer program includes program instructions. When the program instructions are executed by a processor, the processor executes the above method, such as executing the method executed by the above electronic device, which is not repeated here.

[0178] Optionally, the storage medium involved in the present application, such as computer-readable storage medium, may be non-volatile or volatile.

[0179] Optionally, the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function, etc.; the data storage area may store data created according to the use of blockchain nodes, etc. Among them, the blockchain referred to in this application is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods, each of which contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. The blockchain may include the blockchain underlying platform, the platform product service layer, and the application service layer.

[0180] It should be noted that, for the above-mentioned various method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that this application is not limited by the order of the actions described, because according to this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by this application.

[0181] A person skilled in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0182] The embodiment of the present application also provides a computer program product or a computer program, which includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device performs the steps performed in the embodiments of the above methods. For example, the computer device can be a terminal, or can be a server.

[0183] The above is a detailed introduction to a data management method based on a knowledge graph, related equipment and media provided in an embodiment of the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of ​​the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A data management method based on knowledge graph, characterized in that: include: Acquire multiple resource data, and acquire at least one metadata corresponding to each resource data in the multiple resource data, each metadata including a metadata item and metadata content corresponding to the metadata item; The resource data includes first resource data and second resource data; Construct at least one triple data for each resource data according to each resource data, the metadata item corresponding to each metadata, and the metadata content corresponding to the metadata item; the triple data includes a first entity, a relationship, and a second entity; receiving a data query instruction submitted by a user client, and querying the at least one triple data set to be queried indicated by the data query instruction; Determine a first entity in each triple data in the triple data set as a first vertex, and determine a second entity in each triple data in the triple data set as a second vertex; Determine an edge between the first vertex and the second vertex based on a relationship between a first entity and a second entity in each triple data in the triple data set; Acquire a data source identifier carried in the first resource data; the data source identifier is used to indicate an acquisition location of data in the first resource data; When the data source identifier is used to indicate data in the second resource data, determining first metadata corresponding to the data source identifier from at least one metadata corresponding to the first resource data; Determine that a first entity corresponding to the second resource data is the first vertex, and determine that a second entity corresponding to metadata content included in the first metadata is the second vertex; Merge the first vertex corresponding to the second resource data with the second vertex corresponding to the first metadata to obtain a first target vertex; A target knowledge graph for the data query instruction is constructed based on the first vertex, the second vertex, the first target vertex, and the edges between the vertices.

2. The method according to claim 1, characterized in that: The step of constructing at least one triplet of data for each resource data according to each resource data, a metadata item corresponding to each metadata, and metadata content corresponding to the metadata item comprises: Determine each resource data as a first entity, determine the metadata content corresponding to the metadata item as a second entity, and determine the relationship between the first entity and the second entity according to the metadata item corresponding to each metadata; At least one triple data for each resource data is constructed according to the first entity, the second entity, and the relationship between the first entity and the second entity.

3. The method according to claim 2, characterized in that: The step of constructing a target knowledge graph for the data query instruction according to the first vertex, the second vertex, the first target vertex, and the edges between the vertices includes: Merge the same vertices among the second vertices to obtain a second target vertex; A target knowledge graph for the data query instruction is constructed based on the first vertex, the second vertex, the second target vertex, the first target vertex, and the edges between each vertex.

4. The method according to claim 3, characterized in that: The resource data includes first table resource data and second table resource data; the method further includes: When it is detected that both the first table resource data and the second table resource data include a target field, second metadata corresponding to the target field is obtained from at least one metadata corresponding to the first table resource data, and third metadata corresponding to the target field is obtained from at least one metadata corresponding to the second table resource data; Determine that the second entity corresponding to the metadata content in the second metadata is a second vertex, and determine that the second entity corresponding to the metadata content in the third metadata is another second vertex; The step of merging the same vertices among the second vertices to obtain a second target vertex includes: The second vertex corresponding to the second metadata and the other second vertex corresponding to the third metadata are merged to obtain the second target vertex.

5. The method according to claim 1, characterized in that: The data query instruction carries the permission information of the target object and the identification information for indicating the triple data set to be queried; and the querying of the triple data set to be queried indicated by the data query instruction from the at least one triple data comprises: Detecting whether the permission information of the target object carried by the data query instruction indicates that the target object has permission to query the triple data set indicated by the identification information; If the detection result is that the permission information indicates that the target object has the permission to query the triple data set indicated by the identification information, then the triple data set to be queried indicated by the data query instruction is queried from the at least one triple data.

6. A data management device based on knowledge graph, characterized in that: The device is used to implement the method according to any one of claims 1 to 5, and the device comprises: An acquisition unit, configured to acquire a plurality of resource data and acquire at least one metadata corresponding to each resource data in the plurality of resource data, wherein each metadata includes a metadata item and metadata content corresponding to the metadata item; A processing unit, configured to construct at least one triplet of data for each resource data according to each resource data, a metadata item corresponding to each metadata, and metadata content corresponding to the metadata item; A receiving unit, configured to receive a data query instruction submitted by a user client, and query the at least one triple data set to be queried indicated by the data query instruction; The processing unit is also used to determine the entities and relationships corresponding to each triple data in the triple data set, and to construct a target knowledge graph for the data query instruction based on the entities and the relationships.

7. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory is used to store a computer program, the computer program comprises program instructions, and the processor is configured to call the program instructions to execute the method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and when the program instructions are executed by a processor, the processor is caused to perform the method according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Knowledge graph construction method based on disaster scene

    CN109992672A

  • Knowledge graph construction method and device, computer equipment and storage medium

    CN110489561A