An Optimization System and Method for Unstructured Data Join Query Based on Twin Networks
The unstructured data connection query optimization system based on twin networks solves the problems of insufficient accuracy and efficiency in existing technologies for unstructured data connection, and realizes efficient and automated data connection and query optimization, which is applicable to database systems with various unstructured data types.
Patent Information
- Application Number
- CN202511234631.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-01
- Publication Date
- 2025-12-02
- Estimated Expiration
- 2045-09-01
AI Technical Summary
Existing methods for joining unstructured data are insufficient in terms of accuracy and efficiency, especially prone to misjudgment in boundary cases, lack a unified feature extraction framework and effective decision-making mechanism, and are difficult to integrate with query optimizers.
A query optimization system for unstructured data connectivity based on Siamese networks is adopted, including a feature extraction module, a Siamese network module, a judgment layer module, a threshold decision module, and a query optimization module. Feature vectors are extracted through a deep learning model, mapped to a low-dimensional embedding space using a Siamese network, and automatic decision-making and verification area division are performed by combining threshold decision and a dedicated inference model, and then integrated with the query optimizer.
It enables efficient join operations for various unstructured data types, improves join accuracy and efficiency, supports automatic decision-making and review area partitioning, optimizes query execution plans, and enhances database query performance.
Smart Images

