An open source data object multi-dimensional association and translation method based on semantic analysis

CN122777136APending Publication Date: 2026-09-18神州数码数云科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610995959.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-06
Publication Date
2026-09-18

AI Technical Summary

Technical Problem

[0002]现有针对开源代码仓库数据的处理方式,多分别对代码、注释、版本日志等异构数据进行独立处理,语义分析环节多采用单一粒度的解析方式,代码结构特征提取后未与语义特征进行结合,开源数据对象的关联识别与翻译多依托单一语义或结构特征开展

Benefits of technology

对清洗后的异构数据自然语言文本进行多粒度语义分析,针对代码注释执行段落级意图解析,针对版本日志执行句子级变更模式识别,能够让语义解析过程匹配不同类型自然语言文本的表述特点,语义分析结果能够精准贴合代码注释的整体意图与版本日志的具体变更信息,高维语义向量空间的映射基准更贴合数据对象的实际语义属性,不同数据对象间语义距离的计算能够反映真实的语义关联程度,语义关联图的节点关联强度表征更贴合数据对象的实际语义联系,语义关联关系的呈现可贴合异构数据的文本语义本质。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122777136A_ABST
    Figure CN122777136A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of data processing semantic analysis, in particular to a kind of open source data object multidimensional association and translation method based on semantic analysis, comprising: extracting the heterogeneous data of code, comment, version log in open source code repository and completing deduplication and format cleaning.Multiple granularity semantic analysis is carried out on natural language text, code comment paragraph level intention analysis and version log sentence level change mode recognition are realized, through the improved semantic embedding algorithm is mapped to uniform semantic space, the semantic distance is calculated and the semantic association graph is constructed.Parsing code syntax tree extracts structural features and encodes as structural fingerprint, which is fused with semantic vector to form a unified multidimensional feature description to obtain translation result.The method can adapt to different text expression characteristics, improve the accuracy of data object association recognition, and make the translation result take into account the structure attribute and semantic connotation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of data processing semantic analysis technology, and in particular to an open-source method for multidimensional association and translation of data objects based on semantic analysis. Background Technology

[0002] Current methods for processing open-source code repository data often treat heterogeneous data such as code, comments, and version logs separately. Semantic analysis typically employs a single-granularity parsing approach, failing to integrate extracted code structural features with semantic features. Furthermore, the identification and translation of open-source data objects often rely on single semantic or structural features. When processing natural language text, existing technologies do not establish differentiated parsing rules for the textual attribute differences between code comments and version logs. The syntactic structural features of code snippets are used only for syntax validation and other stages, without being jointly represented with semantic vectors.

[0003] Single-granularity semantic parsing methods cannot adapt to the paragraph-based expression characteristics of code comments and the short-sentence change expression characteristics of version logs, easily leading to discrepancies between semantic parsing results and the actual intent of the text. Code structural features and semantic vectors are represented independently, and the calculation of associations between different data objects relies solely on single-dimensional features, resulting in biases in the identification of semantic relationships. The translation results of data objects cannot simultaneously take into account semantic connotations and structural attributes, and the multi-dimensional association construction and translation effects of open-source data objects are difficult to meet practical usage requirements.

[0004] To address the issues of missing paragraph-level intent parsing in code comments and inaccurate sentence-level change pattern recognition in version logs, this paper also solves the problem that code structure features cannot be fused with high-dimensional semantic vectors to form a unified multi-dimensional feature description, and optimizes the semantic association and translation processing flow of open-source data objects. Summary of the Invention

[0005] The purpose of this invention is to address the shortcomings of existing technologies by proposing an open-source data object multidimensional association and translation method based on semantic analysis.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: an open-source data object multidimensional association and translation method based on semantic analysis, comprising: Extract an initial heterogeneous data set containing code, comments, and version logs from the open-source code repository, and perform deduplication and format cleaning on the initial heterogeneous data set; Multi-granular semantic analysis is performed on natural language text in the cleaned heterogeneous dataset, including paragraph-level intent parsing of code comments and sentence-level change pattern recognition of version logs, to generate semantic analysis results; Based on the semantic analysis results, an improved semantic embedding algorithm is used to map natural language text and code fragments to the same high-dimensional semantic vector space, and the semantic distance between different data objects is calculated in the high-dimensional semantic vector space. Based on the semantic distance, data object pairs with a semantic distance less than a similarity threshold are identified, and a semantic association graph is constructed based on the identified data object pairs. In the semantic association graph, nodes represent data objects, and edges represent semantic association strength. Synchronously perform syntax tree parsing on code snippets, extract function signatures, class structures, and control flow patterns as structural features, and encode these structural features as structural fingerprints; The structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space to form a unified multidimensional feature description of the data object; Based on the unified multidimensional feature description, the final translation result is obtained.

[0007] As a further aspect of the present invention, the step of performing multi-granular semantic analysis on the natural language text in the cleaned heterogeneous dataset includes: The code comment text is segmented, dividing the continuous comment text above each function or class into an analysis segment; For each analyzed paragraph, a pre-trained paragraph encoder is used to extract paragraph-level semantic vectors. Based on the paragraph-level semantic vectors, a classification model is used to determine the intent category of the annotation. The intent category includes functional description, parameter description, algorithm explanation, and usage example. The version log text is segmented by commit record, and dependency parsing is performed on the descriptive sentences of each commit record to identify the core verbs describing the actions and the code entity objects that perform the actions. The core verbs and code entity objects are combined into change action tuples. The change action tuples are input into the change pattern classifier to obtain the submitted change pattern labels. The change pattern labels include new features, defect fixes, performance optimizations and refactoring. The paragraph-level semantic vector, intent category, change action tuple, and change pattern label together constitute the semantic analysis result.

[0008] As a further aspect of the present invention, the working principle of the improved semantic embedding algorithm includes: Construct a twin neural network with a dual-tower structure to handle natural language text input and code text input respectively; In the Natural Language Text Processing Tower, a hierarchical Transformer encoder is used. The first layer encoder processes word sequences, and the second layer encoder processes the sentence-level representation output by the first layer to obtain a context-aware representation of the text. In the code text processing tower, a graph neural network encoder is used to parse code fragments into abstract syntax trees. The nodes of the abstract syntax trees are used as graph nodes, and the syntactic relationships between nodes are used as edges. The graph neural network encoder learns the structured representation of the code. Set a joint optimization objective, which includes a contrastive loss function and an alignment loss function; The contrastive loss function brings closer the vector representations of natural language descriptions and code snippets that are determined to be relevant in the semantic analysis results, while pushing away the vector representations of irrelevant descriptions. The alignment loss function encourages the alignment of paragraph-level semantic vectors output by the natural language text processing tower with vectors of class names and function names key identifiers output by the code text processing tower in a subspace. The Siamese neural network is trained by jointly optimizing the contrast loss function and the alignment loss function. After training, the natural language text processing tower and the code text processing tower are used to map the natural language text and code fragments to the same high-dimensional semantic vector space, respectively.

