Data power-off protection method and device based on memory mapping and computer equipment

By establishing a memory mapping relationship with temporary files in the controller, storing and refreshing the computational data to memory and nonvolatile RAM, the limitations and timeliness of data storage methods in the prior art are solved, and efficient and durable data power-off protection is achieved.

CN119537097APending Publication Date: 2025-02-28BEIJING GUODIAN ZHISHEN CONTROL TONGDY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411539601.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

In the prior art, there are limitations in the power-off protection method of opening up address space in advance for data storage, and the method of using flash files for data storage is poor in time and is not conducive to the service life of the flash memory device.

Method used

The data power-off protection method based on memory mapping is adopted. By establishing a memory mapping relationship with temporary files, the real-time computing data is stored in memory and saved in temporary files. When a power outage is detected, refresh the temporary file to the nonvolatile RAM and copy the files in the RAM back to the temporary file after restarting.

Benefits of technology

It improves the efficiency and correctness of data reading and writing, avoids the shortening of the flash device life caused by frequent access to flash files, and ensures the persistence of computing data during power outage and restart.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119537097A_ABST
    Figure CN119537097A_ABST
Patent Text Reader

Abstract

The invention provides a data power-off protection method and device based on memory mapping and computer equipment, and relates to the technical field of computers. The method comprises the following steps: establishing a memory mapping relationship with a temporary file; according to the file page table, storing the operation data generated in real time into a memory and a temporary file; when power failure is monitored, the temporary file is refreshed into a file of a first memory, and the first memory is a nonvolatile RAM; and after restarting, copying the file in the first memory into the temporary file. According to the method, data power-off protection is achieved, temporary file reading and writing are carried out in a memory mapping and file list mode, the efficiency of reading and writing the temporary file is improved, the correctness of data information is guaranteed, the problem that the service life of a flash memory is shortened due to frequent access to the flash memory file is solved, and the reliability of the flash memory is improved. And the temporary file is transferred by the first memory before power failure, so that the problem of data loss caused by the fact that the temporary file cannot be recovered after restarting is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of computer technology, and specifically relates to a data power-off protection method based on memory mapping, a data power-off protection device based on memory mapping, a controller, a computer device and a machine-readable storage medium. Background Art

[0002] In order to save the real-time computing information generated during the operation of the controller during power failure and restore it after restart, the industry currently mainly adopts two methods. The first method is to open up an address space in the controller to store the real-time computing information, and obtain the computing information saved before power failure from the address space opened by the controller after restart. The second method is to store the real-time computing information in a file of the flash memory device by reading and writing files, and obtain the computing information saved before power failure from the file of the flash memory device after restart.

[0003] As for the first method, there are limitations in allocating address space for storage in the controller for two reasons. First, the controller must allocate specific storage space in advance, and second, it places high requirements on the storage medium.

[0004] As for the second method, there are the following defects: (1) Using the file reading and writing method to read and write data has poor timeliness and cannot guarantee data consistency; (2) Flash memory devices have a limited number of write cycles. Frequent read and write operations will reduce the service life of the flash memory device. Summary of the invention

[0005] The purpose of the embodiments of the present application is to provide a data power-off protection method based on memory mapping, a data power-off protection device based on memory mapping, a controller, a computer device and a machine-readable storage medium, so as to overcome the defects of the power-off protection method of allocating address space in advance for data storage and the data power-off protection method of using flash memory files for data storage in the prior art.

[0006] To achieve the above-mentioned object, a first aspect of the present application provides a data power-off protection method based on memory mapping, which is applied to a controller, and the method comprises: Establish a memory mapping relationship with the temporary file; According to the file page table established in the memory mapping, the real-time computing data is stored in the memory and saved in a temporary file; When a power outage is detected, refreshing the temporary file to a file in a first memory, wherein the first memory is a non-volatile RAM; After restarting, the existing files in the first storage are copied to the temporary files.

[0007] In a specific embodiment of the present application, the non-volatile RAM is a ferroelectric memory.

