Model processing method and apparatus

CN115309650BActive Publication Date: 2026-08-11ALIPAY (HANGZHOU) INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-15
Publication Date
2026-08-11

AI Technical Summary

Technical Problem

对于在软件开发工作中,由于各种因素的影响,产生的软件缺陷是无法避免的

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115309650B_ABST
    Figure CN115309650B_ABST
Patent Text Reader

Abstract

This specification provides a model processing method and apparatus. The model processing method includes: acquiring program source code related to historical processing tasks and determining the abstract syntax tree corresponding to the program source code; inputting the program source code and the tree node information corresponding to the abstract syntax tree into a task processing model for feature fusion processing to obtain a corresponding feature fusion vector; occluding at least one feature fusion sub-vector corresponding to a tree node in the feature fusion vector through the task processing model and predicting the occluded content; and adjusting the model parameters of the task processing model based on the prediction result and the feature fusion vector.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This specification relates to the field of computer technology, and in particular to a model processing method. One or more embodiments of this specification also relate to a model processing apparatus, a computing device, and a computer-readable storage medium. Background Technology

[0002] The existing information platform's R&D quality assurance process includes: coding phase, testing phase, regression testing phase, and deployment phase. As is well known, the delivery of high-quality code during the R&D phase is crucial to the entire project lifecycle and the quality of project releases.

[0003] In practical applications, intelligent understanding of the semantic and syntactic information of program code plays a crucial role in daily software development. Software defects are unavoidable in software development due to various factors. During the testing and maintenance phases, anomaly detection and repair rely on developers' domain knowledge, requiring significant human and material resources for manual code analysis and understanding. Therefore, reducing these costs while improving the accuracy of code comprehension is a pressing issue that needs to be addressed. Summary of the Invention

[0004] In view of the above, embodiments of this specification provide a model processing method. One or more embodiments of this specification also relate to a model processing apparatus, a computing device, and a computer-readable storage medium, to address the technical deficiencies existing in the prior art.

[0005] According to a first aspect of the embodiments of this specification, a model processing method is provided, comprising:

[0006] Obtain the source code of the program related to the historical processing task, and determine the abstract syntax tree corresponding to the source code;

[0007] The program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0008] Using the task processing model, the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded, and the occluded content is predicted.

[0009] Based on the prediction results and the feature fusion vector, the model parameters of the task processing model are adjusted.

[0010] According to a second aspect of the embodiments of this specification, a model processing apparatus is provided, comprising:

[0011] The acquisition module is configured to acquire the program source code related to historical processing tasks and determine the abstract syntax tree corresponding to the program source code;

[0012] The input module is configured to input the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0013] The prediction module is configured to occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector through the task processing model, and predict the occluded content.

[0014] The adjustment module is configured to adjust the model parameters of the task processing model based on the prediction results and the feature fusion vector.

[0015] According to a third aspect of the embodiments of this specification, a computing device is provided, comprising:

[0016] Memory and processor;

[0017] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the model processing method.

[0018] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided that stores computer-executable instructions that, when executed by a processor, implement the steps of the model processing method.

[0019] One embodiment of this specification obtains the program source code related to historical processing tasks and determines the abstract syntax tree corresponding to the program source code. The program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Through the task processing model, occlusion information is added to the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector. Based on the addition result, the occluded content is predicted by the feature fusion sub-vector. The model parameters of the task processing model are adjusted according to the prediction result and the feature fusion sub-vector.

[0020] In this embodiment, when adjusting the model parameters of the task processing model, the textual information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code are integrated to generate a feature fusion vector. By occluding some feature fusion sub-vectors in the feature fusion vector, the model parameters of the task processing model are adjusted, which helps to ensure the accuracy of the output results of the task processing model, that is, to improve the accuracy of understanding the program code. In addition, this task processing model can be used to support downstream classification and regression tasks such as code anomaly detection, duplicate code detection, and automatic code generation. This helps to reduce the human and material costs required in the testing and software maintenance stages, and helps to improve the accuracy of anomaly detection, duplicate code detection, and automatic code generation results. Attached Figure Description

[0021] Figure 1 This is a schematic diagram of a model processing procedure provided in one embodiment of this specification;

[0022] Figure 2 This is a flowchart illustrating a model processing method provided in one embodiment of this specification.

[0023] Figure 3a This is an architecture diagram of a model processing procedure provided in one embodiment of this specification;

[0024] Figure 3b This is a schematic diagram of a feature vector fusion process provided in one embodiment of this specification;

[0025] Figure 4 This is a flowchart illustrating the processing procedure of a model processing method provided in one embodiment of this specification.

[0026] Figure 5 This is a schematic diagram of a model processing device provided in one embodiment of this specification;

[0027] Figure 6 This is a structural block diagram of a computing device provided in one embodiment of this specification. Detailed Implementation

[0028] Many specific details are set forth in the following description to provide a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar extensions without departing from the spirit of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0029] The terminology used in one or more embodiments of this specification is for the purpose of describing particular embodiments only and is not intended to be limiting of the one or more embodiments of this specification. The singular forms “a,” “described,” and “the” as used in one or more embodiments of this specification and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise. It should also be understood that the term “and / or” as used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0030] It should be understood that although the terms first, second, etc., may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish information of the same type from one another. For example, first may also be referred to as second without departing from the scope of one or more embodiments of this specification, and similarly, second may also be referred to as first. Depending on the context, the word "if" as used herein may be interpreted as "when," "when," or "in response to a determination."

[0031] First, the terms and concepts used in one or more embodiments of this specification will be explained.