[0009] As a further aspect of the present invention, calculating the semantic distance between different data objects in the high-dimensional semantic vector space includes: For any two data objects, if both data objects are natural language text, then calculate the cosine distance between the paragraph-level semantic vectors corresponding to the two data objects. If both data objects are code snippets, then calculate the Euclidean distance between the code vectors output by the code text processing tower corresponding to the two data objects; If one is natural language text and the other is code snippet, then the modified cosine distance between the paragraph-level semantic vector corresponding to the text and the code vector corresponding to the code snippet is calculated. The modified cosine distance is calculated by normalizing and weighting the vectors by dimension before calculation. The calculated cosine distance, Euclidean distance, or modified cosine distance are uniformly defined as the semantic distance between data objects.

[0010] As a further aspect of the present invention, based on the semantic distance, data object pairs with a semantic distance less than a similarity threshold are identified, and a semantic association graph is constructed based on the identified data object pairs, including: A dynamic similarity threshold is set, which is determined based on the distribution quantile of all semantic distances in the current high-dimensional semantic vector space; Iterate through all pairwise combinations of data objects. When the semantic distance between any two data objects is less than the dynamic similarity threshold, the two data objects are recorded as a semantic association pair. Initialize an undirected weighted graph with all data objects as nodes and each semantic association pair as an edge; The inverse of the semantic distance corresponding to each edge is used as the initial semantic association strength weight of the edge to complete the construction of the semantic association graph.

[0011] As a further aspect of the present invention, the synchronous parsing of the code fragment into a syntax tree, extracting function signatures, class structures, and control flow patterns as structural features, and encoding these structural features into a structural fingerprint, includes: Parse code snippets into a standard abstract syntax tree; Traverse the abstract syntax tree, extract all function definition nodes, and record the function name, parameter type list and return type of each function to form the function signature characteristics; Traverse the abstract syntax tree, extract all class definition nodes, and record the class name, the list of inherited parent classes, the list of internal methods and the list of attributes of each class, which together form the class structure features; The analysis function defines the control flow nodes, identifies structural patterns of loops, conditional branches, and exception handling, and encodes the frequency and nesting depth of these structural patterns as control flow pattern features. The function signature features, class structure features, and control flow pattern features are concatenated into a high-dimensional sparse vector. The high-dimensional sparse vector is subjected to local sensitive hashing to generate a fixed-length binary code, which is the structural fingerprint.

[0012] As a further aspect of the present invention, the structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space to form a unified multi-dimensional feature description of the data object, including: For each data object, if it is a code fragment, its structural fingerprint and its corresponding code vector in the high-dimensional semantic vector space are obtained; The binary encoding of the structural fingerprint is converted into a dense fingerprint vector through an embedding layer; The fingerprint vector and the code vector are concatenated to form a fused vector; The fused vector is input into a feedforward neural network for dimensionality reduction and information integration. The output vector of the feedforward neural network is the unified multidimensional feature description of the code segment. For natural language text data objects, their paragraph-level semantic vectors in the high-dimensional semantic vector space are directly used as their unified multidimensional feature descriptions.

[0013] As a further aspect of the present invention, based on the unified multidimensional feature description, the final translation result is obtained, including: Based on the unified multidimensional feature description, the semantic association graph is enhanced, the weights of the edges in the graph are updated, and a multidimensional association topology graph is generated. Receive a translation query for a specific data object, perform a multi-hop association retrieval in the multidimensional association topology graph, and obtain the object cluster associated with the query object; Based on the unified multidimensional feature description of the object cluster, combined with the pre-trained multilingual code translation model, code translation results in the target language are generated, and the context consistency of the code translation results is checked. The semantic consistency of the translation results in the associated cluster is verified by using a multidimensional association topology graph, and the final translation result is output. The process of enhancing the semantic association graph based on a unified multidimensional feature description, updating the edge weights in the graph, and generating a multidimensional association topology graph includes: For each edge in the semantic association graph, obtain a unified multidimensional feature description of the two nodes connected by the edge; Calculate the Mahalanobis distance between two unified multidimensional feature descriptions; The Mahalanobis distance is mapped to the structural semantic association strength through a monotonically decreasing function; The weighted average of the structural semantic association strength and the initial semantic association strength weight of the edge is used to obtain the comprehensive association strength after the edge is updated. The updated comprehensive association strength is used as the new weight of the edge to replace the old weight of the corresponding edge in the semantic association graph, generating a multidimensional association topology graph.

[0014] As a further aspect of the present invention, the step of receiving a translation query for a specific data object, performing a multi-hop association retrieval in the multidimensional association topology graph, and obtaining an object cluster associated with the query object includes: The data object specified in the translation query is used as the query node and located in the multidimensional association topology graph; Starting from the query node, a weighted random walk algorithm is used to perform a multi-step walk in the multidimensional association topology graph; Record all nodes visited during the traversal. The traversal terminates when the number of traversal steps reaches the preset maximum number of steps or the cumulative edge weight is lower than the connectivity threshold. The set of all nodes visited during the traversal, after deduplication, is used as the object cluster associated with the query object.

[0015] As a further aspect of the present invention, based on the unified multidimensional feature description of the object cluster, combined with a pre-trained multilingual code translation model, code translation results in the target language are generated, and the context consistency of the code translation results is verified, including: From the object cluster, select objects of all code fragment types and extract a unified multidimensional feature description of the objects; The code text of the query object and its unified multidimensional feature description are input into a pre-trained multilingual code translation model. The multilingual code translation model is based on an attention mechanism and uses the unified multidimensional feature descriptions of other code fragments in the object cluster as context information to generate preliminary translated code of the target programming language syntax. The preliminary translated code is parsed into an abstract syntax tree, and its structural fingerprint is calculated. In the multidimensional association topology graph, the average similarity between the structural fingerprint of the preliminary translated code and the structural fingerprints of other code segments in the object cluster is calculated. If the average similarity is higher than the consistency threshold, the preliminary translated code is determined to have passed the context consistency check and is used as the final translated output. If the verification fails, adjust the generation parameters of the multilingual code translation model, regenerate the translated code, and repeat the verification steps until the verification is passed or the maximum number of retries is reached.

