CN114840364A - Method and device for backing up storage data in memory and electronic equipment - Google Patents
Method and device for backing up storage data in memory and electronic equipment Download PDFInfo
- Publication number
- CN114840364A CN114840364A CN202210506772.7A CN202210506772A CN114840364A CN 114840364 A CN114840364 A CN 114840364A CN 202210506772 A CN202210506772 A CN 202210506772A CN 114840364 A CN114840364 A CN 114840364A
- Authority
- CN
- China
- Prior art keywords
- storage unit
- backup
- data
- memory
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1448—Management of the data involved in backup or backup restore
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/0223—User address space allocation, e.g. contiguous or non contiguous base addressing
- G06F12/023—Free address space management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- Techniques For Improving Reliability Of Storages (AREA)
Abstract
The present disclosure provides a method, an apparatus and an electronic device for backing up stored data in a memory, which relate to a data storage technology, wherein a backup space is preset in the memory; when data are read from a storage unit of a memory, if the risk that uncorrectable errors occur in the storage unit is determined, writing the data in the storage unit into a backup space, and determining that a memory address where the storage unit is located corresponds to a backup address of the data in the backup space; and if uncorrectable errors occur when the data are read from the storage unit again, reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit. According to the scheme provided by the disclosure, the data of the storage unit is backed up by using the space of the memory, and the size of the storage unit can be set according to requirements, so that the electronic equipment can back up the data of the storage unit which is dispersed in the memory and possibly has the UE error, and the problem of system downtime caused by the UE error of the memory is solved.
Description
Technical Field
The present disclosure relates to data storage technologies, and in particular, to a method and an apparatus for backing up storage data in a memory, and an electronic device.
Background
At present, many service functions are provided by a server, and the influence of the stability of the server on the service quality is important.
If the internal memory of the server has errors, the server is prone to being down. Especially, when UE (Uncorrectable Errors) type Errors occur in the memory, the server is likely to be automatically restarted, which may cause service interruption
Therefore, how to still normally process the service when the UE-like error occurs in the memory of the server is a technical problem to be solved.
Disclosure of Invention
The present disclosure provides a method, an apparatus, and an electronic device for backing up stored data in a memory, so as to solve a problem in the prior art that a server cannot normally process a service due to a UE-like error.
A first aspect of the present disclosure is to provide a method for backing up data stored in a memory, in which a backup space is preset in the memory;
the method comprises the following steps: when data are read from a storage unit of a memory, if the risk that uncorrectable errors occur in the storage unit is determined, writing the data in the storage unit into the backup space, and determining that a memory address where the storage unit is located corresponds to a backup address of the data in the backup space;
and if uncorrectable errors occur when the data are read from the storage unit again, reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit.
A second aspect of the present disclosure is to provide an apparatus for backing up data stored in a memory, in which a backup space is preset in the memory;
the device comprises:
the backup unit is used for writing the data in the storage unit into the backup space and determining that the memory address of the storage unit corresponds to the backup address of the data in the backup space if the risk of uncorrectable errors of the storage unit is determined when the data is read from the storage unit of the memory;
and the backup data reading unit is used for reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit if uncorrectable errors occur when the data is read from the storage unit again.
A third aspect of the present disclosure is to provide an electronic device, including:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of backing up data stored in the memory as described in the first aspect above.
A fourth aspect of the present disclosure is to provide a computer-readable storage medium, on which a computer program is stored, the computer program being executed by a processor to implement the method for backing up storage data in a memory as described in the first aspect above.
The method, the device and the electronic equipment for backing up the storage data in the memory have the technical effects that:
according to the method, the device and the electronic equipment for backing up the storage data in the memory, a backup space is preset in the memory; the method comprises the following steps: when data are read from a storage unit of a memory, if the risk that uncorrectable errors occur in the storage unit is determined, writing the data in the storage unit into a backup space, and determining correspondence between a memory address where the storage unit is located and a backup address of the data in the backup space; and if uncorrectable errors occur when the data are read from the storage unit again, reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit. According to the scheme provided by the disclosure, the data of the storage unit can be backed up by using the space of the memory, and the size of the storage unit can be set according to the requirement, so that the electronic equipment can back up the data of the storage unit which is dispersed in the memory and possibly has the UE error, and the problem of system downtime caused by the UE error of the memory is solved.
Drawings
Fig. 1 is a flowchart illustrating a method for backing up data stored in a memory according to an exemplary embodiment of the present disclosure;
fig. 2 is a flowchart illustrating a method for backing up data stored in a memory according to another exemplary embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a data backup shown in an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating reading data according to another exemplary embodiment of the present disclosure;
fig. 5 is a block diagram illustrating an apparatus for backing up data stored in a memory according to an exemplary embodiment of the present disclosure;
fig. 6 is a block diagram of an apparatus for backing up data stored in a memory according to another exemplary embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
Detailed Description
The memory component is a key component for directly providing data cache for a central processing unit in a computer architecture, and the failure of the memory system directly causes the processor of the computer to stop responding, thus causing the system to be down.
The fault of the memory has Errors of UE (Uncorrectable Errors), which cannot be corrected based on the existing ECC ("Error Correcting Code"), and the system is most likely to be restarted in order to ensure the reliability of the system and the accuracy of the data.
If the memory set in the server is restarted due to a UE error, service interruption may be caused, and poor user experience may be brought.
In order to solve the technical problem, data backup can be performed based on a memory mirror image, and when a memory access fails, the content in a corresponding backup block is used.
In another scheme, the wrong bits in the memory can be replaced by the bits stored in the memory controller, but the storage space in the memory controller is limited, so that the cost of the single-bit backup mode is too high, and only a few backup bits can be stored.
In yet another scheme, a bad row of contents may be replaced by a redundant circuit in a memory, and specifically, the bad row in the memory may be remapped to a row with built-in redundancy. However, the number of rows for backup is limited in this manner, and this increases hardware costs.
In order to solve the above technical problem, in the solution provided by the present disclosure, a backup space is pre-partitioned in a memory, and when it is determined that a UE error may occur in a memory address where a storage unit is located, data of the storage unit may be written into the backup space, and a mapping relationship between the memory address where the storage unit is located and the backup address is determined, so as to achieve a purpose of backing up the data in the storage unit. The implementation mode does not increase extra hardware cost, the size of the storage unit can be set according to requirements, and the implementation mode is more flexible.
Fig. 1 is a flowchart illustrating a method for backing up storage data in a memory according to an exemplary embodiment of the present disclosure.
The method provided by the disclosure can be applied to the electronic equipment with the memory, and when the electronic equipment is started, the electronic equipment can partition a backup space in the memory. For example, the size of the backup space may be preset, so that the electronic device can partition the backup space of a corresponding size in the memory. The addresses of the backup space in the memory may be continuous addresses or discontinuous addresses.
As shown in fig. 1, the method for backing up stored data in a memory provided by the present disclosure includes:
The storage component in the electronic device may include a hard disk, a memory, a cache, and the like, where the electronic device may read data from the cache first when reading the data, and if the data is not in the cache, the data is read from the memory, and if the data is not in the memory, the data is not read from the hard disk.
Specifically, the electronic device may store more commonly used data in a cache or a memory to improve the data reading speed. Therefore, the electronic device typically stores data in the memory during runtime.
Further, when the data to be read is stored in the memory, the electronic device may read the data from the memory. For example, when a user operates a picture and the picture is stored in the memory, the electronic device may read data of the picture from the memory.
In practical applications, the memory may be divided into a plurality of storage units, the data to be read may be dispersed in the plurality of storage units, and the electronic device may read the data from the storage units. The size of the storage unit can be set according to requirements, such as 32B, 64B, 72B, and the like.
In an alternative implementation, the size of the storage unit may be the size of the smallest amount of data when the electronic device reads the data. For example, when the electronic device writes data in the memory into the cache, the size of the storage unit is 64B each time 64B (bytes) is written at least.
In another alternative implementation, the size of the memory cell may also be set based on the requirement, such as 64B × 2, 64B × 3, and the like.
When the electronic device reads data from the storage unit, if it is determined that the storage unit has a risk of a UE error, the data in the storage unit may be written into the backup space.
Specifically, the electronic device may determine whether a storage unit has a risk of a UE error by using a scheme in the prior art, for example, if a storage unit has multiple CE errors, it may determine that the storage unit has a risk of a UE error.
Further, the memory cells have corresponding memory addresses, for example, the space with memory addresses 0-63B is the first memory cell, and the space with memory addresses 64-127B is the second memory cell. If the space with the memory address of 0-63B has multiple CE errors, for example, the CE error occurs once in the 4 th byte, and then, for example, the CE error occurs 8 times in the 10 th byte, it can be determined that the space with the memory address of 0-63B has the risk of the occurrence of the UE error, and further it is determined that the storage unit corresponding to the memory address of 0-63B has the risk of the occurrence of the UE error.
In practical application, if it is determined that the storage unit has a risk of a UE error, the data in the storage unit is backed up in the backup space, and specifically, the data in the storage unit may be written in the backup space.
For example, if it is determined that the first storage unit has a UE error risk, the data in the first storage unit may be written into the backup space, and then, if it is determined that the fourth storage unit has a UE error risk again, the data in the fourth storage unit may also be written into the backup space, and the data in the fourth storage unit may be arranged behind the data in the first storage unit.
Specifically, if the storage unit has a risk of a UE error, it may be considered that the data stored in the storage unit has a risk of being unreadable, and the data in the storage unit is backed up at this time, so that when the storage unit really has a UE error, the corresponding data can be read from the backup space, so as to avoid the problem of downtime caused by the UE error in the memory.
Further, after the data in the storage unit is backed up in the backup space, the correspondence between the source address of the data and the backup address may also be determined, for example, it may be determined that a mapping relationship exists between the source address and the backup address, specifically, the memory address where the storage unit is located may be determined as the source address of the data, and the address of the data in the backup space is used as the backup address.
For example, the memory address of the first storage unit is 0 to 63B, the data in the first storage unit is written in the backup space, and the address where the data is located is N- (N +63B), it is determined that the address (0 to 63B) corresponds to the address (N- (N + 63B)).
In actual application, if it is determined that there is a mapping relationship between addresses, an address mapping table may be generated, and the determined mapping relationship may be written into the address mapping table.
In this implementation, data can be backed up in units of storage units, and the granularity of the storage units can be controlled according to requirements, for example, can be controlled to be 64B, so that data with the minimum reading granularity can be backed up.
The memory address where the storage unit is located and the backup address of the data refer to physical addresses.
Step 102, if an uncorrectable error occurs when the data is read from the storage unit again, the data is read from the backup space according to the backup address corresponding to the memory address where the storage unit is located.
If the data is read from the storage unit again, and a UE error occurs, it may be determined whether the data in the storage unit is backed up, and if the data is backed up, the corresponding data may be read from the backup space, so as to avoid a system downtime and a service interruption.
Specifically, a backup address corresponding to the memory address where the storage unit is located may be determined, and corresponding data may be read from the backup space based on the backup address. For example, if the first source address corresponds to the first backup address, a UE error occurs when reading data from the storage unit, and the memory address of the storage unit is the first source address, the backup data may be read from the first backup address in the backup space.
In an alternative implementation manner, after the data in the storage unit is backed up to the backup space, a mark may be further added to the storage unit, for example, a backup mark may be added.
If a UE error occurs when reading data from the storage unit again, and the electronic device determines that the storage unit has the backup mark, the electronic device may read data from the backup address of the backup space according to the backup address corresponding to the memory address where the storage unit is located, for example, may determine the backup address corresponding to the memory address where the storage unit is located according to the mapping relationship, and then obtain the data from the backup address.
In another optional implementation manner, if a UE error occurs when data is read from the storage unit again, the electronic device may determine a memory address where the storage unit is located, and acquire the data from the backup address according to a backup address corresponding to the memory address where the storage unit is located.
In this implementation, even if a UE error occurs in the storage unit, the system is not down.
According to the scheme provided by the disclosure, the storage unit can be pre-judged, and the storage unit with the risk of the UE error is determined, so that the data of the storage unit with the risk of the UE error can be backed up, and when the storage unit has the UE error, the corresponding data can be read from the backup space, so that the problem that the data cannot be acquired due to the UE error of the storage unit is solved.
According to the method for backing up the storage data in the memory, a backup space is preset in the memory; the method comprises the following steps: when data are read from a storage unit of a memory, if the risk that uncorrectable errors occur in the storage unit is determined, writing the data in the storage unit into a backup space, and determining correspondence between a memory address where the storage unit is located and a backup address of the data in the backup space; and if uncorrectable errors occur when the data are read from the storage unit again, reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit. According to the scheme provided by the disclosure, the data of the storage unit can be backed up by using the space of the memory, and the size of the storage unit can be set according to the requirement, so that the electronic equipment can back up the data of the storage unit which is dispersed in the memory and possibly has the UE error, and the problem of system downtime caused by the UE error of the memory is solved.
Fig. 2 is a flowchart illustrating a method for backing up data stored in a memory according to another exemplary embodiment of the present disclosure.
As shown in fig. 2, the method for backing up storage data in a memory according to this embodiment includes:
step 201, when data is read from a storage unit of a memory, if it is determined that the storage unit has a risk of generating correctable errors, determining correctable error information of the memory; the memory correctable error information is used to determine whether the memory cell is at risk of having an uncorrectable error.
The method provided by the disclosure can be executed by an electronic device with a memory, and the electronic device can partition a backup space in the memory when starting up. The size of the backup space can be set based on requirements to meet the business requirements of various application scenarios.
The memory may be divided into a plurality of storage units, the data to be read may be dispersed in the plurality of storage units, and the electronic device may read the data from the storage units.
Specifically, when the electronic device reads data from the storage unit, if it is determined that the storage unit has a risk of a CE error, the electronic device may determine correctable error information of the memory, where the correctable error information of the memory may include a location, a cause, and the like where the error occurs.
The in-memory correctable error information is used to determine whether the storage unit is at risk of a UE error.
In an optional implementation manner, a management program may be set in the electronic device, and the management program in the electronic device may determine whether the storage unit is at risk of a UE error according to the memory correctable error information.
In another optional implementation manner, the electronic device may further send the correctable memory error information to the cloud, and the cloud determines whether the storage unit is at risk of a UE error according to the correctable memory error information.
Furthermore, a prediction strategy can be set, and when the correctable error information of the memory is used for determining whether the storage unit has the risk of the occurrence of the UE error, the prediction strategy and the correctable error information of the memory can be combined to determine whether the storage unit has the risk of the occurrence of the UE error.
For example, if it is determined that CE errors occur in a plurality of bytes in the storage unit according to the error correctable information in the memory, it may be determined whether the storage unit has a risk of generating a UE error. For example, it may be determined whether a CE error occurs in all bytes in a storage unit corresponding to the currently received correctable memory error information according to the historically received correctable memory error information and the currently received correctable memory error information, and if so, it may be determined that the storage unit has a risk of a UE error.
In step 202, information characterizing the risk of uncorrectable errors occurring in the memory cell is obtained.
If the management program of the electronic device determines that the storage unit has a risk of sending a UE error, the management program may further generate information for representing that the storage unit has a risk of having an uncorrectable error, so that the electronic device may acquire the information.
The Management program may be set in the electronic device, or may be set in the cloud, and if the Management program is set in the electronic device, the Management program may be specifically set in a BIOS (Basic Input Output System), a BMC (Baseboard Management Controller), or an OS (operating System), which is not limited by this disclosure.
Further, the data is written into the backup space, and the data can be backed up twice, for example, the data can be written twice in succession in the backup space, so that the data is more secure.
In practical application, the data in the storage unit can be written in the first backup address and the second backup address of the backup space, and the stability of the data is further ensured through a multi-backup mode. For example, the data in the backup space may include data a, data a ', data B, and data B', where data a is the same as data a 'and data B is the same as data B'.
In the method provided by the disclosure, after the data in the storage unit is backed up in the backup space, the electronic device may further add a backup mark to the storage unit, thereby representing that the data in the storage unit is backed up in the backup space.
For example, if there is a first storage unit and the electronic device stores data in the first storage unit into the backup space, a backup mark may be added to the first storage unit. For another example, if there is a fourth storage unit and the electronic device stores data in the fourth storage unit into the backup space, a backup mark may be added to the fourth storage unit.
Fig. 3 is a schematic diagram illustrating data backup according to an exemplary embodiment of the present disclosure.
As shown in fig. 3, the memory has a backup space 31, and the size of the backup space 31 is larger than the size of the storage unit.
If the electronic device determines that the storage unit 32 is at risk of a possible UE error, the data32 in the storage unit 32 is written into the backup space 31. Thereafter, if the electronic device determines again that there is a risk that the storage unit 33 may have a UE error, the data33 in the storage unit 33 is also written into the backup space 31.
It should be noted that the addresses in the backup space for the backup data may be continuous or discontinuous. For example, data32 can be written at the third backup address, data33 can be written at the fourth backup address, and the third backup address and the fourth backup address can be discontinuous.
After obtaining the information for representing that the storage unit has a risk of an uncorrectable error, the electronic device may further add a backup mark to the storage unit, for example, the backup marks may be added to both the storage unit 32 and the storage unit 33.
In step 205, an address mapping entry is generated according to the memory address of the storage unit and the backup address for backing up data in the backup space.
The execution sequence of step 203-.
In an optional implementation manner, when data needs to be backed up, a backup address for the backup data may be determined first, a mapping item between the memory address where the storage unit is located and the backup address is regenerated, and then the data needing to be backed up is written into the backup address.
In another alternative implementation, when data needs to be backed up, data may be written in the backup space first, and then a backup address is determined according to a location of the written data, and an address mapping item is generated.
Further, the electronic device may determine a memory address where the storage unit is located, and a backup address for backing up data in the backup space, and generate an address mapping entry. For example, the memory address where the storage unit is located is address 1, data in the storage unit is to be written into the backup space, and the written backup address is address 2, an address mapping item may be generated according to address 1 and address 2, and the address mapping item is used to represent that address 1 corresponds to address 2.
Further, if two or more identical data are backed up in the backup space, the electronic device may further determine correspondence between the memory address where the storage unit is located and the first backup address, for example, may determine that the memory address where the storage unit is located and the first backup address have a first mapping relationship, and may also determine correspondence between the first backup address and the second backup address, for example, determine that the first backup address and the second backup address have a second mapping relationship. Both the first mapping relationship and the second mapping relationship may be written to an address mapping table.
For example, if the memory address of the storage unit is address 1, the data in the storage unit is stored in the backup space, and the specific storage location is address 2, it may be determined that there is a first mapping relationship between address 1 and address 2, and at the same time, the data is stored at address 3, which is another location in the backup space, and it may be determined that there is a second mapping relationship between address 2 and address 3.
In this implementation, if a UE error occurs when reading data of the storage unit, the electronic device may read the backup data from the first backup address, and if a UE error also occurs when reading data from the first backup address, the electronic device may also read the backup data from the second backup address. Therefore, the problem that the system is down due to the fact that the address for the backup data in the backup space is wrong by the UE is solved.
At step 206, the address mapping entry is written into the address mapping table.
In actual application, an address mapping table can be generated for recording address mapping entries.
The electronic device may determine whether an address mapping table in which the address mapping entry can be written currently exists, and if the address mapping table does not exist, the electronic device may further generate a new address mapping table and write the address mapping entry therein.
If an address mapping table capable of writing the address mapping item exists, the electronic device may write the currently generated address mapping item into the address mapping table.
The electronic equipment can also determine a hash value according to the memory address of the storage unit, and determine a target position in the address mapping table according to the hash value; the address mapping entry is stored in a target location of the address mapping table.
Specifically, the electronic device may determine the hash value according to a low-order value of the memory address, for example, the hash value may be determined by using a low-order 4-order value of the memory address. And then the hash value is used as an offset item of the mapping table, so that the target position is determined. For example, if the hash value is hash (m), the destination address may be the hash (m) of the address mapping table. In this implementation manner, when the address mapping item of the storage unit needs to be queried, the target position in the address mapping table can be quickly located according to the memory address of the storage unit, so that the address mapping item is quickly read, and the backup address is quickly read.
Furthermore, if the address mapping entries are recorded in the address mapping table, the address mapping table may be stored in the memory, which may store a larger number of address mapping entries.
In an alternative implementation, two address mapping tables may be stored in the memory, for example, the address mapping table is stored at a first location of the memory, and a backup table may be stored at a second location, where the contents of the backup table and the address mapping table are the same.
The address mapping table is a logical table, the content stored in the storage medium is address mapping entries, the address mapping table can be regarded as a set of address mapping entries, and the addresses of the address mapping entries in the storage medium may be continuous or discontinuous.
In practical application, each time an address mapping entry is added to the address mapping table, the address mapping entry may also be added to the backup table in the same manner, so that the contents of the two tables are synchronized.
Some positions can be reserved in the cache of the electronic equipment and used for storing partial address mapping items. For example, a location capable of storing N address mapping entries may be reserved so that the electronic device can read the backup address more quickly.
Specifically, the address mapping entries stored in the cache can be updated, and specifically, the address mapping entries that have been recently read may be stored in the cache.
After steps 2-3, 204, 206, step 207 may be performed and step 209 may also be performed.
If the electronic device reads data from the storage unit, the electronic device may determine whether the storage unit has a backup flag, and if so, the electronic device may indicate that the data in the storage unit is backed up in the backup space.
Specifically, if the address mapping table is used to record the mapping relationship of the addresses, the electronic device may query the address mapping table for a backup address corresponding to the memory address where the storage unit is located, and read data from the backup address.
In this implementation, even if a UE error occurs in the storage unit storing the data, the electronic device can still read the corresponding data from the backup space to avoid system restart.
Optionally, if the electronic device successfully reads the data from the storage unit, the electronic device may further store the data in the cache, and record information that the storage unit has the backup mark in the cache, so that it can be determined that the data is backed up in the backup space when the data is synchronized from the cache to the memory storage unit next time, and therefore, the electronic device may synchronize the data to the backup address according to the address mapping table.
Fig. 4 is a schematic diagram illustrating reading data according to another exemplary embodiment of the present disclosure.
As shown in FIG. 4, data42 is stored in backup space 41, data42 is the data in storage unit 42, data43 is also stored in backup space 41, and data43 is the data in storage unit 43.
The correspondence between the backup address of data42 in backup space 41 and the memory address of storage unit 42 is recorded, and the correspondence between the backup address of data43 in backup space 41 and the memory address of storage unit 43 is also recorded.
When the electronic device reads data from the storage unit 42, if a UE error occurs, the electronic device may query a backup address corresponding to the memory address of the storage unit 42 according to the mapping relationship of the addresses, and the data42 corresponds to the backup address in the backup space 41 and the memory address of the storage unit 42, so that the data42 can be read from the backup address.
In step 208, if an uncorrectable error occurs during reading data from the backup space, information for indicating that the uncorrectable error exists in the memory is output.
The backup space is a part of the memory, so that a UE error may occur in the backup space, and if a UE error occurs when data is read from the backup space, the electronic device may not obtain valid data finally, so that the electronic device may output information indicating that the memory has the UE error.
Specifically, the electronic device may further perform a write operation on the storage unit, and specifically may execute a write instruction. For example, a user may change data stored in the electronic device, the electronic device may execute a write instruction to the storage unit based on the operation, and for example, the electronic device may also update the data in the storage unit when executing a program, and may also perform a write operation to the storage unit in the execution process, and may specifically execute a corresponding write instruction.
Further, when the electronic device executes a write instruction to the storage unit, if it is determined that the storage unit has the backup mark, the electronic device may determine a backup address corresponding to the memory address where the storage unit is located.
For example, the backup address corresponding to the memory address where the storage unit is located may be determined according to the mapping relationship between the determined addresses, and if the address mapping table is used to record the mapping relationship between the addresses, the electronic device may query the address mapping table for the backup address corresponding to the memory address where the storage unit is located.
And step 210, writing data in the storage unit and the backup address according to the writing instruction.
In practical application, the electronic device may write data in the storage unit according to the write instruction, and may also write data in the backup address corresponding to the storage unit. In this implementation, it can be ensured that the data in the storage unit and the backup space are consistent.
In any of the above embodiments, the size of the storage space of the storage unit is the same as the size of the cache line of the cache. The cache is another storage component in the electronic device, the cache is divided into a plurality of groups, each group has a plurality of cachelines (cache lines), the size of a cache line is the size of one cacheline, when the electronic device writes data in the memory into the cache, the minimum granularity of the data is the cache, that is, each time the data is written into the cache, the data amount is the least line.
In this implementation manner, data in a storage unit in the memory, which may have a risk of a UE error, can be backed up, and the size of the storage unit is the size of cacheline, so that data blocks with sizes of linesize, which are dispersed in the memory and may have errors, can be backed up by using a small amount of backup space, so as to improve reliability and stability of the electronic device.
Fig. 5 is a block diagram illustrating an apparatus for backing up data stored in a memory according to an exemplary embodiment of the present disclosure.
As shown in fig. 5, in the apparatus 500 for backing up data stored in the memory according to this embodiment, a backup space is preset in the memory; the device comprises:
a backup unit 510, configured to, when reading data from a storage unit of a memory, if it is determined that the storage unit has a risk of an uncorrectable error, write the data in the storage unit into the backup space, and determine that a memory address of the storage unit corresponds to a backup address of the data in the backup space;
a backup data reading unit 530, configured to, if an uncorrectable error occurs when data is read from the storage unit again, read data from the backup space according to a backup address corresponding to a memory address where the storage unit is located.
According to the scheme provided by the disclosure, the data of the storage unit can be backed up by using the space of the memory, and the size of the storage unit can be set according to the requirement, so that the electronic equipment can back up the data of the storage unit which is dispersed in the memory and possibly has the UE error, and the problem of system downtime caused by the UE error of the memory is solved.
Fig. 6 is a block diagram illustrating an apparatus for backing up data stored in a memory according to another exemplary embodiment of the present disclosure.
As shown in fig. 6, on the basis of the foregoing embodiment, in the apparatus 600 for backing up data stored in a memory according to this embodiment, the backup unit 510 includes:
a mapping item generating module 511, configured to generate an address mapping item according to the memory address where the storage unit is located and a backup address used for backing up the data in the backup space;
a writing module 512, configured to write the address mapping entry into an address mapping table.
The write module 512 is specifically configured to:
determining a hash value according to the memory address of the storage unit, and determining a target position in the address mapping table according to the hash value;
storing the address mapping entry in the target location of the address mapping table.
In an alternative implementation, the address mapping table is stored at a first location of the memory, and a backup table identical to the address mapping table is stored at a second location of the memory.
Optionally, the memory is disposed in an electronic device, and a cache is further disposed in the electronic device;
the apparatus further comprises a caching unit 530 configured to:
and storing N address mapping items in the address mapping table in the cache, wherein N is a positive integer.
Optionally, the apparatus further comprises a marking unit 540, configured to:
adding a backup mark to the storage unit; the backup marks are used for representing data of the storage units and written into the backup space;
the backup data reading unit 520 includes a reading module 521 for:
and if an uncorrectable error occurs when the data is read from the storage unit, and the storage unit has the backup mark, reading the data from the backup space according to a backup address corresponding to the memory address of the storage unit.
The apparatus further comprises a writing unit 550 for:
responding to a write instruction of the storage unit, and if the storage unit is determined to have the backup mark, determining a backup address corresponding to a memory address where the storage unit is located;
and writing data in the storage unit and the backup address according to the writing instruction.
Optionally, the backup data reading unit 520 further includes an output module 522, configured to:
and if uncorrectable errors occur when the data are read from the backup space, outputting information for representing the existence of the uncorrectable errors in the memory.
Optionally, the memory is disposed in an electronic device, and a cache is further disposed in the electronic device;
the size of the storage space of the storage unit is the same as the size of the cache line of the cache.
Optionally, the backup unit 510 includes:
a correctable error determining module 513, configured to determine that the memory can correct error information if it is determined that the storage unit has a risk of generating a correctable error when data is read from the storage unit of the memory; the memory correctable error information is used for determining whether the storage unit has risk of generating uncorrectable errors;
an error information obtaining module 514, configured to obtain information used for characterizing that the storage unit is at risk of an uncorrectable error.
Optionally, the backup unit 510 is specifically configured to:
writing the data in the storage unit into a first backup address and a second backup address of the backup space;
and determining that the memory address of the storage unit corresponds to the first backup address, and determining that the first backup address corresponds to the second backup address.
Fig. 7 is a block diagram of an electronic device shown in an exemplary embodiment of the present disclosure.
As shown in fig. 7, the electronic device provided in this embodiment includes:
a memory 71;
a processor 72; and
a computer program;
wherein the computer program is stored in the memory 71 and configured to be executed by the processor 72 to implement any of the above-mentioned methods for backing up stored data in a memory.
The present embodiments also provide a computer-readable storage medium, having stored thereon a computer program,
the computer program is executed by a processor to implement any of the methods for backing up data stored in a memory as described above.
The present embodiment also provides a computer program, which includes a program code, and when the computer runs the computer program, the program code executes any of the above methods for backing up data stored in the memory.
Those of ordinary skill in the art will understand that: all or a portion of the steps of implementing the above-described method embodiments may be performed by hardware associated with program instructions. The program may be stored in a computer-readable storage medium. When executed, the program performs steps comprising the method embodiments described above; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present disclosure, and not for limiting the same; while the present disclosure has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art will understand that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present disclosure.
Claims (14)
1. A method for backing up stored data in a memory is characterized in that a backup space is preset in the memory;
the method comprises the following steps:
when data are read from a storage unit of a memory, if the risk that uncorrectable errors occur in the storage unit is determined, writing the data in the storage unit into the backup space, and determining that a memory address where the storage unit is located corresponds to a backup address of the data in the backup space;
and if uncorrectable errors occur when the data are read from the storage unit again, reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit.
2. The method according to claim 1, wherein the determining that the memory address of the storage unit corresponds to the backup address of the data in the backup space comprises:
generating an address mapping item according to the memory address of the storage unit and a backup address for backing up the data in the backup space;
and writing the address mapping item into an address mapping table.
3. The method of claim 2, wherein the address mapping table is stored in the memory.
4. The method of claim 2, wherein writing the address mapping entry to an address mapping table comprises:
determining a hash value according to the memory address of the storage unit, and determining a target position in the address mapping table according to the hash value;
storing the address mapping entry in the target location of the address mapping table.
5. The method of any of claims 2-4, wherein the address mapping table is stored at a first location in the memory, and wherein a backup table that is the same as the address mapping table is stored at a second location in the memory.
6. The method according to any one of claims 2-4, wherein the memory is provided in an electronic device, and the electronic device is further provided with a cache;
the method further comprises the following steps:
and storing N address mapping items in the address mapping table in the cache, wherein N is a positive integer.
7. The method according to any one of claims 1-4, further comprising:
adding a backup mark to the storage unit; the backup marks are used for representing data of the storage units and written into the backup space;
if an uncorrectable error occurs when reading data from the storage unit again, reading data from the backup space according to a backup address corresponding to a memory address where the storage unit is located, including:
and if an uncorrectable error occurs when the data is read from the storage unit, and the storage unit has the backup mark, reading the data from the backup space according to a backup address corresponding to the memory address of the storage unit.
8. The method of claim 7, further comprising:
responding to a write instruction of the storage unit, and if the storage unit is determined to have the backup mark, determining a backup address corresponding to a memory address where the storage unit is located;
and writing data in the storage unit and the backup address according to the writing instruction.
9. The method according to any one of claims 1 to 4, wherein if an uncorrectable error occurs when data is read from the backup space, outputting information for indicating that the memory has the uncorrectable error.
10. The method according to any one of claims 1-4, wherein the memory is provided in an electronic device, and the electronic device is further provided with a cache;
the size of the storage space of the storage unit is the same as the size of the cache line of the cache.
11. The method according to any one of claims 1-4, wherein determining that the storage unit of the memory is at risk of having an uncorrectable error when reading data from the storage unit comprises:
when data are read from the storage unit of the memory, if the storage unit is determined to have risk of error which can be corrected, error information which can be corrected by the memory is determined; the memory correctable error information is used for determining whether the storage unit has risk of generating uncorrectable errors;
information characterizing that the memory cell is at risk of an uncorrectable error is obtained.
12. The method according to any one of claims 1 to 4,
the writing the data in the storage unit into the backup space includes:
writing the data in the storage unit into a first backup address and a second backup address of the backup space;
the determining that the memory address of the storage unit corresponds to the backup address of the data in the backup space includes:
determining that the memory address of the storage unit corresponds to the first backup address;
the method further comprises the following steps: determining a correspondence between the first backup address and the second backup address.
13. A device for backing up stored data in a memory is characterized in that a backup space is preset in the memory;
the device comprises:
the backup unit is used for writing the data in the storage unit into the backup space and determining that the memory address of the storage unit corresponds to the backup address of the data in the backup space if the risk of uncorrectable errors of the storage unit is determined when the data is read from the storage unit of the memory;
and the backup data reading unit is used for reading the data from the backup space according to the backup address corresponding to the memory address of the storage unit if an uncorrectable error occurs when the data is read from the storage unit again.
14. An electronic device, comprising:
a memory;
a processor; and
a computer program;
wherein the computer program is stored in the memory and configured to be executed by the processor to implement the method of any of claims 1-12.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210506772.7A CN114840364A (en) | 2022-05-07 | 2022-05-07 | Method and device for backing up storage data in memory and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210506772.7A CN114840364A (en) | 2022-05-07 | 2022-05-07 | Method and device for backing up storage data in memory and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114840364A true CN114840364A (en) | 2022-08-02 |
Family
ID=82569583
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210506772.7A Pending CN114840364A (en) | 2022-05-07 | 2022-05-07 | Method and device for backing up storage data in memory and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114840364A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024093299A1 (en) * | 2022-10-31 | 2024-05-10 | 华为技术有限公司 | Memory fault repairing method and apparatus |
-
2022
- 2022-05-07 CN CN202210506772.7A patent/CN114840364A/en active Pending
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2024093299A1 (en) * | 2022-10-31 | 2024-05-10 | 华为技术有限公司 | Memory fault repairing method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
AU2017228544B2 (en) | Nonvolatile media dirty region tracking | |
US8255742B2 (en) | Dynamically replicated memory | |
US9916116B2 (en) | Memory access and detecting memory failures using dynamically replicated memory based on a replication policy | |
US8117496B2 (en) | Detecting and recovering from silent data errors in application cloning systems | |
US10558519B2 (en) | Power-reduced redundant array of independent memory (RAIM) system | |
US20100199126A1 (en) | Disk array apparatus, data distribution and management method, and data distribution and management program | |
TW201535382A (en) | DRAM row sparing | |
US8516208B2 (en) | Data backup method and information processing apparatus | |
JP2010033287A (en) | Storage subsystem and data-verifying method using the same | |
US9092357B2 (en) | Remapping of inoperable memory blocks | |
US11314594B2 (en) | Method, device and computer program product for recovering data | |
US7076686B2 (en) | Hot swapping memory method and system | |
WO2013080299A1 (en) | Data management device, data copy method, and program | |
KR20140086223A (en) | Parity re-synchronization sturcture of disk array and the method thereof | |
CN117667467A (en) | Method for processing memory fault and related equipment thereof | |
CN114840364A (en) | Method and device for backing up storage data in memory and electronic equipment | |
US9128887B2 (en) | Using a buffer to replace failed memory cells in a memory component | |
CN114625563B (en) | Data protection method and device of SSD, readable storage medium and electronic equipment | |
CN111048141B (en) | Error processing method, device, equipment and computer readable storage medium | |
CN103092727B (en) | Data error-correcting method in flash storage medium and device | |
WO2024193273A1 (en) | Memory mirroring method and system, and cluster | |
CN118737239A (en) | Method and system for repairing dynamic random access memory of memory device | |
GB2454597A (en) | Packet receiving buffer where packet sub-blocks are stored as linked list with sequence numbers and start/end flags to detect read out errors | |
JPWO2013080299A1 (en) | Data management apparatus, data copy method, and program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |