The invention relates to the technical field of
network security, and discloses a program-level code
similarity analysis method and device based on semantic
slicing, and the method comprises the steps: constructing a program-level target function
call graph based on a target
source code; matching the target function
call graph with a
standard function call graph to obtain a plurality of isomorphic sub-graphs; performing semantic
slicing on each function node in the first sub-graph and the second sub-graph to obtain a first
slicing result of the first sub-graph and a second slicing result of the second sub-graph; and evaluating the slice similarity between each function in the first slice result and each function in the second slice result, and determining the similarity of the target
source code according to the slice similarity. According to the method, the user-defined function call graph for eliminating
system function interference is constructed, an isomorphic sub-graph matching
algorithm is combined, multi-dimensional features are comprehensively considered, the accuracy of similarity calculation is improved, effective support is provided for practical application scenes such as code reconstruction and security audit, and the guarantee of code quality and security is improved.