[0016] Compared with the prior art, the advantages and positive effects of the present invention are as follows: Multi-granular semantic analysis is performed on cleaned heterogeneous natural language text. Paragraph-level intent parsing is performed on code comments, and sentence-level change pattern recognition is performed on version logs. This allows the semantic parsing process to match the expression characteristics of different types of natural language text. The semantic analysis results can accurately match the overall intent of code comments and the specific change information of version logs. The mapping benchmark of the high-dimensional semantic vector space is more in line with the actual semantic attributes of data objects. The calculation of semantic distance between different data objects can reflect the true degree of semantic association. The node association strength representation of the semantic association graph is more in line with the actual semantic connection of data objects. The presentation of semantic association relationships can fit the textual semantic essence of heterogeneous data.

[0017] By parsing code snippets using syntax trees to extract function signatures, class structures, and control flow patterns, and encoding them into structural fingerprints, and then fusing these structural fingerprints with corresponding semantic vectors in a high-dimensional semantic vector space, the feature representation of data objects can simultaneously cover both syntactic structure and semantic connotation dimensions. This unified multi-dimensional feature description can fully carry the structural and semantic information of data objects. The construction of semantic association graphs can combine the relationships between structural and semantic dimensions. The final translation result can synchronously match the syntactic structural attributes and semantic expression connotations of data objects. Both the feature representation and translation output of data objects are consistent with the actual composition characteristics of open-source data, and the output content after feature fusion can fully adapt to the multi-dimensional attribute representation requirements of open-source data objects. Attached Figure Description

[0018] Figure 1 This is a state diagram of an open-source data object multidimensional association and translation method based on semantic analysis, as described in this invention. Figure 2 This is a flowchart of multi-granularity semantic analysis; Figure 3 This is a flowchart for calculating semantic distance in a high-dimensional semantic vector space. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0020] In the description of this invention, it should be understood that the terms "length," "width," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer," etc., indicating orientation or positional relationships, are based on the orientation or positional relationships shown in the accompanying drawings and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Furthermore, in the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0021] See Figure 1 This invention provides an open-source data object multidimensional association and translation method based on semantic analysis, the overall implementation scheme of which is as follows: An initial heterogeneous dataset containing code, comments, and version logs is extracted from an open-source code repository. This dataset is then deduplicated and cleaned to eliminate noise and inconsistencies. Multi-granular semantic analysis is performed on the natural language text within the cleaned heterogeneous dataset. This analysis includes paragraph-level intent parsing of code comments and sentence-level change pattern recognition of version logs, generating semantic analysis results. Based on these results, an improved semantic embedding algorithm is used to map the natural language text and code fragments to the same high-dimensional semantic vector space, where the semantic distance between different data objects is calculated. Data object pairs with a semantic distance less than a preset similarity threshold are identified based on these distances, and a semantic association graph is constructed based on these pairs. Nodes in the graph represent data objects, and edges represent semantic association strength. Simultaneously with semantic processing, syntax tree parsing is performed on the code fragments to extract function signatures, class structures, and control flow patterns as structural features, which are then encoded as structural fingerprints. These structural fingerprints are fused with the corresponding semantic vectors in the high-dimensional semantic vector space to form a unified multi-dimensional feature description of the data objects. Based on the unified multidimensional feature description, the final translation result from the query object to the target language code is obtained.

[0022] In one embodiment of the present invention, multi-granular semantic analysis is performed on natural language text in a cleaned heterogeneous dataset, see reference. Figure 2 The process involves segmenting the code comment text, dividing the continuous comment text above each function or class into an independent analysis segment. Each analysis segment is fed into a pre-trained segment encoder to extract its segment-level semantic vector. Based on this vector, a classification model determines the intent category of the comment, which includes function description, parameter description, algorithm explanation, and usage examples. For version log text, it is segmented by commit record. Dependency parsing is performed on the descriptive sentences in each commit record to identify the core verbs describing the action and the code entity objects to which the action is applied. The identified core verbs and code entity objects are combined into a change action tuple, and this tuple is input into a change pattern classifier to obtain the change pattern label for the commit record. The change pattern label includes feature addition, defect fix, performance optimization, and refactoring. The segment-level semantic vector, intent category, change action tuple, and change pattern label together constitute the semantic analysis result.

[0023] The improved semantic embedding algorithm is implemented based on a Siamese neural network with a dual-tower structure, used to process natural language text input and code text input respectively. In the natural language text processing tower, a hierarchical Transformer encoder is employed. The first layer of the encoder processes word sequences, while the second layer processes the sentence-level representation output by the first layer to obtain a context-aware representation of the text. In the code text processing tower, a graph neural network encoder is used. Code fragments are first parsed into an abstract syntax tree, where nodes are graph nodes and syntactic relationships between nodes are edges. The graph neural network encoder learns the structured representation of the code. The algorithm's training uses a joint optimization objective, which includes a contrastive loss function and an alignment loss function. The contrastive loss function brings the vector representations of natural language descriptions and code fragments that are determined to be relevant in the semantic analysis results closer together, while distancing the vector representations of irrelevant descriptions. The alignment loss function encourages the alignment of the paragraph-level semantic vectors output by the natural language text processing tower with the vectors of key identifiers such as class names and function names output by the code text processing tower in a subspace. The Siamese neural network is trained by jointly optimizing the contrast loss function and the alignment loss function. After training, the natural language text processing tower and the code text processing tower are used to map the natural language text and code fragments to the same high-dimensional semantic vector space, respectively.

