Model training method, database table association relationship prediction method and device

By establishing a sample graph structure and feature matrix, and using a graph convolutional neural network to train a prediction model, the problems of high training burden and low prediction accuracy caused by manual intervention in existing technologies are solved, and efficient prediction of database table relationships is achieved.

CN117785881BActive Publication Date: 2026-11-24BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202311824782.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-27
Publication Date
2026-11-24
Estimated Expiration
2043-12-27

AI Technical Summary

Technical Problem

In existing technologies, the prediction of database table relationships relies on manually extracting sample features, resulting in a heavy training burden and low prediction accuracy.

Method used

By establishing a sample graph structure and feature matrix, and using a graph convolutional neural network to extract feature information from the database table, a prediction model is trained, reducing human intervention and improving prediction accuracy.

Benefits of technology

It reduces the training burden, improves the accuracy of the prediction model, and can effectively predict the relationships between database tables.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117785881B_ABST
    Figure CN117785881B_ABST
Patent Text Reader

Abstract

This application provides a model training method, a database table association prediction method, and an apparatus. One specific implementation of the method includes: determining the sample graph structure and sample feature matrix corresponding to the sample database table set; edges in the sample graph structure represent the association relationships between various sample database tables, and nodes represent sample database tables; extracting node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model; inputting the node features and the sample graph structure into the point predictor of the prediction model, and using the true labels of the sample graph structure as the expected output of the point predictor to train the prediction model; the true labels represent the probability that there are connections between nodes in the sample graph structure; if the prediction model meets the convergence requirements, then the prediction model is determined to have converged. This method can reduce the training burden of the prediction model and improve its prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of database table processing, and more specifically, to a model training method, a database table relationship prediction method, and an apparatus. Background Technology

[0002] With the rapid development of technology, many enterprises have transformed from traditional paper-based offices to paperless offices, generating a large amount of data during this process. Typically, enterprises use database tables to manage this data. However, as enterprises grow and the number of database tables increases, relationships may exist between these tables. Identifying these relationships is beneficial for data integration, avoiding duplicate data storage, improving data accuracy, and reducing the burden of data synchronization.

[0003] In related technologies, predictive models can be obtained based on machine learning, and then the relationships can be predicted using these models. However, this still requires manual extraction of sample features, which increases the training burden. Furthermore, the accuracy of the prediction depends on the manually extracted sample features. If the sample features are not selected properly, the accuracy of the model prediction may be low. Summary of the Invention

[0004] The purpose of this application is to provide a model training method, a database table relationship prediction method and apparatus, so as to reduce the training burden of the prediction model and improve its prediction accuracy.

[0005] In a first aspect, embodiments of this application provide a model training method, which includes: determining a sample graph structure and a sample feature matrix corresponding to a set of sample database tables; edges in the sample graph structure representing the association between various sample database tables, and nodes representing sample database tables; extracting node features corresponding to the sample graph structure from the sample feature matrix using a feature extractor of a prediction model; inputting the node features and the sample graph structure into a point predictor of the prediction model, and training the prediction model using the true labels of the sample graph structure as the expected output of the point predictor; the true labels representing the probability that there is a connection relationship between various nodes in the sample graph structure; and determining that the prediction model has converged if the prediction model meets the convergence requirements.

[0006] In this implementation, a sample graph structure can be established by leveraging the relationships between the various sample database tables in the sample database table set. This sample graph structure, along with the sample feature matrix, can then be used to train the prediction model. This eliminates the need for manual intervention in the training process, reducing the training burden and improving the prediction accuracy of the model.

[0007] Optionally, the sample graph structure includes a positive sample graph structure and a negative sample graph structure; the edge relationships in the negative sample graph structure are opposite to those in the positive sample graph structure, and the nodes in the negative sample graph structure are the same as those in the positive sample graph structure; and the step of extracting node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model includes: extracting node features corresponding to the positive sample graph structure from the sample feature matrix using the feature extractor; and the step of inputting the node features and the sample graph structure into the point predictor of the prediction model, and training the prediction model using the true label of the sample graph structure as the expected output of the point predictor includes: obtaining the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features; and obtaining the probability of each edge existing in the negative sample graph structure based on the negative sample graph structure and the node features. In this way, constructing both positive and negative sample graph structures using the sample graph structure can yield richer training factors, improving the accuracy of the prediction model to a certain extent.