[0032] An Abstract Syntax Tree (AST) is an abstract representation of the syntax structure of source code. It represents the syntax structure of a programming language in a tree-like structure, where each node represents a structure in the source code. The syntax is described as "abstract" because it doesn't represent every detail of the actual syntax. For example, nested parentheses are implicit in the tree structure and not presented as nodes; while conditional jump statements like `if-condition-then` can be represented using nodes with three branches.

[0033] Bidirectional Encoder Representations from Transformers (BERT) is a pre-trained language representation model. It emphasizes a departure from traditional unidirectional language models or shallow concatenation of two unidirectional language models for pre-training. Instead, it employs a novel masked language model (MLM) to generate deep bidirectional language representations.

[0034] Word embeddings are high-dimensional vector representations that project source word data into a new vector space by training a projection function or matrix. In the field of natural language processing, word embeddings are considered to better represent the information that words can convey.

[0035] Intelligent understanding of the semantic and syntactic information of code plays a crucial role in daily software development. In daily software development, software defects are unavoidable due to various factors. During the testing and software maintenance phases, anomaly detection and fixing rely on developers' domain knowledge, requiring significant human and material resources to manually analyze and understand the code.

[0036] Currently, most tasks involving semantic understanding of program code involve embedding the original text of the program code or adding the tree node information of the abstract syntax tree as ordinary text information into the embedding. However, during actual execution, program code needs to be translated into machine language for execution. In tasks involving semantic understanding of program code, considering only the information in the program code itself presents the following problems:

[0037] When implementing the same program function, different program codes vary greatly depending on different programming languages ​​and programming habits, which brings great difficulties to the task of semantic understanding of program code;

[0038] For the same target task implemented in different programming languages, there will be significant differences in syntax and semantics, and relying solely on expert knowledge cannot form a unified standard paradigm.

[0039] Abstract syntax trees contain a lot of information about their tree nodes, which can lead to excessive noise due to information overload.

[0040] To more intelligently identify various problems in code, this specification proposes a model processing method with good generalization ability. During the critical process from program code compilation to machine execution, it integrates program text information and the tree node information of the corresponding abstract syntax tree (AST) to generate a feature fusion vector. Based on this feature fusion vector, a task processing model with a good understanding of the code is trained, effectively supporting downstream classification and regression tasks such as code anomaly detection, duplicate code detection, and automatic code generation. Furthermore, to avoid information overload and excessive noise issues when using ASTs, this specification proposes pruning the AST to improve the accuracy of fused information, resulting in better performance in program code semantic understanding tasks.

[0041] This specification provides a model processing method, and also relates to a model processing apparatus, a computing device, and a computer-readable storage medium, which will be described in detail in the following embodiments.

[0042] Figure 1 A schematic diagram of a model processing procedure provided according to an embodiment of this specification is shown.

[0043] Figure 1 First, the source code of the program related to the historical processing task is obtained, and the source code is parsed to obtain the corresponding abstract syntax tree. The source code and the tree node information corresponding to the abstract syntax tree are input into the feature fusion layer of the task processing model. The feature fusion layer fuses the source code and the tree node information corresponding to the abstract syntax tree, and the fusion result is encoded to generate a fusion vector.

[0044] Then, the program source code fragments and tree node information in the fusion result are labeled with information types, and the type vector corresponding to the fusion result is determined based on the labeling results. Based on the position of the program source code fragments in the program source code in the fusion result, the position information of the program source code fragments is labeled. Based on the position of the tree node information in the abstract syntax tree in the fusion result, the position information of the tree node information is labeled. Based on the position information labeling results, the position vector corresponding to the fusion result is determined. Alternatively, based on the position of the program source code fragments and tree node information in the fusion result, the position information of the program source code fragments and tree node information is labeled. Based on the position information labeling results, the position vector corresponding to the fusion result is determined. The fusion vector, type vector, and position vector are then fused to generate the corresponding feature fusion vector.

[0045] Next, the neural network layer of the task processing model is used to occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector, and the occluded content is predicted. Based on the prediction results and the feature fusion vector, the model parameters of the task processing model are adjusted.

[0046] In addition, the task processing model may also include a task processing layer, which can be used to implement classification tasks, such as code anomaly detection and duplicate code detection. When there is source code of the program to be detected, the abstract syntax tree corresponding to the source code can be determined first. The source code and the tree node information of the abstract syntax tree are input into the feature fusion layer of the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Then, the task processing layer of the task processing model performs classification processing to determine whether the source code of the program to be detected has anomalies based on the classification results. Alternatively, the task processing layer of the task processing model can perform code generation processing to achieve automated code generation.

[0047] Figure 2 A flowchart of a model processing method according to an embodiment of this specification is shown, including steps 202 to 208.

[0048] Step 202: Obtain the program source code related to the historical processing task, and determine the abstract syntax tree corresponding to the program source code.

[0049] Specifically, since many tools currently rely on program code for automated operation, and automated operation largely depends on writing and executing code in various programming languages, intelligently understanding the semantic and syntactic information of code can play a very important role in daily program development.

[0050] Based on this, the model processing method provided in the embodiments of this specification can first obtain the program source code and determine the abstract syntax tree corresponding to the program source code. Then, by integrating the tree node information of the program source code and the abstract syntax tree, a feature fusion vector is generated. Based on the feature fusion vector, a task processing model with a good understanding of the program source code is trained. This task processing model can support downstream classification and regression tasks such as code anomaly detection, duplicate code detection, and automatic code generation.

[0051] The historical processing task can be a data development task or a software development task, and the program source code can be the code submitted by programmers for the historical processing task, such as code statements generated according to the language format of the JavaScript programming language.

