A data structure analysis and modeling method and system based on deep learning

By introducing deep learning methods of structure perception layer and graph structure coding module in data modeling, the problem of insufficient understanding of data structures in the existing technology is solved, efficient and automated data modeling and sharing are achieved, and the accuracy and sharing efficiency of modeling are improved.

CN119740613APending Publication Date: 2025-04-01GUANGZHOU HUITONG GUOXIN TECH CO LTD
View PDF 0 Cites 5 Cited by

Patent Information

Application Number
CN202411781621.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-01

AI Technical Summary

Technical Problem

The prior art has difficulty in deeply understanding data structures and relationships when processing structured data, resulting in insufficient modeling results, inefficient sharing, and lack of automation and scalability.

Method used

Using a deep learning-based method, deep understanding and feature extraction of data structures are carried out by building a Transformer encoder-decoder model with structure perception layer and graph structure encoding module. The method includes model pre-training, data input processing, feature fusion and modeling decision generation, as well as the construction of high-dimensional semantic vectors and the establishment of approximate nearest neighbor search indexes.

Benefits of technology

It achieves a deep understanding of data structures and entity relationships, improves the accuracy and automation of modeling, supports efficient model retrieval and matching, and ensures the security and reliability of data sharing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119740613A_ABST
    Figure CN119740613A_ABST
Patent Text Reader

Abstract

The present invention discloses a data structure analysis and modeling method and system based on deep learning. The method constructs a Transformer encoder-decoder model integrating a structure perception layer and a graph structure encoding module, and realizes a deep understanding of data structure and entity relationship through pre-training of structure reconstruction and relationship reasoning tasks. The system includes core components such as a structure perception layer, a graph structure encoding module, an encoder-decoder unit, and a vector mapping and index retrieval unit. The structure perception layer is used to identify hierarchical structure features, and the graph structure encoding module is used to extract association relationships. The data model is mapped into a high-dimensional semantic vector, and model retrieval and sharing are realized based on approximate nearest neighbor search. The present invention solves the technical problems that traditional data modeling methods are difficult to accurately understand complex data structures, have a low degree of automation, and have poor model reuse efficiency. The present invention innovatively introduces a structure perception mechanism, which significantly improves the intelligence level and accuracy of data modeling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data modeling technology, and in particular to a data structure analysis and modeling method and system based on deep learning. Background Art

[0002] With the rapid development of informatization and digitalization, various industries have generated a large amount of heterogeneous structured data with different organizational forms and expressions, such as the table structure in relational databases, the class hierarchy in object-oriented programs, the tag nesting structure of XML documents, and the key-value pair structure of JSON files. How to effectively understand, model and share these data with complex structural characteristics has become an important challenge in the current data management and knowledge engineering fields.

[0003] In the prior art, the modeling and sharing of structured data mainly adopts serialization or flattening processing methods. This method often ignores the hierarchical relationship and association characteristics between data, lacks the ability to deeply understand the data structure, and is difficult to accurately grasp the inherent organizational laws of the data. Especially when dealing with complex nested structures and multi-level relationships, existing methods are difficult to accurately extract and represent features. In addition, traditional data modeling methods mainly rely on manual experience and predefined rules. The modeling process lacks flexibility and adaptability, and it is difficult to take into account both the structural characteristics and semantic characteristics of the data at the same time, resulting in incomplete modeling results. The ability to express new data structures and complex relationships is also relatively limited, making it difficult to meet diverse modeling needs.

[0004] In terms of data model sharing, due to the lack of unified representation and measurement standards between data models from different sources and formats, existing model matching and retrieval methods mainly rely on keywords or simple structural comparisons, which are not only inaccurate but also inefficient. At the same time, the data model sharing process lacks effective compression and security mechanisms, making it difficult to ensure transmission efficiency and security. Existing methods also have obvious deficiencies in scalability, poor adaptability to new data types and structural features, and difficulty in effectively handling the storage and retrieval requirements of large-scale data models. They also lack effective support for model evolution and version management. More importantly, the current data modeling process is overly dependent on the experience and knowledge of domain experts, and model reuse and sharing require a lot of manual intervention and adjustment. There is a lack of intelligent decision support and recommendation mechanisms, and the degree of automation is low.

[0005] In order to solve the above technical problems, the present invention proposes a data structure analysis and modeling method based on deep learning. This method enhances the ability to understand the data structure by introducing a structure perception layer and a graph structure encoding module, uses a pre-training mechanism to improve the versatility of the model, and uses a high-dimensional semantic vector to achieve efficient model retrieval and sharing. This method can deeply understand the structural characteristics and semantic information of the data, has powerful model expression and feature extraction capabilities, supports efficient model retrieval and matching, and has good scalability and automation level. It can also ensure the security and reliability of the data sharing process, and provides a new technical solution for solving the problems in the prior art. Summary of the invention

[0006] The purpose of the present invention is to propose a data structure analysis and modeling method based on deep learning to solve the problems of insufficient understanding of data structure, limited model expression ability, low sharing efficiency, poor scalability and low automation in the prior art, and to improve the modeling efficiency and sharing quality of structured data. To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0007] A data structure analysis and modeling method based on deep learning, comprising the following steps:

[0008] S1. Build a Transformer encoder-decoder model with a structure-aware layer and a graph structure encoding module to achieve a deep understanding of data structures and relationships;

