A cross-language name binding method for java framework

By using the BERT model and ensemble learning, combined with framework rules and programming context, the problem of cross-language renaming propagation in multilingual software applications was solved, achieving bidirectional propagation of identifiers and improving accuracy, thus ensuring software quality.

CN115407978BActive Publication Date: 2026-05-01NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING UNIV OF AERONAUTICS & ASTRONAUTICS
Filing Date
2022-08-22
Publication Date
2026-05-01

AI Technical Summary

Technical Problem

Existing cross-language renaming and refactoring methods have problems in multilingual software applications, such as the inability to achieve bidirectional propagation, the need to build meta-models requiring professional knowledge, and the ease with incorrect renaming of unrelated entities, which makes it difficult to guarantee software quality.

Method used

By employing the BERT model and ensemble learning, combined with framework rules and programming context, we construct name bindings between Java class members and domain-specific language identifiers. Through cross-language name binding methods, we achieve renaming propagation, reducing errors and improving accuracy.

Benefits of technology

It enables bidirectional propagation of identifiers in a multilingual environment, reduces errors caused by lack of knowledge, and improves the accuracy of renaming and software quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115407978B_ABST
    Figure CN115407978B_ABST
Patent Text Reader

Abstract

This invention discloses a cross-language name binding method for the Java framework. The method involves selecting a suitable project, collecting data to construct a cross-language name binding dataset, inputting text vectors of code information into a name binding recognition model for fine-tuning, extracting classification features for duplicate Java identifiers, and using an ensemble learning classification model for differentiation to achieve name binding, matching all identical identifiers for the identifier to be renamed to form binding pairs, and extracting relevant code information for input into the name binding recognition model, and for Java identifiers that appear multiple times, extracting programming context information for input into a duplicate identifier name binding differentiation model to predict whether the cross-language name binding pair is valid, executing the renaming of the identifier, and simultaneously propagating the renaming of other identically named identifiers bound to it, ultimately achieving a complete cross-language renaming execution task. This invention ensures that the program can still be compiled and run after renaming, guaranteeing software quality.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of static code analysis technology, specifically relating to a cross-language name binding method for Java frameworks. Background Technology

[0002] Software source code contains a large number of identifiers, and meaningful identifiers are one of the most important sources of program understanding. During software evolution, identifiers often become inconsistent with their semantic function, thus requiring renaming operations to improve the identifiers and the overall quality of the software. Performing identifier renaming and refactoring requires ensuring that the program can still compile and run after the renaming.

[0003] Modern software projects are often multilingual software applications (MLSA), which frequently use multiple frameworks or programming languages ​​during development. When performing renaming refactoring, changing the identifier in one language often affects more than two languages. For example, in a project that includes both the Wicket and Hibernate frameworks, renaming some Java class properties will simultaneously affect four languages ​​contained in both frameworks. This requires not only renaming and propagating the changes within Java but also renaming the identifiers in other languages.

[0004] However, even the most widely used IDE refactoring frameworks cannot perfectly propagate cross-language renaming correctly. For most identifiers, they only search for all matches with the same name. For example, when renaming an identifier, IDEA will pop up a Refactoring Preview window to display all matches. These matches are generally divided into two categories: those in code and those in strings, comments, and text. Each category is further subdivided according to identifier type and location, but it does not tell developers which ones can be renamed. Replacing all of them can easily lead to mistakenly renaming unrelated entities with the same name. Therefore, developers must manually identify all identifiers that should be renamed, which requires a thorough and meticulous understanding of the code structure.

[0005] The primary task of renaming refactoring is to preserve all name bindings in the code to propagate the renaming, ensuring the program compiles and runs after the renaming. For cross-language name bindings in multilingual software applications, existing research primarily focuses on identifier reference-based name binding methods. This involves identifying all references to the identifier that needs renaming within the project and consistently renaming them.

[0006] Chen and Johnson proposed automatic renaming across three popular Java frameworks by studying the interaction between Java files and XML configuration files. When renaming Java identifiers, they traverse the XML files in the project, filtering out framework-related files and building reference relationships to ensure program consistency. Kempf et al.'s method is similar, extending the scope of Java renaming refactoring to the Groovy language. These methods are all limited to only two languages, have fewer application scenarios, and the domain-specific language only acts as a participant in the refactoring process, only achieving propagation from a general-purpose language to a domain-specific language.

