Database knowledge graph construction method and device and electronic equipment

By assigning security level labels to metadata information and vectorizing it using corresponding models, the risk of data leakage was mitigated, and secure data management and analysis were achieved.

CN117332092BActive Publication Date: 2026-06-05CCB FINTECH CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CCB FINTECH CO LTD
Filing Date
2023-09-13
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing technologies do not consider the privacy and security of data during the data vectorization process, leading to the risk of data leakage.

Method used

A knowledge graph is constructed by assigning security level labels to metadata information and vectorizing it using a large natural speech processing model and/or a private model based on different security level labels.

Benefits of technology

It effectively ensures the privacy and security of data, prevents data leakage, and realizes secure data management and analysis.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117332092B_ABST
    Figure CN117332092B_ABST
Patent Text Reader

Abstract

The application discloses a database knowledge graph construction method and device and electronic equipment, and relates to the technical field of big data processing and mining. A specific embodiment of the method comprises: obtaining metadata information of a database, performing semantic analysis on the metadata information; assigning at least one category label to the metadata information, inputting the metadata information subjected to semantic analysis and the corresponding category label into a pre-training model for training, thereby obtaining a private model through training; wherein the at least one category label comprises a security level label; based on the security level label corresponding to the metadata information, performing vectorization on the metadata information by using a natural speech processing large model and / or the private model, thereby obtaining feature vectors of each word segmentation in the metadata information; and constructing a knowledge graph according to the feature vectors of each word segmentation. The embodiment can solve the technical problem of data leakage danger.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of big data processing and mining technology, and in particular to a method, apparatus, electronic device, and computer-readable medium for constructing a database knowledge graph. Background Technology

[0002] Knowledge graphs can visually represent the knowledge and relationships within a database, enhancing the user experience of querying and exploring the graph, and attracting more users to utilize and analyze the database data. By applying machine learning and deep learning technologies to knowledge graphs, AI systems with a deep understanding of data and knowledge can be built, enabling automated data management, analysis, and services.

[0003] In the process of realizing this invention, the inventors discovered at least the following problems in the prior art:

[0004] The data vectorization process failed to consider data privacy and security, leading to a risk of data leakage. Summary of the Invention

[0005] In view of this, embodiments of the present invention provide a database knowledge graph construction method, apparatus, electronic device, and computer-readable medium to solve the technical problem of data leakage risk.

[0006] To achieve the above objectives, according to one aspect of the present invention, a method for constructing a database knowledge graph is provided, comprising:

[0007] Obtain metadata information from the database and perform semantic analysis on the metadata information;

[0008] At least one category label is assigned to the metadata information, and the semantically analyzed metadata information and its corresponding category label are input into a pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label;

[0009] Based on the security level label corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model, thereby obtaining the feature vector of each word segment in the metadata information;

[0010] A knowledge graph is constructed based on the feature vectors of each word segment.

[0011] Optionally, based on the security level label corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model to obtain the feature vectors of each word segment in the metadata information, including:

[0012] If the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information;

[0013] If the security level label corresponding to the metadata information is a medium security level label, then the metadata information is vectorized using the natural speech processing big model and the private model to obtain the feature vector of each word in the metadata information;

[0014] If the security level label corresponding to the metadata information is a low security level label, then the metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

[0015] Optionally, the metadata information is vectorized using a large natural speech processing model and the private model to obtain the feature vectors of each word segment in the metadata information, including:

[0016] The metadata information is input into a large natural speech processing model to output industry keywords associated with the metadata information.

[0017] The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

[0018] Optionally, the proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information, including:

[0019] The proprietary model is used to filter out target keywords that match the metadata information from the industry keywords;

[0020] The metadata information is vectorized using the private model and the target keywords to obtain the feature vectors of each word segment in the metadata information.

[0021] Optionally, the pre-trained model is selected from one of the following: BERT, GPT, ResNet, VGGNet, Transformer;

[0022] The large natural speech processing model is selected from the following: ChatGPT, claude, and bard.

[0023] Optionally, a knowledge graph is constructed based on the feature vectors of each word segmentation, including:

[0024] Based on the feature vectors of each word segment, each word segment is clustered to obtain each cluster.

[0025] Each cluster is treated as an entity in the knowledge graph, and the relationships between the clusters are combined to construct the knowledge graph.

[0026] Optionally, after constructing the knowledge graph based on the feature vectors of each word segmentation, the method further includes:

[0027] Receive a data query request sent by a client, the data query request carrying data query information;

[0028] The security level label of the data query information is calculated using the private model.

[0029] Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information.

[0030] Based on the feature vectors of each word segment in the data query information, at least one target entity is matched in the knowledge graph.

[0031] The word segmentation corresponding to the at least one target entity is returned to the client.

[0032] Furthermore, according to another aspect of the present invention, a database knowledge graph construction apparatus is provided, comprising:

[0033] The semantic analysis module is used to obtain metadata information from the database and perform semantic analysis on the metadata information;

[0034] The training module is used to assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into a pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label;

[0035] The vectorization module is used to vectorize the metadata information based on the security level label corresponding to the metadata information, using a large natural speech processing model and / or the private model, thereby obtaining the feature vector of each word segment in the metadata information.

[0036] The construction module is used to construct a knowledge graph based on the feature vectors of each word segmentation.

[0037] Optionally, the vectorization module is further configured to:

[0038] If the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information;

[0039] If the security level label corresponding to the metadata information is a medium security level label, then the natural speech processing big model and the private model are used to vectorize the metadata information to obtain the feature vector of each word in the metadata information;

[0040] If the security level label corresponding to the metadata information is a low security level label, then the metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

[0041] Optionally, the vectorization module is further configured to:

[0042] The metadata information is input into a large natural speech processing model to output industry keywords associated with the metadata information.

[0043] The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

[0044] Optionally, the vectorization module is further configured to:

[0045] The proprietary model is used to filter out target keywords that match the metadata information from the industry keywords;

[0046] The metadata information is vectorized using the private model and the target keywords to obtain the feature vectors of each word segment in the metadata information.

[0047] Optionally, the pre-trained model is selected from one of the following: BERT, GPT, ResNet, VGGNet, Transformer;

[0048] The large natural speech processing model is selected from the following: ChatGPT, claude, and bard.

[0049] Optionally, the building module is further configured to:

[0050] Based on the feature vectors of each word segment, each word segment is clustered to obtain each cluster.

[0051] Each cluster is treated as an entity in the knowledge graph, and the relationships between the clusters are combined to construct the knowledge graph.

[0052] Optionally, a query module is also included for:

[0053] Receive a data query request sent by a client, the data query request carrying data query information;

[0054] The security level label of the data query information is calculated using the private model.

[0055] Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information.

[0056] Based on the feature vectors of each word segment in the data query information, at least one target entity is matched in the knowledge graph.

[0057] The word segmentation corresponding to the at least one target entity is returned to the client.

[0058] According to another aspect of the present invention, an electronic device is also provided, comprising:

[0059] One or more processors;

[0060] Storage device for storing one or more programs.

[0061] When the one or more programs are executed by the one or more processors, the one or more processors implement the method described in any of the above embodiments.

[0062] According to another aspect of the present invention, a computer-readable medium is also provided, on which a computer program is stored, which, when executed by a processor, implements the methods described in any of the above embodiments.

[0063] According to another aspect of the present invention, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.

[0064] One embodiment of the above invention has the following advantages or beneficial effects: By employing a technique of assigning security level labels to metadata information and inputting them into a pre-trained model for training, and then using a large natural speech processing model and / or a private model to vectorize the metadata information based on the corresponding security level labels, thereby obtaining the feature vectors of each word segment in the metadata information, the technical problem of data leakage risk in the prior art is overcome. This invention, considering data privacy and security, assigns security level labels to metadata information, and uses different models to vectorize different security level labels, thereby ensuring data privacy and security and preventing data leakage.

[0065] The further effects of the aforementioned unconventional alternative methods will be explained below in conjunction with specific implementation methods. Attached Figure Description

[0066] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:

[0067] Figure 1 This is a flowchart of a database knowledge graph construction method according to an embodiment of the present invention;

[0068] Figure 2 This is a flowchart of a database knowledge graph construction method according to a possible embodiment of the present invention;

[0069] Figure 3 This is a flowchart of a database knowledge graph construction method according to another possible embodiment of the present invention;

[0070] Figure 4 This is a flowchart of a database knowledge graph construction method according to another possible embodiment of the present invention;

[0071] Figure 5 This is a schematic diagram of a database knowledge graph construction apparatus according to an embodiment of the present invention;