[0008] Optionally, the dot predictor includes a dot product layer and an activation layer; and the step of obtaining the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features includes: for each edge in the positive sample graph structure, determining the two positive nodes connected by the edge; inputting the node features corresponding to the two positive nodes into the dot product layer to perform a dot product operation to obtain the positive sample edge score corresponding to the edge; inputting the positive sample edge score into the activation layer to obtain the probability of the edge existing using a preset activation function in the activation layer; the step of obtaining the probability of each edge existing in the negative sample graph structure based on the negative sample graph structure and the node features includes: for each edge in the negative sample graph structure, determining the two negative nodes connected by the edge; inputting the node features corresponding to the two negative nodes into the dot product layer to perform a dot product operation to obtain the negative sample edge score corresponding to the edge; inputting the negative sample edge score into the activation layer to obtain the probability of the edge existing using a preset activation function in the activation layer. In this way, the probability of each edge existing in the positive or negative sample graph structure can be determined by the dot product operation layer and the activation layer, and then the loss can be calculated by comparing it with the true label to train the prediction model.

[0009] Optionally, the feature extractor includes a preset number of graph convolutional layers; and the feature extractor of the prediction model extracts node features corresponding to the sample graph structure from the sample feature matrix, including: performing graph convolution operations on the sample feature matrix layer by layer through the preset number of graph convolutional layers to obtain the node features. This allows the structural relationships between fields in the sample database table to be captured, thereby improving the prediction accuracy of the prediction model to some extent.

[0010] Optionally, determining the sample graph structure and sample feature matrix corresponding to the sample database table set includes: encoding the field information in each of the sample database tables to obtain the sample feature matrix; and determining the sample graph structure based on the association relationships between the sample database tables. Here, a method for obtaining the sample feature matrix and determining the sample graph structure is provided.

[0011] Secondly, embodiments of this application provide a method for predicting database table relationships, comprising: determining a feature matrix and a graph structure corresponding to a set of database tables to be processed; the edges in the graph structure represent the relationships between the database tables to be processed, and the nodes represent the database tables to be processed; inputting the feature matrix and the graph structure into a prediction model, and predicting the relationships between the database tables in the set of database tables to be processed through the prediction model; the prediction model is obtained by the model training method described in the first aspect.

[0012] In this way, the relationships between database tables can be predicted using a predictive model. Because this predictive model has high accuracy, relatively accurate prediction results can be obtained. This overcomes the shortcomings of related technologies, which rely entirely on human familiarity with the database tables to determine relationships, resulting in low prediction efficiency and difficulty in predicting the relationships between massive numbers of database tables.

[0013] Thirdly, embodiments of this application provide a model training apparatus, comprising: a sample determination module, used to determine the sample graph structure and sample feature matrix corresponding to a set of sample database tables; the edges in the sample graph structure represent the association relationships between various sample database tables, and the nodes represent sample database tables; an extraction module, used to extract node features corresponding to the sample graph structure from the sample feature matrix through a feature extractor of the prediction model; an input module, used to input the node features and the sample graph structure into the point predictor of the prediction model, and use the true labels of the sample graph structure as the expected output of the point predictor to train the prediction model; the true labels represent the probability that there are connection relationships between various nodes in the sample graph structure; and a convergence module, used to determine that the prediction model has converged when the prediction model meets the convergence requirements. In this way, no manual intervention is required in the training process, reducing the training burden and improving the prediction accuracy of the prediction model.

[0014] Fourthly, embodiments of this application provide a database table relationship prediction device. The device includes: a determination module, configured to determine a feature matrix and a graph structure corresponding to a set of database tables to be processed; edges in the graph structure represent the relationships between the database tables to be processed, and nodes represent the database tables to be processed; and a prediction module, configured to input the feature matrix and the graph structure into a prediction model, and predict the relationships between the database tables in the set of database tables to be processed using the prediction model; the prediction model is obtained through the model training method described in the first aspect. This overcomes the shortcomings of related technologies, which rely entirely on human familiarity with the database tables to obtain the relationships, resulting in low prediction efficiency and difficulty in predicting the relationships between massive numbers of database tables.

[0015] Fifthly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores computer-readable instructions, and when the computer-readable instructions are executed by the processor, the steps of the method provided in the first or second aspect above are performed.

[0016] In a sixth aspect, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, performs the steps of the methods provided in the first or second aspect above.

