The invention discloses a sequence-sensitive API (Application Program Interface) recommendation method based on a gated graph neural network, which comprises the following steps of: extracting an API calling sequence from a project
source code, modeling the calling sequence into a
data structure of a
directed graph, and representing one API calling by each node in the graph; then, a pre-trained word2vec model is used for initializing the
semantic representation of each API node, and a
network layer is used for randomly initializing the ID representation of each
graph node; learning by using a gated graph neural
network model to obtain a vector representation of each
graph node, and obtaining a vector representation of each method
declaration through an API sequence representation of each method
declaration and a
semantic representation of the method; and finally, outputting a recommendation result according to the global preference feature and the local preference feature of the context of the API recommendation point. According to the method, the calling sequence of the API sequence is coded into the
data structure of the
directed graph, and the GGNN is used, so that the calling sequence problem of each API in the API recommendation mode is solved, the accuracy and the practicability of the API recommendation mode are enhanced, and the
software development efficiency is improved.