[0052] After obtaining the program's source code, it can be parsed to obtain the corresponding Abstract Syntax Tree (AST). An AST is a tree-like representation of the abstract syntactic structure of the source code; it abstracts the essential elements of language structure from concrete syntax, without considering the specific symbolic representation of the language. The AST demonstrates an operational process and simultaneously describes the hierarchical structure of the program's source code. By traversing the AST, code information and structural information related to the historical processing tasks can be extracted.

[0053] In practical applications, the program source code can be input into an open-source tool to parse the source code and obtain the corresponding abstract syntax tree. The specific method of generating the abstract syntax tree can be determined according to actual needs and is not restricted here.

[0054] Step 204: Input the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0055] Specifically, after obtaining the program source code and its corresponding abstract syntax tree (AST), the source code and the corresponding tree node information can be input into the task processing model for feature fusion. Feature fusion essentially requires embedding vector transformation of the source code and tree node information. Embedding vector transformation is a common technique in machine learning and deep learning used to convert features into high-dimensional embedding vector representations. Typically, a transformation matrix W is determined, and through matrix multiplication, this transformation matrix is ​​linearly transformed with the original feature vectors, resulting in a better numeric representation of the embedding vectors in the projection space.

[0056] In specific implementation, the program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing, including:

[0057] The abstract syntax tree is pruned to generate the target abstract syntax tree;

[0058] The program source code and the tree node information corresponding to the target abstract syntax tree are input into the task processing model for feature fusion processing.

[0059] Specifically, since the tree node information corresponding to the abstract syntax tree of the program source code contains complete code information of the program source code, the abstract syntax tree provides rich descriptive information for each program source code segment. In this embodiment of the specification, in order to prevent the problem of information overload, the abstract syntax tree can be pruned, that is, some tree nodes in the abstract syntax tree corresponding to the program source code are selected and other tree nodes in the abstract syntax tree are deleted, so as to use the tree node information of some tree nodes and the program source code for feature fusion processing. Specifically, the abstract syntax tree is pruned to generate a target abstract syntax tree, and the program source code and the tree node information corresponding to the target abstract syntax tree are input into the task processing model for feature fusion processing.

[0060] The pruning process for the abstract syntax tree includes:

[0061] The tree nodes in the abstract syntax tree are traversed, and the target tree node is determined based on the node type information, operation information and / or node position information corresponding to the tree node.

[0062] The target tree node is deleted from the abstract syntax tree to perform pruning on the abstract syntax tree.

[0063] Specifically, during the pruning of the abstract syntax tree (AST), the tree nodes to be deleted can be determined based on their node type information, operation information (operators and input parameters required by the operators), and node position information. Specifically, node deletion conditions can be pre-set based on node type information, operation information, and / or node position information. After generating the AST, tree nodes that meet these deletion conditions are identified as target tree nodes, and then these target tree nodes are deleted from the AST to achieve pruning.

[0064] In addition, the task processing model includes a feature fusion layer;

[0065] Accordingly, the program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector, including:

[0066] The program source code and the tree node information corresponding to the abstract syntax tree are input into the feature fusion layer of the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0067] Specifically, when the task processing model includes a feature fusion layer, the task processing model performs feature fusion processing on the tree node information corresponding to the program source code and the abstract syntax tree. In other words, the feature fusion layer performs feature fusion processing on the tree node information corresponding to the program source code and the abstract syntax tree.

[0068] Specifically, the program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector, including:

[0069] The program source code and the tree node information corresponding to the abstract syntax tree are fused together, and the fusion result is encoded to generate a first feature vector;

[0070] The program source code fragments and / or the tree node information in the fusion result are labeled with information types, and the second feature vector corresponding to the fusion result is determined based on the labeling results;

[0071] The program source code fragments and / or the tree node information are labeled with position information, and the third feature vector corresponding to the fusion result is determined based on the labeling results;

[0072] The first feature vector, the second feature vector, and the third feature vector are fused to generate a corresponding feature fusion vector.

[0073] Specifically, the architecture diagram of a model processing procedure provided in the embodiments of this specification is as follows: Figure 3aAs shown, Figure 3a The following program source code serves as an example to illustrate the model processing procedure:

[0074] Double var=iteminfo.getValueAsDouble("TEST_var",0.0);

[0075] Among them, Double, var, iteminfo, getValueAsDouble, TEST_var, and 0.0 are program source code fragments contained in the program source code.

[0076] like Figure 3a As shown, the tree node information corresponding to the abstract syntax tree of the program source code is: Double, var, iteminfo, getValueAsDouble, TEST_var, 0.0, Type(ClassOrInterfaceType), name(SimpleName), scope(NameExpr), Initializer(MethodCallExpr), name(SimpleName), argument(StringLiteralExpr), arguments, argument(DoubleLiteralExpr).

[0077] Therefore, by fusing the program source code and tree node information, the resulting fusion is: Type(ClassOrInterfaceType)Double name(SimpleName)var Initializer(MethodCallExpr)……arguments argument(StringLiteralExpr)TEST_var argument(DoubleLiteralExpr)0.0.

[0078] Encoding the fusion result will generate the corresponding first feature vector.

[0079] In addition, information type annotations are performed on the program source code fragments and / or tree node information in the fusion results. This information type is used to characterize whether it belongs to the program source code. If it belongs, it is marked as 1, and if it does not belong, it is marked as 0. Based on this, the second feature vector corresponding to the fusion results can be determined according to the annotation results.

[0080] In addition, positional information can be labeled for program source code fragments and / or tree node information in the fusion result. For example, natural numbers starting from 0 can be used to represent the relative offset of each word unit in the fusion result from the starting position. The word unit is the aforementioned program source code fragment and / or tree node information. The larger the number, the farther away it is from the starting position. Alternatively, natural numbers starting from 0 can be used to represent the relative offset of each program source code fragment in the fusion result from the starting position of the program source code, and natural numbers starting from 0 can be used to represent the relative offset of each tree node information in the fusion result from the starting position of the abstract syntax tree. This is used as the positional information labeling result. The third feature vector corresponding to the fusion result can be determined based on the labeling result. The first feature vector, the second feature vector, and the third feature vector are then concatenated to obtain the corresponding feature fusion vector.

