Memory operation method and device, computer equipment and readable storage medium

By setting user-visible storage space and rotating backup storage space in memory, and establishing address mapping relationships, the problem of unreliability of traditional memory operation methods after the number of operations exceeds the limit is solved, and the effect of improving memory operation reliability is achieved.

CN120144049APending Publication Date: 2025-06-13SHENZHEN XIHUA TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510140503.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-06-13

AI Technical Summary

Technical Problem

After the number of operations exceeds a certain limit, the traditional memory operation method causes the memory to be unreliable, reducing the reliability of the memory.

Method used

By setting the user-visible storage space and the rotary backup storage space in the memory, establishing an address mapping relationship, and recording the rotary storage information in the mapping identification recording area, in response to the data operation instructions, the target backup storage space where the current valid data is located is determined based on the rotary storage information to operate.

Benefits of technology

It effectively disperses the pressure of data storage, avoids the problem of reducing reliability caused by repeated rewritten in a single storage space, and improves the reliability of memory operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120144049A_ABST
    Figure CN120144049A_ABST
Patent Text Reader

Abstract

The invention relates to a memory operation method and device, computer equipment, a computer readable storage medium and a computer program product, and can be applied to the technical field of computers. The method comprises the following steps: determining a user visible storage space and an alternate backup storage space of a memory; the alternate backup storage space comprises a plurality of backup storage spaces, and the alternate backup storage space is used for alternately storing data corresponding to the user visible storage space through the plurality of backup storage spaces; establishing an address mapping relationship between the user visible storage space and the alternate backup storage space; recording rotation storage information corresponding to the address mapping relation in a mapping identification recording area; in response to a data operation instruction for the memory, determining a target backup storage space in which the current valid data of the memory is located from the plurality of backup storage spaces according to the alternate storage information; and performing an operation corresponding to the data operation instruction on the target backup storage space. By adopting the method, the reliability of memory operation can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technologies, and particularly to a memory operation method, apparatus, computer device, computer-readable storage medium, and computer program product. Background Art

[0002] With the rapid development of computer technologies, memories are increasingly widely used. Memories play an important role in storing key data in a system. Therefore, how to perform memory operations reliably has become an important research direction.

[0003] Traditional technologies usually perform operations on memories through simple direct operation methods. However, the limit value of the number of memory operations is usually between 10,000 and 100,000 times. When the number of operations on a memory exceeds the limit value, the memory will not be able to store data reliably, resulting in low reliability of memory operations. Summary of the Invention

[0004] Based on this, it is necessary to provide a memory operation method, apparatus, computer device, computer-readable storage medium, and computer program product that can improve the reliability of memory operations for the above technical problems.

[0005] In a first aspect, this application provides a memory operation method. The method includes:

[0006] Determine the user-visible storage space of the memory and the rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0007] Establish an address mapping relationship between the user-visible storage space and the rotating backup storage space;

[0008] Record the rotating storage information corresponding to the address mapping relationship in a mapping identifier record area;

[0009] In response to a data operation instruction for the memory, determine a target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotating storage information;

[0010] Perform an operation corresponding to the data operation instruction on the target backup storage space.

[0011] In one embodiment, the determining the user-visible storage space of the memory and the rotating backup storage space of the memory includes:

[0012] Determine the storage capacity of the user-visible storage space;

[0013] Set the storage capacity of the rotation backup storage space to N times the storage capacity of the user-visible storage space according to the preset rotation number N;

[0014] Divide the rotation backup storage space into N backup storage spaces; the storage capacity of each backup storage space is equal to the storage capacity of the user-visible storage space.

[0015] In one embodiment, the determining the target backup storage space where the current valid data of the memory is located from the multiple backup storage spaces according to the rotation storage information includes:

[0016] Identify the rotation identification bit in the rotation storage information;

[0017] Determine the serial number of the target backup storage space according to the number of the rotation identification bits and the number of the backup storage spaces in the rotation backup storage space;

[0018] Determine the target backup storage space from the multiple backup storage spaces according to the serial number of the target backup storage space.

[0019] In one embodiment, the data operation instruction is an erase operation instruction;

[0020] The performing the operation corresponding to the data operation instruction on the target backup storage space includes:

[0021] Judge whether the number of the rotation identification bits reaches a preset maximum value; the preset maximum value is determined according to the storage capacity of the rotation backup storage space;

[0022] In the case that the number of the rotation identification bits does not reach the preset maximum value, write the rotation identification bits in the mapping identification record area;

[0023] Perform the erase operation corresponding to the erase operation instruction on the target backup storage space;

[0024] Determine the serial number of the next-round target backup storage space according to the serial number of the target backup storage space and the number of the backup storage spaces; the next-round target backup storage space is used to store the next-round valid data of the memory.

[0025] In one embodiment, the writing the rotation identification bits in the mapping identification record area includes:

[0026] Determine the current writing position information of the rotation identification bits in the mapping identification record area according to the historical writing position information of the rotation identification bits in the mapping identification record area;

[0027] Write the rotation identification bit in the mapping identification record area according to the current writing position information.

[0028] In one embodiment, the historical writing position information is the previous historical writing position information of the rotation identification bit in the mapping identification record area;

[0029] The method further includes:

[0030] Update the previous historical writing position information according to the current writing position information.

[0031] In one embodiment, the method further includes:

[0032] In the case where the number of the rotation identification bits has reached the preset maximum value, perform an erasing operation on the rotation storage information in the mapping identification record area;

[0033] Perform the erasing operation corresponding to the erasing operation instruction on the target backup storage space;

[0034] Determine that the serial number of the next target backup storage space is the initial serial number.

[0035] In one embodiment, the method further includes:

[0036] Initialize the previous historical writing position information of the rotation identification bit in the mapping identification record area.

[0037] In a second aspect, the present application further provides a memory operation device. The device includes:

[0038] A space determination module, configured to determine a user-visible storage space of a memory and the rotation backup storage space of the memory; the rotation backup storage space includes a plurality of backup storage spaces, and the rotation backup storage space is used to rotatably store data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0039] A relationship establishment module, configured to establish an address mapping relationship between the user-visible storage space and the rotation backup storage space;

[0040] An information recording module, configured to record the rotation storage information corresponding to the address mapping relationship in a mapping identification record area;

[0041] An instruction response module, configured to, in response to a data operation instruction for the memory, determine a target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotation storage information;

[0042] A space operation module for performing an operation corresponding to the data operation instruction on the target backup storage space.

[0043] In a third aspect, the present application further provides a computer device. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the following steps are implemented:

[0044] Determine the user-visible storage space of the memory and the rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0045] Establish an address mapping relationship between the user-visible storage space and the rotating backup storage space;

[0046] Record the rotating storage information corresponding to the address mapping relationship in the mapping identifier record area;

[0047] In response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotating storage information;

[0048] Perform an operation corresponding to the data operation instruction on the target backup storage space.

[0049] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the following steps are implemented:

[0050] Determine the user-visible storage space of the memory and the rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0051] Establish an address mapping relationship between the user-visible storage space and the rotating backup storage space;

[0052] Record the rotating storage information corresponding to the address mapping relationship in the mapping identifier record area;

[0053] In response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotating storage information;

[0054] Perform an operation corresponding to the data operation instruction on the target backup storage space.

[0055] In a fifth aspect, the present application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the following steps:

[0056] Determine the user-visible storage space of the memory and the rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0057] Establish an address mapping relationship between the user-visible storage space and the rotating backup storage space;

[0058] Record the rotating storage information corresponding to the address mapping relationship in the mapping identifier record area;

[0059] In response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotating storage information;

[0060] Perform an operation corresponding to the data operation instruction on the target backup storage space.

[0061] The above memory operation method, device, computer device, computer-readable storage medium, and computer program product determine the user-visible storage space of the memory and the rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the plurality of backup storage spaces; establish an address mapping relationship between the user-visible storage space and the rotating backup storage space; record the rotating storage information corresponding to the address mapping relationship in the mapping identifier record area; in response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotating storage information; perform an operation corresponding to the data operation instruction on the target backup storage space. This solution is beneficial to dispersing the data storage pressure to multiple backup storage spaces by establishing a mapping relationship between the user-visible storage space and the rotating backup storage space including a plurality of backup storage spaces and recording the rotating storage information in the mapping identifier record area, avoiding the problem of reduced reliability caused by repeated erasing and writing of a single storage space; in addition, by determining the target backup storage space where the current valid data is located according to the rotating storage information before each data operation, it is beneficial to accurately track and access the data storage location, thereby improving the reliability of memory operations. Brief Description of the Drawings

[0062] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the following will briefly introduce the drawings required for the description of the embodiments or the related art. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0063] Figure 1 It is a schematic flowchart of a memory operation method in an embodiment;

[0064] Figure 2 It is a schematic diagram of the correspondence relationship between the virtual space and the physical space in an embodiment;

[0065] Figure 3 It is a schematic diagram of the storage method of data in the mapping number record area in an embodiment;

[0066] Figure 4 It is a schematic flowchart of the reset startup of the Flash controller in an embodiment;

[0067] Figure 5 It is a schematic flowchart of the erasing operation of the Flash controller in an embodiment;

[0068] Figure 6 It is a structural block diagram of a memory operation device in an embodiment;

[0069] Figure 7 It is an internal structure diagram of a computer device in an embodiment. Detailed Embodiments

[0070] In order to make the objectives, technical solutions and advantages of the present application clearer, the following further details the present application in conjunction with the drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0071] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data need to comply with the relevant regulations.

[0072] In an exemplary embodiment, as Figure 1As shown, a memory operation method is provided. In this embodiment, the method is exemplified by being applied to a controller. The controller can be a controller of a flash (flash memory) device. It can be understood that this method can also be applied to a terminal or a server, and can also be applied to a system including a terminal and a server, and is implemented through the interaction between the terminal and the server. Among them, the terminal can be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, etc.; the server can be an independent physical server, can also be a server cluster or a distributed system composed of multiple physical servers, and can also be a cloud server providing cloud computing services. In this embodiment, the method includes the following steps:

[0073] Step S101, determine the user-visible storage space of the memory and the rotation backup storage space of the memory; the rotation backup storage space includes multiple backup storage spaces, and the rotation backup storage space is used to rotationally store the data corresponding to the user-visible storage space through the multiple backup storage spaces.

[0074] Step S102, establish an address mapping relationship between the user-visible storage space and the rotation backup storage space.

[0075] Step S103, record the rotation storage information corresponding to the address mapping relationship in the mapping identification record area.

[0076] Step S104, in response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the multiple backup storage spaces according to the rotation storage information.

[0077] Step S105, perform the operation corresponding to the data operation instruction on the target backup storage space.

[0078] Among them, the memory can be a hardware device for storing data. For example, the memory can be a flash device (flash device).

[0079] Among them, the user-visible storage space can be a virtual address space that the user can directly access. For example, the user-visible storage space can be a sector (sector) with a size of 1KB.

[0080] Among them, the rotation backup storage space can be a physical storage space for actually storing data. For example, the rotation backup storage space can be N (N represents the quantity) sectors with a size of 1KB.

[0081] Among them, the backup storage space can be a single storage unit in the rotation backup storage space. For example, the backup storage space can be a sector (sector) with a size of 1KB.

[0082] Among them, the address mapping relationship can be the corresponding relationship between the user-visible storage space and the rotating backup storage space. For example, the address mapping relationship can be a 1:N mapping ratio relationship.

[0083] Among them, the mapping identification record area can be a storage area for recording the rotating backup area number. For example, the mapping identification record area can be the RCD_MAP_NUM (mapping number record area) area, with a size of one sector.