[0017] Other features and advantages of this application will be set forth in the following description and will be apparent in part from the description or may be learned by practicing embodiments of this application. The objectives and other advantages of this application may be realized and obtained by means of the structures particularly pointed out in the written description, claims, and drawings. Attached Figure Description

[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0019] Figure 1 A flowchart illustrating a model training method provided in this application embodiment;

[0020] Figure 2 A flowchart illustrating a database table relationship prediction method provided in this application embodiment;

[0021] Figure 3 A structural block diagram of a model training device provided in an embodiment of this application;

[0022] Figure 4 A structural block diagram of a database table association prediction device provided in this application embodiment;

[0023] Figure 5 This is a schematic diagram of the structure of an electronic device used to perform a model training method or a database table association prediction method, as provided in an embodiment of this application. Detailed Implementation

[0024] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0025] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0026] It should be noted that, where there is no conflict, the embodiments or technical features in the embodiments of this application can be combined.

[0027] In related technologies, training prediction models requires manual extraction of sample features, resulting in a heavy training burden and potentially low prediction accuracy. To address this issue, this application provides a model training method. This method extracts feature information between fields in a sample database table using a graph convolutional neural network. This feature information, along with the corresponding sample graph structure of the database table, allows the model to be trained until convergence. This eliminates the need for manual intervention in the training process, reducing the training burden and improving the model's prediction accuracy.

[0028] The defects in the solutions in the above-mentioned related technologies are all the result of the inventors' practice and careful research. Therefore, the discovery process of the above problems and the solutions proposed by the embodiments of the present invention in the following text should be the inventors' contributions to the present invention.

[0029] In some application scenarios, the above model training method can be executed on servers, server clusters, or cloud platforms. This application will use the execution on a server as an example for illustration.

[0030] Please refer to Figure 1 The diagram illustrates a flowchart of a model training method provided in an embodiment of this application. Figure 1 As shown, the model training method includes the following steps 101 to 104.

[0031] Step 101: Determine the sample graph structure and sample feature matrix corresponding to the sample database table set; the edges in the sample graph structure represent the association between each sample database table, and the nodes represent the sample database tables.

[0032] In some application scenarios, the server can preprocess the sample database table set. Specifically, the server can obtain the sample database table set V and the set of connection relationships W between the sample database tables. Then, it can determine the inter-table connection relationships R using the sample database table set V and the connection relationship set W. Subsequently, it can determine the edge set E using the inter-table connection relationships R, so that the edge set E can represent the connection relationships between the sample database tables. For example, if there is an association between sample database table Vi and sample database table Vt, then there exists an edge it ∈ E.

[0033] Then, the sample graph structure can be determined based on the relationships between the various sample database tables. Specifically, a directed graph structure G can be determined based on the relationships between the sample database tables. For example, if there is a relationship between sample database table Vi and sample database table Vt, then in the directed graph structure G, there exists a node i representing database table Vi, a node t representing sample database table Vt, and an edge it representing the relationship between database table Vi and sample database table Vt. Here, the directed graph structure G can be regarded as the sample graph structure described above.

[0034] Furthermore, the server can encode the field information in each of the sample database tables to obtain the sample feature matrix. Specifically, the server can collect field information from all sample database tables in the sample database table set to form a table field library. For example, the fields contained in database table Vi can be encoded using binary encoding to obtain the aforementioned sample feature matrix. That is, the position where the field exists is encoded as 1, and the position where the field does not exist is encoded as 0, thereby obtaining the sample feature matrix corresponding to database table Vi, and subsequently, the sample feature matrices corresponding to all sample database tables in the sample database table set. Furthermore, the server can also remove fields whose field names appear less than twice to reduce the amount of information in the sample feature matrix.

[0035] Step 102: Extract the node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model;

[0036] The aforementioned feature extractor may include a graph convolutional layer, which can perform graph convolution operations on the sample feature matrix to obtain the node features corresponding to the sample graph structure.

[0037] In some applications, the graph convolution operation described above may include operations using the first-order Chebyshev approximation of spectral domain convolution. The graph convolution expression can be: Among them, H k Let A1 represent the hidden layer feature matrix obtained through the convolutional operation of the k-th graph, and W represent the adjacency matrix of the positive sample graph structure. k-1 The parameters are the learnable parameters for the corresponding layer. The graph convolution operation M() uses the first-order Chebyshev approximation of spectral domain convolution, where A = A + IN represents the adjacency matrix with added self-connections, IN represents the N-order identity matrix, D represents the degree matrix calculated from the adjacency matrix A1, and δ() is the activation function. The graph convolution operation can use the ReLU function as the activation function. The aforementioned adjacency matrix A1 can be obtained from the aforementioned directed graph structure G. For example, if there exists an edge it ∈ edge set E, then the corresponding element it in the adjacency matrix A1 is 1; otherwise, it is 0.