[0007] Mayer and Schroeder provide a refactoring algorithm that builds a metamodel for each language in MLSA, constructs links based on the rules provided by the framework to find mutually referencing artifacts, implements refactoring, and achieves transitive closure. While their method can achieve name binding and renaming propagation across multiple languages, it requires building a complete metamodel for each language, which demands extensive expertise from the developers.

[0008] Current methods for renaming and refactoring provide a solid research foundation for ensuring code name binding and propagating renaming. However, most existing methods are designed for single languages, and research on MLSA is limited and has not been fully explored, mainly in the following aspects:

[0009] 1. Most existing MLSA refactoring execution methods involve linking and refactoring between two languages. However, when MLSA changes the identifiers of one language, it often affects more than two languages.

[0010] 2. Cross-language refactoring propagation often involves moving from a general-purpose language (such as Java) to certain domain-specific languages ​​(such as XML, HTML, etc.). In IDEs or previous methods, these domain-specific languages ​​always act as participants in the refactoring process, making bidirectional propagation impossible.

[0011] 3. Most cross-language methods first require the establishment of a meta-model. The construction of the meta-model requires rich professional knowledge and sufficient detail, but not all modules of the meta-model have an impact on the refactoring execution.

[0012] 4. Search-and-replace methods traverse source code as plain text or abstract syntax trees without considering semantics, which can easily lead to the erroneous renaming of unrelated entities with the same name.

[0013] 5. Methods should not be language- or domain-specific, nor should they be specific to refactoring operations; they should be more general. Summary of the Invention

[0014] Purpose of the invention: The purpose of this invention is to propose a cross-language name binding method for Java frameworks. During the software renaming and refactoring phase, by using framework rules and programming context, and employing the BERT model and ensemble learning, name bindings are constructed between Java class members (general language) and non-Java identifiers (domain-specific language) to achieve the propagation of renaming. This ensures that the program can still be compiled and run after renaming, thus guaranteeing software quality.

[0015] Technical Solution: This invention provides a cross-language name binding method for Java frameworks, comprising the following steps:

[0016] (1) Select a project with high popularity of Java language frameworks that contain both general language and domain-specific language, extract all Java language identifiers of the project, match the same identifiers in the entire project, extract code information to build a cross-language name binding dataset.

[0017] (2) Input the text vector of the code information in the name binding dataset into the name binding recognition model, extract the code semantic information, and recognize the name binding code format; for Java identifiers with no duplicate names, construct the correct name binding pair;

[0018] (3) For Java identifiers with the same name, after determining that the non-Java identifier has the name binding condition, distinguish which Java identifier in which class it is matched; analyze code information, programming context information and framework rules, extract features from them, use ensemble learning to train the name binding differentiation model of the duplicate identifier, realize the differentiation task, and complete the name binding of the duplicate Java identifiers.

[0019] (4) Match all identifiers with the same name for the identifier that needs to be renamed to form a binding pair. Extract the code information and input it into the name binding identification model in step (2) to find all non-Java identifiers that are bound. If the identifier has no duplicate name, the name binding pair is completed. For identifiers with duplicate names, extract the programming context information and input it into the name binding differentiation model of duplicate name identifiers in step (3) to differentiate the correct name binding pair. Execute the renaming of the identifier and at the same time, propagate the renaming to other identifiers with the same name bound to it in turn to realize the complete cross-language renaming execution task.

[0020] Further, step (1) includes the following steps:

[0021] (11) Extract all members of all Java classes in the project, count their occurrences, and divide them into those that appear only once and those that appear multiple times; through a global search, find all identifiers with the same name in the project for each member of the Java class.

[0022] (12) For all name binding pairs in the project, construct a cross-language name binding correct binding set and an incorrect binding set through framework rules and professional knowledge; the correct binding set consists of Java identifiers with name binding relationships and matching pairs of non-Java identifiers with the same name, as well as their position information; the incorrect matching set consists of unrelated Java identifiers and matching pairs of non-Java identifiers with the same name.

