The invention discloses an intelligent target code
vulnerability detection method and device based on cooperation of large and small models, and belongs to the technical field of
computer software and
artificial intelligence. The implementation method comprises the following steps: 1, mapping static source codes and
vulnerability metadata to form a target
knowledge base; 2, performing hash value matching on the
source code to be detected and a target
source code of a target
knowledge base; 3, when matching is the same, returning the
vulnerability report; 4, when the matching is different, calling an RAG searcher to generate a vulnerability report; 5, performing deep semantic analysis on the vulnerability cue words of the fe-shot learning and thinking chain construction and the to-be-detected
source code through the optimized CodeShell parameter level
vulnerability model to generate a repair code, and performing differential
verification; 6, performing structured
JSON (
JavaScript Object Notation) and visual
HTML (
Hypertext Markup Language) output on the vulnerability report, the repair code and the repaired detection source code, and exporting a repair code file; compared with the prior art, the source code
vulnerability detection efficiency is improved, and
automation of source code vulnerability repair
verification is achieved.