[0072] Figure 6 This is an exemplary system architecture diagram in which embodiments of the present invention can be applied;

[0073] Figure 7 This is a schematic diagram of the structure of a computer system suitable for implementing terminal devices or servers of the present invention. Detailed Implementation

[0074] The following description, in conjunction with the accompanying drawings, illustrates exemplary embodiments of the present invention, including various details to aid understanding. These details 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 the invention. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.

[0075] It should be noted that the collection, analysis, use, transmission, and storage of user personal information involved in the technical solution of this invention all comply with relevant laws and regulations, are used for legitimate and reasonable purposes, and are not shared, disclosed, or sold outside of these legitimate uses, and are subject to supervision and management by regulatory authorities. Necessary measures should be taken to prevent unauthorized access to such personal information data, ensure that personnel authorized to access personal information data comply with relevant laws and regulations, and ensure the security of user personal information. Once this user personal information data is no longer needed, the risk should be minimized by restricting or even prohibiting data collection and / or deleting the data.

[0076] When applicable, including in certain relevant applications, data deidentification is used to protect user privacy, such as by removing specific identifiers (e.g., name, age, gender, date of birth, account, etc.), controlling the amount or specificity of stored data, controlling how data is stored, and / or other methods of deidentification.

[0077] Figure 1 This is a flowchart of a database knowledge graph construction method according to an embodiment of the present invention. As one embodiment of the present invention, such as... Figure 1 As shown, the database knowledge graph construction method may include:

[0078] Step 101: Obtain the metadata information of the database and perform semantic analysis on the metadata information.

[0079] First, it's necessary to determine the target database for acquiring metadata. Specifically, based on business needs, one or more representative databases with large datasets can be selected as the target databases for knowledge graph construction. Therefore, it's essential to understand the business background knowledge of the selected databases, including general industry concepts, key entity types, and potential relationships between entities. Understanding the business logic behind the database architecture design is also crucial, identifying the meaning and business rules of the main tables and fields. Then, various metadata information is retrieved from the target database, such as table structure (table name, field names and types), table data, primary keys, indexes, constraints, and relationships between tables, identifying foreign keys and other related fields.

[0080] Next, NLP technology is used to perform text processing and semantic analysis on the acquired metadata information, mainly including the following tasks:

[0081] Word segmentation: dividing text into words or phrases for subsequent processing;

[0082] Part-of-speech tagging: Determines the part of speech of each word, such as noun, verb, adjective, etc., to help understand the meaning of the word;

[0083] Named entity recognition: Identifies specific entities in text, such as table names, column names, etc.

[0084] Syntactic analysis: Analyzing the structure and components of a sentence to identify its subject, predicate, object, and other elements;

[0085] Semantic role labeling: Identifies the actions in a sentence and their corresponding participants, helping to understand the meaning of the sentence.

[0086] Step 102: Assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into the pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label.

[0087] Each piece of metadata information should have at least one category label. The category label can be a security level label or a custom label, such as a domain label or a disease label.

[0088] This invention employs a pre-trained model to learn from semantically analyzed metadata and their corresponding category labels, thereby obtaining a private model. Specifically, the semantically analyzed metadata is imported into the pre-trained model, a loss function is constructed using the labels and model training results, and the parameters of the initial pre-trained model are iteratively updated based on the loss function. Model training is complete when the loss function converges. Optionally, the pre-trained model is selected from the following: BERT, GPT, ResNet, VGGNet, and Transformer.

[0089] Step 103: Based on the security level label corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model to obtain the feature vector of each word segment in the metadata information.

[0090] Since security level labels are assigned to each piece of metadata information, the metadata information can be vectorized using a large-scale natural speech processing model and / or the private model based on the corresponding security level labels, thereby obtaining the feature vectors of each word segment in each piece of metadata information. Optionally, the large-scale natural speech processing model is selected from the following: ChatGPT, claude, or bard.

[0091] Optionally, step 103 may include: if the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information; if the security level label corresponding to the metadata information is a medium security level label, then the natural speech processing large model and the private model are used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information; if the security level label corresponding to the metadata information is a low security level label, then the natural speech processing large model is used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information. To ensure data security and prevent data leakage, different models are used to vectorize the words for each piece of metadata information according to the different security level labels. Specifically, if the security level label corresponding to the metadata information is a high security level label, then the private model trained in step 102 is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; if the security level label corresponding to the metadata information is a medium security level label, then the large natural speech processing model and the private model trained in step 102 are used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; if the security level label corresponding to the metadata information is a low security level label, then the large natural speech processing model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information.

[0092] In this embodiment of the invention, a large-scale natural speech processing model and / or a private model are used to vectorize various metadata information to construct a vocabulary. This vocabulary contains all the words that appear in the data and their vectors.

[0093] Optionally, the metadata information is vectorized using a large-scale natural language processing model and the proprietary model to obtain feature vectors for each word segment in the metadata information. This includes: inputting the metadata information into the large-scale natural language processing model to output industry keywords associated with the metadata information; and using the proprietary model in conjunction with the industry keywords to vectorize the metadata information to obtain feature vectors for each word segment in the metadata information. Loading the metadata information into the large-scale natural language processing model first allows for the acquisition of more related data from external knowledge sources. This data can include various open knowledge bases, online encyclopedias, professional literature, industry reports, etc., enriching the entire knowledge base.

[0094] Large-scale natural language processing models possess automatic reasoning and inference capabilities: through deep learning and inference mechanisms, employing rule-based reasoning, statistical reasoning, and analogical reasoning, they can automatically reason and infer from input data. Based on existing knowledge and rules, they can automatically infer new knowledge and relationships. This application can help users discover hidden patterns and associations, providing more comprehensive and accurate data, and subsequently, more comprehensive and accurate knowledge.

[0095] Optionally, the metadata information is vectorized using the private model and in combination with the industry keywords to obtain the feature vectors of each word segment in the metadata information, including: using the private model to filter out target keywords that match the metadata information from the industry keywords; and using the private model and in combination with the target keywords to vectorize the metadata information to obtain the feature vectors of each word segment in the metadata information.

[0096] If the security level label corresponding to the metadata information is medium security level, the large-scale natural language processing model is loaded first to output industry keywords associated with the metadata information. Then, the private model is loaded to obtain the feature vectors of each word segment in the metadata information. This ensures a certain level of security and privacy for enterprise data while also combining the reasoning capabilities of the large-scale natural language processing model. Furthermore, the private model can filter out erroneous results that may occur in the large-scale natural language processing model, achieving complementary advantages.

[0097] The private model performs security level assessment, quality assessment, consistency check and conflict resolution on the data output from the large natural speech processing model. This allows it to obtain rich related data from the large natural speech processing model and filter out errors that may occur in the large natural speech processing model, thereby achieving the complementary advantages of the two models. The data is then vectorized.

[0098] Step 104: Construct a knowledge graph based on the feature vectors of each word segmentation.

[0099] Knowledge graph construction represents data and the relationships between it in the form of a graph. A knowledge graph is a data structure that represents entities and the relationships between them in the form of a graph, typically using nodes to represent entities and edges to represent the relationships between entities. Building knowledge graphs can help us better understand the information structure and relationships in a database.

[0100] Optionally, step 104 may include: clustering the word segments based on their feature vectors to obtain clusters; treating each cluster as an entity in the knowledge graph and constructing the knowledge graph by combining the relationships between the clusters. After obtaining the feature vectors of each word segment, clustering the word segments based on their feature vectors to obtain clusters; after clustering, treating each cluster as an entity in the knowledge graph and constructing the knowledge graph by combining the relationships between the clusters.

[0101] This invention employs NLP, machine learning, and other technologies to automatically parse the database, extract entities, concepts, and relationships, and generate an initial knowledge graph. This is the foundation and key to constructing a knowledge graph, and it concerns the scale and quality of the knowledge graph.

[0102] Based on the various embodiments described above, it can be seen that the embodiments of the present invention solve the technical problem of data leakage risks in the prior art by assigning security level labels to metadata information and inputting them into a pre-trained model for training. Based on the security level labels corresponding to the metadata information, a large natural speech processing model and / or a private model are used to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information. The embodiments of the present invention take into account the privacy and security of data, assigning security level labels to metadata information, and using different models to vectorize different security level labels, thereby ensuring data privacy and security and preventing data leakage.

[0103] Figure 2 This is a flowchart of a database knowledge graph construction method according to a possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 2 As shown, the database knowledge graph construction method may include:

[0104] Step 201: Obtain the metadata information of the database and perform semantic analysis on the metadata information.