[0081] In specific implementation, the program source code fragments and / or the tree node information are labeled with position information, and the third feature vector corresponding to the fusion result is determined based on the labeling results, including:

[0082] Based on the position of the program source code fragment in the program source code in the fusion result, the program source code fragment is marked with first position information; and based on the position of the tree node information in the abstract syntax tree in the fusion result, the tree node information is marked with first position information.

[0083] The third feature vector corresponding to the fusion result is determined based on the first position information annotation result.

[0084] Specifically, as mentioned above, when annotating the position information of program source code fragments and / or tree node information in the fusion result, natural numbers starting from 0 can be used to represent the relative offset of each program source code fragment in the fusion result with respect to the starting position of the program source code, and natural numbers starting from 0 can be used to represent the relative offset of each tree node information in the fusion result with respect to the starting position of the abstract syntax tree. This is used as the position information annotation result, and the third feature vector corresponding to the fusion result can be determined based on the annotation result.

[0085] Alternatively, the program source code fragments and / or the tree node information are labeled with location information, and a third feature vector corresponding to the fusion result is determined based on the labeling results, including:

[0086] Based on the position of the program source code fragment and / or the tree node information in the fusion result, a second position information annotation is performed on the program source code fragment and / or the tree node information;

[0087] The third feature vector corresponding to the fusion result is determined based on the second position information annotation result.

[0088] Specifically, as mentioned above, when annotating the program source code fragments and / or tree node information in the fusion result with position information, natural numbers starting from 0 can be used to represent the relative offset of each word unit in the fusion result from the starting position. The larger the number, the farther away it is from the starting position. This is used as the position information annotation result. Therefore, the third feature vector corresponding to the fusion result can be determined based on the annotation result.

[0089] Alternatively, the program source code and the tree node information corresponding to the abstract syntax tree can be input into a task processing model for feature fusion processing to obtain the corresponding feature fusion vector, including:

[0090] The program source code and the tree node information corresponding to the abstract syntax tree are fused together, and the fusion result is encoded to generate a first feature vector;

[0091] The program source code fragments and / or the tree node information in the fusion result are labeled with information types, and the second feature vector corresponding to the fusion result is determined based on the labeling results;

[0092] Based on the position of the program source code fragment in the program source code in the fusion result, the program source code fragment is marked with first position information; and based on the position of the tree node information in the abstract syntax tree in the fusion result, the tree node information is marked with first position information.

[0093] The third feature vector corresponding to the fusion result is determined based on the first position information annotation result;

[0094] Based on the position of the program source code fragment and / or the tree node information in the fusion result, a second position information annotation is performed on the program source code fragment and / or the tree node information;

[0095] The fourth feature vector corresponding to the fusion result is determined based on the second position information annotation result.

[0096] The first feature vector, the second feature vector, the third feature vector, and the fourth feature vector are fused to generate a corresponding feature fusion vector.

[0097] Specifically, information embedding based on the Abstract Syntax Tree (AST) includes tree node information after pruning the AST and textual information from the program source code. In generating the embedding vector (feature fusion vector), four types of information can be considered simultaneously: the token embedding of program source code symbols, the segment embedding of AST symbols, the positional embedding of AST symbols, and the overall embedding of the AST tree.

[0098] The process involves fusing the program source code and tree node information, resulting in the following fusion result: Type(ClassOrInterfaceType)Double name(SimpleName)var Initializer(MethodCallExpr)……arguments argument(StringLiteralExpr)TEST_var argument(DoubleLiteralExpr)0.0.

[0099] Encoding the fusion result generates the corresponding first feature vector, which is the token embedding of the program source code.

[0100] In addition, information type annotations are performed on the program source code fragments and / or tree node information in the fusion results. This information type is used to characterize whether it belongs to the program source code. If it belongs, it is marked as 1, and if it does not belong, it is marked as 0. Based on this, the second feature vector corresponding to the fusion results can be determined according to the annotation results.

[0101] In addition, natural numbers starting from 0 can be used to represent the relative offset of each program source code fragment in the fusion result to the starting position of the program source code, and natural numbers starting from 0 can be used to represent the relative offset of each tree node information in the fusion result to the starting position of the abstract syntax tree. This is used as the first position information annotation result, and the third feature vector corresponding to the fusion result can be determined based on the annotation result.

[0102] Natural numbers starting from 0 are used to represent the relative offset of each word unit in the fusion result from the starting position. The larger the number, the farther away it is from the starting position. This is used as the second position information annotation result. Based on the annotation result, the fourth feature vector corresponding to the fusion result is determined. Then, the first feature vector, the second feature vector, the third feature vector and the fourth feature vector are concatenated to generate the corresponding feature fusion vector.

[0103] In particular, since the code semantic understanding task requires extracting as much information as possible from the program source code, the feature fusion layer based on abstract syntax tree can fully extract information from the program source code and the tree node information in the corresponding abstract syntax tree.

[0104] The schematic diagram of the feature vector fusion process provided in the embodiments of this specification is as follows: Figure 3b As shown, Figure 3b In this process, the feature fusion considers the distinguishing information between the Abstract Syntax Tree (AST) and the program source code (AST-SegmentVector), the position information of the AST (AST-PositionVector), and the text embedding information of the program source code and its corresponding AST (token-vector). For the tree node information of the program source code and its corresponding AST, the AST block flag vector (AST-SegmentVector) is used for differentiation: a unit belonging to the program source code is set to 1, and a unit not belonging to the program source code is set to 0. This effectively distinguishes the origin of different units and helps reduce noise problems caused by repeated units or polysemy.