[0023] (13) Collect the code information of the two identifiers in each binding pair and perform data preprocessing, then add them to the binding set;

[0024] (14) Add classification labels 1 and 0 to the correct binding set and the incorrect binding set respectively, merge them to form the name binding dataset, and divide it into training set and test set.

[0025] Furthermore, step (2) includes the following steps:

[0026] (21) The code data of each binding pair in the name binding set constructed in step (1) is segmented into words, the words are divided into more fine-grained semantic units, all text vectors are converted into number vectors, and the format is processed into the input required by BERT; the input of BERT consists of three types of embeddings, namely word vector token embedding, vector segment embedding to distinguish between two sentences, and vector positional embedding to represent positional features.

[0027] (22) Input the vector into the BERT model, and after passing through the self-attention mechanism of the multi-layer decoder and the feedforward neural network, output the CLS vector that integrates the semantic information of the whole text at each position. The binary classification task is achieved by linear mapping through the Linear layer. Then, the model is fine-tuned to improve the accuracy.

[0028] (23) Use the BERT model to summarize the code format for name binding from the text vector of code information, complete the name binding recognition, and determine whether non-Java identifiers have name binding relationships.

[0029] Furthermore, step (3) includes the following steps:

[0030] (31) Feature extraction: Construct a corpus for text tags of programming context, establish numerical mapping for words and punctuation in the corpus, convert text tags into numerical vector representations, calculate the similarity of programming contexts between Java and non-Java binding pairs, and select cosine similarity and Euclidean distance.

[0031]

[0032]

[0033] Where X and Y represent numeric vectors of programming context information for Java identifiers with the same name and non-Java identifiers with the same name, respectively. i and y i Let X and Y be the coordinates of n-dimensional vectors X and Y in the i-th dimension;

[0034] Remove the file extension from the filename in the code information, calculate the similarity, and select the longest common subsequence length (LCS) and Levinstein ratio (r):

[0035] r = (sum – ldist) / sum

[0036] Where sum refers to the total length of the strings word1 and word2, and ldist is the class edit distance; based on the framework help documentation, the most basic rules for distinguishing Java identifiers with the same name are summarized, including two main categories: those defined inside non-Java files and those defined inside other files, using one-hot encoding; the number of times the class name of the class containing the Java identifier appears in the file containing the non-Java identifier is counted; the number of times other member names of the same class of the Java identifier appear in the file containing the non-Java identifier is counted, and the probability and average occurrence frequency are calculated;

[0037] (32) Construct a classification dataset: For non-Java identifiers that are matched, the correct matching set is a set of binding pairs where the name binding is successful, and the incorrect matching set is the binding pairs between the other Java identifiers with the same name and the non-Java identifier. The classification labels are 1 and 0. Extract the corresponding features for each matching pair, normalize them, and put them into a one-dimensional array as the feature set for classification. Connect the feature sets of all matching pairs in the dataset to obtain a two-dimensional matrix.

[0038] (33) Training of the name binding differentiation model for duplicate identifiers: Support vector machine, decision tree, random forest and nearest neighbor classifier are selected as the first layer basic classifiers. The class probability values ​​generated by the first layer basic classifier are used as the input of the new training set. Logistic regression classifier is selected as the second layer target classifier and trained on the new training set to obtain the final classification result. This realizes the name binding differentiation of duplicate identifiers and constructs the correct name binding for duplicate identifiers.

[0039] Furthermore, the programming context information mentioned in step (3) is:

[0040] For Java identifiers, the Java Parser is used to convert the class into an abstract syntax tree, extracting the class name, member names of the same class, member names defined in other classes but of the same type, member names of the class, member names of inherited classes or interfaces, comment information, and annotation information.

[0041] For non-Java identifiers, extract them by hierarchy and format: extract the identifiers defined in the outermost layer of the file or in a meaningful hierarchy that is associated with the name, as well as the identifier names in the same level and under the same label.

[0042] Furthermore, the code information mentioned in step (13) includes the file name, file address, code, and location information of the identifier.

