This application provides a
memory refresh method, apparatus, electronic device, and storage medium, relating to the field of
computer technology. The method includes: determining a first set of memory pages based on modification operations on memory pages of non-
volatile memory, the first set of memory pages including at least one address range of memory pages; determining a second set of memory pages from the first set of memory pages based on a write-back triggering mechanism, the second set of memory pages including a target address range to be refreshed, the write-back triggering mechanism including a trigger period, a trigger condition, or a computer
system power failure event; determining the content to be refreshed from a cache based on the target address range, and refreshing the content to be refreshed from the cache to the corresponding
physical address segment of the non-
volatile memory. This application can ensure that the latest version of the content is stored in the non-
volatile memory even in the event of a power failure.