[0038] Step 103: Input the node features and the sample graph structure into the point predictor of the prediction model, and use the true labels of the sample graph structure as the expected output of the point predictor to train the prediction model; the true labels represent the probability that there is a connection relationship between each node in the sample graph structure.

[0039] In some application scenarios, the probability of connections between nodes in a sample graph structure can be pre-labeled to obtain the true label of the sample graph structure. Specifically, if two nodes are connected, the corresponding true label is 1; if two nodes are not connected, the corresponding true label is 0.

[0040] Then, the server can train the point predictor in a direction that makes it output the true labels. Specifically, the server can input the node features corresponding to the sample graph structure and the sample graph structure into the point predictor, so that the point predictor can output the probability that there are edges between each node.

[0041] Step 104: If the prediction model meets the convergence requirement, then the prediction model is determined to have converged.

[0042] The aforementioned convergence requirements may include, for example, that the loss value between the predicted probability output by the prediction model and the true label is less than a preset loss value threshold, or that the number of training iterations of the prediction model is greater than a preset number of training iterations threshold.

[0043] In some application scenarios, for example, the cross-entropy loss function can be used to calculate the loss value between the predicted probability and the true label. If the loss value is less than the preset loss value threshold or the number of training times has reached the threshold, it means that the prediction model can accurately predict the association probability between the sample database tables, and thus the prediction model can be regarded as having converged.

[0044] In this implementation, a sample graph structure can be established by leveraging the relationships between the various sample database tables in the sample database table set. This sample graph structure, along with the sample feature matrix, can then be used to train the prediction model. This eliminates the need for manual intervention in the training process, reducing the training burden and improving the prediction accuracy of the model.

[0045] In some optional implementations, the sample graph structure includes a positive sample graph structure and a negative sample graph structure; the edge relationships in the negative sample graph structure are the opposite of those in the positive sample graph structure, and the nodes in the negative sample graph structure are the same as those in the positive sample graph structure.

[0046] In some application scenarios, the sample graph structure determined by the server based on the relationships between various sample database tables can be a directed graph, which can indicate the direction of the relationships between sample database tables. For example, the data in sample database table V1 is calculated from the data in sample database table V2, therefore, there are directed edges in the directed graph pointing from sample database table V1 to sample database table V2.

[0047] In these application scenarios, the server can convert the directed edges in a directed graph into undirected edges, that is, remove the associated directions to obtain an undirected graph, which can be regarded as a positive sample graph structure.

[0048] Then, the server can determine the corresponding negative sample graph structure based on the positive sample graph structure. That is, the negative sample graph structure can have the same nodes as the positive sample graph structure, but if there is an edge it between node i and node t in the positive sample graph structure, then there is no such edge it in the negative sample graph structure.

[0049] Thus, the step 102 above, in which the feature extractor of the prediction model extracts the node features corresponding to the sample graph structure from the sample feature matrix, includes: extracting the node features corresponding to the positive sample graph structure from the sample feature matrix using the feature extractor.

[0050] In some application scenarios, the above feature extractor can extract node features from the positive sample graph structure through graph convolution operations.

[0051] Thus, step 103 above, which involves inputting the node features and the sample graph structure into the point predictor of the prediction model, and using the true labels of the sample graph structure as the expected output of the point predictor to train the prediction model, includes:

[0052] Step 1031: The point predictor obtains the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features.

[0053] In some application scenarios, for each edge in a positive sample graph structure, the two positive nodes connected to that edge can be identified. Then, the node features corresponding to the two positive nodes are added together, and an activation function is used to calculate the sum of the added features. This yields the edge weight score, which can be considered the probability of the edge's existence. Activation functions such as the sigmoid function and ReLU function can be used.

[0054] Step 1032: The point predictor obtains the probability of each edge existing in the negative sample graph structure based on the negative sample graph structure and the node features.

[0055] Similarly, for each edge in the negative sample graph structure, the two nodes connected by that edge can be determined. Then, the node features corresponding to the two nodes are added together, and the addition score is calculated using an activation function to obtain the edge weight score corresponding to that edge. The edge weight score can be regarded as the probability of the edge existing.