[0024] In practice, code comment text is segmented, dividing continuous comment text above each function or class into an analysis segment. Each analysis segment is input into a pre-trained segment encoder, such as a BERT-based model, to extract fixed-dimensional segment-level semantic vectors. Based on the extracted segment-level semantic vectors, a pre-trained classification model (a fully connected neural network classifier) ​​determines the intent category of the comment. Intent categories include function descriptions, parameter descriptions, algorithm explanations, and usage examples. In another implementation, version log text is segmented by commit record, with the description text of each commit record further segmented into independent sentences. Dependency parsing is performed on each description sentence to identify the core verb and the noun phrases of code entities governed by that verb. The core verb and the noun phrases of code entities are combined to form a change action tuple. This change action tuple is input into a change pattern classifier, which outputs a change pattern label for the commit record. Change pattern labels include feature additions, bug fixes, performance optimizations, and refactoring. Paragraph-level semantic vectors, intent categories, change action tuples, and change pattern labels together constitute the semantic analysis results used in subsequent steps.

[0025] In its implementation, the improved semantic embedding algorithm is based on a Siamese neural network structure. The Siamese neural network comprises two independent processing towers: a natural language text processing tower and a code text processing tower. In the natural language text processing tower, a hierarchical Transformer encoder is employed. The first layer processes the input word sequence, generating a contextual representation for each word. The second layer further encodes the representations output by the first layer, working on sentences or clauses, to obtain a context-aware representation of the entire text segment. In the code text processing tower, a graph neural network encoder is used. The code fragment is first parsed into an abstract syntax tree (AST). Each node of the AST is initialized as a feature vector, and the syntactic relationships between nodes are defined as edges in the graph. The AST encoder performs message passing and aggregation on this graph, ultimately obtaining a structured representation vector representing the entire code fragment.

[0026] In practical implementation, the training of the improved semantic embedding algorithm requires a joint optimization objective. This joint optimization objective includes a contrastive loss function and an alignment loss function. The contrastive loss function, based on semantic analysis results, aims to narrow the distance between the vector representations of natural language descriptions and code snippets deemed relevant in the semantic analysis, while widening the distance between the vector representations of randomly sampled irrelevant descriptions and code snippets. The alignment loss function is designed to align the paragraph-level semantic vectors output by the natural language text processing tower with the vectors extracted from key identifier nodes such as class names and function names output by the code text processing tower within a shared subspace. The joint optimization objective is achieved by minimizing the weighted sum of the contrastive and alignment loss functions. In some embodiments, semantic similarity can be measured using the following formula: in: Representing vectors with vector The semantic similarity score between them Representing vectors with vector Euclidean distance in the embedded space This is a normalization constant representing the maximum Euclidean distance between all pairs of samples in this batch of training data. The Siamese neural network jointly optimizes the contrastive loss function and the alignment loss function through backpropagation. After training, the natural language text processing tower and the code text processing tower can map the input natural language text and code snippets to the same high-dimensional semantic vector space, respectively, and generate corresponding semantic vectors. It can be understood that the parameters of the natural language text processing tower and the code text processing tower are shared to ensure the consistency of the mapping space.

[0027] In one embodiment of the present invention, the semantic distance between different data objects is calculated in a high-dimensional semantic vector space, and the calculation method varies depending on the type of data object. See also... Figure 3 For any two data objects, if both are natural language text, the cosine distance between their corresponding paragraph-level semantic vectors is calculated. If both are code snippets, the Euclidean distance between their corresponding code vectors output by the code text processing tower is calculated. If one is natural language text and the other is a code snippet, the modified cosine distance between the paragraph-level semantic vector of the text and the code vector of the code snippet is calculated. The modified cosine distance is calculated after normalizing and weighting the vectors according to their dimensions. The calculated cosine distance, Euclidean distance, or modified cosine distance is uniformly defined as the semantic distance between data objects.

[0028] Constructing a semantic association graph based on the calculated semantic distances involves setting a dynamic similarity threshold, determined by the quantiles of the distribution of all semantic distances in the current high-dimensional semantic vector space. Iterating through all pairwise combinations of data objects, when the semantic distance between any two data objects is less than the dynamic similarity threshold, these two data objects are recorded as a semantic association pair. Using all data objects as nodes and each semantic association pair as an edge, an undirected weighted graph is initialized. The reciprocal of the semantic distance corresponding to each edge is used as the initial semantic association strength weight for that edge, thus completing the construction of the semantic association graph.

[0029] In practice, the method for calculating the semantic distance between any two data objects varies strictly depending on the data object type. If both data objects are natural language text, the cosine distance between their corresponding paragraph-level semantic vectors is calculated. The formula for cosine distance is 1 minus the cosine similarity value of the two vectors. If both data objects are code snippets, the Euclidean distance between their corresponding code vectors output by the code text processing tower is calculated. Euclidean distance is the straight-line distance between two points in Euclidean space. If one data object is natural language text and the other is a code snippet, the modified cosine distance between the paragraph-level semantic vector of the text and the code vector of the code snippet is calculated. Before calculation, the modified cosine distance is normalized and dimensionally weighted to eliminate vector scale differences and emphasize the influence of key dimensions.

[0030] In practice, the calculation of the modified cosine distance involves a specific mathematical formula. In some embodiments, the formula for calculating the modified cosine distance can be expressed as: Where: symbol Representing vectors with vector The corrected cosine distance between them. (Symbol) This represents the total dimensions of the vector. (Symbol) and Representing vectors respectively sum vector In the Component values ​​in each dimension. Symbol and Representing vectors respectively sum vector The mean of all dimensional components. (Symbol) Represents a predefined, related to the first Weight coefficients related to each dimension are used to weight different semantic dimensions. The calculated cosine distance, Euclidean distance, or modified cosine distance are uniformly defined as the semantic distance between data objects.

[0031] In practical implementation, constructing a semantic association graph based on semantic distance involves setting a dynamic similarity threshold. This dynamic similarity threshold is determined by the quantiles of the semantic distances calculated from pairwise combinations of all data objects in the current high-dimensional semantic vector space. For example, the dynamic similarity threshold can be set to the Kth percentile of all semantic distance values, where K is a preset integer parameter. All pairwise combinations of data objects are iterated over; when the semantic distance between any two data objects is less than the dynamic similarity threshold, these two data objects are recorded as a semantic association pair. An undirected weighted graph is initialized using all data objects as nodes and each identified semantic association pair as an edge. The reciprocal of the semantic distance corresponding to each edge is used as the initial semantic association strength weight for that edge, thus completing the construction of the semantic association graph. It can be understood that the smaller the semantic distance, the larger its reciprocal, representing a higher initial semantic association strength weight for the edge. Optionally, before initializing the undirected weighted graph, the reciprocal of the semantic distance can be subjected to min-max normalization to map the initial weights of the edges to a fixed numerical range.