[0009] S2. For the Transformer model, pre-training is performed using model structure reconstruction and relationship reasoning tasks to enable the model to understand general data structures and entity relationships;

[0010] S3. for the pre-trained model, obtaining structured data to be modeled containing entity and relationship information as input data to be processed;

[0011] S4. Input the data to be modeled into the pre-trained Transformer model, identify the hierarchical structure of the data through the structure perception layer, extract the association relationship between entities through the graph structure encoding module, and automatically parse and extract features of the data structure;

[0012] S5. The Transformer encoder-decoder model uses feature concatenation and multi-head self-attention mechanism to integrate the hierarchical features of the structure perception layer and the relational features of the graph structure encoding module to generate a modeling decision sequence of entity type, relationship type and attribute definition;

[0013] S6. Encode the constructed initial relational data model using the multi-head attention mechanism and feedforward neural network of the Transformer encoder, and map the data model into a high-dimensional semantic vector of fixed dimension by combining average pooling and vector normalization operations;

[0014] S7. For the high-dimensional semantic vector, construct a semantic vector index space based on approximate nearest neighbor search, and realize retrieval, matching and sharing of data models through cosine similarity calculation;

[0015] Furthermore, in the Transformer encoder-decoder model of S1:

[0016] The structure perception layer uses the long short-term memory network LSTM to process hierarchical data structures. The input gate controls the influence of new input information, the forget gate controls the retention of historical information, and the output gate controls the output of the current unit state.

[0017] The graph structure encoding module uses a graph convolutional neural network (GCN) to aggregate the features of entity nodes and edges. In the node feature aggregation stage, the feature information of adjacent nodes is integrated. In the edge feature update stage, the relationship representation between connected nodes is updated. In the graph representation learning stage, an embedded representation of the overall graph structure is generated.

[0018] Among them, the encoder part is responsible for feature extraction and encoding of input data, and the decoder part generates a target output sequence based on the encoding result. The encoder and decoder interact with each other through the attention mechanism.

[0019] Furthermore, in S2, the Transformer model is pre-trained by the following tasks:

[0020] The model structure reconstruction task masks the node type, connection relationship and attribute information in the input data, uses the structure perception layer to restore the node information, and uses the graph structure encoding module to reconstruct the connection relationship;

[0021] The relational reasoning task selects entity pair samples by constructing positive and negative sample pairs, extracts the structural features of the entities using the structure perception layer, calculates the connection features between entities using the graph structure encoding module, and determines the relationship type and direction between entity pairs based on the feature analysis results.

[0022] Furthermore, the structured data to be modeled in S3 includes data tables with row and column structures, which contain primary keys, foreign keys and field definitions; object trees with hierarchical structures, which contain inheritance and combination relationships between nodes; XML documents with nested tag structures, which contain element nodes and attribute nodes; and JSON files with key-value pair structures, which support nesting of objects and arrays.

[0023] Further, in S4, for the data to be modeled obtained in S3, the data table with a row and column structure, the object tree with a hierarchical structure, the XML document with a tag nesting structure, and the JSON file with a key-value pair structure are uniformly converted into a serialized input;

[0024] The LSTM network of the structure perception layer processes serialized input, extracts the nested depth of data, calculates the maximum depth and average depth of the data structure, counts the number of nodes at each level, identifies the parent-child node relationship, determines the direct parent node and child node, analyzes the sibling node relationship, identifies the node group at the same level, and adjusts the retention degree of information at each level through the gating mechanism;

[0025] The GCN network of the graph structure encoding module processes entity relationships, maps entities to nodes in the graph, maps relationships between entities to edges, assigns initial feature vectors to nodes and edges, performs node message transmission, aggregates feature information of adjacent nodes, updates the state representation of the current node, and generates an overall graph structure feature representation;

[0026] The hierarchical structure features output by LSTM and the graph structure features output by GCN are concatenated, and the concatenated features are uniformly encoded through the Transformer encoder to obtain the fused data structure analysis and feature extraction results.

[0027] Furthermore, the process of generating a modeling decision sequence by the Transformer encoder-decoder model in S5 includes:

[0028] The hierarchical structure feature vector output by the structure perception layer is concatenated with the relational feature vector output by the graph structure encoding module to form a unified feature representation;

[0029] The concatenated features are processed through a multi-head self-attention mechanism, where the number of attention heads is set to 4-16, and each attention head independently calculates the query, key, and value mapping matrices to achieve attention to different feature dimensions;

[0030] Position coding is used to enhance the position information in the feature sequence, and the position coding is added to the feature representation and then input into the encoder;

[0031] The encoder passes through 4-8 layers of Transformer encoding layers, each of which contains a multi-head self-attention sublayer and a feedforward neural network sublayer, with residual connections and layer normalization added in the middle to obtain the encoding result;

[0032] The decoder performs autoregressive decoding based on the encoder output through 4-8 layers of Transformer decoding layers. Each layer contains a self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward network sublayer, and outputs modeling decision tokens position by position.

[0033] The modeling decision token includes an entity type identifier, a relationship type identifier, an attribute definition identifier, etc., and forms a complete modeling decision sequence according to grammatical rules.

[0034] Furthermore, the process of mapping the data model into a high-dimensional semantic vector in S6 includes:

[0035] The attention weights between components in the data model are calculated using the multi-head attention mechanism of the Transformer encoder, and the local feature representation is extracted through a feedforward neural network, wherein the number of attention heads of the multi-head attention mechanism is set to 4-16, and the dimension of each attention head is between 32-128. The feedforward neural network includes two fully connected layers, the output dimension of the first layer is 2-4 times the input dimension, and the second layer maps the features back to the original dimension, wherein the dimension range of the local feature representation is between 64-512;

[0036] Perform sequence preprocessing on the variable-length feature sequence output by the encoder, including length normalization and redundant information filtering;

[0037] A weighted average pooling operation is used to calculate the weight coefficient of each position in the sequence based on the attention score, and a weighted average is performed along the sequence dimension to generate a semantic vector of fixed dimension.

[0038] The generated semantic vectors are subjected to L2 normalization and the vector space distribution is optimized through principal component analysis to generate high-dimensional semantic vectors with dimensions between 128 and 1024.

[0039] Furthermore, the process of constructing an index space based on high-dimensional semantic vectors and realizing data model retrieval, matching and sharing in S7 includes:

[0040] Based on the obtained high-dimensional semantic vector set, an approximate nearest neighbor search algorithm is used to establish an index. By analyzing the distribution density and clustering characteristics of the vectors, the vector space is divided into 8-32 subspaces. A two-layer index structure consisting of a coarse-grained global index and a fine-grained local index is constructed to finely divide the vectors in each subspace.

[0041] In the vector similarity calculation stage, the cosine similarity measurement is used in combination with the characteristics of high-dimensional semantic vectors, and the cosine similarity threshold is set between 0.6 and 0.9 for initial screening. The search results are sorted in descending order by similarity score. For the similar data models retrieved, their structural features and semantic features are extracted for precise matching to determine the set of data models that can be shared.

[0042] For the successfully matched data model, the model's structure definition, relationship mapping, attribute configuration and metadata information are serialized into a unified intermediate format, and the serialized data is compressed and encoded using a lossless compression algorithm based on a dictionary tree to generate a compressed package with a digital signature to achieve secure transmission and verification of the data model. A data structure analysis and modeling system based on deep learning, characterized by comprising: a Transformer structure perception layer, using a long short-term memory network LSTM to process hierarchical data structures, and controlling the information processing flow through input gates, forget gates and output gates;

[0043] The Transformer graph structure encoding module uses a graph convolutional neural network (GCN) to aggregate and update the features of entity nodes and edges;

[0044] Transformer encoder, which consists of 4-8 layers of Transformer encoding layers, each of which has a multi-head self-attention sublayer and a feedforward neural network sublayer;

[0045] Transformer decoder, comprising 4-8 layers of Transformer decoding layers, each layer comprising a self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward network sublayer, wherein the number of attention heads of the multi-head self-attention mechanism is set to 4-16, and the dimension of each attention head is between 32-128;

[0046] A model training unit, used for pre-training the Transformer encoding and decoding unit through a model structure reconstruction task and a relational reasoning task;

[0047] A data processing unit, used to obtain structured data to be modeled and convert the data into a serialized input format;

[0048] The vector mapping unit is used to extract local features through a multi-head attention mechanism and a feedforward neural network, preprocess the feature sequence, and generate a high-dimensional semantic vector with a dimension between 128 and 1024;

[0049] The index retrieval unit is used to build a double-layer index structure and divide the vector space into 8-32 subspaces, match data models based on cosine similarity, sort and filter the retrieval results, and serialize and securely transmit the successfully matched data models.

[0050] The data sharing unit is used to convert the data model into a unified intermediate format, use a lossless compression algorithm based on a dictionary tree to compress the data, generate a digital signature and realize secure data transmission.

[0051] The beneficial effects of the present invention are as follows:

[0052] (1) The present invention achieves a deep understanding of data structure and entity relationships through the synergy of the structure perception layer and the graph structure encoding module, overcoming the problem of insufficient understanding of data structure in the prior art. The structure perception layer can effectively capture the hierarchical features of the data, and the graph structure encoding module can accurately extract the association relationship between entities, greatly improving the accuracy and comprehensiveness of data modeling.

[0053] (2) The present invention adopts a pre-training mechanism to improve the versatility and adaptability of the model through model structure reconstruction and relational reasoning tasks, so that the model can process various types of structured data, effectively solving the problem of limited model expression ability in the prior art. At the same time, the pre-training mechanism also reduces the dependence on the experience of domain experts and improves the automation level of the modeling process.

[0054] (3) The present invention innovatively maps the data model into a high-dimensional semantic vector and constructs an index space based on approximate nearest neighbor search, achieving efficient model retrieval and matching. Through cosine similarity calculation and exact matching strategy, the efficiency and accuracy of model sharing are greatly improved. In addition, the lossless compression algorithm based on dictionary tree and digital signature mechanism are adopted to ensure the efficiency and security of data transmission.

[0055] (4) The system architecture of the present invention has good scalability and flexibility, and can easily adapt to newly added data types and structural features. Through the multi-layer Transformer structure and configurable parameter settings, the system can effectively handle the storage and retrieval requirements of large-scale data models and support model evolution and version management. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] In order to more clearly illustrate the implementation of the present invention or the existing technical solutions, the following briefly introduces the drawings required to be used in the embodiments or the description of the prior art.

[0057] Figure 1 Flowchart of the Transformer-based structure-aware data modeling and sharing method.

[0058] Figure 2 Flowchart for model pre-training.

