The application discloses an AI-based
vulnerability repair rule generation method and related equipment, and relates to the field of
digital data processing. A
computer device performs double analysis on
vulnerability code fragments and
vulnerability description texts through a large
language model, constructs double representations of
abstract syntax trees and semantic graphs, aligns the semantic graphs and the
abstract syntax trees in a cross-
modal manner, and obtains a vulnerability context relationship matrix. The
computer device traverses the
abstract syntax trees, extracts vulnerability code feature vectors, and determines multiple repair
modes according to vulnerability type identifiers. The
computer device calculates the similarity between the vulnerability code feature vectors and
multiple context constraint conditions, filters target repair
modes, verifies the feasibility of the target repair
modes based on the vulnerability context relationship matrix, determines an optimal repair mode, and generates a repair rule. The double analysis and cross-
modal alignment greatly improve the accuracy and reliability of vulnerability repair rule generation.