The invention discloses an
embedded system snapshot optimization method and
system oriented to a resource-constrained environment. The method comprises the following steps: firstly, configuring snapshot parameters according to hardware parameters of the embedded equipment; secondly, constructing a page
state management structure, and continuously capturing page writing events during scanning in a pre-
copying stage so as to distinguish a high-writing-frequency page from a low-writing-frequency page; executing multiple rounds of traversal in the pre-
copying stage to ensure the convergence of the
working set, and judging whether to terminate the pre-
copying stage or not according to the convergence; storing the identified
working set pages instead of all dirty pages in the shutdown stage again, setting
write protection for non-
working set pages, and restoring the operation of the
virtual machine; after the operation of the
virtual machine is recovered, a non-working set is stored in the background; and finally, real-time redundancy
elimination and writing are carried out. According to the method, the shutdown duration can be effectively shortened in an embedded scene with dense dynamic write-in and obvious working set change, the snapshot duration and the storage write-in burden are reduced, and the overall performance of an embedded
virtualization operation framework is improved.