[0059] Figure 3 A diagram of the model sharing mechanism. DETAILED DESCRIPTION

[0060] The present invention provides a data structure analysis and modeling method based on deep learning, and the present invention is described in detail below in conjunction with specific embodiments. Figure 1 The main steps of the method provided by the present invention are as follows:

[0061] (1) Build a Transformer encoder-decoder model with a structure-aware layer and a graph structure encoding module to achieve a deep understanding of data structures and relationships;

[0062] (2) For the Transformer model, pre-training is performed using model structure reconstruction and relationship reasoning tasks to enable the model to understand general data structures and entity relationships;

[0063] (3) For the pre-trained model, obtain the structured data to be modeled containing entity and relationship information as input data to be processed;

[0064] (4) inputting the data to be modeled into the pre-trained Transformer model, identifying the hierarchical structure of the data through the structure perception layer, and extracting the association relationship between entities through the graph structure encoding module;

[0065] (5) The Transformer encoder-decoder model uses feature concatenation and multi-head self-attention mechanism to integrate features and generate modeling decision sequences;

[0066] (6) Use the Transformer encoder’s multi-head attention mechanism and feedforward neural network for encoding to generate high-dimensional semantic vectors;

[0067] (7) Construct a semantic vector index space based on approximate nearest neighbor search to achieve retrieval, matching, and sharing of data models.

[0068] As a preferred embodiment of the present invention, in step (1), the process of constructing the Transformer model is as follows: (1-1) Constructing a structural perception layer: using a long short-term memory network LSTM, configuring the input dimension to be 256, the hidden layer dimension to be 512, and using a 2-layer network structure. LSTM controls the flow of information through three gate units: the input gate controls the influence of new input information, uses the sigmoid activation function to map the input value to the [0,1] interval, and determines how much new information is allowed to enter the cell state; the forget gate controls the degree of retention of historical information, and also uses the sigmoid activation function to determine the proportion of historical information that needs to be forgotten; the output gate controls the output degree of the current cell state, and combines the sigmoid activation function and the tanh activation function to determine the final output information. The network adopts a bidirectional LSTM structure, and extracts the bidirectional dependency of the sequence through the forward and backward LSTM layers to enhance the ability to understand the context. Each layer of LSTM is followed by a dropout layer, and the ratio is set to 0.1 to prevent overfitting.

[0069] (1-2) Constructing the graph structure encoding module: Using the graph convolutional neural network GCN, the input feature dimension is 128, the hidden layer dimension is 256, and it contains a 2-layer GCN structure. In the node feature aggregation stage, GCN aggregates the node features through the adjacency relationship of the graph structure. Each node obtains the feature information of the adjacent nodes according to the connection relationship of the edge, and updates the node representation by weighted summation. In the edge feature update stage, based on the feature representation of the connected nodes, a multi-layer perceptron is used to update the edge feature vector to capture the interaction pattern between nodes. In the graph representation learning stage, the node information is propagated in the graph structure through the message passing mechanism, and the hierarchical feature representation is constructed layer by layer. A residual connection is added after each layer of GCN and the ReLU activation function is used to ensure the training stability of the deep network. The dropout rate is set to 0.1 to enhance the generalization ability of the model.

[0070] (1-3) Construct the Transformer encoder-decoder: Both use a 6-layer structure, each layer contains a multi-head self-attention mechanism and a feedforward neural network. The number of attention heads is set to 8, and the dimension of each attention head is 64. Attention to different positions of the input sequence is achieved through parallel computing. The model dimension is set to 512 as the benchmark dimension throughout the entire network. The feedforward neural network adopts a two-layer structure. The dimension of the first layer is 2048, using the ReLU activation function, and the second layer is mapped back to the model dimension of 512. Residual connections and layer normalization are used in the network to prevent network degradation and accelerate training convergence. The encoder is responsible for feature extraction and representation learning of the input sequence, and the decoder decodes the encoded information through a multi-layer attention mechanism to generate the target output sequence. Between the encoder and the decoder, a cross-attention mechanism is used to achieve bidirectional interaction of information, enhancing the feature extraction and generation capabilities of the model.

[0071] As a preferred embodiment of the present invention, refer to Figure 2 In step (2), model pre-training includes two main tasks: structure reconstruction task and relational reasoning task. The specific process is as follows:

[0072] As a preferred embodiment of the present invention, in step (2), based on the Transformer model architecture constructed in step (1), a pre-training process is designed and implemented. The pre-training task makes full use of the characteristics of the structure perception layer LSTM, the graph structure encoding module GCN and the Transformer encoder-decoder to improve the model performance through the two tasks of structure reconstruction and relational reasoning. The specific process is as follows:

[0073] (2-1) Implementation process of model structure reconstruction task: For the structure perception layer LSTM and graph structure encoding module GCN constructed in step (1), a masked reconstruction strategy is designed for pre-training. First, 15% of the node information is randomly selected for masking, including the node type identification, attribute value, numerical range, etc. This information will be extracted and reconstructed by the gating mechanism of the LSTM network; at the same time, 15% of the edge information is selected for masking, including the relationship type, connection direction, association strength, etc. This part of information will be restored by the GCN network through node feature aggregation and edge feature update. For the masked information, a strategy of replacing 80% with the [MASK] mark, 10% unchanged, and 10% randomly replaced is adopted. This distribution helps LSTM capture contextual dependencies and enables GCN to perform feature inference based on partially visible graph structures. The structure reconstruction task uses the cross entropy loss function and the multi-head attention mechanism of the Transformer encoder-decoder architecture to achieve accurate reconstruction of the masked information.