[0084] Among them, the rotating storage information can be the record of all rotating identification bits and their position information stored in the mapping identification record area RCD_MAP_NUM (mapping number record area). For example, the rotating storage information can be all the bit positions with a value of 0 and their position information recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area).

[0085] Among them, the data operation instruction can be an instruction for reading, writing, or erasing the memory. For example, the data operation instruction can be a flash erase operation instruction.

[0086] Among them, the currently valid data can be the actual data content currently in use. For example, the currently valid data can be the data stored in the current rotating backup area.

[0087] Among them, the target backup storage space can be the rotating backup area currently storing the valid data. For example, the target backup storage space can be the rotating backup area corresponding to the number obtained by calculating the number of 0s in the mapping identification record area.

[0088] Optionally, the controller (the controller of the flash device) first determines the user-visible storage space of the memory and the rotating backup storage space of the memory, where the rotating backup storage space of the memory includes multiple backup storage spaces; then, the controller establishes an address mapping relationship between the user-visible storage space of the memory and the rotating backup storage space of the memory, and records the rotating storage information corresponding to the address mapping relationship in the mapping identification record area RCD_MAP_NUM (mapping number record area); when the controller receives a data operation instruction for the memory, the controller reads the rotating storage information recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area), calculates the number of 0s in the mapping identification record area RCD_MAP_NUM (mapping number record area), determines the target backup storage space where the currently valid data of the memory is located according to the number of 0s, and finally executes the operation corresponding to the data operation instruction on the target backup storage space.

[0089] For example, the controller sets the user-visible storage space of the memory to 1 sector (sector) with a size of 1 KB, and sets the rotational backup storage space of the memory to N sectors (sectors) with a size of 1 KB; the controller establishes a 1:N address mapping relationship and records the rotational storage information in the mapping identifier record area RCD_MAP_NUM (mapping number record area) with a size of 1 KB; when the controller receives an erase instruction, the controller reads 8192-bit data in the mapping identifier record area RCD_MAP_NUM (mapping number record area), calculates the number of 0s therein (which can be denoted as zero_cnt), determines the number of the target backup storage space by calculating the remainder L of zero_cnt divided by N, then performs an erase operation on the target backup storage space with the number L, and writes new 0s in the mapping identifier record area RCD_MAP_NUM (mapping number record area) to update the rotational storage information.

[0090] In the above memory operation method, determine the user-visible storage space of the memory and the rotational backup storage space of the memory; the rotational backup storage space includes multiple backup storage spaces, and the rotational backup storage space is used to rotate and store the data corresponding to the user-visible storage space through the multiple backup storage spaces; establish an address mapping relationship between the user-visible storage space and the rotational backup storage space; record the rotational storage information corresponding to the address mapping relationship in the mapping identifier record area; in response to a data operation instruction for the memory, determine the target backup storage space where the current valid data of the memory is located from the multiple backup storage spaces according to the rotational storage information; perform the operation corresponding to the data operation instruction on the target backup storage space. This solution is beneficial to dispersing the data storage pressure to multiple backup storage spaces by establishing a mapping relationship between the user-visible storage space and the rotational backup storage space including multiple backup storage spaces and recording the rotational storage information in the mapping identifier record area, avoiding the problem of reduced reliability caused by repeated erasing and writing of a single storage space; in addition, by determining the target backup storage space where the current valid data is located according to the rotational storage information before each data operation, it is beneficial to accurately track and access the data storage location, thereby improving the reliability of memory operations.

[0091] In an exemplary embodiment, determining the user-visible storage space of the memory and the rotational backup storage space of the memory specifically includes the following content: determining the storage capacity of the user-visible storage space; according to a preset rotation number N, setting the storage capacity of the rotational backup storage space to N times the storage capacity of the user-visible storage space; dividing the rotational backup storage space into N backup storage spaces; the storage capacity of each backup storage space is equal to the storage capacity of the user-visible storage space.

[0092] Among them, the storage capacity can be the amount of data that the storage space can store. For example, the storage capacity can be the size of one sector, that is, 1KB.

[0093] Among them, the preset rotation number N can be the number of backup storage spaces included in the rotation backup storage space. For example, the preset rotation number N can be the total number of rotation backup areas. When N is 8, it means there are 8 rotation backup areas.

[0094] Among them, N times can be the multiple relationship between the storage capacity of the rotation backup storage space and the storage capacity of the user-visible storage space. For example, N times can be when the preset rotation number N is 8, the storage capacity of the rotation backup storage space is 8 times that of the user-visible storage space.

[0095] Optionally, the controller first determines the storage capacity of the user-visible storage space of the memory according to the system requirements, then calculates the storage capacity of the rotation backup storage space of the memory according to the preset rotation number N, and sets the storage capacity of the rotation backup storage space of the memory to N times that of the user-visible storage space of the memory; thereafter, the controller divides the rotation backup storage space of the memory into N backup storage spaces with equal storage capacity, the storage capacity of each backup storage space is equal to that of the user-visible storage space of the memory, and an additional sector is allocated in the memory as a mapping identification record area RCD_MAP_NUM (mapping number record area) for recording rotation storage information.

[0096] The technical solution provided in this embodiment is beneficial to dispersing the erasing and writing pressure of a single storage space to N backup storage spaces by setting the storage capacity of the rotation backup storage space to N times that of the user-visible storage space and evenly dividing the rotation backup storage space into N backup storage spaces with equal capacity, so that the actual erasing and writing times of each physical storage location are reduced to 1 / N of the original, thereby being beneficial to extending the service life of the memory and improving the reliability of the memory.

[0097] In an exemplary embodiment, according to the rotation storage information, determining the target backup storage space where the current valid data of the memory is located from multiple backup storage spaces specifically includes the following contents: identifying the rotation identification bit in the rotation storage information; determining the serial number of the target backup storage space according to the number of rotation identification bits and the number of backup storage spaces in the rotation backup storage space; and determining the target backup storage space from multiple backup storage spaces according to the serial number of the target backup storage space.