[0008] In a specific embodiment of the present application, storing the real-time generated operation data in the memory and saving it in a temporary file according to the file page table established in the memory mapping includes: By querying the file page table established in the memory mapping, it is determined whether the registration item that the current process needs to access exists. If so, jump to execute the next step. Otherwise, register the registration item in the file page table and then jump to execute the next step. The data required by the process is obtained from the memory for real-time calculations, and the real-time calculation data is stored in the memory and updated back to the temporary file.

[0009] In a specific embodiment of the present application, the file page table includes: A public management area, used to store definition information, including the number of registration items and the time of the most recent data update; A configuration management area, used to store registration item information, the registration item information including a unique mark of the registration item, an offset address of the data information stored in the registration item in the storage space, and a real length of the data in the data partition corresponding to the registration item; The real-time data area is used to store the data required to be stored in each registration item in each data partition in a one-to-one correspondence according to each offset address in the configuration management area.

[0010] A second aspect of the present application provides a data power-off protection device based on memory mapping, comprising: A mapping establishment module is used to establish a memory mapping relationship with a temporary file; The file reading and writing module is used to store the real-time computing data into the memory and save it into a temporary file according to the file page table established in the memory mapping; A file refresh module, used for refreshing the temporary file to a file in a first memory when a power outage is detected, wherein the first memory is a non-volatile RAM; The file copy module is used to copy the existing files in the first storage to the temporary files after restarting.

[0011] In a specific embodiment of the present application, storing the real-time generated operation data in the memory and saving it in a temporary file according to the file page table established in the memory mapping includes: By querying the file page table established in the memory mapping, it is determined whether the registration item that the current process needs to access exists. If so, jump to execute the next step. Otherwise, register the registration item in the file page table and then jump to execute the next step. The data required by the process is obtained from the memory for real-time calculations, and the real-time calculation data is stored in the memory and updated back to the temporary file.

[0012] In a specific embodiment of the present application, the file page table includes: A public management area, used to store definition information, including the number of registration items and the time of the most recent data update; A configuration management area, used to store registration item information, the registration item information including a unique mark of the registration item, an offset address of the data information stored in the registration item in the storage space, and a real length of the data in the data partition corresponding to the registration item; The real-time data area is used to store the data required to be stored in each registration item in each data partition in a one-to-one correspondence according to each offset address in the configuration management area.

[0013] The third aspect of the present application provides a controller, including a processor, the processor is connected to a storage module, the storage module includes a memory, a first storage device and a flash memory, the processor executes a computer program in the flash memory to implement the data power-off protection method based on memory mapping described in the first aspect of the present application.

[0014] A fourth aspect of the present application provides a computer device, comprising: a memory configured to store instructions; and The processor is configured to call the instruction from the memory and implement the data power-off protection method based on memory mapping according to the first aspect of the present application when executing the instruction.

[0015] The fifth aspect of the present application provides a machine-readable storage medium, on which instructions are stored, and the instructions are used to enable a machine to execute the data power-off protection method based on memory mapping according to the first aspect of the present application.

[0016] In the above technical solution, temporary files are read and written by means of memory mapping and file page tables to store real-time generated computing data. When a power outage is detected, the temporary files are transferred to the first memory. After restarting, the files in the first memory are copied back to the temporary files, thereby realizing power-off protection of computing data. It can be seen that the above technical solution combines temporary files and the first memory to realize power-off protection of computing data generated in real time. Firstly, temporary files are used to save computing data, and temporary files are read and written by means of memory mapping and file lists, thereby improving the efficiency of reading and writing temporary files and ensuring the correctness of data information, and avoiding the problem of shortening the life of flash memory due to frequent access to flash memory files. Secondly, when a power outage is detected, the temporary files are transferred to the first memory, thereby avoiding the problem of computing data loss caused by the inability to restore temporary files after restarting after a power outage, thereby realizing persistent storage of computing data. Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings: Figure 1 A flowchart of a data power-off protection method based on memory mapping according to an embodiment of the present application is schematically shown; Figure 2 A block diagram schematically shows a composition of a data power-off protection device based on memory mapping according to an embodiment of the present application; Figure 3 The structural block diagram of a computer device according to an embodiment of the present application is schematically shown. DETAILED DESCRIPTION

[0018] The specific implementation of the embodiment of the present application is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present application, and is not used to limit the embodiment of the present application.