[0043] Beneficial effects: Compared with the prior art, the beneficial effects of the present invention are as follows:

[0044] 1. This invention proposes that for frameworks containing multiple languages, name bindings can be constructed according to the method to achieve the propagation of renaming;

[0045] 2. In contrast to most methods where domain-specific language identifiers only serve as participants in the refactoring process, this invention enables bidirectional propagation of renaming between the general language and the domain-specific language by constructing cross-language name bindings. For all identifiers with the same name that have binding relationships, changing one of them will propagate to the other identifiers.

[0046] 3. This invention does not construct a complete meta-model, but starts with the framework structure, combining framework rules, professional knowledge and programming context, etc., and extracts code format containing semantic information through deep learning model (BERT). For unrelated entities with the same name, it combines ensemble learning model to distinguish them, realize name binding, reduce errors or omissions caused by lack of knowledge, and improve matching accuracy.

[0047] 4. This invention has universality. This invention selects Java as the general language and other languages ​​in the most commonly used Java framework as domain-specific languages. However, this method can also be used to build models for other general languages ​​or languages ​​in other frameworks that are not selected, so as to achieve cross-language renaming propagation. Attached Figure Description

[0048] Figure 1 This is a flowchart of the present invention;

[0049] Figure 2 This is a schematic diagram illustrating the name binding identification based on the BERT model according to the present invention;

[0050] Figure 3 A flowchart illustrating the method for distinguishing unrelated entities with the same name according to the present invention;

[0051] Figure 4 This is a schematic diagram of the ensemble learning classification model used in this invention. Detailed Implementation

[0052] The present invention will now be described in further detail with reference to the accompanying drawings.

[0053] This invention provides a cross-language name binding method for Java frameworks, such as... Figure 1 As shown, it includes the following steps:

[0054] Step 1: Select popular projects that use Java frameworks (such as Spring, Hibernate, etc.) that are the most widely used and include both general-purpose languages ​​(Java) and domain-specific languages ​​(XML, etc.). Extract all Java language identifiers from the projects (including those that appear only once and those that appear multiple times). Match the identifiers with the same name across the entire project and extract the code information to build a cross-language name binding dataset.

[0055] Step 1.1. Project Selection. Select Java as the general language for research, investigate Java language frameworks, and choose the most widely used frameworks that simultaneously include general language and domain-specific languages ​​(such as Spring, Hibernate, etc.). In version control repositories (Git or SVN), select projects with high popularity using these frameworks for research.

[0056] Step 1.2. Identifier Extraction. Extract all member names (attributes, methods, etc.) of all Java classes in each project. Find all identifiers with the same name in the project through a global search. For all name binding pairs in the project, construct a cross-language name binding correct binding set and an incorrect binding set using framework rules and expertise. The correct binding set consists of Java identifiers with name binding relationships and matching non-Java identifiers with the same name, along with their position information. The incorrect binding set consists of unrelated Java identifiers and matching non-Java identifiers with the same name.

[0057] Step 1.3. Name Binding Dataset Construction. Using the framework's help documentation and professional knowledge, manually label the name binding dataset for subsequent model training. The correct binding set consists of Java identifiers with name binding relationships and matching pairs of non-Java identifiers with the same name, along with their positional information. The incorrect matching set consists of unrelated Java identifiers and matching pairs of non-Java identifiers with the same name (for Java identifiers with the same name, the non-Java elements in the incorrect matching set may not match any of the Java elements with the same name, or they may match only one of them; binding pairs with the remaining unrelated identifiers with the same name are included in the incorrect matching set). Add classification labels 1 and 0 to the correct and incorrect matching sets, respectively.

[0058] Step 1.4. Code Information Collection. Collect the code information for the two identifiers in each binding pair. The code information includes the filename, file address, code, and location information of the identifier.

[0059] Step 1.5. Data Preprocessing. Remove non-alphanumeric characters from the code information, and convert all remaining words into text vectors.

[0060] Step 1.6. Dataset Splitting. Add code information and programming context information to each line of data in both the correct and incorrect binding sets, merge them to form a dataset, and then split it into a training set and a test set. Step 2. Name Binding Recognition.