[0032] In one embodiment of the present invention, the code fragment is simultaneously parsed using a syntax tree to extract structural features. The steps include parsing the code fragment into a standard abstract syntax tree (AST). The AST is traversed, extracting all function definition nodes and recording the function name, parameter type list, and return type of each function; these information collectively constitute the function signature feature. The AST is also traversed, extracting all class definition nodes and recording the class name, inherited parent class list, internal method list, and attribute list of each class; this information collectively constitutes the class structure feature. The control flow nodes under the function definition nodes are analyzed to identify structural patterns such as loops, conditional branches, and exception handling, and the frequency and nesting depth of these structural patterns are encoded as control flow pattern features. The function signature feature, class structure feature, and control flow pattern feature are concatenated into a high-dimensional sparse vector. This high-dimensional sparse vector is then subjected to locality-sensitive hashing (LSH) to generate a fixed-length binary code, which is the structural fingerprint.

[0033] The structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space. For each data object, if it is a code fragment, its structural fingerprint and its corresponding code vector in the high-dimensional semantic vector space are obtained. The binary encoding of the structural fingerprint is converted into a dense fingerprint vector through an embedding layer. This fingerprint vector is then concatenated with the code vector to form a fused vector. This fused vector is input into a feedforward neural network for dimensionality reduction and information integration; the output vector of the feedforward neural network is the unified multidimensional feature description of the code fragment. For natural language text data objects, their paragraph-level semantic vectors in the high-dimensional semantic vector space are directly used as their unified multidimensional feature description.

[0034] In practice, the input code snippet is parsed into a standard abstract syntax tree (API). This process is accomplished by calling a specific programming language parser. Each node in the API represents a syntactic element in the code. The complete API is traversed, extracting all function definition nodes. From each function definition node, the function name, parameter type list, and return type are recorded; this information collectively constitutes the function signature. The API is also traversed, extracting all class definition nodes. From each class definition node, the class name, list of inherited parent classes, list of methods defined within the class, and list of attributes defined within the class are recorded; this information collectively constitutes the class structure features. The child nodes under each function definition node are analyzed to identify control flow nodes, including loop statements, conditional branch statements, and exception handling statements. The frequency of different control flow structure patterns is statistically analyzed, and the maximum nesting depth of each pattern is recorded. The statistically obtained frequency and nesting depth values ​​are encoded as control flow pattern features.

[0035] In specific implementation, the function signature features, class structure features, and control flow pattern features are concatenated into a unified high-dimensional sparse vector. Each dimension of the high-dimensional sparse vector corresponds to a specific feature existence or feature value, with most dimensions having values ​​of 0. Locality-sensitive hashing (LSH) is then applied to this high-dimensional sparse vector. LSH maps the high-dimensional vector to a low-dimensional signature using a set of random projection functions, and then converts this signature into a fixed-length binary code, which is the final structural fingerprint. Optionally, the family of random projection functions used in LSH can be based on a p-stable distribution. The generation process of the structural fingerprint can be described by a formal representation of a family of hash functions. In some embodiments, the core operation of LSH can be represented as: Where: symbol Represents a vector The result of a single hash function operation is an integer value. (symbol) It is a vector Random vectors of the same dimension have components that follow a standard normal distribution. (Symbol) It is a high-dimensional sparse vector to be mapped. (Dot notation) This represents the dot product operation of vectors. (Symbol) It is a random real-number offset uniformly distributed within the interval [0, r). (Symbol) This is a preset real-valued parameter representing the width of the hash bucket. Multiple different random parameter combinations can be used to determine this width. Multiple hash values ​​are generated and converted into binary bits, which are then concatenated to form a structural fingerprint. It can be understood that locality-sensitive hashing can largely preserve the approximate proximity relationships of the original high-dimensional vector space. To illustrate more specifically the encoding from different features to high-dimensional sparse vectors, refer to Table 1, which presents a conceptual mapping.

[0036] Table 1: Partial Dimension Mapping Table from Structural Features to High-Dimensional Sparse Vectors In specific implementation, the structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space. The method is as follows: for each data object, if the data object is a code fragment, the structural fingerprint of this code fragment and its corresponding code vector in the high-dimensional semantic vector space are obtained. The binary encoding of the structural fingerprint is converted into a dense fingerprint vector through an embedding layer, which is a trainable lookup table or linear projection layer. This fingerprint vector and the code vector are concatenated to form a higher-dimensional fused vector. This fused vector is input into a feedforward neural network for dimensionality reduction and information integration. The feedforward neural network contains multiple fully connected layers and non-linear activation functions; the output vector of the feedforward neural network is the unified multidimensional feature description of the code fragment. Optionally, before the concatenation operation, the fingerprint vector and the code vector can be subjected to layer normalization. For natural language text data objects, their paragraph-level semantic vectors in the high-dimensional semantic vector space are directly used as their unified multidimensional feature description. In some embodiments, the output dimension of the feedforward neural network is set to be the same as the dimension of the paragraph-level semantic vector to ensure that the unified multidimensional feature descriptions of different types of data objects are located in the same comparable vector space. It is understandable that by fusing structural fingerprints, the unified multidimensional feature description of code snippets simultaneously encodes semantic and syntactic structural information.

[0037] In one embodiment of the present invention, the final translation result is obtained based on a unified multidimensional feature description. The process begins by enhancing the semantic association graph according to the unified multidimensional feature description, updating the edge weights in the graph, and generating a multidimensional association topology graph. A translation query for a specific data object is received, and a multi-hop association retrieval is performed in the multidimensional association topology graph to obtain the object cluster associated with the query object. Based on the unified multidimensional feature description of the object cluster, combined with a pre-trained multilingual code translation model, a code translation result in the target language is generated. The code translation result undergoes contextual consistency verification, and the semantic consistency of the translation result within the association cluster is verified using the multidimensional association topology graph. Finally, the final translation result is output.

[0038] The process of enhancing the semantic association graph based on unified multidimensional feature descriptions includes: for each edge in the semantic association graph, obtaining the unified multidimensional feature descriptions of the two nodes connected by the edge; calculating the Mahalanobis distance between these two unified multidimensional feature descriptions; mapping the Mahalanobis distance to a structural semantic association strength using a monotonically decreasing function; weighting this structural semantic association strength with the initial semantic association strength weight of the edge to obtain the updated comprehensive association strength of the edge; and using the updated comprehensive association strength as the new weight of the edge to replace the old weight of the corresponding edge in the semantic association graph, thereby generating a multidimensional association topology graph.

