The invention discloses a multi-
relational graph network-based
vulnerability model construction method and a detection method thereof, and the method comprises the steps: collecting a
source code program file, carrying out the preprocessing of the
source code program file, obtaining a function block, and according to whether a function name corresponding to the function block contains a good and a bad, enabling a corresponding
label to be a function block without a
vulnerability and a function block with a
vulnerability;
processing the function blocks without the vulnerabilities and the function blocks with the vulnerabilities to obtain respective corresponding second
abstract syntax trees; and performing first traversal on the second
abstract syntax tree to obtain seven edge relationships. On the basis of extracting node information of the
abstract syntax tree in the prior art, seven edge relationships are added, and the seven edge relationships can remarkably improve the accuracy rate in the aspect of
vulnerability detection and reduce the missing report rate; when the GGNN
vulnerability model is built, the GRU and the highway gate are fused to improve the propagation speed of the vector among different relational graphs, so that the model
training period is shortened, and the technical problem that the detection effect of a
vulnerability detection model is poor in the prior art is solved.