[0105] Step 202: Assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into the pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label.

[0106] If the security level label corresponding to the metadata information is a high security level label, then proceed to step 203; if the security level label corresponding to the metadata information is a medium security level label, then proceed to step 204; if the security level label corresponding to the metadata information is a low security level label, then proceed to step 205.

[0107] Step 203: The private model is used to vectorize the metadata information to obtain the feature vectors of each word segment in the metadata information.

[0108] Step 204: The metadata information is vectorized using the natural speech processing big model and the private model to obtain the feature vectors of each word segment in the metadata information.

[0109] Step 205: The metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

[0110] Step 206: Construct a knowledge graph based on the feature vectors of each word segmentation.

[0111] Furthermore, the specific implementation details of the database knowledge graph construction method in one of the reference embodiments of the present invention have been described in detail in the database knowledge graph construction method described above, so the details will not be repeated here.

[0112] Figure 3 This is a flowchart of a database knowledge graph construction method according to another possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 3 As shown, the database knowledge graph construction method may include:

[0113] Step 301: Obtain the metadata information of the database and perform semantic analysis on the metadata information.

[0114] Step 302: Assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into the pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label.

[0115] If the security level label corresponding to the metadata information is a high security level label, then proceed to step 303; if the security level label corresponding to the metadata information is a medium security level label, then proceed to step 304; if the security level label corresponding to the metadata information is a low security level label, then proceed to step 307.

[0116] Step 303: The private model is used to vectorize the metadata information to obtain the feature vectors of each word segment in the metadata information.

[0117] Step 304: Input the metadata information into the natural speech processing model to output industry keywords associated with the metadata information.

[0118] Step 305: Use the private model to filter out target keywords that match the metadata information from the industry keywords.

[0119] Step 306: The private model is used in conjunction with the target keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

[0120] Step 307: The metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

[0121] Step 308: Construct a knowledge graph based on the feature vectors of each word segmentation.

[0122] In addition, the specific implementation details of the database knowledge graph construction method in another reference embodiment of the present invention have been described in detail in the database knowledge graph construction method described above, so the details will not be repeated here.

[0123] Figure 4 This is a flowchart of a database knowledge graph construction method according to another possible embodiment of the present invention. As another embodiment of the present invention, such as... Figure 4 As shown, the database knowledge graph construction method may include:

[0124] Step 401: Obtain the metadata information of the database and perform semantic analysis on the metadata information.

[0125] Step 402: Assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into the pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label.

[0126] Step 403: Based on the security level label corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model to obtain the feature vector of each word segment in the metadata information.

[0127] Step 404: Based on the feature vectors of each word segment, cluster each word segment to obtain each cluster.

[0128] Step 405: Treat each cluster as an entity in the knowledge graph and combine the relationships between the clusters to construct the knowledge graph.

[0129] After constructing the knowledge graph, perform the following operations:

[0130] Knowledge fusion: Mapping entities in the initial knowledge graph to external public knowledge sources to expand and enrich knowledge.

[0131] Knowledge mapping and matching: In the knowledge fusion process, it is necessary to map and match entities in the initial knowledge graph with corresponding entities in external knowledge sources. This can be achieved in the following ways:

[0132] 1) Word matching: Based on word similarity calculation or word association model, entities in the initial knowledge graph are matched with similar entities in external knowledge sources.

[0133] 2) Entity Linking: Entity linking technology is used to connect entities in the initial knowledge graph with entities in external knowledge sources. Entity linking can be performed by matching and linking based on entity names, contextual information, semantic features, etc.

[0134] 3) Semantic relation extraction: By performing semantic analysis and relation extraction on external knowledge sources, the relationships between concepts and entities are identified, and then matched with the relationships in the initial knowledge graph.

[0135] After knowledge mapping and matching are completed, relevant information from external knowledge sources can be integrated into the initial knowledge graph to expand and enrich the knowledge base. This includes the following aspects:

[0136] 1) Attribute expansion: Obtain more attribute information from external knowledge sources and associate it with entities in the initial knowledge graph to enrich the attribute descriptions of entities.

[0137] 2) Relationship Expansion: By corresponding and matching relationships with external knowledge sources, the relationships between entities in the initial knowledge graph are expanded, enriching the semantic and contextual information of the relationships.

[0138] Step 406: Receive a data query request sent by the client, the data query request carrying data query information.