[0039] In practice, for each edge in the semantic association graph, a unified multidimensional feature description of the two nodes connected by that edge is obtained. The Mahalanobis distance between the two unified multidimensional feature descriptions is calculated, taking into account the correlation between feature dimensions. The calculated Mahalanobis distance is mapped to the structural semantic association strength through a monotonically decreasing function; the smaller the distance, the greater the mapped structural semantic association strength. In practice, the mapping relationship can be defined as the structural semantic association strength being equal to the negative exponential function value of the Mahalanobis distance. The calculated structural semantic association strength is then weighted and averaged with the initial semantic association strength weights of the edges to obtain the updated comprehensive association strength of the edges. The updated comprehensive association strength is used as the new weight of the edges, replacing the old weights of the corresponding edges in the semantic association graph. The graph enhanced through this process is then generated as a multidimensional association topology graph.

[0040] In practical implementation, the calculation of Mahalanobis distance involves the covariance matrix of the eigenvectors. In some embodiments, the formula for calculating Mahalanobis distance can be expressed as: Where: symbol Represents two eigenvectors and The Mahalanobis distance between them. (Symbol) and These represent unified multidimensional feature description vectors obtained from two nodes connected by an edge in a multidimensional relational topology graph. (Symbols) This represents the transpose operation of a vector. (Symbol) This represents the inverse of the covariance matrix of the unified multidimensional feature description vectors of all nodes. The process of calculating the overall association strength through weighted averaging can be achieved through a linear combination. Overall Association Strength The calculation can be expressed as: ,in It is the initial semantic association strength weight of the edge. It is the structural semantic association strength obtained from the Mahalanobis distance mapping. It is a weighting coefficient between 0 and 1, used to balance the contributions of the two association strengths. See Table 2, which illustrates the concept of an edge weight update.

[0041] Table 2: Semantic Association Graph Edge Weight Enhancement Process In implementation, after generating a multidimensional association topology graph, the system receives translation queries for specific data objects. The translation query locates the specified data object as the query node in the multidimensional association topology graph. Starting from the query node, a weighted random walk algorithm is used to perform multiple steps in the multidimensional association topology graph. At each step, the algorithm calculates the transition probability based on the comprehensive association strength weights of each outgoing edge of the current node and selects the next node according to the probability. All nodes visited during the walk are recorded. The walk process terminates when the number of steps reaches a preset maximum or the cumulative product of the path edge weights from the starting point is lower than a connectivity threshold. The set of all visited nodes is deduplicated and then used as the object cluster associated with the query object.

[0042] In practice, the final translation result is obtained based on object clusters. Objects of all code fragment types are selected from the object cluster, and unified multidimensional feature descriptions of these code fragment objects are extracted. The original code text of the query object and its own unified multidimensional feature description are input into a pre-trained multilingual code translation model. The multilingual code translation model, based on an attention mechanism, can encode and utilize the unified multidimensional feature descriptions of other code fragments in the object cluster as contextual information, thereby generating preliminary translated code that conforms to the syntax of the target programming language. Optionally, the multilingual code translation model can adopt a Transformer-based sequence-to-sequence architecture. Contextual consistency verification is performed on the preliminary translated code. First, the preliminary translated code is parsed into an abstract syntax tree, and its structural fingerprint is calculated. In the context defined by the multidimensional association topology graph, the average similarity between the structural fingerprint of the preliminary translated code and the structural fingerprints of other code fragments in the object cluster is calculated. It can be understood that the similarity comparison of structural fingerprints can be achieved by calculating Hamming distance or cosine similarity. If the calculated average similarity is higher than a preset consistency threshold, the preliminary translated code is determined to have passed the contextual consistency verification and is output as the final translation result. If the average similarity fails the consistency threshold check, the generation parameters of the multilingual code translation model are adjusted, such as adjusting the kernel sampling temperature or the repetition penalty factor during generation. The translated code is then regenerated, and the above verification steps are repeated until the verification is passed or the maximum number of retries is reached. In some embodiments, if the verification still fails after reaching the maximum number of retries, the generation result with the highest average similarity can be output, or a consistency warning message can be output.

[0043] In one embodiment of the present invention, multi-hop association retrieval is performed in a multidimensional association topology graph. Specifically, the data object specified in the translation query is used as the query node and located within the multidimensional association topology graph. Starting from the query node, a weighted random walk algorithm is used to perform multiple steps within the multidimensional association topology graph. All nodes visited during the walk are recorded. The walk terminates when the number of steps reaches a preset maximum or the cumulative edge weight is lower than a connectivity threshold. The set of all visited nodes, after deduplication, is used as the object cluster associated with the query object.

[0044] The process of generating and validating translation results based on unified multidimensional feature descriptions of object clusters includes: selecting objects of all code fragment types from the object cluster and extracting unified multidimensional feature descriptions of these objects; inputting the code text of the query object and its unified multidimensional feature description into a pre-trained multilingual code translation model; the multilingual code translation model, based on an attention mechanism, using the unified multidimensional feature descriptions of other code fragments in the object cluster as context information to generate preliminary translated code of the target programming language syntax; parsing the preliminary translated code into an abstract syntax tree and calculating its structural fingerprint; calculating the average similarity between the structural fingerprint of the preliminary translated code and the structural fingerprints of other code fragments in the object cluster in the multidimensional association topology graph; if the average similarity is higher than a preset consistency threshold, the preliminary translated code is determined to have passed the context consistency check and is used as the final translation output; if it fails the check, the generation parameters of the multilingual code translation model are adjusted, the translated code is regenerated, and the above check steps are repeated until the check is passed or the maximum number of retries is reached.

[0045] In practical implementation, after receiving a translation query for a specific data object, the data object explicitly specified in the translation query is designated as the query node and located in the multidimensional association topology graph. Starting from the query node, a weighted random walk algorithm is used to perform a multi-step exploratory walk in the multidimensional association topology graph. At each walk step, the algorithm calculates the transition probability to each neighbor node based on the comprehensive association strength weight of all edges originating from the current node; edges with higher comprehensive association strength weights are more likely to be selected. All nodes visited during the walk are recorded. The walk process terminates when the number of walk steps reaches a preset maximum step limit, or when the cumulative product of the path edge weights originating from the query node is lower than a preset connectivity threshold. After deduplication, the set of all visited nodes is considered as the object cluster associated with the query object. It can be understood that the weighted random walk algorithm can probabilistically explore node regions that are semantically and structurally closely related to the query node based on the strength of edges in the graph.