[0061] Step 2: Input the text vectors of code information from the name binding dataset into the name binding recognition model to extract semantic information and identify the name binding code format. For Java identifiers with unique names, correct name binding pairs can be constructed.

[0062] This implementation inputs the text vector of code information into the BERT model and performs fine-tuning. The BERT model then summarizes the code matching format based on semantic information, determines whether the identifier code format meets the name binding requirements, and thus achieves the subsequent name binding task. Figure 2 This is a diagram illustrating how the BERT model implements cross-language name binding.

[0063] Step 2.1. This invention uses the BERT model proposed by Google. This model is based on Google's Transformers architecture, which stacks multiple encoders together. It is a pre-trained model for language representation and achieves advanced performance in tasks such as classification and general language understanding evaluation.

[0064] Step 2.2. Tokenize the code data for each binding pair in the matching set, dividing English words into finer-grained semantic units and converting all text vectors into numeric vectors. BERT's input consists of three types of embeddings: token embedding, segment embedding to distinguish between two sentences, and positional embedding to represent positional features. This invention's input includes Java code data and non-Java code data, so the SEP character needs to be added between the two sentences.

[0065] Step 2.3. Input the vectors into the BERT model as required. The vectors flow upwards through multiple layers of decoders, each layer passing through a self-attention mechanism and a feedforward neural network. After encoding, all input vectors to BERT output a CLS vector at each position, incorporating full-text semantic information. This CLS vector is then linearly mapped through a Linear layer to achieve binary classification based on whether a match is valid. Fine-tune the model parameters to improve accuracy.

[0066] Step 2.4. Name recognition and binding is a binary classification task, with results of successful or unsuccessful binding. The BERT model is used to summarize the code format for successful name bindings from the text vectors of code information, completing name binding recognition and determining whether non-Java identifiers have name binding relationships.

[0067] Step 3: For Java identifiers with duplicate names, after determining that the non-Java identifier meets the name binding conditions, it is necessary to distinguish which specific Java identifier in which class it matches; analyze code information, programming context, and framework rules to extract features, and use ensemble learning to train a name binding differentiation model for duplicate-name identifiers to achieve the differentiation task and complete the name binding of duplicate-name Java identifiers. The specific process is as follows: Figure 3 As shown.

[0068] Step 3.1. Extraction and processing of programming context information.

[0069] For Java identifiers, the Java Parser is used to convert the class into an Abstract Syntax Tree (AST) to extract the class name, member names of the same class (if the type of the member is a class in the project, the member name of that class is also collected), member names defined in other classes but of the same type as the class name, member names contained in inherited classes or interfaces, comment information, annotation information, etc.

[0070] For non-Java identifiers, extraction rules need to be summarized based on different programming languages, and extracted according to hierarchical structure and the same format. Extract identifiers defined in the outermost layer of the file or in a meaningful hierarchy bound to the name, as well as identifier names in the same level and under the same label. Remove non-alphanumeric characters from the programming context information, and deduplicate the remaining words into text tags.

[0071] Step 3.2. Feature Extraction. Based on the programming context information extracted in Step 3.1 and the code information extracted in Step 1, and combined with the framework rules, classification features are extracted. The feature extraction process is as follows:

[0072] A corpus (containing all words from two text segments) is constructed for the text tags of the programming context. Numerical mappings are established for the words and punctuation in the corpus, converting the text tags into numerical vector representations. The similarity of the programming contexts of Java and non-Java binding pairs is calculated, selecting cosine similarity and Euclidean distance as the two main metrics.

[0073]

[0074]

[0075] Where X and Y represent numeric vectors of programming context information for Java identifiers with the same name and non-Java identifiers with the same name, respectively. i and y i Let X and Y be the coordinates of n-dimensional vectors X and Y in the i-th dimension.

[0076] Remove the file extension from the filename in the code information, calculate the similarity, and select the longest common subsequence length (LCS) and Levinstein ratio (r):

[0077] r = (sum – ldist) / sum

[0078] Where sum refers to the total length of the word1 and word2 strings, and ldist is the edit distance (deletion and insertion increment the value by 1, replacement increment the value by 2).