[0056] It should be noted that in the negative sample graph structure, since the nodes of the negative sample graph structure are the same as those of the positive sample graph structure, the node features of the negative sample graph structure are the same as those of the positive sample graph structure. Therefore, the node features can be used to determine the probability of each edge existing in the positive sample graph structure and the negative sample graph structure, respectively.

[0057] In this implementation, positive and negative sample graph structures are constructed through the sample graph structure, which can obtain richer training factors and improve the accuracy of the prediction model to a certain extent.

[0058] In some optional implementations, the dot predictor includes a dot product layer and an activation layer. The dot product layer performs a dot product operation on the features of any two input nodes to obtain the edge score corresponding to the edge between these two nodes. The activation layer calculates the edge score to obtain the probability of the edge's existence.

[0059] Thus, step 1031 above, which describes obtaining the probability of each edge in the positive sample graph structure based on the positive sample graph structure and the node features, includes: for each edge in the positive sample graph structure, determining the two positive nodes connected to that edge; inputting the node features corresponding to the two positive nodes into the dot product operation layer to perform a dot product operation, obtaining the positive sample edge score corresponding to that edge; and inputting the positive sample edge score into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer.

[0060] In some application scenarios, if the preset activation function is the sigmoid function, the above process can be characterized by a calculation formula. This formula includes: p_1 = Dot(G1, H) and... Where Dot() represents the dot product operation, G1 represents the structure of the positive sample graph, H represents the node features, p_1 represents the edge score of the positive sample, and y represents the probability of the edge existing, and 0 < y < 1.

[0061] The step 1032 above, which describes obtaining the probability of each edge in the negative sample graph structure based on the negative sample graph structure and the node features, includes: for each edge in the negative sample graph structure, determining the two negative nodes connected by the edge; inputting the node features corresponding to the two negative nodes into the dot product operation layer to perform a dot product operation to obtain the negative sample edge score corresponding to the edge; and inputting the negative sample edge score into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer.

[0062] In some application scenarios, if the preset activation function is the sigmoid function, the above process can be characterized by the following formula: p_2 = Dot(G2,H) and... Where Dot() represents the dot product operation, G2 represents the positive sample graph structure, H represents the node features, p_2 represents the negative sample edge score, and y represents the probability of the edge existing, and 0 < y < 1.

[0063] In this implementation, the probability of each edge in the positive or negative sample graph structure can be determined by the dot product layer and the activation layer, and then the loss can be calculated by comparing it with the true label to train the prediction model.

[0064] It should be noted that the number of training iterations of the prediction model during training can be determined by the number of times the probability of the existence of an edge is calculated in the point predictor.

[0065] In some alternative implementations, the feature extractor includes a preset number of graph convolutional layers.

[0066] In some application scenarios, the above-mentioned preset number of layers can be, for example, 2 or 3 layers.

[0067] Thus, the step 102 above, in which the feature extractor of the prediction model extracts the node features corresponding to the sample graph structure from the sample feature matrix, includes: performing graph convolution operations on the sample feature matrix layer by layer through the preset number of graph convolution layers to obtain the node features.