[0098] Among them, the rotation identification bit can be a data bit in the mapping identification record area used to identify the rotation state. For example, the rotation identification bit can be the bit with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area).

[0099] Among them, the number of rotation identification bits can be the cumulative number of specific data bits in the mapping identification record area. For example, the number of rotation identification bits can be the number zero_cnt of bits with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area).

[0100] Among them, the number of backup storage spaces can be the total number of backup storage spaces included in the rotation backup storage space. For example, the number of backup storage spaces can be the preset rotation number N.

[0101] Among them, the serial number of the target backup storage space can be a number used to identify the position of the target backup storage space in the rotation backup storage space. For example, the serial number of the target backup storage space can be the rotation backup area number obtained by calculating the remainder L of the number of rotation identification bits divided by the preset rotation number N.

[0102] Optionally, the controller first reads out all the data in the mapping identification record area RCD_MAP_NUM (mapping number record area), identifies the rotation identification bits in the mapping identification record area RCD_MAP_NUM (mapping number record area), that is, the bits with a value of 0; then the controller records the position of the last bit with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area) (which can be denoted as last_zero_local), and calculates the total number zero_cnt of bits with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area); then, the controller calculates the remainder L of zero_cnt divided by N as the serial number of the target backup storage space according to the calculated zero_cnt and the total number N of preset rotation backup areas, and finally determines the target backup storage space from multiple rotation backup areas according to the serial number L.

[0103] The technical solution provided in this embodiment is beneficial to accurately locate the specific position of the current valid data in multiple backup storage spaces by identifying the rotation identification bits in the rotation storage information and calculating and determining the serial number of the target backup storage space according to the number of rotation identification bits and the number of backup storage spaces, avoiding the situation of data positioning errors and access confusion, and thus being beneficial to improving the data access reliability of the memory during the rotation storage process.

[0104] In an exemplary embodiment, the data operation instruction is an erase operation instruction; performing an operation corresponding to the data operation instruction on the target backup storage space specifically includes the following: determining whether the number of rotation identification bits reaches a preset maximum value; the preset maximum value is determined according to the storage capacity of the rotation backup storage space; in the case where the number of rotation identification bits does not reach the preset maximum value, writing the rotation identification bits in the mapping identification record area; performing an erase operation corresponding to the erase operation instruction on the target backup storage space; determining the serial number of the next target backup storage space according to the serial number of the target backup storage space and the number of backup storage spaces; the next target backup storage space is used to store the next round of valid data of the memory.

[0105] Among them, the erase operation instruction can be an operation command for clearing data in the memory. For example, the erase operation instruction can be an erase operation that changes the data in the memory from 0 to 1.

[0106] Among them, the preset maximum value can be the maximum number of rotation identification bits that can be recorded in the mapping identification record area. For example, the preset maximum value can be the total number of bits 8191 of the mapping identification record area RCD_MAP_NUM (mapping number record area).

[0107] Among them, the next target backup storage space can be a backup storage space used to store new valid data after the current target backup storage space completes the erase operation. For example, the next target backup storage space can be the number obtained by taking the remainder of the serial number of the current target backup storage space plus 1 with respect to the preset rotation number N corresponding to the rotation backup area.

[0108] Among them, the next round of valid data can be new data that needs to be stored in the next target backup storage space after the current target backup storage space completes the erase operation. For example, the next round of valid data can be the data that needs to be written into the next rotation backup area after the current rotation backup area is erased.

[0109] Optionally, when receiving an erasure operation instruction, the controller first checks whether the number of rotation identification bits in the mapping identification record area RCD_MAP_NUM (mapping number record area) reaches the preset maximum value of 8191; when the number of rotation identification bits does not reach the preset maximum value of 8191, the controller writes a rotation identification bit with a value of 0 at the next position of the position last_zero_local of the last bit with a value of 0 recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area); then, the controller performs an erase operation on the target backup storage space to erase all data in the target backup storage space to 1; finally, the controller determines the serial number of the next target backup storage space for storing the valid data of the next round by calculating the remainder of (L + 1) divided by N according to the serial number L of the target backup storage space and the preset rotation number N.

[0110] For example, after determining the serial number of the next target backup storage space, the controller determines the next target backup storage space from multiple backup storage spaces according to the serial number of the next target backup storage space; subsequently, the controller can write the valid data of the next round into the next target backup storage space to implement the rotation storage of the valid data in the rotation backup storage space.

[0111] The technical solution provided by this embodiment is beneficial to realizing the automatic rotation of the storage space and the automatic recording of the erasure operation by judging the number of rotation identification bits and automatically writing new rotation identification bits during the execution of the erasure operation, and combining the serial number of the target backup storage space to automatically determine the storage position of the next round, thereby being beneficial to improving the reliability of the memory during frequent erasing and writing processes and prolonging the service life of the memory.

[0112] In an exemplary embodiment, writing rotation identification bits in the mapping identification record area specifically includes the following content: determining the current writing position information of the rotation identification bits in the mapping identification record area according to the historical writing position information of the rotation identification bits in the mapping identification record area; writing rotation identification bits in the mapping identification record area according to the current writing position information.

[0113] Among them, the historical writing position information may be the position information of the last rotation identification bit with a value of 0 recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area). For example, the historical writing position information may be the position of the last bit with a value of 0 recorded by the last_zero_local variable in the mapping identification record area RCD_MAP_NUM (mapping number record area).

[0114] Among them, the current writing position information may be the position information of the next rotation identification bit that needs to be written with a value of 0 determined according to the historical writing position information.

[0115] Optionally, when the controller writes the rotation identification bit, it first reads the position information last_zero_local of the last bit with a value of 0 recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area), and uses this position information as the historical writing position information of the rotation identification bit; then the controller determines the current writing position information of the rotation identification bit by adding 1 to last_zero_local according to the historical writing position information last_zero_local; finally, the controller writes the rotation identification bit with a value of 0 at the corresponding position in the mapping identification record area RCD_MAP_NUM (mapping number record area) according to the determined current writing position information.