[0019] If there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0020] In order to overcome the defects of the power-off protection method of storing data by allocating address space in advance and the data power-off protection method of storing data by using flash memory files, the embodiment of the present application provides a data power-off protection method based on memory mapping, including: The controller establishes a memory mapping relationship with the temporary file; The controller stores the real-time generated computation data in the memory and in a temporary file according to the file page table established in the memory mapping; When the controller detects a power outage, it refreshes the temporary file into a file in the first memory, where the first memory is a non-volatile RAM; After restarting, the controller copies the existing files in the first storage to the temporary files.

[0021] It should be understood that refreshing the temporary file to the file in the first memory specifically means: copying the updated data in the temporary file to the file in the first memory to achieve consistency between the file in the first memory and the temporary file, that is, transferring the temporary file to the file in the first memory.

[0022] As in the above embodiment, there are at least the following beneficial effects: 1. By establishing a memory mapping relationship with the temporary file, the memory space is opened up, which solves the limitation of opening up address space in the controller in advance for computing data storage.

[0023] 2. The "memory mapping + file page table" method is used to perform temporary file read and write operations, which improves the efficiency and correctness of file data reading and writing, and avoids the problem of shortening the life of flash memory devices caused by frequent access to flash memory files.

[0024] 3. Storing computing data through temporary files reduces the impact of frequent access to the flash memory on the life of the flash memory device.

[0025] 4. When a power outage is detected, the temporary files are transferred to the first memory, which is a non-volatile RAM such as FRAM, thereby avoiding the problem of loss of computing data caused by the inability to restore the temporary files after restart, and ensuring the long-term preservation of computing data.

[0026] The embodiments of the present application may be applicable to a scenario where power-off protection is performed on any operation data in a controller.

[0027] The data power-off protection method based on memory mapping provided in the embodiment of the present application can be applied to controllers such as embedded controllers, network controllers, human-machine interface controllers, and computer controllers. In this case, the controller is the executor of the data power-off protection method based on memory mapping provided in the embodiment of the present application. The embodiment of the present application does not impose any restrictions on the specific type of the controller.

[0028] Figure 1 The flowchart of a data power-off protection method based on memory mapping according to an embodiment of the present application is schematically shown. Figure 1 As shown, the data power-off protection method may include the following steps 101 to 103. It can be understood that the above-mentioned data power-off protection method based on memory mapping may include all the steps in steps 101 to 103, or may only include some of the steps. It can be understood that the various steps in a data power-off protection method based on memory mapping can be arbitrarily combined without conflict. As an optional embodiment of the present application, a data power-off protection method based on memory mapping may be a scheme that only includes steps 101 and 102. In another optional embodiment, a data power-off protection method based on memory mapping may be a scheme that only includes steps 102 and 103.

[0029] Step 101, the controller starts and initializes the storage space. During initialization, it is determined whether there is a file in the first memory. If so, the existing file in the first memory is copied to a temporary file and a memory mapping relationship is established with the temporary file. Otherwise, a memory mapping relationship is directly established with the temporary file.

[0030] Wherein, the first memory is a non-volatile RAM.

[0031] As an optional embodiment of the present application, the first memory is a ferroelectric memory (FRAM) mounted on the controller. The ferroelectric memory has the characteristics of high-speed reading and writing capability, low power consumption, radiation resistance and non-volatility.

[0032] In this application, a file access method of memory mapped (MMAP, English full name: Memory Map) file is adopted, which can map the file to the address space of the process, thereby avoiding frequent IO operations when reading and writing files and improving the access efficiency of the file.

[0033] As an example, the controller establishes a memory mapping relationship with the temporary file in the following way: When the process calls the mmap function, the controller opens up a free continuous virtual address in the virtual address space of the current process, allocates a virtual area structure for the virtual area, and inserts the virtual area structure into the virtual address area tree or linked list of the process, thus completing the creation of the virtual mapping area for memory mapping; The system call function mmap of the kernel space is called to realize the mapping relationship between the physical address of the temporary file and the virtual address of the process. Specifically, the kernel mmap function locates the disk physical address of the temporary file through the virtual file system, and establishes the file page table through functions such as remap_pfn_range, thereby realizing the mapping relationship between the physical address of the temporary file and the virtual address of the process.

