The invention discloses a
formal verification method based on a hierarchical
verification framework, which comprises the following steps of: firstly, dividing a target program into a C code and an
assembly code, modeling and verifying the
assembly code, then modeling and verifying the C code, and in the modeling process of the C code, carrying out
verification on the C code; and defining a specific state and an abstract state of each
data structure, establishing mapping through a refinement relationship, defining a
function model based on the abstract state, constructing a function API specification, and finally defining
system properties for a target program according to the
function model and verifying the
system properties. According to the method, a hierarchical
verification framework and a formalization tool are combined, formalization verification is carried out on the target program from specific implementation to abstract division into three
layers, comprehensive verification from bottom-layer codes to high-layer
system properties is realized, the risk of security vulnerabilities is reduced, and the reliability of the target program is improved.