[0116] The technical solution provided by this embodiment determines the current writing position information according to the historical writing position information of the rotation identification bit, and writes the rotation identification bit at the determined position, which is beneficial to ensuring the orderly writing and position continuity of the rotation identification bit in the mapping identification record area, thereby being beneficial to improving the data reliability of the memory during the rotation storage process.

[0117] In an exemplary embodiment, the historical writing position information is the previous historical writing position information of the rotation identification bit in the mapping identification record area; it further includes the following content: updating the previous historical writing position information according to the current writing position information.

[0118] Among them, the previous historical writing position information may be the position information of the current last rotation identification bit with a value of 0 recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area). For example, the previous historical writing position information may be the value currently recorded in the last_zero_local variable.

[0119] Among them, the update process may be an operation of updating the position information of the newly written rotation identification bit in the mapping identification record area RCD_MAP_NUM (mapping number record area) to the position information of the last rotation identification bit with a value of 0. For example, the update process may be an operation of assigning the current writing position information to the last_zero_local variable.

[0120] Optionally, when the controller performs the rotation flag bit writing operation, it first uses the value of the last_zero_local variable recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area) as the previous historical writing position information. This value represents the position of the last rotation flag bit with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area). After completing the writing operation of the new rotation flag bit, the controller assigns the current writing position information to the last_zero_local variable, thereby completing the update process of the previous historical writing position information and ensuring that the last_zero_local variable always records the position of the rotation flag bit with the latest written value of 0.

[0121] The technical solution provided in this embodiment defines the historical writing position information of the rotation flag bits in the mapping identification record area as the previous historical writing position information, and updates the previous historical writing position information in a timely manner according to the current writing position information after each new rotation flag bit is written, which is beneficial to maintaining the continuity and accuracy of the rotation flag bit writing position information.

[0122] In an exemplary embodiment, the following is further included: when the number of rotation flag bits has reached the preset maximum value, perform an erasing operation on the rotation storage information in the mapping identification record area; perform the erasing operation corresponding to the erasing operation instruction on the target backup storage space; determine that the serial number of the next target backup storage space is the initial serial number.

[0123] Among them, the initial serial number can be the starting number of the rotation backup storage space. For example, the initial serial number can be the number 0 of the rotation backup area 0.

[0124] Optionally, when the controller detects that the number zero_cnt of the rotation flag bits in the mapping identification record area RCD_MAP_NUM (mapping number record area) has reached the preset maximum value of 8191, it first performs an erasing operation on all the rotation storage information in the mapping identification record area RCD_MAP_NUM (mapping number record area), so that the values of all the bit positions in the mapping identification record area RCD_MAP_NUM (mapping number record area) become 1. Then the controller performs the erasing operation corresponding to the erasing operation instruction on the current target backup storage space. Finally, the controller sets the serial number of the next target backup storage space to the initial serial number 0, thereby restarting a new round of rotation storage.

[0125] The technical solution provided in this embodiment performs an erasure operation on the mapping identification record area when the number of rotation identification bits reaches the preset maximum value, and performs an erasure operation on the target backup storage space. At the same time, the sequence number of the next-round target backup storage space is reset to the initial sequence number, which is conducive to realizing the automatic recycling of the rotation storage space and the re-recording of the rotation identification bits, avoiding the problem of storage space exhaustion, and thus is conducive to ensuring the continuous storage and reliable operation of the memory during long-term use.

[0126] In an exemplary embodiment, the following content is further included: initializing the previous historical write position information of the rotation identification bits in the mapping identification record area.

[0127] Among them, the initialization process may be an operation of resetting the previous historical write position information of the rotation identification bits recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area) to the initial value. For example, the initialization process may be an operation of clearing the last_zero_local variable.

[0128] Optionally, after the controller performs an erasure operation on the rotation storage information in the mapping identification record area RCD_MAP_NUM (mapping number record area), it is necessary to initialize the previous historical write position information of the rotation identification bits recorded in the mapping identification record area RCD_MAP_NUM (mapping number record area). Specifically, the last_zero_local variable is cleared, so that the last_zero_local variable starts to record the position information of the last rotation identification bit with a value of 0 in the mapping identification record area RCD_MAP_NUM (mapping number record area) again.

[0129] The technical solution provided in this embodiment initializes the previous historical write position information of the rotation identification bits after the mapping identification record area is erased, which is conducive to clearing the influence of the historical position record information on the new-round rotation storage, ensuring that the system can accurately record the write position of the rotation identification bits during the new-round rotation storage process, and thus is conducive to ensuring the accuracy and continuity of the position information recording during the rotation storage process.

[0130] The following uses an application example to illustrate the memory operation method provided in this application. This application example takes the application of this method to a controller as an example for illustration.

[0131] The cycling (repetitive erase and write) times of a flash device are generally between 10,000 and 100,000 times. In specific application scenarios, the data information recorded in the flash needs to be updated frequently, which may exceed the cycling times limit of the flash device itself. When the cycling times limit of the flash device is exceeded, the data stored in this area subsequently will no longer be reliable.

[0132] When the erase and write times of a certain area in the flash device exceed the cycling times limit, the data in this area needs to be copied to other areas, and this area can no longer be used.

[0133] Basic characteristics of the flash device:

[0134] The storage space is arranged in sectors. The size of each sector is generally 1KB, and it is usually organized in a structure where 64 bits of data are stored in one row and there are 128 rows in total;

[0135] After the flash erase operation, the value of the storage unit will become all 1s;

[0136] For a storage unit that has not been written with 0 (i.e., the value is 1), 0 can be written to make its value become 0;

[0137] For a storage unit that has been written with 0, its value remains 0 when writing 1; only through the erase operation can the value of the storage unit be restored from 0 to 1;

[0138] Writing 0 to a storage unit that has been written with 0 is strictly prohibited, otherwise it will cause damage to the flash device components;