[0034] Step 102: According to the file page table established in the memory mapping, the real-time generated computing data is stored in the memory and saved in a temporary file.

[0035] In this application, the controller stores the real-time computing data in the memory and saves it in a temporary file in the following ways: By querying the file page table established in the memory mapping, it is determined whether the registration item that the current process needs to access exists. If so, jump to execute the next step. Otherwise, register the registration item in the file page table and then jump to execute the next step. The data required by the process is obtained from the memory for real-time calculations, and the real-time calculation data is stored in the memory and updated back to the temporary file.

[0036] As an example, storing the real-time computing data in the memory and saving it in a temporary file may include the following: the current process initiates access to the mapping address generated by step 101, triggering a page fault exception, and copying the temporary file content to the physical memory.

[0037] Specifically, when the current process's read and write operations access the mapping address, by querying the file page table, it is found that the mapping address is not on the physical page, which causes a page fault exception. The kernel initiates a paging request process, after which the process can read and write to this piece of physical memory and update the modified page back to the temporary file.

[0038] As a preferred embodiment of the present application, the file page table includes a public management area, a configuration management area and a real-time data area, wherein: The public management area is used to store definition information, including the number of registration items and the time of the most recent data update; Configuration management area, used to store registration information, including the unique mark of the registration, the offset address of the data information stored in the registration in the storage space, and the real length of the data in the data partition corresponding to the registration; The real-time data area is used to store the data required to be stored in each registration item in each data partition in a one-to-one correspondence according to each offset address in the configuration management area.

[0039] As an example, the structure of the file page table is shown in Table 1. Among them: the size of the public management area is 64 bytes, which is used to store general definition information, including the controller unique flag, the number of registration items and the time of the most recent data update; the size of the configuration management area is 24*n bytes, which is used to store registration item information, each registration item is a fixed length of 24, n represents the maximum number of registration items supported, and the registration item information includes the unique flag of the registration item, the offset address of the registration item storage data information in the storage space, and the real length of the data in the data partition corresponding to the registration item; the file size supported by the real-time data area is between 64 and 24*n bytes, and the real-time data area is used to sequentially store real-time data to each data partition according to each address defined by each configuration item in the configuration management area.

[0040] Table 1

[0041] Step 103: When the controller detects a power outage, the controller refreshes the temporary file into the file in the first memory.

[0042] The controller detects power failure information in real time, determines that a power failure has occurred according to the power failure information, adds protection, and refreshes the temporary file into the file in the first memory.

[0043] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0044] Corresponding to the above embodiment, a data power-off protection method based on memory mapping is provided. Figure 2 The composition block diagram of the data power-off protection device based on memory mapping provided in an embodiment of the present application is schematically shown. For the sake of convenience of explanation, only the parts related to the embodiment of the present application are shown.

[0045] like Figure 2 As shown, the data power-off protection device 400 based on memory mapping includes: A mapping establishment module 410 is used to establish a memory mapping relationship with a temporary file; The file reading and writing module 420 is used to store the real-time generated operation data into the memory and save it into a temporary file according to the file page table established in the memory mapping; A file refresh module 430, configured to refresh the temporary file to a file in a first memory when a power outage is detected, wherein the first memory is a non-volatile RAM; The file copy module 440 is used to copy the existing files in the first storage to the temporary files after restarting.

[0046] As an embodiment of the present application, the data power-off protection device 400 based on memory mapping can be implemented as follows: Figure 1 The illustrated embodiments and other related method embodiments.

[0047] The process of each module in the data power-off protection device 400 based on memory mapping provided in the embodiment of the present application realizing its own function can be specifically referred to the aforementioned Figure 1 The description of the illustrated embodiment and other related method embodiments will not be repeated here.

[0048] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.

[0049] An embodiment of the present application also provides a controller, which includes a processor, the processor is connected to a storage module, the storage module includes a memory, a first memory and a flash memory, and the processor executes a computer program in the flash memory to implement the data power-off protection method based on memory mapping described in the above embodiment.

[0050] Figure 3 A block diagram of the structure of a computer device according to an embodiment of the present application is schematically shown. In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 3As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a data power-off protection method based on memory mapping is implemented. The display screen A04 of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device shell, or an external keyboard, touchpad or mouse, etc.