[0074] (2-2) Implementation process of relational reasoning task: Based on the two-layer network architecture constructed in step (1), the entity relationship prediction task is designed. First, the structure perception layer LSTM is used to process the hierarchical representation of the entity, and the structural features of the entity are extracted through the input gate, forget gate and output gate; at the same time, the graph structure encoding module GCN is used to aggregate features based on the connection relationship between entities to generate the relationship representation of the entity. On this basis, the training sample pairs are constructed: the positive sample extracts entity pairs with direct or indirect relationships from the known data structure, making full use of the hierarchical relationship captured by LSTM and the graph structure features extracted by GCN; the negative sample is generated through a random sampling strategy, and 3 entity pairs without association are selected for each positive sample to ensure that the positive and negative sample ratio is 1:3. The features of LSTM and GCN are fused through the attention mechanism of Transformer, and finally the relationship type and direction between entity pairs are predicted.

[0075] As a preferred embodiment of the present invention, in step (3), for the Transformer model constructed in step (1) and pre-trained in step (2), it is necessary to obtain and pre-process the structured data to be modeled. The specific implementation process is as follows:

[0076] (3-1) Data acquisition and standardization: First, the input multi-source heterogeneous data is uniformly standardized and preprocessed. For the data table structure, the naming format of the table name and field name is standardized, and the definition specifications of the primary key and foreign key are unified. For XML documents, the DTD or Schema definition is parsed to extract the element node and attribute node information. For the object tree structure, the naming format of the class name and attribute name is standardized. For JSON files, the key name format is standardized. All data is uniformly encoded in UTF-8 to ensure that character information can be correctly processed in the subsequent processing process.

[0077] (3-2) Data structure serialization conversion: Serialization conversion is performed based on standardized data. For a data table, its table structure is converted into a node sequence, where each node contains information such as field attributes and constraints. For an object tree, a pre-order traversal strategy is used to generate a sequence. For an XML document, a label sequence is generated through a depth-first traversal. For a JSON object, it is converted into a key-value pair sequence. This serialization process provides a unified data format for subsequent feature extraction and model processing.

[0078] As a preferred embodiment of the present invention, in step (4), the standardized data preprocessed in step (3) is input into the pre-trained Transformer model, and deep feature extraction is performed using the structure perception layer and the graph structure encoding module. This step makes full use of the model architecture constructed in step (1) and the parameters obtained by pre-training in step (2), and the specific implementation process is as follows:

[0079] (4-1) Structure-aware feature extraction: The serialized data in step (3) is input into the structure-aware LSTM layer for processing. First, LSTM filters the newly input serialized data through the input gate, focusing on the key information in the data structure. Secondly, the forget gate is used to adjust the degree of retention of historical information. For deeply nested structures, more contextual information is retained; for flat structures, the impact of historical information is appropriately reduced. The degree of information output is controlled through the output gate to generate hidden states that reflect the characteristics of the data structure. On this basis, the maximum depth and average depth of the data structure are calculated, key hierarchical nodes are identified, and the hierarchical associations between nodes are analyzed.

[0080] (4-2) Graph structure feature encoding: Based on the standardized data obtained in step (3), the entity relationship graph structure is first constructed. For the data table structure, the table and field are mapped to nodes; for the object tree structure, the class and attribute are mapped to nodes; for the XML document, the element and attribute are mapped to nodes; for the JSON object, the object and array are mapped to nodes. Then, the association relationship between entities is analyzed to construct the edge connection of the graph: the primary and foreign key relationship is identified to establish the connection between tables, the inheritance and combination relationship is extracted to establish the connection between objects, the hierarchical nesting relationship of elements is analyzed to establish the connection between nodes, and the object reference relationship is parsed to establish the connection between JSON objects. The constructed nodes are assigned initial feature vectors, including node type, attribute information, etc.; the edges are assigned initial feature vectors, including relationship type, association strength, etc. The constructed graph structure is input into the graph structure encoding module GCN for processing. First, node feature aggregation is performed. Each node fuses the neighbor node information according to the pre-trained attention weight to capture the local structural features; then the edge feature representation is updated, and the attribute vector of the edge is adjusted based on the state of the connected node to enhance the relationship modeling capability; through multi-layer graph convolution operations, the receptive field is expanded layer by layer to achieve effective aggregation of global structural information. Finally, a graph structure feature vector with a dimension of 256 is generated through graph pooling operation.

[0081] (4-3) Feature fusion and supplementation: The structure-aware features (dimension 512) output by LSTM are fused with the graph structure features (dimension 256) output by GCN. First, the graph structure features are expanded to the same dimension as the structural features (512 dimensions) through a linear mapping layer. The residual connection mechanism is used for feature concatenation. This design inherits the feature fusion strategy in the pre-training stage and can maintain the expressive power of the original features. Based on the concatenated features, the correlation matrix between the features is calculated to identify complementary features and redundant features. The features are selectively enhanced through the attention mechanism, focusing on the complementary parts of the structural features and the relationship features. Finally, a fused feature vector with a dimension of 512 is generated as the input of the subsequent Transformer encoder.