[0139] Writing 1 to a storage unit that has been written with 0 will not affect the original 0 value.

[0140] The current solution is to record the erase and write times of each area in the flash device through software. When the erase and write times reach the upper limit, switch to other areas to save information. However, this solution has the following defects:

[0141] During the program running process, every time an erase operation is performed on a certain address, it is necessary to update the erase times record of this area and record the change of the data storage location. This is an overhead for the software and will lead to a reduction in the normal program execution efficiency;

[0142] If an exception occurs during software execution, it may cause the loss or abnormality of the data storage location information, resulting in the inability to obtain correct data during subsequent system operation.

[0143] This application example effectively solves the problems of insufficient cycling times of the flash device and easy errors in software maintenance. In the space rotation scheme, the address space visible to the user is a virtual address space, rather than the real physical storage space. The space for actually storing data is called the rotation backup storage space.

[0144] This application example improves the cycling times of a fixed amount of data by increasing the physical storage space. The storage space visible to the user and the rotation backup storage space are mapped in a ratio of 1:N, so that the cycling times are increased to N times the original.

[0145] Taking the storage space visible to the user as 1 sector as an example:

[0146] The rotation backup storage space is N sectors;

[0147] The numbers of the rotation backup storage space need to be saved in the mapping number record area RCD_MAP_NUM region, and the size is 1 sector;

[0148] Therefore, the total flash device space required is (N + 1) sectors.

[0149] When the storage space visible to the user is M sectors, the total flash device space required is (N + 1) × M sectors.

[0150] The specific implementation details of this application example are as follows:

[0151] Reference Figure 2 Taking the storage space visible to the user of 1 sector as an example, the corresponding relationship between the user's virtual access space and the physical space for actually storing data is described: Figure 2It contains the correspondence between two parts, namely the virtual space and the physical space. Among them, the virtual space contains the user-visible Flash (flash memory) space with a capacity of 1 KB; the physical space contains multiple Flash rotation backup areas and a mapping number record area RCD_MAP_NUM, specifically including: Flash rotation backup area 0 (with a capacity of 1 KB), Flash rotation backup area 1 (with a capacity of 1 KB), Flash rotation backup area 2 (with a capacity of 1 KB), Flash rotation backup area 3 (with a capacity of 1 KB), Flash rotation backup area 4 (with a capacity of 1 KB), Flash rotation backup area 5 (with a capacity of 1 KB) … until Flash rotation backup area (N - 1) (with a capacity of 1 KB), and the mapping number record area RCD_MAP_NUM (with a capacity of 1 KB).

[0152] In the initial state, the mapping number record area is in an erased state, and the value in it is all 1 (that is, 1024×8 = 8192 bits (bits) are all 1). Whenever the flash (flash memory) rotation backup area switches once, a '0' of 1 bit (bit) is written to the mapping number record area.

[0153] Reference Figure 3 , taking the total number of rotation backup areas as N as an example, illustrate the storage method of data in the mapping number record area: Figure 3 It shows the state change process of the mapping number record area in different erasure stages:

[0154] In the initial state, the value of Addr0 is 64'hFFFF_FFFF_FFFF_FFFF, the value of Addr1 is 64'hFFFF_FFFF_FFFF_FFFF, the value of Addr2 is 64'hFFFF_FFFF_FFFF_FFFF, and the value of Addr127 is 64'hFFFF_FFFF_FFFF_FFFF. The number of '0's saved in it, zero_cnt, is 0, the remainder of zero_cnt divided by (%) 8 is 0, and the valid data is saved in rotation backup area 0.

[0155] After the first erasure is executed, the value of Addr0 becomes 64'hFFFF_FFFF_FFFF_FFFE, the value of Addr1 is 64'hFFFF_FFFF_FFFF_FFFF, the value of Addr2 is 64'hFFFF_FFFF_FFFF_FFFF, and the value of Addr127 is 64'hFFFF_FFFF_FFFF_FFFF. The number of '0's saved in it, zero_cnt, is 1, the remainder of zero_cnt divided by (%) 8 is 1, and the valid data is saved in rotation backup area 1.

[0156] After the second erasure, the value of Addr0 becomes 64'hFFFF_FFFF_FFFF_FFFC, the value of Addr1 is 64'hFFFF_FFFF_FFFF_FFFF, the value of Addr2 is 64'hFFFF_FFFF_FFFF_FFFF, and the value of Addr127 is 64'hFFFF_FFFF_FFFF_FFFF. The number of '0's saved, zero_cnt, is 2. The remainder of zero_cnt divided by (%) 8 is 2, and the valid data is saved in the rotation backup area 2.

[0157] After the 8191st erasure, the value of Addr0 is 64'h0000_0000_0000_0000, the value of Addr1 is 64'h0000_0000_0000_0000, the value of Addr2 is 64'h0000_0000_0000_0000, and the value of Addr127 is 64'h8000_0000_0000_0000. The number of '0's saved, zero_cnt, is 8191. The remainder of zero_cnt divided by (%) 8 is 7, and the valid data is saved in the rotation backup area 7.

[0158] For example, the complete binary of FFFE is 1111 1111 1111 1110, where F represents 1111 (binary) and E represents 1110 (binary).