[0105] In addition, positional information is labeled for each word unit, meaning the differences caused by positional offsets can be represented by embedding vectors. Furthermore, the abstract syntax tree (AST) is pruned, considering only the node type information, operators and their required input parameters, and node position information. This approach ensures that the AST's node information is incorporated into the embedding vectors while avoiding information overload due to excessive AST node information.

[0106] Step 206: Using the task processing model, add occlusion information to the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector, and predict the occluded content based on the added result.

[0107] Specifically, after generating the feature fusion vector, the model parameters of the task processing model can be adjusted based on the feature fusion vector to train the task processing model. Specifically, adjusting the model parameters of the task processing model can involve randomly occluding a certain proportion of word units (feature fusion sub-vectors) in the feature fusion vector, and then using the remaining word units to predict the occluded word units.

[0108] In specific implementation, the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded, including:

[0109] Determine the target tree nodes contained in the abstract syntax tree;

[0110] If the target tree node has a first branch and a second branch, and the first branch is identified as the target branch, then at least one tree node contained in the second branch is determined; or,

[0111] If the target tree node has a first branch and a second branch, and the second branch is determined to be the target branch, then at least one tree node contained in the first branch is determined.

[0112] The feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded.

[0113] Specifically, since the abstract syntax tree has a multi-branch tree structure, nodes at the same level will not affect the branches of other nodes. Therefore, during model training, the tree node information contained in branches other than the target branch can be masked, which can effectively avoid the noise caused by redundant information.

[0114] Alternatively, occluding the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector further includes:

[0115] Attention is calculated for the tree nodes contained in the target branch, and the tree nodes to be occluded are determined based on the attention calculation results.

[0116] The feature fusion sub-vectors corresponding to the tree nodes to be occluded in the feature fusion vector are occluded.

[0117] Specifically, in addition to occluding the feature fusion sub-vectors corresponding to at least one tree node in the other branches besides the target branch, the importance of each tree node in the target branch can be determined, so as to occlude the feature fusion sub-vectors corresponding to some tree nodes in the target branch according to their importance.

[0118] The attention mechanism originates from research on human vision. In cognitive science, due to information processing bottlenecks, humans selectively focus on a portion of information while ignoring other visible information. This mechanism, commonly known as the attention mechanism, has become a special structure embedded in deep learning models to automatically learn and calculate the contribution of input data to output data. Therefore, when determining the importance of each tree node in a target branch, the attention mechanism can be used to calculate attention scores for each tree node, thereby identifying which tree nodes are important and occluding the feature fusion sub-vectors corresponding to less important tree nodes.

[0119] In specific implementation, when the task processing model includes a neural network layer, the task processing model is used to occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector and predict the occluded content. Specifically, the neural network layer is used to occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector and predict the occluded content.

[0120] Specifically, the schematic diagram of the task processing model for the implementation examples in this manual is as follows: Figure 3a As shown, after the feature fusion layer generates the feature fusion vector, the feature fusion vector can be transmitted to the neural network layer. The neural network layer will occlude some of the feature fusion sub-vectors in the feature fusion vector and predict the occluded content, so as to adjust the model parameters of the task processing model using the prediction results.

[0121] Step 208: Adjust the model parameters of the task processing model based on the prediction results and the feature fusion sub-vector.

[0122] Specifically, after predicting the occluded content and obtaining the corresponding prediction results, the prediction results can be compared with the occluded feature fusion subvector to determine the accuracy of the prediction results, thereby adjusting the model parameters of the task processing model.

[0123] After adjusting the model parameters of the task processing model, the generated task processing model can be used to support downstream code anomaly detection, duplicate code detection, automatic code generation, and other processing.

[0124] Taking code anomaly detection as an example, the source code of the program to be detected related to the task to be processed can be obtained, and the abstract syntax tree to be processed corresponding to the source code of the program to be detected can be determined. The source code of the program to be detected and the tree node information corresponding to the abstract syntax tree to be processed are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Anomaly detection is performed on the source code of the program to be detected through the task processing model and the feature fusion vector, and the corresponding anomaly detection result is output.

[0125] like Figure 3aAs shown, the task processing model may also include a task processing layer. The task processing layer can be used to implement classification tasks, namely code anomaly detection and duplicate code detection. When there is source code of the program to be detected, the abstract syntax tree corresponding to the source code of the program to be detected can be determined first. The source code of the program to be detected and the tree node information corresponding to the abstract syntax tree can be input into the feature fusion layer of the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Then, the task processing layer of the task processing model is used to classify it so as to determine whether the source code of the program to be detected has anomalies based on the classification results.

[0126] Alternatively, after generating the corresponding feature fusion vector, the task processing layer of the task processing model can be used to generate code, thereby achieving automated code generation.

[0127] One embodiment of this specification obtains the program source code related to historical processing tasks and determines the abstract syntax tree corresponding to the program source code. The program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Through the task processing model, occlusion information is added to the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector. Based on the addition result, the occluded content is predicted by the feature fusion sub-vector. The model parameters of the task processing model are adjusted according to the prediction result and the feature fusion sub-vector.

[0128] In this embodiment, when adjusting the model parameters of the task processing model, the textual information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code are integrated to generate a feature fusion vector. By occluding some feature fusion sub-vectors in the feature fusion vector, the model parameters of the task processing model are adjusted, which helps to ensure the accuracy of the output results of the task processing model, that is, to improve the accuracy of understanding the program code. In addition, this task processing model can be used to support downstream classification and regression tasks such as code anomaly detection, duplicate code detection, and automatic code generation. This helps to reduce the human and material costs required in the testing and software maintenance stages, and helps to improve the accuracy of anomaly detection, duplicate code detection, and automatic code generation results.