[0082] As a preferred embodiment of the present invention, in step (5), based on the dual-stream features extracted in step (4), feature fusion and modeling decision generation are performed through a Transformer encoder-decoder model. This step makes full use of the Transformer architecture constructed in step (1), and the specific implementation process is as follows:

[0083] (5-1) Feature alignment and concatenation: First, align the structure-aware features (dimension 512) output by LSTM and the graph structure features (dimension 256) output by GCN. The dimension of the graph structure features is expanded to 512 through a linear mapping layer to ensure consistency with the dimension of the structural features. Feature concatenation uses a residual connection mechanism. This design inherits the feature fusion strategy of the pre-training phase in step (2) and can maintain the expressive power of the original features. The concatenated feature dimension is 512 and serves as the input of the subsequent Transformer encoder.

[0084] (5-2) Multi-head attention feature fusion: The concatenated features are input into the Transformer encoder for processing. The encoder contains 6 layers of multi-head attention layers, each layer has 8 attention heads, and the dimension of each attention head is 64. The attention mechanism achieves selective attention to different feature dimensions through three mapping matrices: query, key, and value. This design is consistent with the pre-training stage in step (2), allowing the model to fully utilize the feature extraction capabilities obtained through pre-training. At the same time, the position encoding generated in step (3) is introduced to enhance the expression of position information in the sequence. Each attention layer is followed by a normalization layer and a feedforward neural network to ensure the stability of the feature distribution.

[0085] (5-3) Modeling decision sequence generation: The fused features output by the encoder are input into the Transformer decoder for processing. The decoder also adopts a 6-layer structure, and achieves a deep understanding of the input features through the self-attention mechanism and the encoder-decoder attention mechanism. The decoding process uses an autoregressive method to gradually generate a modeling decision sequence. At each time step, the decoder will refer to the previously generated decision and combine the current input features to predict the next decision identifier. The generated decision sequence includes key information such as entity type determination, relationship type determination, and attribute definition. These decisions are based on the patterns learned in the pre-training phase of step (2) and can accurately reflect the structural and semantic characteristics of the data.

[0086] As a preferred embodiment of the present invention, in step (6), based on the modeling decision sequence generated in step (5), the data model is mapped into a high-dimensional semantic vector using the multi-head attention mechanism and feedforward neural network of the Transformer encoder. This step makes full use of the feature representation constructed in the previous step, and the specific implementation process is as follows:

[0087] (6-1) Encoder feature extraction: The modeling decision sequence generated in step (5) is input into the Transformer encoder for deep feature extraction. The encoder adopts the same 6-layer structure as step (1), and the multi-head attention mechanism of each layer sets 8 attention heads to maintain the consistency of the model architecture. During the feature extraction process, the multi-head attention mechanism focuses on the entity features, relationship features and attribute features in the modeling decision respectively. This multi-dimensional feature extraction method corresponds to the dual-stream feature extraction in step (4). The encoder's feedforward neural network adopts a two-layer structure: the first layer expands the input dimension to 3 times (1536 dimensions) and uses the ReLU activation function to enhance the nonlinear expression of the features; the second layer maps the features back to the original dimension (512 dimensions) to maintain the compactness of the feature representation.

[0088] (6-2) Sequence feature optimization: The feature sequence output by the encoder is optimized. First, sequence preprocessing is performed, including length normalization and information filtering, to ensure that models of different lengths have comparable feature representations. Subsequently, the importance score of each position in the sequence is calculated based on the weight distribution learned by the attention layer in step (5). These scores reflect the contribution of different modeling decisions to the overall model, which is consistent with the feature importance evaluation method learned in the pre-training phase of step (2). On this basis, a weighted average pooling operation is used to perform a weighted average of the feature sequence according to the attention score to generate a semantic vector of fixed dimension.

[0089] (6-3) Vector representation optimization: further optimize the semantic vector obtained by pooling. First, apply L2 normalization to project the vector onto the unit sphere. This normalization process helps with subsequent similarity calculations. The vector space distribution is then optimized using principal component analysis technology. This process draws on the feature representation learning experience of the pre-training phase in step (2). Principal component analysis not only reduces the redundancy of features, but also retains the key semantic information of the model. The final high-dimensional semantic vector dimension generated is 512, which matches the basic dimension of the Transformer model in step (1) to ensure the adequacy of feature representation and computational efficiency. As a preferred embodiment of the present invention, refer to Figure 3 In step (7), based on the high-dimensional semantic vector generated in step (6), a semantic retrieval space is constructed to achieve efficient retrieval and secure sharing of the data model. This step is a practical application of the processing results of the previous steps. The specific implementation process is as follows:

[0090] (7-1) Index space construction: Based on the standardized semantic vector set obtained in step (6), an efficient retrieval index structure is constructed. First, through cluster analysis, the distribution characteristics of vectors in high-dimensional space are studied. This analysis method draws on the feature clustering experience in the pre-training stage of step (2). According to the analysis results, the vector space is divided into 16 subspaces, each of which corresponds to a specific model category or domain feature. On this basis, a two-layer index structure is constructed: the first layer is a coarse-grained global index to quickly locate the target subspace; the second layer is a fine-grained local index to perform precise retrieval within the subspace.