[0159] Among them, Addr represents the address, zero_cnt represents the zero count (indicating the number of binary 0's), h represents hexadecimal, and last_zero_local represents the last zero position (indicating the position of the last binary 0).

[0160] Exemplarily, Figure 3 In the mapping number record area, Addr0 to Addr127 can all be used to record the rotation storage information corresponding to the address mapping relationship, or only a part of Addr0 to Addr127 can be used to record the rotation storage information corresponding to the address mapping relationship. There is no limitation here; for example, Addr0 to AddrX in the mapping number record area can be used to record the rotation storage information corresponding to the address mapping relationship, and X can be less than or equal to 127.

[0161] Next, it is divided into the reset process and the normal flash erasure process.

[0162] During the reset process, it is necessary to find the position of the rotation backup area where the valid data is saved for use during normal erasure:

[0163] Read all the data in the mapping number record area;

[0164] Record the position of the last '0' in the mapping number record area (denoted as last_zero_local);

[0165] Calculate the number of '0's in 8192 bits of data (denoted as zero_cnt);

[0166] Calculate the remainder value L of zero_cnt divided by N (N is the number of rotation backup areas), and L is the rotation backup area number where the current valid data is stored.

[0167] Reference Figure 4 , this figure shows the Flash controller reset startup process, including the following steps: First, starting from the reset state, enter the reset release judgment. If the reset release judgment result is no, stay in the reset state; if the reset release judgment result is yes, enter the subsequent process. Next, perform the following operations: Read the data in the mapping number record area; Record the position where the last '0' appears in the mapping number record area (denoted as last_zero_local); Calculate the number of '0's in 8192 bits of data (denoted as zero_cnt); Calculate the remainder of zero_cnt / N as L, and L is the number of the rotation backup area where the current valid data exists; Finally, enter the end stage of the startup process.

[0168] Normal flash erase process:

[0169] Update the information in the mapping number record area;

[0170] Update the position information of the most recently written '0' (last_zero_local);

[0171] Perform an erase operation on the current rotation backup area;

[0172] Update the valid data mapping space to the next rotation backup area.

[0173] Reference Figure 5 , this figure shows the Flash controller erase operation process, specifically including the following steps:

[0174] First, start from the idle state and make a judgment when the trigger erase signal arrives. If the result of the trigger erase judgment is no, then maintain the idle state; if the result of the trigger erase judgment is yes, then enter the subsequent process. Next, judge whether zero_cnt is equal to 8191. If it is equal to 8191, perform the following operations: erase the mapping number recording area, clear last_zero_local, erase the current rotation backup area with the number L, and update the rotation backup area number L to 0. If zero_cnt is less than 8191, perform the following operations: burn the mapping number recording area according to the recorded last_zero_local, increment last_zero_local by 1, erase the current rotation backup area with the number L, and update the rotation backup area number L to the remainder of (L + 1) / N; finally, enter the stage of completion of the erase operation.

[0175] The technical solution provided by this application example solves the problem of insufficient cycling times of flash device erasing and writing. By automatically implementing the rotation of the backup area in hardware, it significantly improves the cycling times of flash device erasing and writing, and expands the application range and system reliability of flash device.

[0176] It should be understood that although the steps in the flowcharts involved in the above-described embodiments are displayed in sequence according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps has no strict order limit, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-described embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be executed alternately or alternately with at least a part of other steps or steps in other steps.

[0177] Based on the same inventive concept, the embodiments of the present application also provide a memory operation device for implementing the memory operation method involved above. The solution for solving the problem provided by this device is similar to the solution described in the above method. Therefore, the specific limitations in one or more embodiments of the memory operation device provided below can refer to the limitations on the memory operation method in the above text, and will not be repeated here.

[0178] In an exemplary embodiment, as Figure 6 shown, a memory operation device is provided. The memory operation device 600 may include:

[0179] A space determination module 601, configured to determine a user-visible storage space of a memory and a rotation backup storage space of the memory; the rotation backup storage space includes a plurality of backup storage spaces, and the rotation backup storage space is used to rotationally store data corresponding to the user-visible storage space through the plurality of backup storage spaces;

[0180] A relationship establishment module 602, configured to establish an address mapping relationship between the user-visible storage space and the rotation backup storage space;

[0181] An information recording module 603, configured to record rotation storage information corresponding to the address mapping relationship in a mapping identifier recording area;

[0182] An instruction response module 604, configured to, in response to a data operation instruction for the memory, determine a target backup storage space where the current valid data of the memory is located from the plurality of backup storage spaces according to the rotation storage information;

[0183] A space operation module 605, configured to perform an operation corresponding to the data operation instruction on the target backup storage space.

[0184] In an exemplary embodiment, the space determination module 601 is further configured to determine the storage capacity of the user-visible storage space; according to a preset rotation number N, set the storage capacity of the rotation backup storage space to N times the storage capacity of the user-visible storage space; divide the rotation backup storage space into N backup storage spaces; the storage capacity of each backup storage space is equal to the storage capacity of the user-visible storage space.

[0185] In an exemplary embodiment, the instruction response module 604 is further configured to identify a rotation identifier bit in the rotation storage information; determine the serial number of the target backup storage space according to the number of rotation identifier bits and the number of backup storage spaces in the rotation backup storage space; determine the target backup storage space from the plurality of backup storage spaces according to the serial number of the target backup storage space.

[0186] In an exemplary embodiment, the data operation instruction is an erase operation instruction; the space operation module 605 is further configured to determine whether the number of rotation identifier bits reaches a preset maximum value; the preset maximum value is determined according to the storage capacity of the rotation backup storage space; in the case where the number of rotation identifier bits does not reach the preset maximum value, write the rotation identifier bit in the mapping identifier recording area; perform an erase operation corresponding to the erase operation instruction on the target backup storage space; determine the serial number of the next-round target backup storage space according to the serial number of the target backup storage space and the number of backup storage spaces; the next-round target backup storage space is used to store the next-round valid data of the memory.

[0187] In an exemplary embodiment, the spatial operation module 605 is further configured to determine the current write position information of the rotation identification bit in the mapping identification record area according to the historical write position information of the rotation identification bit in the mapping identification record area; and write the rotation identification bit in the mapping identification record area according to the current write position information.

[0188] In an exemplary embodiment, the historical write position information is the previous historical write position information of the rotation identification bit in the mapping identification record area; the apparatus 600 further includes: an information update module, configured to update the previous historical write position information according to the current write position information.

[0189] In an exemplary embodiment, the apparatus 600 further includes: a sequence number determination module, configured to perform an erasure operation on the rotation storage information in the mapping identification record area when the number of rotation identification bits has reached a preset maximum value; perform an erasure operation corresponding to the erasure operation instruction on the target backup storage space; and determine that the sequence number of the next target backup storage space is the initial sequence number.

[0190] In an exemplary embodiment, the apparatus 600 further includes: an information processing module, configured to initialize the previous historical write position information of the rotation identification bit in the mapping identification record area.

[0191] Each module in the above memory operation apparatus can be implemented in whole or in part by software, hardware, and their combination. The above modules can be embedded in the processor of the computer device in hardware form or independent of the processor, or stored in the memory of the computer device in software form, so as to facilitate the processor to call and execute the operations corresponding to the above respective modules.

[0192] In an exemplary embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as Figure 7As shown in the figure. The computer device includes a processor, a memory, an input / output interface, a communication interface, a display unit, and an input device. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface, the display unit, and the input device are connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals in a wired or wireless manner, and the wireless manner can be implemented through WIFI, a mobile cellular network, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a memory operation method. The display unit of the computer device is used to form a visually visible picture, which can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be a liquid crystal display screen or an electronic ink display screen. The input device of the computer device can be a touch layer covering the display screen, or a button, a trackball, or a touchpad provided on the housing of the computer device, or an external keyboard, touchpad, or mouse, etc.

[0193] Those skilled in the art can understand that Figure 7 the structure shown in the figure is only a block diagram of some structures 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 some components, or have different component arrangements.

[0194] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0195] In an exemplary embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0196] In an exemplary embodiment, a computer program product is provided, including a computer program. When the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0197] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The databases involved in the embodiments provided in the present application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the embodiments provided in the present application can be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0198] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered as the scope described in this specification.