[0129] The following is in conjunction with the appendix Figure 4 Taking the application of the model processing method provided in this specification in a real-world scenario as an example, the model processing method will be further explained. Among other things, Figure 4 The flowchart of a model processing method provided in one embodiment of this specification is shown, and the specific steps include steps 402 to 422.

[0130] Step 402: Obtain the program source code related to the historical processing tasks and determine the abstract syntax tree corresponding to the program source code.

[0131] Step 404: Prune the abstract syntax tree to generate the target abstract syntax tree.

[0132] Step 406: Input the program source code and the tree node information corresponding to the target abstract syntax tree into the feature fusion layer of the task processing model, and fuse the program source code and the tree node information corresponding to the abstract syntax tree through the feature fusion layer, encode the fusion result, and generate the first feature vector.

[0133] Step 408: Label the program source code fragments and tree node information in the fusion result with information types, and determine the second feature vector corresponding to the fusion result based on the labeling results.

[0134] Step 410: Based on the position of the program source code fragment in the program source code in the fusion result, the program source code fragment is marked with the first position information. Based on the position of the tree node information in the abstract syntax tree in the fusion result, the tree node information is marked with the first position information.

[0135] Step 412: Determine the third feature vector corresponding to the fusion result based on the first position information annotation result.

[0136] Step 414: Based on the positions of the program source code fragments and tree node information in the fusion result, perform second position information annotation on the program source code fragments and tree node information.

[0137] Step 416: Determine the fourth feature vector corresponding to the fusion result based on the second position information annotation result.

[0138] Step 418: Perform fusion processing on the first feature vector, the second feature vector, the third feature vector, and the fourth feature vector to generate the corresponding feature fusion vector.

[0139] Step 420: Through the neural network layer of the task processing model, the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded, and the occluded content is predicted.

[0140] Step 422: Adjust the model parameters of the task processing model based on the prediction results and feature fusion vector.

[0141] In addition, task processing models can be used to perform code anomaly detection, duplicate code detection, and automatic code generation on program source code. Taking code anomaly detection as an example, the source code of the program to be detected related to the task to be processed can be obtained, and the abstract syntax tree to be processed corresponding to the source code of the program to be detected can be determined. The source code of the program to be detected and the tree node information corresponding to the abstract syntax tree to be processed are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector. Through the task processing model and the feature fusion vector, anomaly detection is performed on the source code of the program to be detected, and the corresponding anomaly detection results are output.

[0142] In this embodiment, when adjusting the model parameters of the task processing model, the textual information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code are integrated to generate a feature fusion vector. By occluding some feature fusion sub-vectors in the feature fusion vector, the model parameters of the task processing model are adjusted, which helps to ensure the accuracy of the output results of the task processing model, that is, to improve the accuracy of understanding the program code. In addition, this task processing model can be used to support downstream classification and regression tasks such as code anomaly detection, duplicate code detection, and automatic code generation. This helps to reduce the human and material costs required in the testing and software maintenance stages, and helps to improve the accuracy of anomaly detection, duplicate code detection, and automatic code generation results.

[0143] Corresponding to the above method embodiments, this specification also provides embodiments of a model processing apparatus. Figure 5 A schematic diagram of a model processing apparatus provided in one embodiment of this specification is shown. Figure 5 As shown, the device includes:

[0144] The acquisition module 502 is configured to acquire the program source code related to the historical processing task and determine the abstract syntax tree corresponding to the program source code;

[0145] The input module 504 is configured to input the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0146] The prediction module 506 is configured to occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector through the task processing model, and predict the occluded content.

[0147] The adjustment module 508 is configured to adjust the model parameters of the task processing model based on the prediction results and the feature fusion vector.

[0148] Optionally, the input module 504 is further configured to:

[0149] The abstract syntax tree is pruned to generate the target abstract syntax tree;

[0150] The program source code and the tree node information corresponding to the target abstract syntax tree are input into the task processing model for feature fusion processing.

[0151] Optionally, the input module 504 is further configured to:

[0152] The tree nodes in the abstract syntax tree are traversed, and the target tree node is determined based on the node type information, operation information and / or node position information corresponding to the tree node.

[0153] The target tree node is deleted from the abstract syntax tree to perform pruning on the abstract syntax tree.

[0154] Optionally, the task processing model includes a feature fusion layer;

[0155] Accordingly, the input module 504 is further configured as follows:

[0156] The program source code and the tree node information corresponding to the abstract syntax tree are input into the feature fusion layer of the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0157] Optionally, the input module 504 is further configured to:

[0158] The program source code and the tree node information corresponding to the abstract syntax tree are fused together, and the fusion result is encoded to generate a first feature vector;

[0159] The program source code fragments and / or the tree node information in the fusion result are labeled with information types, and the second feature vector corresponding to the fusion result is determined based on the labeling results;

[0160] The program source code fragments and / or the tree node information are labeled with position information, and the third feature vector corresponding to the fusion result is determined based on the labeling results;

[0161] The first feature vector, the second feature vector, and the third feature vector are fused to generate a corresponding feature fusion vector.

[0162] Optionally, the input module 504 is further configured to:

[0163] Based on the position of the program source code fragment in the program source code in the fusion result, the program source code fragment is marked with first position information; and based on the position of the tree node information in the abstract syntax tree in the fusion result, the tree node information is marked with first position information.

[0164] The third feature vector corresponding to the fusion result is determined based on the first position information annotation result.