[0139] After step 406, the query text entered by the user is preprocessed, including removing special characters, punctuation marks, stop words, etc., which can help reduce noise and simplify the query text.

[0140] Step 407: Calculate the security level label of the data query information using the private model.

[0141] The security level label of the data query information can be calculated using the private model trained in step 402, for example, by calculating the security level label of the metadata information to be obtained in the data query information.

[0142] Step 408: Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information.

[0143] Step 408 is similar to step 403. Specifically, if the security level label corresponding to the data query information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information; if the security level label corresponding to the data query information is a medium security level label, then the natural speech processing large model and the private model are used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information; if the security level label corresponding to the data query information is a low security level label, then the natural speech processing large model is used to vectorize the metadata information to obtain the feature vectors of each word in the metadata information.

[0144] Step 409: Based on the feature vectors of each word segment in the data query information, match at least one target entity in the knowledge graph.

[0145] The similarity between the feature vectors of each word segment in the data query information and the feature vectors of each entity in the knowledge graph (with the center of the cluster corresponding to the entity as the feature vector of that entity) is calculated, so as to match at least one target entity with a high similarity.

[0146] Step 410: Return the word segmentation corresponding to the at least one target entity to the client.

[0147] Furthermore, the specific implementation details of the database knowledge graph construction method in another reference embodiment of the present invention have been described in detail in the database knowledge graph construction method described above, so the details will not be repeated here.

[0148] Figure 5 This is a schematic diagram of a database knowledge graph construction apparatus according to an embodiment of the present invention. Figure 5As shown, the database knowledge graph construction device 500 includes a semantic analysis module 501, a training module 502, a vectorization module 503, and a construction module 504. The semantic analysis module 501 acquires metadata information from the database and performs semantic analysis on the metadata information. The training module 502 assigns at least one category label to the metadata information and inputs the semantically analyzed metadata information and its corresponding category label into a pre-trained model for training, thereby training a private model. The at least one category label includes a security level label. The vectorization module 503 vectorizes the metadata information based on the security level label corresponding to the metadata information, using a large natural speech processing model and / or the private model, thereby obtaining the feature vectors of each word segment in the metadata information. The construction module 504 constructs a knowledge graph based on the feature vectors of each word segment.

[0149] Optionally, the vectorization module 503 is further configured to:

[0150] If the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information;

[0151] If the security level label corresponding to the metadata information is a medium security level label, then the natural speech processing big model and the private model are used to vectorize the metadata information to obtain the feature vector of each word in the metadata information;

[0152] If the security level label corresponding to the metadata information is a low security level label, then the metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

[0153] Optionally, the vectorization module 503 is further configured to:

[0154] The metadata information is input into a large natural speech processing model to output industry keywords associated with the metadata information.

[0155] The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

[0156] Optionally, the vectorization module 503 is further configured to:

[0157] The proprietary model is used to filter out target keywords that match the metadata information from the industry keywords;

[0158] The metadata information is vectorized using the private model and the target keywords to obtain the feature vectors of each word segment in the metadata information.

[0159] Optionally, the pre-trained model is selected from one of the following: BERT, GPT, ResNet, VGGNet, Transformer;

[0160] The large natural speech processing model is selected from the following: ChatGPT, claude, and bard.

[0161] Optionally, the building module 504 is further configured to:

[0162] Based on the feature vectors of each word segment, each word segment is clustered to obtain each cluster.

[0163] Each cluster is treated as an entity in the knowledge graph, and the relationships between the clusters are combined to construct the knowledge graph.

[0164] Optionally, a query module is also included for:

[0165] Receive a data query request sent by a client, the data query request carrying data query information;

[0166] The security level label of the data query information is calculated using the private model.

[0167] Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information.

[0168] Based on the feature vectors of each word segment in the data query information, at least one target entity is matched in the knowledge graph.

[0169] The word segmentation corresponding to the at least one target entity is returned to the client.

[0170] It should be noted that the specific implementation details of the database knowledge graph construction device described in this invention have been described in detail in the database knowledge graph construction method described above, so the details will not be repeated here.

[0171] Figure 6 An exemplary system architecture 600 is shown that can be applied to the database knowledge graph construction method or database knowledge graph construction apparatus of the present invention.