[0091] (7-2) Similarity calculation and sorting: During the retrieval process, the query model is first converted into a standardized semantic vector through the processing flow of step (6). Considering that the vector has been L2 normalized, cosine similarity is used for similarity calculation, and the threshold is set to 0.8. This threshold setting is based on the model similarity experience accumulated during the pre-training phase of step (2). The retrieval process first quickly screens the relevant subspace at the global index level, and then accurately calculates the similarity score in the local index. The retrieval results are sorted in descending order of similarity.

[0092] (7-3) Model matching and verification: Accurately match and verify the retrieved similar data models. First, extract the structural features and semantic features of the model, which are consistent with the dual-stream features extracted in step (4). Verify the similarity of the model through feature comparison to ensure the accuracy of the retrieval results. For the successfully matched model, further analyze its applicable scenarios and constraints. This analysis is based on the modeling decision sequence generated in step (5) to ensure the feasibility of model sharing.

[0093] (7-4) Secure sharing mechanism: A complete transmission and verification mechanism is designed to ensure the secure sharing of data models. First, the successfully matched data model is serialized into a unified intermediate format, which contains the modeling decision information generated in step (5). A lossless compression algorithm based on a dictionary tree is used to compress the serialized data. During the compression process, key information such as the model's structural definition, relationship mapping, and attribute configuration are retained. At the same time, a digital signature is generated based on the model features for integrity verification of the transmission process. At the receiving end, signature verification is performed to ensure that the model has not been tampered with, followed by decompression and model reconstruction to achieve secure and reliable model sharing.

[0094] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can make equivalent replacements or changes according to the technical scheme and inventive concept of the present invention within the technical scope disclosed by the present invention, which should be within the protection scope of the present invention.

Claims

1. A data structure analysis and modeling method based on deep learning, characterized in that: The following steps are involved: S1. Build a Transformer encoder-decoder model with a structure-aware layer and a graph structure encoding module to achieve a deep understanding of data structures and relationships; S2. For the Transformer model, pre-training is performed using model structure reconstruction and relationship reasoning tasks to enable the model to understand general data structures and entity relationships; S3. for the pre-trained model, obtaining structured data to be modeled containing entity and relationship information as input data to be processed; S4. Input the data to be modeled into the pre-trained Transformer model, identify the hierarchical structure of the data through the structure perception layer, extract the association relationship between entities through the graph structure encoding module, and automatically parse and extract features of the data structure; S5. The Transformer encoder-decoder model uses feature concatenation and multi-head self-attention mechanism to integrate the hierarchical features of the structure perception layer and the relational features of the graph structure encoding module to generate a modeling decision sequence of entity type, relationship type and attribute definition; S6. Encode the constructed initial relational data model using the multi-head attention mechanism and feedforward neural network of the Transformer encoder, and map the data model into a high-dimensional semantic vector of fixed dimension by combining average pooling and vector normalization operations; S7. For the high-dimensional semantic vector, a semantic vector index space based on approximate nearest neighbor search is constructed, and the retrieval, matching and sharing of the data model are realized through cosine similarity calculation.

2. A data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: In the Transformer encoder-decoder model of S1: The structure perception layer uses a long short-term memory network LSTM to process hierarchical data structures, controls the influence of new input information through the input gate, controls the retention of historical information through the forget gate, and controls the output degree of the current unit state through the output gate; The graph structure encoding module uses a graph convolutional neural network (GCN) to aggregate the features of entity nodes and edges, integrates the feature information of adjacent nodes in the node feature aggregation phase, updates the relationship representation between connected nodes in the edge feature update phase, and generates an embedded representation of the overall graph structure in the graph representation learning phase; Among them, the encoder is responsible for feature extraction and encoding of the input data, and the decoder generates a target output sequence based on the encoding result. The encoder and decoder interact with each other through the attention mechanism.

3. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: In S2, the Transformer model is pre-trained through the following tasks: The model structure reconstruction task masks the node type, connection relationship and attribute information in the input data, uses the structure perception layer to restore the node information, and uses the graph structure encoding module to reconstruct the connection relationship; The relational reasoning task selects entity pair samples by constructing positive and negative sample pairs, extracts the structural features of the entities using the structure perception layer, calculates the connection features between entities using the graph structure encoding module, and determines the relationship type and direction between entity pairs based on the feature analysis results.

4. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: The structured data to be modeled in S3 includes data tables with row and column structures, which contain primary keys, foreign keys, and field definitions; object trees with hierarchical structures, which contain inheritance and combination relationships between nodes; XML documents with nested tag structures, which contain element nodes and attribute nodes; and JSON files with key-value pair structures, which support nesting of objects and arrays.

5. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: In S4, for the data to be modeled obtained in S3, the data table with row and column structure, the object tree with hierarchical structure, the XML document with tag nesting structure and the JSON file with key-value pair structure are uniformly converted into serialized input; The LSTM network of the structure perception layer processes serialized input, extracts the nested depth of data, calculates the maximum depth and average depth of the data structure, counts the number of nodes at each level, identifies the parent-child node relationship, determines the direct parent node and child node, analyzes the sibling node relationship, identifies the node group at the same level, and adjusts the retention degree of information at each level through the gating mechanism; The GCN network of the graph structure encoding module processes entity relationships, maps entities to nodes in the graph, maps relationships between entities to edges, assigns initial feature vectors to nodes and edges, performs node message transmission, aggregates feature information of adjacent nodes, updates the state representation of the current node, and generates an overall graph structure feature representation; The hierarchical structure features output by LSTM and the graph structure features output by GCN are concatenated, and the concatenated features are uniformly encoded through the Transformer encoder to obtain the fused data structure analysis and feature extraction results.

6. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: The process of generating a modeling decision sequence by the Transformer encoder-decoder model in S5 includes: The hierarchical structure feature vector output by the structure perception layer is concatenated with the relational feature vector output by the graph structure encoding module to form a unified feature representation; The concatenated features are processed through a multi-head self-attention mechanism, where the number of attention heads is set to 4-16, and each attention head independently calculates the query, key, and value mapping matrices to achieve attention to different feature dimensions; Position coding is used to enhance the position information in the feature sequence, and the position coding is added to the feature representation and then input into the encoder; The encoder passes through 4-8 layers of Transformer encoding layers, each of which contains a multi-head self-attention sublayer and a feedforward neural network sublayer, with residual connections and layer normalization added in between to obtain the encoding result; The decoder performs autoregressive decoding based on the encoder output through 4-8 layers of Transformer decoding layers. Each layer contains a self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward network sublayer, and outputs modeling decision tokens position by position. The modeling decision token includes an entity type identifier, a relationship type identifier, an attribute definition identifier, etc., and forms a complete modeling decision sequence according to grammatical rules.

7. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: The process of mapping the data model into a high-dimensional semantic vector in S6 includes: The attention weights between components in the data model are calculated using the multi-head attention mechanism of the Transformer encoder, and the local feature representation is extracted through a feedforward neural network, wherein the number of attention heads of the multi-head attention mechanism is set to 4-16, and the dimension of each attention head is between 32-128. The feedforward neural network includes two fully connected layers, the output dimension of the first layer is 2-4 times the input dimension, and the second layer maps the features back to the original dimension, wherein the dimension range of the local feature representation is between 64-512; Perform sequence preprocessing on the variable-length feature sequence output by the encoder, including length normalization and redundant information filtering; A weighted average pooling operation is used to calculate the weight coefficient of each position in the sequence based on the attention score, and a weighted average is performed along the sequence dimension to generate a semantic vector of fixed dimension. The generated semantic vectors are subjected to L2 normalization and the vector space distribution is optimized through principal component analysis to generate high-dimensional semantic vectors with dimensions between 128 and 1024.

8. The data structure analysis and modeling method based on deep learning according to claim 1, characterized in that: The process of constructing an index space based on high-dimensional semantic vectors and implementing data model retrieval, matching, and sharing in S7 includes: Based on the obtained high-dimensional semantic vector set, an approximate nearest neighbor search algorithm is used to establish an index. By analyzing the distribution density and clustering characteristics of the vectors, the vector space is divided into 8-32 subspaces. A two-layer index structure consisting of a coarse-grained global index and a fine-grained local index is constructed to finely divide the vectors in each subspace. In the vector similarity calculation stage, the cosine similarity measurement is used in combination with the characteristics of high-dimensional semantic vectors, and the cosine similarity threshold is set between 0.6 and 0.9 for initial screening. The search results are sorted in descending order by similarity score. For the similar data models retrieved, their structural features and semantic features are extracted for precise matching to determine the set of data models that can be shared. For the successfully matched data model, the model's structure definition, relationship mapping, attribute configuration and metadata information are serialized into a unified intermediate format. The serialized data is compressed and encoded using a lossless compression algorithm based on a dictionary tree, and a compressed package with a digital signature is generated to achieve secure transmission and verification of the data model.

9. A data structure analysis and modeling system based on deep learning, characterized in that: include: The Transformer structure perception layer uses the long short-term memory network LSTM to process hierarchical data structures and controls the information processing flow through the input gate, forget gate, and output gate; The Transformer graph structure encoding module uses a graph convolutional neural network (GCN) to aggregate and update the features of entity nodes and edges; Transformer encoder, which consists of 4-8 layers of Transformer encoding layers, each of which has a multi-head self-attention sublayer and a feedforward neural network sublayer; Transformer decoder, comprising 4-8 layers of Transformer decoding layers, each layer comprising a self-attention sublayer, an encoder-decoder attention sublayer, and a feedforward network sublayer, wherein the number of attention heads of the multi-head self-attention mechanism is set to 4-16, and the dimension of each attention head is between 32-128; A model training unit, used for pre-training the Transformer encoding and decoding unit through a model structure reconstruction task and a relational reasoning task; A data processing unit, used to obtain structured data to be modeled and convert the data into a serialized input format; The vector mapping unit is used to extract local features through a multi-head attention mechanism and a feedforward neural network, preprocess the feature sequence, and generate a high-dimensional semantic vector with a dimension between 128 and 1024; Index retrieval unit, used to build a double-layer index structure and divide the vector space into 8-32 subspaces, match data models based on cosine similarity, sort and filter the retrieval results, and serialize and securely transmit the successfully matched data models; The data sharing unit is used to convert the data model into a unified intermediate format, use a lossless compression algorithm based on a dictionary tree to compress the data, generate a digital signature and realize secure data transmission.

Citation Information

Cited By

  • Mass medical image data storage device and method

    CN120072168A

  • Inspection system based on edge device gateway

    CN120146411A

  • Laparoscopic surgery video retrieval and visualization method and system

    CN120670618A

  • A laparoscopic surgery video retrieval and visualization method and system

    CN120670618B

  • Multi-modal data driven commercial vehicle frame performance prediction method and system

    CN120911318A