The invention relates to a code homology detection method based on code fingerprint and a device thereof. The method comprises: performing dependence analysis on input codes, obtaining an original program dependence graph PDG; performing structure simplification, removing nesting and performing shading on the original program dependence graph PDG, to obtain a simplified program dependence graph sPDG; based on an abstract syntax tree, analyzing code key grammar information; extracting a system call sequence of a code execution path, to obtain a full path parameter vector assembly of an object code, to build code fingerprint; calculating a homology coefficient of code fingerprint components; according to the homology coefficient, calculating a homology index of two codes S and T, and through the homology index, determining a homologous relation exists in the both codes. The method can give consideration to code semantics and behaviors on the basis of similarity, and improves detection efficiency by using a lightweight characteristic and simplified mechanism, and measures homologous relations among codes in a multi-angle manner, and improves detection efficiency while ensuring accuracy.