The invention provides a target code auditing method and device, and belongs to the technical field of computers. The method comprises the following steps: acquiring a rule file
data set and a
knowledge graph structure; generating a
syntax tree rule plug-in according to the rule file
data set; under the condition that the target code is received, based on the
syntax tree rule plug-in and the
knowledge graph structure, executing multi-level auditing on the target code to obtain a code auditing
score; and determining an execution strategy based on the code auditing
score, and
processing the target code according to the execution strategy. In this way, multi-level auditing is conducted on the target code based on the
syntax tree rule plug-in and the
knowledge graph structure to determine the execution strategy, the problem that according to an existing code auditing method, due to auditing rule updating
lag, a compliance blind area is caused can be solved, the problem that due to the lack of deep semantic understanding, service logic cannot be effectively verified, and
code reuse cannot be effectively promoted can be solved, and user experience is improved. The real-time performance and accuracy of code auditing are improved, and the compliance risk is reduced.