[0051] Those skilled in the art will understand that Figure 3 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0052] In one embodiment, the data power-off protection device 400 based on memory mapping provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 3 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the data power-off protection device 400 based on memory mapping. The computer program composed of various program modules enables the processor to execute the steps of the data power-off protection method based on memory mapping in various embodiments of the present application described in this specification.

[0053] In one embodiment, the present application further provides a machine-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the data power-off protection method based on memory mapping in the above embodiment is implemented.

[0054] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.

[0055] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

[0056] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0057] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A data power-off protection method based on memory mapping, characterized in that: Applied to a controller, the method comprises: Establish a memory mapping relationship with the temporary file; According to the file page table established in the memory mapping, the real-time computing data is stored in the memory and saved in a temporary file; When a power outage is detected, refreshing the temporary file to a file in a first memory, wherein the first memory is a non-volatile RAM; After restarting, the existing files in the first storage are copied to the temporary files.

2. The data power-off protection method based on memory mapping according to claim 1 is characterized in that: The non-volatile RAM is a ferroelectric memory.

3. The data power-off protection method based on memory mapping according to claim 1 is characterized in that: According to the file page table established in the memory mapping, the real-time generated operation data is stored in the memory and saved in a temporary file, including: By querying the file page table established in the memory mapping, it is determined whether the registration item that the current process needs to access exists. If so, jump to execute the next step. Otherwise, register the registration item in the file page table and then jump to execute the next step. The data required by the process is obtained from the memory for real-time calculations, and the real-time calculation data is stored in the memory and updated back to the temporary file.

4. The data power-off protection method based on memory mapping according to claim 1, characterized in that: The file page table includes: A public management area, used to store definition information, including the number of registration items and the time of the most recent data update; A configuration management area, used to store registration item information, the registration item information including a unique mark of the registration item, an offset address of the data information stored in the registration item in the storage space, and a real length of the data in the data partition corresponding to the registration item; The real-time data area is used to store the data required to be stored in each registration item in each data partition in a one-to-one correspondence according to each offset address in the configuration management area.

5. A data power-off protection device based on memory mapping, characterized in that: include: A mapping establishment module is used to establish a memory mapping relationship with a temporary file; The file reading and writing module is used to store the real-time computing data into the memory and save it into a temporary file according to the file page table established in the memory mapping; A file refresh module, used for refreshing the temporary file to a file in a first memory when a power outage is detected, wherein the first memory is a non-volatile RAM; The file copy module is used to copy the existing files in the first storage to the temporary files after restarting.

6. The data power-off protection device based on memory mapping according to claim 5, characterized in that: The file page table includes: A public management area, used to store definition information, including the number of registration items and the time of the most recent data update; A configuration management area, used to store registration item information, the registration item information including a unique mark of the registration item, an offset address of the data information stored in the registration item in the storage space, and a real length of the data in the data partition corresponding to the registration item; The real-time data area is used to store the data required to be stored in each registration item in each data partition in a one-to-one correspondence according to each offset address in the configuration management area.

7. The data power-off protection device based on memory mapping according to claim 5, characterized in that: According to the file page table established in the memory mapping, the real-time generated operation data is stored in the memory and saved in a temporary file, including: By querying the file page table established in the memory mapping, it is determined whether the registration item that the current process needs to access exists. If so, jump to execute the next step. Otherwise, register the registration item in the file page table and then jump to execute the next step. The data required by the process is obtained from the memory for real-time calculations, and the real-time calculation data is stored in the memory and updated back to the temporary file.

8. A controller, characterized in that: It includes a processor, the processor is connected to a storage module, the storage module includes a memory, a first memory and a flash memory, and the processor executes a computer program in the flash memory to implement the data power-off protection method based on memory mapping as described in any one of claims 1 to 4.

9. A computer device, characterized in that: include: a memory configured to store instructions; as well as A processor is configured to call the instruction from the memory and implement the data power-off protection method based on memory mapping according to any one of claims 1 to 4 when executing the instruction.

10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores instructions, which are used to enable a machine to execute the data power-off protection method based on memory mapping according to any one of claims 1 to 4.