[0046] In practical implementation, calculating the transition probability is a core step in the weighted random walk algorithm. In some embodiments, from node... Travel to its neighboring nodes transition probability The weight of the edge connecting these two nodes is determined by the weight of the edge, and its calculation formula can be expressed as: Where: symbol Indicates starting from the current node Transfer to neighboring nodes The probability. (Symbol) Represents a node With nodes The overall association strength weight between edges. (Symbol) Represents a node The set of all neighboring nodes. (symbol) Represents a node With any of its neighboring nodes The overall association strength weight between edges. Summation term. Represents a node The sum of the overall association strength weights of all outgoing edges is used to normalize the transition probability. Optionally, the connectivity threshold can be set to a constant between 0 and 1 to prevent wandering into regions with low association.

[0047] In practice, the final translation result is generated based on an object cluster. The process begins by selecting objects of all code fragment types from the cluster. A unified multidimensional feature description (UMDV) is extracted from these code fragment objects. The original code text of the query object and its corresponding UMDV are then input into a pre-trained multilingual code translation model. This multilingual code translation model, based on an attention mechanism, integrates the UMDV of other code fragments in the object cluster as additional contextual information during the encoding phase. During the decoding phase, this contextual information guides the generation of the target code, resulting in a preliminary translated code that conforms to the syntax of the target programming language. Optionally, the multilingual code translation model can employ a Transformer-based encoder-decoder architecture.

[0048] In practice, the initial translated code undergoes contextual consistency verification. The initial translated code is parsed into an abstract syntax tree, and its structural fingerprint is calculated using the same method as for extracting structural features. Within the association context defined by the multidimensional association topology graph, the average similarity between the structural fingerprint of the initial translated code and the structural fingerprints of other code segments in the object cluster is calculated. Average similarity... The calculation can be represented as the arithmetic mean of the fingerprint similarities between all other code segments in the object cluster and the initial translated code. It can be understood that the structural fingerprint similarity can be measured by calculating the Hamming distance or the Jaccard coefficient. If the calculated average similarity is higher than a preset consistency threshold, the initial translated code is determined to have passed the context consistency check and is directly output as the final translation result. If the average similarity fails the consistency threshold check, the generation parameters of the multilingual code translation model are adjusted, for example, by lowering the kernel sampling temperature parameter to reduce generation randomness, or by increasing the repetition penalty factor to avoid repetitive patterns. Then, the translated code is regenerated and the above verification steps of calculating the average similarity and comparing it with the threshold are repeated. In some embodiments, the cycle of repeated generation and verification will continue until a generated code passes the consistency check, or the number of cycles reaches a preset maximum number of retries. When the maximum number of retries is reached and the verification still fails, the system can select to output the translated code version with the highest average similarity among all generated versions.

[0049] The above are merely preferred embodiments of the present invention and are not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments that can be applied to other fields. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.

Claims

1. An open-source data object multidimensional association and translation method based on semantic analysis, characterized in that, include: Extract an initial heterogeneous data set containing code, comments, and version logs from the open-source code repository, and perform deduplication and format cleaning on the initial heterogeneous data set; Multi-granular semantic analysis is performed on natural language text in the cleaned heterogeneous dataset, including paragraph-level intent parsing of code comments and sentence-level change pattern recognition of version logs, to generate semantic analysis results; Based on the semantic analysis results, an improved semantic embedding algorithm is used to map natural language text and code fragments to the same high-dimensional semantic vector space, and the semantic distance between different data objects is calculated in the high-dimensional semantic vector space. Based on the semantic distance, data object pairs with a semantic distance less than a similarity threshold are identified, and a semantic association graph is constructed based on the identified data object pairs. In the semantic association graph, nodes represent data objects, and edges represent semantic association strength. Synchronously perform syntax tree parsing on code snippets, extract function signatures, class structures, and control flow patterns as structural features, and encode these structural features as structural fingerprints; The structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space to form a unified multidimensional feature description of the data object; Based on the unified multidimensional feature description, the final translation result is obtained.

2. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 1, characterized in that, The multi-granular semantic analysis of natural language text in the cleaned heterogeneous dataset includes: The code comment text is segmented, dividing the continuous comment text above each function or class into an analysis segment; For each analyzed paragraph, a pre-trained paragraph encoder is used to extract paragraph-level semantic vectors. Based on the paragraph-level semantic vectors, a classification model is used to determine the intent category of the annotation. The intent category includes functional description, parameter description, algorithm explanation, and usage example. The version log text is segmented by commit record, and dependency parsing is performed on the descriptive sentences of each commit record to identify the core verbs describing the actions and the code entity objects that perform the actions. The core verbs and code entity objects are combined into change action tuples. The change action tuples are input into the change pattern classifier to obtain the submitted change pattern labels. The change pattern labels include new features, defect fixes, performance optimizations and refactoring. The paragraph-level semantic vector, intent category, change action tuple, and change pattern label together constitute the semantic analysis result.

3. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 1, characterized in that, The working principle of the improved semantic embedding algorithm includes: Construct a twin neural network with a dual-tower structure to handle natural language text input and code text input respectively; In the Natural Language Text Processing Tower, a hierarchical Transformer encoder is used. The first layer encoder processes word sequences, and the second layer encoder processes the sentence-level representation output by the first layer to obtain a context-aware representation of the text. In the code text processing tower, a graph neural network encoder is used to parse code fragments into abstract syntax trees. The nodes of the abstract syntax trees are used as graph nodes, and the syntactic relationships between nodes are used as edges. The graph neural network encoder learns the structured representation of the code. Set a joint optimization objective, which includes a contrastive loss function and an alignment loss function; The contrastive loss function brings closer the vector representations of natural language descriptions and code snippets that are determined to be relevant in the semantic analysis results, while pushing away the vector representations of irrelevant descriptions. The alignment loss function encourages the alignment of paragraph-level semantic vectors output by the natural language text processing tower with vectors of class names and function names key identifiers output by the code text processing tower in a subspace. The Siamese neural network is trained by jointly optimizing the contrast loss function and the alignment loss function. After training, the natural language text processing tower and the code text processing tower are used to map the natural language text and code fragments to the same high-dimensional semantic vector space, respectively.

4. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 3, characterized in that, Calculating the semantic distance between different data objects in the high-dimensional semantic vector space includes: For any two data objects, if both data objects are natural language text, then calculate the cosine distance between the paragraph-level semantic vectors corresponding to the two data objects. If both data objects are code snippets, then calculate the Euclidean distance between the code vectors output by the code text processing tower corresponding to the two data objects; If one is natural language text and the other is code snippet, then the modified cosine distance between the paragraph-level semantic vector corresponding to the text and the code vector corresponding to the code snippet is calculated. The modified cosine distance is calculated by normalizing and weighting the vectors by dimension before calculation. The calculated cosine distance, Euclidean distance, or modified cosine distance are uniformly defined as the semantic distance between data objects.

5. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 4, characterized in that, Based on the semantic distance, data object pairs with a semantic distance less than a similarity threshold are identified, and a semantic association graph is constructed based on the identified data object pairs, including: A dynamic similarity threshold is set, which is determined based on the distribution quantile of all semantic distances in the current high-dimensional semantic vector space; Iterate through all pairwise combinations of data objects. When the semantic distance between any two data objects is less than the dynamic similarity threshold, the two data objects are recorded as a semantic association pair. Initialize an undirected weighted graph with all data objects as nodes and each semantic association pair as an edge; The inverse of the semantic distance corresponding to each edge is used as the initial semantic association strength weight of the edge to complete the construction of the semantic association graph.

6. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 1, characterized in that, The synchronous parsing of the code snippet performs syntax tree analysis, extracting function signatures, class structures, and control flow patterns as structural features. These structural features are then encoded into structural fingerprints, including: Parse code snippets into a standard abstract syntax tree; Traverse the abstract syntax tree, extract all function definition nodes, and record the function name, parameter type list and return type of each function to form the function signature characteristics; Traverse the abstract syntax tree, extract all class definition nodes, and record the class name, the list of inherited parent classes, the list of internal methods and the list of attributes of each class, which together form the class structure features; The analysis function defines the control flow nodes, identifies structural patterns of loops, conditional branches, and exception handling, and encodes the frequency and nesting depth of these structural patterns as control flow pattern features. The function signature features, class structure features, and control flow pattern features are concatenated into a high-dimensional sparse vector. The high-dimensional sparse vector is subjected to local sensitive hashing to generate a fixed-length binary code, which is the structural fingerprint.

7. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 6, characterized in that, The structural fingerprint is fused with the corresponding semantic vector in the high-dimensional semantic vector space to form a unified multidimensional feature description of the data object, including: For each data object, if it is a code fragment, its structural fingerprint and its corresponding code vector in the high-dimensional semantic vector space are obtained; The binary encoding of the structural fingerprint is converted into a dense fingerprint vector through an embedding layer; The fingerprint vector and the code vector are concatenated to form a fused vector; The fused vector is input into a feedforward neural network for dimensionality reduction and information integration. The output vector of the feedforward neural network is the unified multidimensional feature description of the code segment. For natural language text data objects, their paragraph-level semantic vectors in the high-dimensional semantic vector space are directly used as their unified multidimensional feature descriptions.

8. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 7, characterized in that, Based on the unified multidimensional feature description, the final translation result is obtained, including: Based on the unified multidimensional feature description, the semantic association graph is enhanced, the weights of the edges in the graph are updated, and a multidimensional association topology graph is generated. Receive a translation query for a specific data object, perform a multi-hop association retrieval in the multidimensional association topology graph, and obtain the object cluster associated with the query object; Based on the unified multidimensional feature description of the object cluster, combined with the pre-trained multilingual code translation model, code translation results in the target language are generated, and the context consistency of the code translation results is checked. The semantic consistency of the translation results in the associated cluster is verified by using a multidimensional association topology graph, and the final translation result is output. The process of enhancing the semantic association graph based on a unified multidimensional feature description, updating the edge weights in the graph, and generating a multidimensional association topology graph includes: For each edge in the semantic association graph, obtain a unified multidimensional feature description of the two nodes connected by the edge; Calculate the Mahalanobis distance between two unified multidimensional feature descriptions; The Mahalanobis distance is mapped to the structural semantic association strength through a monotonically decreasing function; The weighted average of the structural semantic association strength and the initial semantic association strength weight of the edge is used to obtain the comprehensive association strength after the edge is updated. The updated comprehensive association strength is used as the new weight of the edge to replace the old weight of the corresponding edge in the semantic association graph, generating a multidimensional association topology graph.

9. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 8, characterized in that, The process of receiving a translation query for a specific data object, performing a multi-hop association retrieval in the multidimensional association topology graph, and obtaining an object cluster associated with the query object includes: The data object specified in the translation query is used as the query node and located in the multidimensional association topology graph; Starting from the query node, a weighted random walk algorithm is used to perform a multi-step walk in the multidimensional association topology graph; Record all nodes visited during the traversal. The traversal terminates when the number of traversal steps reaches the preset maximum number of steps or the cumulative edge weight is lower than the connectivity threshold. The set of all nodes visited during the traversal, after deduplication, is used as the object cluster associated with the query object.

10. The method for multidimensional association and translation of open-source data objects based on semantic analysis according to claim 9, characterized in that, Based on the unified multidimensional feature description of the object cluster, combined with a pre-trained multilingual code translation model, code translation results in the target language are generated, and the context consistency of the code translation results is verified, including: From the object cluster, select objects of all code fragment types and extract a unified multidimensional feature description of the objects; The code text of the query object and its unified multidimensional feature description are input into a pre-trained multilingual code translation model. The multilingual code translation model is based on an attention mechanism and uses the unified multidimensional feature descriptions of other code fragments in the object cluster as context information to generate preliminary translated code of the target programming language syntax. The preliminary translated code is parsed into an abstract syntax tree, and its structural fingerprint is calculated. In the multidimensional association topology graph, the average similarity between the structural fingerprint of the preliminary translated code and the structural fingerprints of other code segments in the object cluster is calculated. If the average similarity is higher than the consistency threshold, the preliminary translated code is determined to have passed the context consistency check and is used as the final translated output. If the verification fails, adjust the generation parameters of the multilingual code translation model, regenerate the translated code, and repeat the verification steps until the verification is passed or the maximum number of retries is reached.