[0172] like Figure 6As shown, system architecture 600 may include terminal devices 601, 602, and 603, a network 604, and a server 605. Network 604 serves as the medium for providing communication links between terminal devices 601, 602, and 603 and server 605. Network 604 may include various connection types, such as wired or wireless communication links or fiber optic cables, etc.

[0173] Users can use terminal devices 601, 602, and 603 to interact with server 605 via network 604 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 601, 602, and 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social media platform software, etc. (for example only).

[0174] Terminal devices 601, 602, and 603 can be various electronic devices with displays and web browsing capabilities, including but not limited to smartphones, tablets, laptops, and desktop computers.

[0175] Server 605 can be a server that provides various services, such as a backend management server that supports shopping websites browsed by users using terminal devices 601, 602, and 603 (this is just an example). The backend management server can analyze and process data such as received item information query requests, and then feed the processing results back to the terminal devices.

[0176] It should be noted that the database knowledge graph construction method provided in this embodiment of the invention is generally executed by server 605, and correspondingly, the database knowledge graph construction device is generally set in server 605.

[0177] It should be understood that Figure 6 The number of terminal devices, networks, and servers shown is merely illustrative. Depending on implementation needs, any number of terminal devices, networks, and servers can be included.

[0178] The following is for reference. Figure 7 It shows a schematic diagram of the structure of a computer system 700 suitable for implementing a terminal device of the present invention. Figure 7 The terminal device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.

[0179] like Figure 7As shown, the computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) 702 or programs loaded from storage section 708 into random access memory (RAM) 703. The RAM 703 also stores various programs and data required for the operation of the system 700. The CPU 701, ROM 702, and RAM 703 are interconnected via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.

[0180] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, etc.; an output section 707 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 708 including a hard disk, etc.; and a communication section 709 including a network interface card such as a LAN card, modem, etc. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I / O interface 705 as needed. A removable medium 711, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., is installed on the drive 710 as needed so that computer programs read from it can be installed into the storage section 708 as needed.

[0181] In particular, according to the embodiments disclosed in this invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this invention include a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 709, and / or installed from removable medium 711. When the computer program is executed by central processing unit (CPU) 701, it performs the functions defined above in the system of this invention.

[0182] It should be noted that the computer-readable medium shown in this invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, 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 device, magnetic storage device, or any suitable combination thereof. In this invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.

[0183] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer programs according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0184] The modules described in the embodiments of the present invention can be implemented in software or hardware. The described modules can also be housed in a processor; for example, a processor can be described as including a semantic analysis module, a training module, a vectorization module, and a construction module. The names of these modules do not necessarily limit the functionality of the module itself.

[0185] In another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiments; or it may exist independently and not assembled into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device implements the following method: acquiring metadata information from a database; performing semantic analysis on the metadata information; assigning at least one category label to the metadata information; inputting the semantically analyzed metadata information and its corresponding category label into a pre-trained model for training, thereby training a private model; wherein the at least one category label includes a security level label; based on the security level label corresponding to the metadata information, using a large natural speech processing model and / or the private model to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information; and constructing a knowledge graph based on the feature vectors of each word segment.

[0186] In another aspect, embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the methods described in any of the above embodiments.

[0187] According to the technical solution of this invention, by assigning security level labels to metadata information and inputting them into a pre-trained model for training, and by using a large natural speech processing model and / or a private model to vectorize the metadata information based on the security level labels corresponding to the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information, the technical problem of data leakage risk in the prior art is overcome. This invention, considering the privacy and security of data, assigns security level labels to metadata information, and uses different models to vectorize different security level labels, thereby ensuring data privacy and security and preventing data leakage.

[0188] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for constructing a database knowledge graph, characterized in that, include: Obtain metadata information from the database and perform semantic analysis on the metadata information; At least one category label is assigned to the metadata information, and the semantically analyzed metadata information and its corresponding category label are input into a pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label; Based on the security level label corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model, thereby obtaining the feature vector of each word segment in the metadata information; Based on the feature vectors of each word segment, a knowledge graph is constructed; Based on the security level tags corresponding to the metadata information, the metadata information is vectorized using a large natural speech processing model and / or the private model to obtain the feature vectors of each word segment in the metadata information, including: If the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; If the security level label corresponding to the metadata information is a medium security level label, then the natural speech processing big model and the private model are used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; If the security level label corresponding to the metadata information is a low security level label, then the metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