[0199] The above-described embodiments merely represent several implementation manners of the present application. The description thereof is relatively specific and detailed, but it should not be construed as a limitation on the patent scope of the present application. It should be noted that for those of ordinary skill in the art, without departing from the concept of the present application, several modifications and improvements can still be made, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.

Claims

1. A memory operation method, characterized in that: The method comprises: Determine a user-visible storage space of a memory and a rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store data corresponding to the user-visible storage space through the plurality of backup storage spaces; Establishing an address mapping relationship between the user-visible storage space and the rotating backup storage space; Recording the rotation storage information corresponding to the address mapping relationship in the mapping identification recording area; In response to a data operation instruction for the memory, determining a target backup storage space where current valid data of the memory is located from the multiple backup storage spaces according to the rotation storage information; The operation corresponding to the data operation instruction is performed on the target backup storage space.

2. The method according to claim 1, characterized in that The determining of the user-visible storage space of the memory and the rotating backup storage space of the memory includes: Determining the storage capacity of the user-visible storage space; According to a preset rotation number N, the storage capacity of the rotation backup storage space is set to N times the storage capacity of the user visible storage space; The rotating backup storage space is divided into N backup storage spaces; the storage capacity of each backup storage space is equal to the storage capacity of the user-visible storage space.

3. The method according to claim 1, characterized in that The step of determining, according to the rotation storage information, a target backup storage space where the current valid data of the memory is located from the multiple backup storage spaces comprises: Identifying a rotation identification bit in the rotation storage information; Determine the sequence number of the target backup storage space according to the number of the rotation identification bits and the number of the backup storage spaces in the rotation backup storage space; The target backup storage space is determined from the multiple backup storage spaces according to the sequence number of the target backup storage space.

4. The method according to claim 3, characterized in that: The data operation instruction is an erase operation instruction; The performing the operation corresponding to the data operation instruction on the target backup storage space includes: Determine whether the number of the rotation identification bits reaches a preset maximum value; the preset maximum value is determined according to the storage capacity of the rotation backup storage space; When the number of the rotation identification bits does not reach the preset maximum value, writing the rotation identification bits into the mapping identification recording area; Performing an erasing operation corresponding to the erasing operation instruction on the target backup storage space; The sequence number of the next round of target backup storage space is determined according to the sequence number of the target backup storage space and the quantity of the backup storage space; the next round of target backup storage space is used to store the next round of valid data of the memory.

5. The method according to claim 4, characterized in that The step of writing the rotation identification bit into the mapping identification recording area comprises: Determine the current write position information of the rotation identification bit in the mapping identification recording area according to the historical write position information of the rotation identification bit in the mapping identification recording area; The rotation identification bit is written into the mapping identification recording area according to the current writing position information.

6. The method according to claim 5, characterized in that The historical write position information is the previous historical write position information of the rotation identification bit in the mapping identification recording area; The method further comprises: The previous historical writing position information is updated according to the current writing position information.

7. The method according to claim 4, characterized in that The method further comprises: When the number of the rotation identification bits has reached the preset maximum value, erasing the rotation storage information in the mapping identification recording area; Performing an erasing operation corresponding to the erasing operation instruction on the target backup storage space; Determine the sequence number of the next round of target backup storage space as the initial sequence number.

8. The method according to claim 7, characterized in that The method further comprises: Initialize the last historical write position information of the rotation identification bit in the mapping identification recording area.

9. A memory operation device, characterized in that: The device comprises: A space determination module, used to determine a user-visible storage space of a memory and a rotating backup storage space of the memory; the rotating backup storage space includes a plurality of backup storage spaces, and the rotating backup storage space is used to rotate and store data corresponding to the user-visible storage space through the plurality of backup storage spaces; A relationship establishing module, used to establish an address mapping relationship between the user-visible storage space and the rotating backup storage space; An information recording module, used for recording the rotation storage information corresponding to the address mapping relationship in the mapping identification recording area; an instruction response module, configured to respond to a data operation instruction for the memory and determine, according to the rotation storage information, a target backup storage space where the current valid data of the memory is located from the multiple backup storage spaces; The space operation module is used to perform the operation corresponding to the data operation instruction on the target backup storage space.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 8 are implemented.

11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

Citation Information

Cited By

  • Partition online backup method and device, equipment, medium and product

    CN122285391A