The invention provides a formalized
verification method and device based on intelligent model interaction, and relates to the technical field of
computer data processing.The method comprises the steps that security constraint conditions input by a tester in a
natural language are received, and a user security attribute constraint file is generated according to the security constraint conditions; according to the user security attribute constraint file, generating a
source code preprocessing request through the thinking chain template; wherein the
source code preprocessing request at least comprises multi-dimensional information of a preprocessing target, code function description, a to-be-processed code text, a thinking chain cue word and a format requirement; according to the
source code preprocessing request and a to-be-verified source code, generating a preprocessed source code inserted with a safety assertion through large
language model reasoning; performing formalized
verification on the preprocessed source code, and generating an intermediate file in the formalized
verification process; and according to the intermediate file, performing analysis based on the semantic analysis prompt word template, and outputting a
natural language prompt corresponding to the optimization direction to a tester.