Figure CN120723958B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the fields of database systems, query optimization, deep learning, and unstructured data processing, and particularly to an unstructured data join query optimization system and method based on Siamese networks. Background Technology
[0002] With the advent of the big data era, unstructured data (such as text, images, and videos) accounts for an increasingly large proportion of database systems. Traditional relational databases primarily handle structured data and have limited capabilities for processing unstructured data. Especially when performing join operations involving unstructured data, the lack of a clear join key makes traditional key-value matching-based join methods difficult to apply, leading to low query efficiency.
[0003] In database systems, join operations are among the most fundamental and time-consuming, especially when dealing with large-scale unstructured data. Existing unstructured data join methods mainly rely on manually defined similarity metrics or simple feature extraction techniques, and the accuracy and efficiency of these methods need improvement in complex scenarios. With the development of deep learning technology, feature extraction and matching methods based on deep neural networks are gradually being applied to database systems, providing new solutions for join operations on unstructured data.
[0004] In deep learning methods, Siamese networks excel at handling similarity comparison tasks due to their unique structural design. A Siamese network consists of two subnetworks sharing weights, mapping input samples to an embedding space where similar samples are closer together and dissimilar samples are farther apart. This structure is particularly well-suited for handling connection problems in unstructured data.
[0005] However, existing deep learning-based unstructured data join systems still have some problems: First, there is a lack of a unified framework for feature extraction of different types of unstructured data (text, images, videos); second, the accuracy of join operations is not high, especially in boundary cases where misjudgments are prone to occur; in addition, there is a lack of effective decision-making mechanisms to balance automated processing and manual intervention, as well as a lack of effective methods to integrate join results with query optimizers.
[0006] Therefore, there is an urgent need for an unstructured data join optimization system and method that can improve the accuracy of unstructured data joins, support automatic decision-making and review area partitioning mechanisms, and be effectively integrated with query optimizers. Summary of the Invention
[0007] The purpose of this invention is to address the problems existing in the prior art by proposing an unstructured data join query optimization system and method based on twin networks. This system can achieve efficient unstructured data join operations, support automatic decision-making and review area partitioning mechanisms, and is effectively integrated with the query optimizer.
[0008] The objective of this invention is achieved through the following technical solution: an unstructured data join query optimization system based on twin networks, comprising:
[0009] The feature extraction module is used to extract raw feature vectors from different types of unstructured data using a deep learning model. The unstructured data includes images, text, and videos.
[0010] The Siamese network module is used to convert feature vectors into low-dimensional embedding vectors. The Siamese network module consists of two sub-networks with shared weights. Each sub-network includes three fully connected layers, each followed by a batch normalization layer, a ReLU activation function, and a Dropout layer.
[0011] The decision layer module is used to calculate the feature difference between two low-dimensional embedding vectors of the same type. After concatenating the feature difference with the original feature vector, it outputs the connection matching probability through a fully connected network.
[0012] The threshold decision module is used to determine the optimal upper and lower threshold pairs through adaptive mapping and grid search, and to divide the connection matching probability into an automatic decision area and a verification area based on the optimal upper and lower threshold pairs. The automatic decision area is used to automatically judge the connection relationship, and the verification area further judges the connection relationship of different types of unstructured data through different types of inference models.
[0013] The query optimization module is used to optimize the query execution plan for unstructured data based on the join matching results.
[0014] Furthermore, the feature extraction module includes:
[0015] Image feature extraction unit, used to extract 2048-dimensional feature vectors of images using ResNet50;
[0016] The text feature extraction unit is used to extract feature vectors from text using BERT or Transformer models.
[0017] The video feature extraction unit is used to extract feature vectors from videos using 3D-CNN or video Transformer models.
[0018] Furthermore, the determination layer module includes:
[0019] The feature difference calculation unit is used to calculate the feature difference between two low-dimensional embedding vectors.
[0020] Feature concatenation unit, used to concatenate feature differences with the original features;
[0021] The fully connected decision unit is used to process spliced features through two layers of fully connected networks and output the connection matching probability.
[0022] Furthermore, the threshold decision module includes:
[0023] Threshold pair search unit, used to search for the best upper and lower threshold pairs on the validation set;
[0024] An automatic decision-making unit is used to automatically determine the connection result based on the connection matching probability and a threshold.
[0025] The verification processing unit is used to further judge the samples that fall into the verification area using a dedicated reasoning model.
[0026] Furthermore, the threshold pair search unit includes:
[0027] An adaptive mapping unit is used to map the connection matching probability distribution to a uniform distribution space according to quantiles;
[0028] A grid search unit is used to search for the optimal threshold pair in the mapped probability space;
[0029] The inverse mapping transformation unit is used to transform threshold pairs in the mapping space back to the original probability space;
[0030] The safety factor adjustment unit is used to adjust the threshold pair by the safety factor to improve system reliability.
[0031] Furthermore, the query optimization module includes:
[0032] The connection cost estimation unit is used to estimate the execution cost of different connection methods;
[0033] The connection strategy selection unit is used to select the optimal connection strategy based on the connection matching results and cost estimation.
[0034] The execution plan generation unit is used to generate optimized query execution plans.
[0035] This invention also provides a method for optimizing unstructured data join queries based on twin networks, comprising:
[0036] (1) Use deep learning models to extract the original feature vectors of unstructured data;
[0037] (2) Based on Siamese network, the high-dimensional feature vector is input into a three-layer fully connected network with shared weights. Each layer is followed by a batch normalization layer, a ReLU activation function and a Dropout layer to obtain a low-dimensional embedding vector, thereby achieving the metric learning objective that similar samples are less than the threshold value and dissimilar samples are greater than the threshold value in the embedding space.
[0038] (3) Calculate the feature difference between the two low-dimensional embedding vectors and concatenate them with the original feature vectors to obtain the concatenated features;
[0039] (4) Process the splicing features through the judgment layer network and output the connection matching probability;
[0040] (5) Determine the optimal upper and lower threshold pairs through adaptive mapping and grid search, and judge the connection matching probability based on the optimal upper and lower threshold pairs. When the connection matching probability is lower than the lower threshold, it is judged as not connected; when the connection matching probability is higher than the upper threshold, it is judged as connected; when the connection matching probability is between the lower threshold and the upper threshold, it is divided into a verification area, and the connection relationship is further judged through a dedicated inference model.
[0041] (6) Optimize the query execution plan for unstructured data based on the join matching results.
[0042] Furthermore, the step of using a deep learning model to extract feature vectors from unstructured data includes:
[0043] For image data, ResNet50 is used to extract 2048-dimensional feature vectors;
[0044] For text data, use BERT or Transformer models to extract feature vectors;
[0045] For video data, feature vectors are extracted using 3D-CNN or Video Transformer models.
[0046] Furthermore, the method also includes a threshold pair search step, specifically:
[0047] Calculate the connection matching probability of all sample pairs on the validation set;
[0048] The probability space is divided according to quantiles by applying adaptive mapping, so that the number of samples in each interval is more uniform;
[0049] Perform a grid search in the mapping space, enumerate and evaluate threshold pairs, and find candidate threshold pairs that meet the target accuracy.
[0050] Sort the candidate threshold pairs according to the optimization objective and select the best threshold pair;
[0051] The optimal threshold pair is transformed back to the original probability space through inverse mapping;
[0052] The system reliability is improved by fine-tuning the threshold using a safety factor;
[0053] Different target accuracy and search strategies can be set for different types of data connection tasks.
[0054] Furthermore, the step of optimizing the query execution plan for unstructured data based on the join matching results includes:
[0055] Estimate the execution cost of different join methods (such as nested loop join, hash join, sort-merge join, etc.);
[0056] Select the optimal connection strategy and execution order based on the connection matching results and cost estimation;
[0057] Generate an optimized query execution plan and provide it to the database execution engine;
[0058] It supports adaptive optimization, dynamically adjusting the connection strategy based on actual execution.
[0059] The beneficial effects of this invention are:
[0060] 1. A unified framework for processing unstructured data: supporting feature extraction and concatenation operations for various unstructured data types such as text, images, and videos;
[0061] 2. Efficient connection optimization: By mapping high-dimensional feature vectors to a low-dimensional embedding space through Siamese networks, the accuracy and efficiency of connection operations are improved;
[0062] 3. Automatic decision-making and review area division mechanism: The automatic decision-making and review area division is effectively achieved by adopting an upper and lower threshold strategy. The review area further improves the judgment accuracy through a dedicated reasoning model.
[0063] 4. Query optimization integration: Effectively integrate join matching results with the query optimizer to optimize the query execution plan and improve overall query performance;
[0064] 5. Adaptive threshold search: By using adaptive mapping and grid search, the optimal threshold pair is found to improve the overall system performance;
[0065] 6. High scalability: The system architecture is modularly designed, and each module can be independently optimized and replaced to adapt to different application scenarios and data types. Attached Figure Description
[0066] Figure 1 An overall architecture diagram of an unstructured data connectivity optimization system based on twin networks;
[0067] Figure 2 This is a schematic diagram of the multimodal feature extraction module structure;
[0068] Figure 3 This is a schematic diagram of a twin network structure;
[0069] Figure 4 This is a schematic diagram of a threshold decision-making mechanism;
[0070] Figure 5 This diagram illustrates the integration of the query optimization module with the database system. Detailed Implementation
[0071] The present invention will now be described in detail with reference to the accompanying drawings. Unless otherwise specified, the features of the following embodiments and implementations can be combined with each other.
[0072] like Figure 1 As shown, this embodiment of the invention provides an unstructured data connection query optimization system based on Siamese networks, including a feature extraction module, a Siamese network module, a judgment layer module, a threshold decision module, and a query optimization module. Specifically, the modules are as follows:
[0073] (1) Feature extraction module
[0074] like Figure 2 As shown, the feature extraction module is used to extract feature vectors from different types of unstructured data, including image feature extraction unit, text feature extraction unit and video feature extraction unit.
[0075] The image feature extraction unit uses a pre-trained ResNet50 network to extract a 2048-dimensional feature vector from the image. ResNet50 is a deep residual network that solves the gradient vanishing problem in deep neural network training through skip connections, enabling it to extract high-level semantic features of images. In this system, the last fully connected layer of ResNet50 is removed, and the 2048-dimensional feature vector from the penultimate layer is used as the image representation.
[0076] The text feature extraction unit uses BERT or Transformer models to extract feature vectors from the text. BERT (Bidirectional Encoder Representations from Transformers) is a pre-trained language model capable of generating context-sensitive text representations. By segmenting and encoding the text, BERT can convert the text into high-dimensional feature vectors, capturing the semantic information of the text.
[0077] The video feature extraction unit uses either a 3D-CNN or a video Transformer model to extract feature vectors from the video. 3D-CNN, by extending a traditional 2D convolutional neural network in the temporal dimension, can simultaneously capture the spatial and temporal features of the video. The video Transformer, on the other hand, processes the video sequence through a self-attention mechanism to generate feature representations containing spatiotemporal information.
[0078] (2) Twin network module
[0079] like Figure 3 As shown, the Siamese network module consists of two sub-networks with shared weights. Each sub-network contains three fully connected layers to map feature vectors of different types of unstructured data to the same low-dimensional embedding space. The core feature of the Siamese network is that the two sub-networks share identical weight parameters. This design allows the network to learn the similarities and differences between samples, rather than specific sample categories. This structure is particularly suitable for solving unstructured data connectivity problems, and its main advantages include:
[0080] 1) Parameter sharing mechanism: The two sub-networks share the same weight parameters, ensuring consistent processing of any input pair, reducing the number of model parameters and improving training efficiency;
[0081] 2) Metric learning ability: Through contrastive learning, Siamese networks can map high-dimensional features into a metric space, so that semantically similar samples are closer in the embedding space and dissimilar samples are farther apart;
[0082] 3) Few-shot adaptability: Compared with traditional classification models, Siamese networks have less dependence on training data and perform well in data-sparse scenarios;
[0083] 4) Cross-modal compatibility: By sharing a weight structure, it can effectively handle connection matching between different types of unstructured data, such as image-image, text-image and other combinations;
[0084] 5) Easy to optimize: The Siamese structure makes the network less prone to overfitting during training and has better generalization ability.
[0085] The specific network structure is as follows:
[0086] The first layer takes a high-dimensional feature vector as input (such as a 2048-dimensional image, a text or video feature vector), outputs a 512-dimensional vector, followed by a batch normalization layer, a ReLU activation function, and a Dropout layer (dropout rate 0.3).
[0087] The second layer: inputs a 512-dimensional vector and outputs a 256-dimensional vector, followed by a batch normalization layer, a ReLU activation function, and a Dropout layer (dropout rate 0.3).
[0088] The third layer: inputs a 256-dimensional vector and outputs a 128-dimensional embedding vector, followed by a batch normalization layer, a ReLU activation function, and a Dropout layer (dropout rate 0.3).
[0089] The training of Siamese networks employs a multi-objective loss function, which minimizes the distance between similar samples in the embedding space and maximizes the distance between dissimilar samples, while maintaining the comparability of embedding vectors from different data types. The loss function is defined as follows:
[0090] L=α*L_contrastive+β*L_triplet+γ*L_classification;
[0091] Here, L_contrastive is the contrastive loss, which calculates the Euclidean distance between sample pairs; L_triplet is the triplet loss, ensuring that the distance between the anchor sample and the positive sample is less than the distance to the negative sample; L_classification is the classification loss, providing additional supervision signals; and α, β, and γ are weighting coefficients. By adjusting these weighting coefficients, the contributions of different loss terms can be balanced, optimizing the model's performance on different types of unstructured data.
[0092] (3) Judgment layer module
[0093] The decision layer module is used to calculate the connection matching probability between two embedding vectors and evaluate the connection relationship between unstructured data, including the following steps:
[0094] Calculate the difference features between two embedding vectors (such as Euclidean distance, cosine similarity, dot product, and other similarity measures).
[0095] The differential features are concatenated with the original embedding vector to form an enhanced feature representation;
[0096] The splicing features are processed by a two-layer fully connected network, and the connection matching probability is output.
[0097] The fully connected network structure is as follows:
[0098] First layer: Input concatenated features, output a 64-dimensional vector, followed by a ReLU activation function;
[0099] The second layer takes a 64-dimensional vector as input and outputs a 1-dimensional probability value, followed by a Sigmoid activation function.
[0100] The judgment layer module supports connection matching evaluation between different types of unstructured data, such as image-image, text-text, image-text, video-image, and other combinations, providing reliable similarity evaluation for connection operations in database systems.
[0101] (4) Threshold decision module
[0102] like Figure 4 As shown, the threshold decision module implements automatic decision-making and review area division mechanisms based on connection matching probability, using upper and lower threshold pair strategies:
[0103] Lower threshold: When the probability of a connection matching is lower than this threshold, the connection is determined not to be established.
[0104] Upper threshold: When the probability of a connection matching is higher than this threshold, it is considered a connection.
[0105] When the connection matching probability is between the lower threshold and the upper threshold, it is divided into a verification zone, and the connection matching probability is further judged by a dedicated inference model.
[0106] The review section employs a dedicated inference model to perform precise analysis of unstructured data. Different inference models are used for different types of data:
[0107] For image data: Use object detection models such as YOLO to extract target objects, attributes, and relationship information from the image;
[0108] For text data: Use named entity recognition and relation extraction models to extract entities and relations from the text;
[0109] For video data: use action recognition and scene segmentation models to extract spatiotemporal information from the video.
[0110] By using detailed information obtained through a dedicated reasoning model, combined with domain knowledge and connection rules, accurate connection judgments can be made on samples in the verification area, effectively reducing misjudgments.
[0111] The search for threshold pairs employs an adaptive mapping and grid search method:
[0112] Adaptive mapping: The original connection matching probability distribution is divided according to quantiles and mapped to a more uniform distribution space, which facilitates more refined threshold search;
[0113] Grid search: In the mapped probability space, the optimal threshold pair that satisfies the target accuracy is found through grid search with a fixed step size;
[0114] Inverse mapping transformation: Transform the determined threshold pairs in the mapping space back to the original probability space through inverse mapping;
[0115] Safety factor: The accuracy of the target is adjusted by the safety factor to improve the reliability of the system.
[0116] The threshold decision module can automatically adjust threshold pairs based on different types of unstructured data join tasks, adapting to varying data distributions and join requirements. Simultaneously, by adjusting the review zone range (i.e., the upper and lower threshold intervals), it can balance the system's automation level and accuracy requirements. Furthermore, the threshold decision module supports online learning and feedback mechanisms, continuously optimizing threshold pair settings based on review zone results to improve system performance.
[0117] (5) Query optimization module
[0118] like Figure 5 As shown, the query optimization module is responsible for integrating the join matching results with the database query optimizer to optimize the query execution plan for unstructured data, including the following functions:
[0119] Join cost estimation: Based on the join matching results and data characteristics, estimate the execution cost of different join methods (such as nested loop join, hash join, sort-merge join, etc.);
[0120] Connection strategy selection: Based on the cost estimation results, select the optimal connection strategy and execution order;
[0121] Execution plan generation: Generates a query execution plan containing the optimal join operations and provides it to the database execution engine.
[0122] The query optimization module is tightly integrated with the database system's query optimizer, incorporating the characteristics of unstructured data joins into the overall query optimization process to achieve end-to-end query performance improvements. Furthermore, this module supports adaptive optimization, dynamically adjusting join strategies based on actual execution conditions to address changes in data distribution and query patterns.
[0123] Based on the above system, this invention also provides a method for optimizing unstructured data join queries based on twin networks, comprising the following steps:
[0124] (1) Feature extraction
[0125] Use deep learning models to extract feature vectors from different types of unstructured data. The specific steps are as follows:
[0126] For image data:
[0127] Resize the input image to 224×224;
[0128] The 2048-dimensional feature vector of the penultimate layer is obtained through the forward propagation of the ResNet50 network.
[0129] L2 normalization is applied to the feature vectors to improve their robustness.
[0130] For text data:
[0131] Perform word segmentation and encoding on the text;
[0132] Extract text feature vectors using BERT or Transformer models;
[0133] Standardize the feature vectors.
[0134] For video data:
[0135] Extract keyframes or temporal features;
[0136] Feature vectors are extracted using 3D-CNN or video Transformer models;
[0137] Standardize the feature vectors.
[0138] (2) Feature mapping of twin networks
[0139] Siamese networks map high-dimensional feature vectors to a low-dimensional embedding space. The design philosophy of Siamese networks is to utilize a weight-sharing, two-branch structure to learn a similarity measure between samples, rather than an absolute classification of samples. The specific steps are as follows:
[0140] Feature vectors of different types of unstructured data are input into two identical sub-networks that share weights.
[0141] Each subnetwork contains three fully connected layers, each followed by a batch normalization layer, a ReLU activation function, and a Dropout layer.
[0142] By using a weight-sharing mechanism, we ensure that the two inputs undergo the same transformation, thus guaranteeing the consistency of the feature space.
[0143] A unified low-dimensional embedding vector (e.g., 128-dimensional) is obtained as a compact representation of the data;
[0144] The network is trained using contrastive loss and triplet loss, which makes the embedding vectors of similar sample pairs closer together and the embedding vectors of dissimilar sample pairs farther apart.
[0145] Ensure that embedding vectors of different types of data are comparable in the same feature space, and support cross-modal matching;
[0146] The embedding space is optimized through metric learning to give it better semantic structure and discriminative ability.
[0147] (3) Calculation and splicing of feature differences
[0148] Calculate the difference between the two embedding vectors and concatenate them with the original features. The specific steps are as follows:
[0149] Calculate various difference features between two embedding vectors, such as Euclidean distance, cosine similarity, and dot product.
[0150] The differential features are concatenated with the original embedding vector to form an enhanced feature representation;
[0151] For connections between different types of data (such as text-image), specific feature fusion strategies are employed to ensure the effectiveness of difference calculation.
[0152] (4) Calculation of connection matching probability
[0153] The concatenated features are processed by a decision layer network, which outputs the connection matching probability. The specific steps are as follows:
[0154] The spliced features are input into a two-layer fully connected network;
[0155] The first fully connected layer is followed by a ReLU activation function;
[0156] The second fully connected layer is followed by a Sigmoid activation function, which outputs the connection matching probability between 0 and 1.
[0157] Different decision layer network structures can be adopted based on the characteristics of different types of data connections.
[0158] (5) Threshold decision
[0159] The system automatically determines the probability of connection matching based on a preset threshold, enabling automatic decision-making and verification zone division. The specific steps are as follows:
[0160] When the connection matching probability is lower than the lower threshold, it is determined that no connection will be established;
[0161] When the connection matching probability is higher than the upper threshold, it is determined to be a connection;
[0162] When the connection matching probability is between the lower threshold and the upper threshold, it is divided into a review area and further processed by a dedicated inference model.
[0163] For samples in the verification area, select an appropriate dedicated inference model based on the data type (e.g., use the YOLO model for image data) to obtain more accurate unstructured data information, and make a final judgment in combination with domain rules;
[0164] The threshold pairs and verification zone processing strategies can be dynamically adjusted based on the importance and accuracy requirements of different connection tasks.
[0165] (6) Threshold for search
[0166] Search for the optimal threshold pair on the validation set to achieve the specified accuracy requirement. The specific steps are as follows:
[0167] Calculate the connection matching probability of all sample pairs on the validation set;
[0168] Apply adaptive mapping: Divide the probability space according to quantiles to make the number of samples in each interval more uniform;
[0169] Perform a grid search in the mapping space, enumerate and evaluate threshold pairs, and find candidate threshold pairs that meet the target accuracy.
[0170] Sort the candidate threshold pairs according to the optimization objective and select the best threshold pair;
[0171] The optimal threshold pair is transformed back to the original probability space through inverse mapping;
[0172] The system reliability is improved by fine-tuning the threshold using a safety factor;
[0173] Different target accuracy and search strategies can be set for different types of data connection tasks.
[0174] (7) Query execution plan optimization
[0175] Optimize the query execution plan for unstructured data based on join matching results. The specific steps are as follows:
[0176] Estimate the execution cost of different join methods (such as nested loop join, hash join, sort-merge join, etc.);
[0177] Select the optimal connection strategy and execution order based on the connection matching results and cost estimation;
[0178] Generate an optimized query execution plan and provide it to the database execution engine;
[0179] It supports adaptive optimization, dynamically adjusting the connection strategy based on actual execution.
[0180] The system and method of this invention can be applied to various scenarios, such as multimodal database querying, cross-media information retrieval, and intelligent data integration. Through feature mapping, threshold decision-making mechanisms, and query plan optimization using twin networks, efficient unstructured data connection operations can be achieved, significantly improving database query performance and effectively balancing automated processing and manual intervention.
[0181] The above embodiments are only used to illustrate the design concept and features of the present invention, and their purpose is to enable those skilled in the art to understand the content of the present invention and implement it accordingly. The protection scope of the present invention is not limited to the above embodiments. Therefore, all equivalent changes or modifications made based on the principles and design ideas disclosed in the present invention are within the protection scope of the present invention.
Claims
1. A system for optimizing unstructured data join queries based on twin networks, characterized in that, include: The feature extraction module is used to extract raw feature vectors from different types of unstructured data using a deep learning model. The unstructured data includes images, text, and videos. The Siamese network module is used to convert feature vectors into low-dimensional embedding vectors. The Siamese network module consists of two sub-networks with shared weights. Each sub-network includes three fully connected layers, each followed by a batch normalization layer, a ReLU activation function, and a Dropout layer. The decision layer module is used to calculate the feature difference between two low-dimensional embedding vectors of the same type. After concatenating the feature difference with the original feature vector, it outputs the connection matching probability through a fully connected network. The threshold decision module determines the optimal upper and lower threshold pairs through adaptive mapping and grid search. Based on these optimal upper and lower threshold pairs, it divides the connection matching probability into an automatic decision zone and a verification zone. The automatic decision zone automatically judges the connection relationship: when the connection matching probability is lower than the lower threshold, it is determined as a disconnect; when the connection matching probability is higher than the upper threshold, it is determined as a connection. When the connection matching probability is between the lower and upper thresholds, it is divided into a verification zone. The verification zone further judges the connection relationship for different types of unstructured data using different types of inference models. Specifically, the adaptive mapping and grid search are performed by dividing the connection matching probability distribution according to quantiles to map it to a more uniform distribution space. In the mapped distribution space, the optimal upper and lower threshold pairs that meet the target accuracy are found through grid search with a fixed step size. The query optimization module is used to optimize the query execution plan for unstructured data based on join relationships.
2. The system according to claim 1, characterized in that, The feature extraction module includes: Image feature extraction unit, used to extract 2048-dimensional feature vectors of images using ResNet50; The text feature extraction unit is used to extract feature vectors from text using BERT or Transformer models. The video feature extraction unit is used to extract feature vectors from videos using 3D-CNN or video Transformer models.
3. The system according to claim 1, characterized in that, The determination layer module includes: The feature difference calculation unit is used to calculate the feature difference between two low-dimensional embedding vectors. Feature concatenation unit, used to concatenate feature differences with the original features; The fully connected decision unit is used to process spliced features through two layers of fully connected networks and output the connection matching probability.
4. The system according to claim 1, characterized in that, The threshold decision module includes: Threshold pair search unit, used to search for the best upper and lower threshold pairs on the validation set; An automatic decision-making unit is used to automatically determine connection relationships based on connection matching probability and threshold. The verification processing unit is used to further judge the samples that fall into the verification area using a dedicated reasoning model.
5. The system according to claim 4, characterized in that, The threshold pair search unit includes: An adaptive mapping unit is used to map the connection matching probability distribution to a uniform distribution space according to quantiles; A grid search unit is used to search for the optimal threshold pair in the mapped probability space; The inverse mapping transformation unit is used to transform threshold pairs in the mapping space back to the original probability space; The safety factor adjustment unit is used to adjust the threshold pair by the safety factor to improve system reliability.
6. The system according to claim 1, characterized in that, The query optimization module includes: The connection cost estimation unit is used to estimate the execution cost of different connection methods; The connection strategy selection unit is used to select the optimal connection strategy based on the connection relationship and cost estimation. The execution plan generation unit is used to generate optimized query execution plans.
7. A method for optimizing unstructured data join queries based on Siamese networks, characterized in that, include: (1) Use deep learning models to extract the original feature vectors of unstructured data; (2) Based on Siamese network, the high-dimensional feature vector is input into a three-layer fully connected network with shared weights. Each layer is followed by a batch normalization layer, a ReLU activation function and a Dropout layer to obtain a low-dimensional embedding vector, thereby achieving the metric learning objective that similar samples are less than the threshold value and dissimilar samples are greater than the threshold value in the embedding space. (3) Calculate the feature difference between the two low-dimensional embedding vectors and concatenate them with the original feature vectors to obtain the concatenated features; (4) Process the splicing features through the judgment layer network and output the connection matching probability; (5) Determine the optimal upper and lower threshold pairs through adaptive mapping and grid search, and judge the connection matching probability based on the optimal upper and lower threshold pairs. When the connection matching probability is lower than the lower threshold, it is judged as not connected; when the connection matching probability is higher than the upper threshold, it is judged as connected; when the connection matching probability is between the lower threshold and the upper threshold, it is divided into a verification zone, and the connection relationship is further judged through a dedicated inference model. The adaptive mapping and grid search are as follows: the connection matching probability distribution is divided according to the quantile and mapped to a more uniform distribution space; in the mapped distribution space, the optimal upper and lower threshold pairs that meet the target accuracy are found through grid search with a fixed step size. (6) Optimize the query execution plan for unstructured data based on the connection relationship.
8. The method according to claim 7, characterized in that, The steps for extracting feature vectors from unstructured data using a deep learning model include: For image data, ResNet50 is used to extract 2048-dimensional feature vectors; For text data, use BERT or Transformer models to extract feature vectors; For video data, feature vectors are extracted using 3D-CNN or Video Transformer models.
9. The method according to claim 7, characterized in that, The method further includes a threshold pair search step, specifically: Calculate the connection matching probability of all sample pairs on the validation set; The probability space is divided according to quantiles by applying adaptive mapping, so that the number of samples in each interval is more uniform; Perform a grid search in the mapping space, enumerate and evaluate threshold pairs, and find candidate threshold pairs that meet the target accuracy. Sort the candidate threshold pairs according to the optimization objective and select the best threshold pair; The optimal threshold pair is transformed back to the original probability space through inverse mapping; The reliability of the system can be improved by fine-tuning the threshold using a safety factor.
10. The method according to claim 7, characterized in that, The steps for optimizing the query execution plan for unstructured data based on join relationships include: Estimate the execution cost of different join methods; Select the optimal connection strategy based on connection relationships and cost estimates; Generate an optimized query execution plan.
Citation Information
Patent Citations
Information security knowledge entity relationship connection prediction method and system, and medium
CN114579761A
Database query optimization method and system, electronic equipment and storage medium
CN116028528A