[0068] In some application scenarios, the graph convolution operation formula can also be used to characterize the extraction process of the above-mentioned node features. Specifically, if the preset number of layers is 2, the graph convolution operation formula includes: H1 = M(A i (x, w0) and H2 = M(A) i M() represents the graph convolution operation, and H1 represents the positive sample graph structure G. iThe node features output after graph convolution operation in the first graph convolutional layer; H2 represents the node features output after graph convolution operation in the second graph convolutional layer; w0 and w1 represent the learning weights (i.e., the model parameters to be learned by the prediction model) of the two graph convolutional operations, respectively; X represents the sample feature matrix; A i The adjacency matrix represents the structure of the sample graph; i represents the positive or negative sample graph structure. For example, i = 1 represents the positive sample graph structure, and i = 0 represents the negative sample graph structure.

[0069] In this implementation, the feature extractor can perform graph convolution operations on the sample feature matrix layer by layer using a preset number of graph convolution layers. This reduces the computational cost of graph convolution while still accurately extracting node features, based on the six degrees of separation theory.

[0070] Furthermore, the feature extractor can aggregate the node features between each node and its neighboring nodes during the node feature extraction process, without explicitly defining the weights or dependencies between neighboring nodes. This allows it to capture the structural relationships between fields in the sample database table, thereby improving the prediction accuracy of the prediction model to some extent.

[0071] Please refer to Figure 2 This document illustrates a database table association prediction method provided by an embodiment of this application, which may include the following steps 201 to 202.

[0072] Step 201: Determine the feature matrix and graph structure corresponding to the set of database tables to be processed; the edges in the graph structure represent the association between the database tables to be processed, and the nodes represent the database tables to be processed.

[0073] The implementation process and technical effects of step 201 are similar to those of step 101, and will not be repeated here.

[0074] Step 202: Input the feature matrix and the graph structure into the prediction model, and use the prediction model to predict the relationships between the database tables in the set of database tables to be processed; the prediction model uses, for example... Figure 1 The model training method described in the illustrated embodiment is used to obtain the model.

[0075] In some application scenarios, after the server inputs the feature matrix and graph structure into the prediction model, the feature extractor within the prediction model can extract the node features corresponding to the graph structure. These node features and the graph structure can then be input into the point predictor of the prediction model to obtain the probability of an edge existing between any two nodes in each graph structure. The process of extracting node features and obtaining edge probabilities through the feature extractor corresponds to the relevant part of the training process described earlier, and will not be elaborated here.

[0076] In other application scenarios, the feature extractor within the prediction model can also extract node features from the positive undirected graph corresponding to the database table to be processed, and then input the node features and the negative undirected graph into the point predictor, thereby outputting the corresponding edge probabilities through the point predictor.

[0077] In some application scenarios, if the above probability is greater than the preset probability threshold, it can be regarded as that there is a relationship between the database tables corresponding to the two nodes, thereby achieving the purpose of predicting the relationship.

[0078] In this implementation, the relationships between database tables can be predicted using a predictive model. Because this model has high prediction accuracy, relatively accurate prediction results can be obtained. This overcomes the shortcomings of related technologies, which rely entirely on human familiarity with the database tables to determine relationships, resulting in low prediction efficiency and difficulty in predicting the relationships between massive numbers of database tables.

[0079] Those skilled in the art will understand that, in the methods described in the specific embodiments, the order in which the steps are written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.

[0080] Please refer to Figure 3 The diagram illustrates a structural block diagram of a model training device provided in an embodiment of this application. This model training device can be a module, program segment, or code on an electronic device. It should be understood that this device is similar to the one described above. Figure 1 The method implementation corresponds to this and can be executed. Figure 1 The various steps involved in the method implementation examples.

[0081] Optionally, the above-mentioned model training device includes a sample determination module 301, an extraction module 302, an input module 303, and a convergence module 304. The sample determination module 301 is used to determine the sample graph structure and sample feature matrix corresponding to the sample database table set; the edges in the sample graph structure represent the association relationships between various sample database tables, and the nodes represent sample database tables. The extraction module 302 is used to extract the node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model. The input module 303 is used to input the node features and the sample graph structure into the point predictor of the prediction model, and train the prediction model using the true labels of the sample graph structure as the expected output of the point predictor; the true labels represent the probability that there are connection relationships between various nodes in the sample graph structure. The convergence module 304 is used to determine that the prediction model has converged when the prediction model meets the convergence requirements.

[0082] Optionally, the sample graph structure includes a positive sample graph structure and a negative sample graph structure; the edge relationships in the negative sample graph structure are opposite to those in the positive sample graph structure, and the nodes in the negative sample graph structure are the same as those in the positive sample graph structure; and the extraction module 302 is further configured to: extract the node features corresponding to the positive sample graph structure from the sample feature matrix through the feature extractor; and the input module 303 is further configured to: obtain the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features through the point predictor; and obtain the probability of each edge existing in the negative sample graph structure based on the negative sample graph structure and the node features.

[0083] Optionally, the dot predictor includes a dot product layer and an activation layer; the input module 303 is further configured to: for each edge in the positive sample graph structure, determine the two positive nodes connected by the edge; and input the node features corresponding to the two positive nodes into the dot product layer to perform a dot product operation to obtain the positive sample edge score corresponding to the edge; input the positive sample edge score into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer; for each edge in the negative sample graph structure, determine the two negative nodes connected by the edge; and input the node features corresponding to the two negative nodes into the dot product layer to perform a dot product operation to obtain the negative sample edge score corresponding to the edge; input the negative sample edge score into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer.

[0084] Optionally, the feature extractor includes a preset number of graph convolutional layers; and the extraction module 302 is further configured to: perform graph convolution operations on the sample feature matrix layer by layer through the preset number of graph convolutional layers to obtain the node features.

[0085] Optionally, the sample determination module 301 is further configured to: encode the field information in each of the sample database tables to obtain the sample feature matrix; and determine the sample graph structure based on the association between the various sample database tables.

[0086] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0087] Please refer to Figure 4 The diagram illustrates a structural block diagram of a database table relationship prediction device according to an embodiment of this application. This device can be a module, program segment, or code on an electronic device. It should be understood that this device is similar to the one described above. Figure 2 The method implementation corresponds to this and can be executed. Figure 2 The various steps involved in the method implementation examples.