2. The method according to claim 1, characterized in that, The metadata information is vectorized using a large-scale natural speech processing model and the proprietary model to obtain the feature vectors of each word segment in the metadata information, including: The metadata information is input into a large natural speech processing model to output industry keywords associated with the metadata information. The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

3. The method according to claim 2, characterized in that, The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information, including: The proprietary model is used to filter out target keywords that match the metadata information from the industry keywords; The metadata information is vectorized using the private model and the target keywords to obtain the feature vectors of each word segment in the metadata information.

4. The method according to claim 1, characterized in that, The pre-trained model is selected from one of the following: BERT, GPT, ResNet, VGGNet, or Transformer; The large natural speech processing model is selected from the following: ChatGPT, claude, and bard.

5. The method according to claim 1, characterized in that, Based on the feature vectors of each word segmentation, a knowledge graph is constructed, including: Based on the feature vectors of each word segment, each word segment is clustered to obtain each cluster. Each cluster is treated as an entity in the knowledge graph, and the relationships between the clusters are combined to construct the knowledge graph.

6. The method according to claim 1, characterized in that, After constructing the knowledge graph based on the feature vectors of each word segmentation, the following steps are also included: Receive a data query request sent by a client, the data query request carrying data query information; The security level label of the data query information is calculated using the private model. Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information. Based on the feature vectors of each word segment in the data query information, at least one target entity is matched in the knowledge graph. The word segmentation corresponding to the at least one target entity is returned to the client.

7. A database knowledge graph construction device, characterized in that, include: The semantic analysis module is used to obtain metadata information from the database and perform semantic analysis on the metadata information; The training module is used to assign at least one category label to the metadata information, and input the semantically analyzed metadata information and its corresponding category label into a pre-trained model for training, thereby training a private model; wherein, the at least one category label includes a security level label; The vectorization module is used to vectorize the metadata information based on the security level label corresponding to the metadata information, using a large natural speech processing model and / or the private model, thereby obtaining the feature vector of each word segment in the metadata information. The construction module is used to construct a knowledge graph based on the feature vectors of each word segmentation. The vectorization module is also used for: If the security level label corresponding to the metadata information is a high security level label, then the private model is used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; If the security level label corresponding to the metadata information is a medium security level label, then the natural speech processing big model and the private model are used to vectorize the metadata information to obtain the feature vector of each word in the metadata information; If the security level label corresponding to the metadata information is a low security level label, then the metadata information is vectorized using a large natural speech processing model to obtain the feature vectors of each word segment in the metadata information.

8. The apparatus according to claim 7, characterized in that, The vectorization module is also used for: The metadata information is input into a large natural speech processing model to output industry keywords associated with the metadata information. The proprietary model is used in conjunction with the industry keywords to vectorize the metadata information, thereby obtaining the feature vectors of each word segment in the metadata information.

9. The apparatus according to claim 8, characterized in that, The vectorization module is also used for: The proprietary model is used to filter out target keywords that match the metadata information from the industry keywords; The metadata information is vectorized using the private model and the target keywords to obtain the feature vectors of each word segment in the metadata information.

10. The apparatus according to claim 7, characterized in that, The pre-trained model is selected from one of the following: BERT, GPT, ResNet, VGGNet, or Transformer; The large natural speech processing model is selected from the following: ChatGPT, claude, and bard.

11. The apparatus according to claim 7, characterized in that, The building module is also used for: Based on the feature vectors of each word segment, each word segment is clustered to obtain each cluster. Each cluster is treated as an entity in the knowledge graph, and the relationships between the clusters are combined to construct the knowledge graph.

12. The apparatus according to any one of claims 7-11, characterized in that, It also includes a query module, used for: Receive a data query request sent by a client, the data query request carrying data query information; The security level label of the data query information is calculated using the private model. Based on the security level label corresponding to the data query information, the data query information is vectorized using the natural speech processing big model and / or the private model to obtain the feature vector of each word segment in the data query information. Based on the feature vectors of each word segment in the data query information, at least one target entity is matched in the knowledge graph. The word segmentation corresponding to the at least one target entity is returned to the client.

13. An electronic device, characterized in that, include: One or more processors; Storage device for storing one or more programs. When the one or more programs are executed by the one or more processors, the one or more processors implement the method as described in any one of claims 1-6.

14. A computer-readable medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1-6.

15. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method as described in any one of claims 1-6.