The invention discloses a
software vulnerability detection method based on a
tree structure convolutional neural network, and the method comprises the steps: analyzing a
source code to obtain an
abstract syntax tree AST structure, and extracting the node type of each node in the AST structure; constructing a neural network pre-
processing model containing an embeding layer, inputting the neural network pre-
processing model into an extracted node type, and outputting a
prediction probability of the node type; performing neural network training by using the node type; after training is completed,enabling the vector characteristic values output by the embeding layer to serve as input of a
convolutional neural network model, taking whether vulnerabilities exist in source codes or not as labels, and training the
convolutional neural network model to serve as a code classifier; and for the
source code to be detected, extracting the node type in the AST structure of the
source code, retraining the neural network preprocessing model, and inputting the vector characteristic value output by the embeding layer into the convolutional neural
network model to obtain a
vulnerability detection result. According to the method, the feature information in the code can be better extracted, so that a comprehensive analysis result can be given.