[0088] Optionally, the database table association prediction device may include a determining module 401 and a prediction module 402. The determining module 401 is used to determine the feature matrix and graph structure corresponding to the set of database tables to be processed; the edges in the graph structure represent the association relationships between the database tables to be processed, and the nodes represent the database tables to be processed; the prediction module 402 is used to input the feature matrix and the graph structure into a prediction model, and predict the association relationships between the database tables in the set of database tables to be processed through the prediction model; the prediction model predicts the association relationships between the database tables in the set of database tables to be processed through methods such as... Figure 1 The model training method in the illustrated embodiment is obtained.

[0089] It should be noted that those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0090] Please refer to Figure 5 , Figure 5 This is a schematic diagram of an electronic device for executing a model training method, provided in an embodiment of this application. The electronic device may include: at least one processor 501, such as a CPU, at least one communication interface 502, at least one memory 503, and at least one communication bus 504. The communication bus 504 is used to establish direct communication between these components. In this embodiment, the communication interface 502 is used for signaling or data communication with other node devices. The memory 503 may be a high-speed RAM or a non-volatile memory, such as at least one disk storage device. Optionally, the memory 503 may also be at least one storage device located remotely from the aforementioned processor. The memory 503 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 501, the electronic device can perform the aforementioned... Figure 1 or Figure 2 The method and process are shown.

[0091] Understandable. Figure 5 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 5 The more or fewer components shown, or having the same Figure 5 The different configurations shown. Figure 5 The components shown can be implemented using hardware, software, or a combination thereof.

[0092] This application provides a computer-readable storage medium storing a computer program thereon. When the computer program is executed by a processor, it can perform actions such as... Figure 1 or Figure 2 The method process executed by the electronic device in the illustrated method embodiment.

[0093] This application provides a computer program product, which includes a computer program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions, and when the program instructions are executed by a computer, the computer can execute the methods provided in the above-described method embodiments. For example, the method may include: determining a sample graph structure and a sample feature matrix corresponding to a set of sample database tables; edges in the sample graph structure representing the association between various sample database tables, and nodes representing sample database tables; extracting node features corresponding to the sample graph structure from the sample feature matrix using a feature extractor of a prediction model; inputting the node features and the sample graph structure into a point predictor of the prediction model, and training the prediction model using the true labels of the sample graph structure as the expected output of the point predictor; the true labels representing the probability that there is a connection relationship between various nodes in the sample graph structure; and determining that the prediction model has converged if the prediction model meets the convergence requirements.

[0094] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.

[0095] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0096] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0097] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.

[0098] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.

Claims

1. A model training method, characterized in that, include: Determine the sample graph structure and sample feature matrix corresponding to the sample database table set; In the sample graph structure, the edges represent the relationships between the various sample database tables, and the nodes represent the sample database tables. The node features corresponding to the sample graph structure are extracted from the sample feature matrix by the feature extractor of the prediction model. The node features and the sample graph structure are input into the point predictor of the prediction model, and the true labels of the sample graph structure are used as the expected output of the point predictor to train the prediction model; the true labels represent the probability that there is a connection relationship between each node in the sample graph structure. If the prediction model meets the convergence requirement, then the prediction model is determined to have converged. The determination of the sample graph structure and sample feature matrix corresponding to the sample database table set includes: The sample feature matrix is ​​obtained by encoding the field information in each of the sample database tables; The sample graph structure is determined based on the relationships between the various sample database tables; The step of determining the sample feature matrix corresponding to the sample database table set includes: collecting field information from all sample database tables in the sample database table set to form a table field library; removing fields whose field names appear less than twice; and performing binary encoding on the field information of each sample database table, encoding 1 where a field exists and 0 where no field exists, to obtain the sample feature matrix.