[0079] Based on the framework's help documentation, the most basic rules for distinguishing Java identifiers with the same name are summarized, including two main categories: rules defined inside non-Java files and rules defined inside other files, using one-hot encoding.

[0080] Count the occurrences of the class name of the class containing the Java identifier in files other than the Java identifier. Count the occurrences of other member names of the same class as the Java identifier in files other than the Java identifier, and calculate their probabilities and average occurrences.

[0081] Step 3.3. Construct the classification dataset. For non-Java identifiers that have a valid match, the correct match set consists of a group of name binding pairs that are valid, and the incorrect match set consists of binding pairs between other Java identifiers with the same name and the non-Java identifier. The classification labels are 1 and 0. For each matching pair, extract the corresponding features, normalize them, and then store them in a one-dimensional array as the feature set for classification. Concatenate the feature sets of all matching pairs in the dataset to obtain a two-dimensional matrix.

[0082] Step 3.4. Model Training. Select the most commonly used classifier and combine it with ensemble learning to train the model to achieve differentiation and complete the name binding of duplicate Java identifiers. Figure 4 This is a flowchart of the integrated learning process used in this invention.

[0083] The dataset is divided into training and test sets, and multiple classifiers are trained sequentially. The test set is used to predict the results of each trained classifier. In this embodiment, Support Vector Machine (SVM), Decision Tree, Random Forest, and Nearest Neighbor (KNN) are selected as the first-layer basic classifiers. The class probability values ​​generated by the first-layer basic classifiers are used as the input to the new training set. A logistic regression classifier is selected as the second-layer target classifier and trained on the new training set to obtain the final classification result, thus achieving name binding and differentiation of duplicate identifiers.

[0084] Step 4: Match all identically named identifiers for the identifier to be renamed, forming binding pairs. Extract code information and input it into the name binding recognition model from Step 2 to find all non-Java identifiers with valid bindings. If the identifier has no duplicate names, the name binding pair is complete. For identifiers with duplicate names, extract programming context information and input it into the duplicate identifier name binding differentiation model from Step 3 to distinguish the correct name binding pair. Execute the renaming of the identifier, and simultaneously propagate the renaming to other identically named identifiers bound to it, ultimately achieving a complete cross-language renaming execution task.

Claims

1. A cross-language name binding method for Java frameworks, characterized in that, Includes the following steps: (1) Select a project with high popularity of Java language frameworks that contain both general language and domain-specific language, extract all Java language identifiers of the project, match the same identifiers in the entire project, extract code information to build a cross-language name binding dataset. (2) Input the text vector of the code information in the name binding dataset into the name binding recognition model, extract the code semantic information, and recognize the name binding code format; for Java identifiers with no duplicate names, construct the correct name binding pair; (3) For Java identifiers with the same name, after determining that the non-Java identifier has the name binding condition, distinguish which Java identifier in which class it is matched; analyze code information, programming context information and framework rules, extract features from them, use ensemble learning to train the name binding differentiation model of the duplicate identifier, realize the differentiation task, and complete the name binding of the duplicate Java identifiers. (4) Match all identifiers with the same name for the identifier that needs to be renamed to form a binding pair. Extract the code information and input it into the name binding identification model in step (2) to find all non-Java identifiers that are bound. If the identifier has no duplicate name, the name binding pair is completed. For identifiers with duplicate names, extract the programming context information and input it into the name binding differentiation model of duplicate name identifiers in step (3) to differentiate the correct name binding pair. Execute the renaming of the identifier and at the same time, propagate the renaming to other identifiers with the same name bound to it in turn to realize the complete cross-language renaming execution task.

2. The method for cross-language name binding for Java frameworks according to claim 1, characterized in that, Step (1) includes the following steps: (11) Extract all members of all Java classes in the project, count their occurrences, and divide them into those that appear only once and those that appear multiple times; through a global search, find all identifiers with the same name in the project for each member of the Java class. (12) For all name binding pairs in the project, construct a cross-language name binding correct binding set and an incorrect binding set through framework rules and professional knowledge; the correct binding set consists of Java identifiers with name binding relationships and matching pairs of non-Java identifiers with the same name, as well as their position information; the incorrect matching set consists of unrelated Java identifiers and matching pairs of non-Java identifiers with the same name. (13) Collect the code information of the two identifiers in each binding pair and perform data preprocessing, then add them to the binding set; (14) Add classification labels 1 and 0 to the correct binding set and the incorrect binding set respectively, merge them to form the name binding dataset, and divide it into training set and test set.