[0165] Optionally, the input module 504 is further configured to:

[0166] Based on the position of the program source code fragment and / or the tree node information in the fusion result, a second position information annotation is performed on the program source code fragment and / or the tree node information;

[0167] The third feature vector corresponding to the fusion result is determined based on the second position information annotation result.

[0168] Optionally, the prediction module 506 is further configured to:

[0169] Determine the target tree nodes contained in the abstract syntax tree;

[0170] If the target tree node has a first branch and a second branch, and the first branch is identified as the target branch, then at least one tree node contained in the second branch is determined; or,

[0171] If the target tree node has a first branch and a second branch, and the second branch is determined to be the target branch, then at least one tree node contained in the first branch is determined.

[0172] The feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded.

[0173] Optionally, the prediction module is further configured to:

[0174] Attention is calculated for the tree nodes contained in the target branch, and the tree nodes to be occluded are determined based on the attention calculation results.

[0175] The feature fusion sub-vectors corresponding to the tree nodes to be occluded in the feature fusion vector are occluded.

[0176] Optionally, the task processing model further includes a neural network layer;

[0177] Accordingly, the prediction module 506 is further configured as follows:

[0178] The neural network layer occludes the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector, and then predicts the occluded content.

[0179] Optionally, the model training apparatus further includes an anomaly detection module, configured as follows:

[0180] Obtain the source code of the program to be tested related to the task to be processed, and determine the abstract syntax tree to be processed corresponding to the source code of the program to be tested;

[0181] The source code of the program to be detected and the tree node information corresponding to the abstract syntax tree to be processed are input into the task processing model for feature fusion processing to obtain the corresponding feature fusion vector.

[0182] The task processing model and the feature fusion vector are used to perform anomaly detection on the source code of the program to be detected, and the corresponding anomaly detection results are output.

[0183] The above is a schematic scheme of a model processing device according to this embodiment. It should be noted that the technical solution of this model processing device and the technical solution of the above-described model processing method belong to the same concept. For details not described in detail in the technical solution of the model processing device, please refer to the description of the technical solution of the above-described model processing method.

[0184] Figure 6 A structural block diagram of a computing device 600 according to one embodiment of this specification is shown. The components of the computing device 600 include, but are not limited to, a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and a database 650 is used to store data.

[0185] The computing device 600 also includes an access device 640, which enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a Public Switched Telephone Network (PSTN), a Local Area Network (LAN), a Wide Area Network (WAN), a Personal Area Network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of wired or wireless network interface (e.g., a Network Interface Card (NIC)), such as an IEEE 802.11 Wireless Local Area Network (WLAN) interface, a Wi-MAX interface, an Ethernet interface, a Universal Serial Bus (USB) interface, a cellular network interface, a Bluetooth interface, a Near Field Communication (NFC) interface, and so on.

[0186] In one embodiment of this specification, the above-described components of the computing device 600 and Figure 6Other components, not shown, can also be connected to each other, for example, via a bus. It should be understood that... Figure 6 The block diagram of the computing device shown is for illustrative purposes only and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.

[0187] The computing device 600 can be any type of stationary or mobile computing device, including mobile computers or mobile computing devices (e.g., tablet computers, personal digital assistants, laptop computers, notebook computers, netbooks, etc.), mobile phones (e.g., smartphones), wearable computing devices (e.g., smartwatches, smart glasses, etc.) or other types of mobile devices, or stationary computing devices such as desktop computers or PCs. The computing device 600 can also be a mobile or stationary server.

[0188] The memory 610 is used to store computer-executable instructions, and the processor 620 is used to execute the computer-executable instructions to implement the steps of the model processing method.

[0189] The above is an illustrative scheme of a computing device according to this embodiment. It should be noted that the technical solution of this computing device and the technical solution of the above-described model processing method belong to the same concept. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solution of the above-described model processing method.

[0190] An embodiment of this specification also provides a computer-readable storage medium storing computer instructions that, when executed by a processor, are used to implement the steps of the model processing method.

[0191] The above is an illustrative scheme of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium and the technical solution of the above-described model processing method belong to the same concept. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solution of the above-described model processing method.

[0192] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0193] The computer instructions include computer program code, which may be in the form of source code, object code, executable file, or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording media, USB flash drive, portable hard drive, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium may be appropriately added to or subtracted according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media may not include electrical carrier signals and telecommunication signals.

[0194] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments in this specification are not limited to the described order of actions, because according to the embodiments in this specification, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments in this specification.

[0195] In the above embodiments, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions in other embodiments.

[0196] The preferred embodiments disclosed above are merely illustrative of this specification. The optional embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the embodiments described herein. These embodiments are selected and specifically described in this specification to better explain the principles and practical applications of the embodiments, thereby enabling those skilled in the art to better understand and utilize this specification. This specification is limited only by the claims and their full scope and equivalents.

Claims

1. A model processing method, comprising: Obtain the source code of the program related to the historical processing task, and determine the abstract syntax tree corresponding to the source code; The program source code and the tree node information corresponding to the abstract syntax tree are input into the task processing model for feature fusion processing. By integrating the text information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code, a corresponding feature fusion vector is obtained. The feature fusion vector is obtained based on the fusion result of fusing the program source code and the tree node information corresponding to the abstract syntax tree, the information type of the program source code fragments and / or the tree node information in the fusion result, and the position information of the program source code fragments and / or the tree node information in the fusion result. The task processing model occludes the feature fusion sub-vectors corresponding to at least one tree node in the feature fusion vectors of branches other than the target branch. The attention score is calculated for each tree node in the target branch through the attention mechanism to determine the importance of each tree node in the target branch. The feature fusion sub-vectors corresponding to unimportant tree nodes are occluded, and the occluded content is predicted. Based on the prediction results and the feature fusion vector, the model parameters of the task processing model are adjusted.