2. The method according to claim 1, characterized in that, The sample graph structure includes a positive sample graph structure and a negative sample graph structure; the edge relationships in the negative sample graph structure are the opposite of those in the positive sample graph structure, and the nodes in the negative sample graph structure are the same as those in the positive sample graph structure. as well as The step of extracting node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model includes: The feature extractor extracts the node features corresponding to the positive sample graph structure from the sample feature matrix; and The step of inputting the node features and the sample graph structure into the point predictor of the prediction model, and using the true labels of the sample graph structure as the expected output of the point predictor to train the prediction model, includes: The point predictor obtains the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features; and Based on the negative sample graph structure and the node features, the probability of each edge existing in the negative sample graph structure is obtained.

3. The method according to claim 2, characterized in that, The point predictor includes a dot multiplication layer and an activation layer; as well as The step of obtaining the probability of each edge existing in the positive sample graph structure based on the positive sample graph structure and the node features includes: For each edge in the positive sample graph structure, determine the two positive nodes connected by that edge; The node features corresponding to the two positive nodes are input into the dot product operation layer to perform a dot product operation, and the positive sample edge score corresponding to the edge is obtained. The positive sample edge score is input into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer; The step of obtaining the probability of each edge existing in the negative sample graph structure based on the negative sample graph structure and the node features includes: For each edge in the negative sample graph structure, determine the two negative nodes connected by that edge; The node features corresponding to the two negative nodes are input into the dot product operation layer to perform a dot product operation, thereby obtaining the negative sample edge score corresponding to the edge. The negative sample edge score is input into the activation layer to obtain the probability of the edge's existence using a preset activation function in the activation layer.

4. The method according to claim 1, characterized in that, The feature extractor includes a preset number of graph convolutional layers; and The step of extracting node features corresponding to the sample graph structure from the sample feature matrix using the feature extractor of the prediction model includes: The node features are obtained by performing graph convolution operations on the sample feature matrix layer by layer through the preset number of graph convolution layers.

5. A method for predicting database table relationships, characterized in that, include: Determine the feature matrix and graph structure corresponding to the set of database tables to be processed; the edges in the graph structure represent the association between each database table to be processed, and the nodes represent the database tables to be processed. The feature matrix and the graph structure are input into the prediction model, and the prediction model predicts the relationships between the database tables in the set of database tables to be processed; the prediction model is obtained by the model training method as described in any one of claims 1-4.

6. A model training device, characterized in that, include: The sample determination module is used to determine the sample graph structure and sample feature matrix corresponding to the sample database table set; In the sample graph structure, the edges represent the relationships between the various sample database tables, and the nodes represent the sample database tables. The extraction module is used to extract node features corresponding to the sample graph structure from the sample feature matrix through the feature extractor of the prediction model; The input module is used to input the node features and the sample graph structure into the point predictor of the prediction model, and to train the prediction model using the true labels of the sample graph structure as the expected output of the point predictor; the true labels represent the probability that there is a connection relationship between each node in the sample graph structure. The convergence module is used to determine that the prediction model has converged when the prediction model meets the convergence requirements. The determination of the sample graph structure and sample feature matrix corresponding to the sample database table set includes: The sample feature matrix is ​​obtained by encoding the field information in each of the sample database tables; The sample graph structure is determined based on the relationships between the various sample database tables; The step of determining the sample feature matrix corresponding to the sample database table set includes: collecting field information from all sample database tables in the sample database table set to form a table field library; removing fields whose field names appear less than twice; and performing binary encoding on the field information of each sample database table, encoding 1 where a field exists and 0 where no field exists, to obtain the sample feature matrix.

7. A database table relationship prediction device, characterized in that, include, The determination module is used to determine the feature matrix and graph structure corresponding to the set of database tables to be processed; the edges in the graph structure represent the association between each database table to be processed, and the nodes represent the database tables to be processed. The prediction module is used to input the feature matrix and the graph structure into the prediction model, and predict the relationship between the database tables in the set of database tables to be processed through the prediction model; the prediction model is obtained by the model training method as described in any one of claims 1-4.

8. An electronic device, characterized in that, It includes a processor and a memory, the memory storing computer-readable instructions that, when executed by the processor, perform the method as described in any one of claims 1-4 or 5.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it performs the method as described in any one of claims 1-4 or 5.

Citation Information

Patent Citations

  • Information network relationship prediction method and system

    CN111325340A