3. The method for cross-language name binding for Java frameworks according to claim 1, characterized in that, Step (2) includes the following steps: (21) The code data of each binding pair in the name binding set constructed in step (1) is segmented into words, the words are divided into more fine-grained semantic units, all text vectors are converted into number vectors, and the format is processed into the input required by BERT; the input of BERT consists of three types of embeddings, namely word vector token embedding, vector segment embedding to distinguish between two sentences, and vector positional embedding to represent positional features. (22) Input the vector into the BERT model, and after passing through the self-attention mechanism of the multi-layer decoder and the feedforward neural network, output the CLS vector that integrates the semantic information of the whole text at each position. The binary classification task is achieved by linear mapping through the Linear layer. Then, the model is fine-tuned to improve the accuracy. (23) Use the BERT model to summarize the code format for name binding from the text vector of code information, complete the name binding recognition, and determine whether non-Java identifiers have name binding relationships.

4. The method for cross-language name binding for Java frameworks according to claim 1, characterized in that, Step (3) includes the following steps: (31) Feature extraction: Construct a corpus for text tags of programming context, establish numerical mapping for words and punctuation in the corpus, convert text tags into numerical vector representations, calculate the similarity of programming contexts between Java and non-Java binding pairs, and select cosine similarity and Euclidean distance. Where X and Y represent numeric vectors of programming context information for Java identifiers with the same name and non-Java identifiers with the same name, respectively. i and y i Let X and Y be the coordinates of n-dimensional vectors X and Y in the i-th dimension; Remove the file extension from the filename in the code information, calculate the similarity, and select the longest common subsequence length (LCS) and Levinstein ratio (r): r = (sum – ldist) / sum Where sum refers to the total length of the strings word1 and word2, and ldist is the class edit distance; based on the framework help documentation, the most basic rules for distinguishing Java identifiers with the same name are summarized, including two main categories: those defined inside non-Java files and those defined inside other files, using one-hot encoding; the number of times the class name of the class containing the Java identifier appears in the file containing the non-Java identifier is counted; the number of times other member names of the same class of the Java identifier appear in the file containing the non-Java identifier is counted, and the probability and average occurrence frequency are calculated; (32) Construct a classification dataset: For non-Java identifiers that are matched, the correct matching set is a set of binding pairs where the name binding is successful, and the incorrect matching set is the binding pairs between the other Java identifiers with the same name and the non-Java identifier. The classification labels are 1 and 0. Extract the corresponding features for each matching pair, normalize them, and put them into a one-dimensional array as the feature set for classification. Connect the feature sets of all matching pairs in the dataset to obtain a two-dimensional matrix. (33) Training of the name binding differentiation model for duplicate identifiers: Support vector machine, decision tree, random forest and nearest neighbor classifier are selected as the first layer basic classifiers. The class probability values ​​generated by the first layer basic classifier are used as the input of the new training set. Logistic regression classifier is selected as the second layer target classifier and trained on the new training set to obtain the final classification result. This realizes the name binding differentiation of duplicate identifiers and constructs the correct name binding for duplicate identifiers.

5. A cross-language name binding method for Java frameworks according to claim 1, characterized in that, The programming context information mentioned in step (3) is: For Java identifiers, the Java Parser is used to convert the class into an abstract syntax tree, extracting the class name, member names of the same class, member names defined in other classes but of the same type, member names of the class, member names of inherited classes or interfaces, comment information, and annotation information. For non-Java identifiers, extract them by hierarchy and format: extract the identifiers defined in the outermost layer of the file or in a meaningful hierarchy that is associated with the name, as well as the identifier names in the same level and under the same label.

6. A cross-language name binding method for Java frameworks according to claim 2, characterized in that, The code information mentioned in step (13) includes the file name, file address, code, and location information of the identifier.