2. The model processing method according to claim 1, wherein inputting the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing includes: The abstract syntax tree is pruned to generate the target abstract syntax tree; The program source code and the tree node information corresponding to the target abstract syntax tree are input into the task processing model for feature fusion processing.

3. The model processing method according to claim 2, wherein pruning the abstract syntax tree includes: The tree nodes in the abstract syntax tree are traversed, and the target tree node is determined based on the node type information, operation information and / or node position information corresponding to the tree node. The target tree node is deleted from the abstract syntax tree to perform pruning on the abstract syntax tree.

4. The model processing method according to claim 1, wherein the task processing model includes a feature fusion layer; correspondingly, the step of inputting the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing, and obtaining the corresponding feature fusion vector by integrating the text information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code, includes: The program source code and the tree node information corresponding to the abstract syntax tree are input into the feature fusion layer of the task processing model for feature fusion processing. By integrating the text information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code, the corresponding feature fusion vector is obtained.

5. The model processing method according to claim 1 or 4, wherein inputting the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing, and obtaining the corresponding feature fusion vector by integrating the text information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code, includes: The program source code and the tree node information corresponding to the abstract syntax tree are fused together, and the fusion result is encoded to generate a first feature vector; The program source code fragments and / or the tree node information in the fusion result are labeled with information types, and the second feature vector corresponding to the fusion result is determined based on the labeling results; The program source code fragments and / or the tree node information are labeled with position information, and the third feature vector corresponding to the fusion result is determined based on the labeling results; The first feature vector, the second feature vector, and the third feature vector are fused to generate a corresponding feature fusion vector.

6. The model processing method according to claim 5, wherein the step of annotating the program source code fragment and / or the tree node information with position information, and determining the third feature vector corresponding to the fusion result based on the annotation result, comprises: Based on the position of the program source code fragment in the program source code in the fusion result, the program source code fragment is marked with first position information; and based on the position of the tree node information in the abstract syntax tree in the fusion result, the tree node information is marked with first position information. The third feature vector corresponding to the fusion result is determined based on the first position information annotation result.

7. The model processing method according to claim 5, wherein the step of annotating the program source code fragment and / or the tree node information with position information, and determining the third feature vector corresponding to the fusion result based on the annotation result, comprises: Based on the position of the program source code fragment and / or the tree node information in the fusion result, a second position information annotation is performed on the program source code fragment and / or the tree node information; The third feature vector corresponding to the fusion result is determined based on the second position information annotation result.

8. The model processing method according to claim 1, wherein occluding the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector includes: Determine the target tree nodes contained in the abstract syntax tree; If the target tree node has a first branch and a second branch, and the first branch is determined to be the target branch, then at least one tree node contained in the second branch is determined; or, if the target tree node has a first branch and a second branch, and the second branch is determined to be the target branch, then at least one tree node contained in the first branch is determined. The feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector is occluded.

9. The model processing method according to claim 8, wherein occluding the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector further comprises: Attention is calculated for the tree nodes contained in the target branch, and the tree nodes to be occluded are determined based on the attention calculation results. The feature fusion sub-vectors corresponding to the tree nodes to be occluded in the feature fusion vector are occluded.

10. The model processing method according to claim 1 or 4, wherein the task processing model further comprises a neural network layer; Accordingly, the step of occluding the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector through the task processing model and predicting the occluded content includes: The neural network layer occludes the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector, and then predicts the occluded content.

11. The model processing method according to claim 1, further comprising: Obtain the source code of the program to be tested related to the task to be processed, and determine the abstract syntax tree to be processed corresponding to the source code of the program to be tested; The source code of the program to be detected and the tree node information corresponding to the abstract syntax tree to be processed are input into the task processing model for feature fusion processing. By integrating the text information of the source code and the tree node information of the abstract syntax tree corresponding to the source code, a corresponding feature fusion vector is obtained. Anomaly detection is performed on the source code of the program to be detected using the task processing model and the feature fusion vector, and the corresponding anomaly detection result is output.

12. A model processing apparatus, comprising: The acquisition module is configured to acquire the program source code related to historical processing tasks and determine the abstract syntax tree corresponding to the program source code; The input module is configured to input the program source code and the tree node information corresponding to the abstract syntax tree into the task processing model for feature fusion processing. By integrating the text information of the program source code and the tree node information of the abstract syntax tree corresponding to the program source code, a corresponding feature fusion vector is obtained. The feature fusion vector is obtained based on the fusion result of fusing the program source code and the tree node information corresponding to the abstract syntax tree, the information type of the program source code fragments and / or the tree node information in the fusion result, and the position information of the program source code fragments and / or the tree node information in the fusion result. The prediction module is configured to, through the task processing model, occlude the feature fusion sub-vector corresponding to at least one tree node in the feature fusion vector of branches other than the target branch, calculate the attention score of each tree node in the target branch through the attention mechanism, determine the importance of each tree node contained in the target branch, occlude the feature fusion sub-vector corresponding to the unimportant tree node, and predict the occluded content. The adjustment module is configured to adjust the model parameters of the task processing model based on the prediction results and the feature fusion vector.

13. A computing device, comprising: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the steps of the model processing method according to any one of claims 1 to 11.

14. A computer-readable storage medium storing computer instructions that, when executed by a processor, implement the steps of the model processing method according to any one of claims 1 to 11.

Citation Information

Patent Citations

  • Program understanding method and system based on abstract syntax tree

    CN112835585A

  • Software defect prediction method and terminal based on bidirectional long short-term memory neural network

    CN114185769A