WO2021195979A1 - Data storage method and related device - Google Patents

Data storage method and related device Download PDF

Info

Publication number
WO2021195979A1
WO2021195979A1 PCT/CN2020/082483 CN2020082483W WO2021195979A1 WO 2021195979 A1 WO2021195979 A1 WO 2021195979A1 CN 2020082483 W CN2020082483 W CN 2020082483W WO 2021195979 A1 WO2021195979 A1 WO 2021195979A1
Authority
WO
WIPO (PCT)
Prior art keywords
mapping relationship
error rate
data
address
media
Prior art date
Application number
PCT/CN2020/082483
Other languages
French (fr)
Chinese (zh)
Inventor
冉宜
孙亚萍
王金伟
Original Assignee
华为技术有限公司
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080098749.8A priority Critical patent/CN115298654A/en
Priority to PCT/CN2020/082483 priority patent/WO2021195979A1/en
Publication of WO2021195979A1 publication Critical patent/WO2021195979A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation

Definitions

  • This application relates to the field of storage technology, and in particular to a data storage method and related devices.
  • Storage class memory as a new type of non-volatile storage technology, has the characteristics of high read and write speed and high storage density.
  • storage-level memory In order to achieve the characteristics of high storage density, storage-level memory usually adopts a crossbar or crosspoint structure. As shown in FIG. 1, the crossbar array is a structure in which multiple sets of bitlines (BL) and wordlines (WL) are stacked alternately, and the memory cells are controlled by the bitlines and wordlines.
  • BL bitlines
  • WL wordlines
  • the user accesses the storage-level memory through the operating system, specifically by accessing a logical block address (logical block address, LBA), and each LBA is mapped to a corresponding physical block address (physical block address, PBA).
  • LBA logical block address
  • PBA physical block address
  • the physical block address is the underlying physical address of the storage-level memory.
  • Each physical block address corresponds to multiple storage units. Since each storage unit has an independent media address (memory address, MA), each physical block address corresponds to Multiple media addresses.
  • ECC error checking and correcting
  • the length of the check bit used in the error correction and the erroneous data in each physical block address are used. The length is positively correlated. Due to manufacturing defects in the semiconductor process, adjacent memory cells may make errors at the same time. Such errors are called concentrated failures. Concentration failure will increase the length of erroneous data in a single physical block address. Therefore, the length of the parity bit needs to be increased to implement error correction of data errors caused by centralized failure. A longer parity bit increases data redundancy and reduces available storage space.
  • the embodiments of the present application provide a data storage method and related devices, which detect the bit error rate of the current data to select the mapping relationship corresponding to the current data, and use the mapping relationship to store the data. Therefore, it is possible to effectively avoid the use of a centralized failure mapping relationship to store data, thereby reducing the length of the check bit required by the physical block address, and increasing the available storage space.
  • an embodiment of the present application provides a data storage method, which is applied to storage-level memory, and may include: first, detecting a symbol error rate (SER) when reading current data. Secondly, according to the bit error rate, determine the mapping relationship used to store data to the storage-level memory, where the mapping relationship includes the association relationship between the physical block address and the media address, and the mapping relationship is, for example, (physical block address A- Media address B). Again, data storage is performed according to the mapping relationship.
  • SER symbol error rate
  • the storage device can detect the bit error rate of the data (current data) in real time, and then select the mapping relationship corresponding to the current data according to the bit error rate of the current data. Finally, the data is stored according to the selected mapping relationship.
  • the bit error rate of the data corresponding to the mapping relationship for example: the bit error rate of the data stored in the media address B
  • the mapping relationship used to store the data to the storage-level memory is determined. This can effectively avoid the use of a centralized failure mapping relationship (the data in the mapping relationship has a larger bit error rate) to store data, thereby reducing the check bit length required by the physical block address in the mapping relationship, and increasing the available storage space .
  • determining the mapping relationship for storing data to the storage-level memory according to the bit error rate includes: when the bit error rate is greater than a preset threshold, The second mapping relationship is determined as the mapping relationship, where, under the second mapping relationship and the first mapping relationship, the association relationship between the physical block address and the media address is different, and the first mapping relationship is that the current data read When fetching, the storage-level memory performs data storage based on the first mapping relationship.
  • the preset threshold may be 5 bits.
  • the mapping relationship is determined by comparing the relationship between the bit error rate and the preset threshold. When the bit error rate is greater than the preset threshold, the second mapping relationship is determined as the mapping relationship. Due to the high bit error rate, it is necessary to select a mapping relationship (second mapping relationship) that is different from the existing mapping relationship (first mapping relationship), for example: the physical block address A in the first mapping relationship is mapped to media addresses 1-4 , The physical block address B is mapped to the media address 10-15, because when the data stored using the first mapping relationship is read, the bit error rate of the detected data is relatively high.
  • mapping relationship is used to store data, in which physical block address A is mapped to media address 1, 3, 5, or 7, and physical block address B is mapped to media address 10-15. Therefore, it is avoided to use a mapping relationship that has a centralized failure (the centralized failure occurs at certain media addresses in the mapping relationship) to store data.
  • determining the mapping relationship for storing data to the storage-level memory according to the bit error rate includes: when the bit error rate is less than or equal to the When the threshold is preset, the first mapping relationship is determined as the mapping relationship. When the bit error rate is less than or equal to the preset threshold, the first mapping relationship is determined as the mapping relationship. Since the bit error rate is small, there is no need to change the mapping relationship, and the read and write resources of the storage device can be saved.
  • a first mapping relationship is obtained, where the first mapping relationship includes a first physical block address and a first medium address, and the first physical block address and the second A media address is associated, the first mapping relationship is for example (logical block address 1-physical block address 1-media address 1); a second mapping relationship is generated according to the first mapping relationship, and the second mapping relationship includes the first physical The block address and the second media address, the first physical block address is associated with the second media address, the second media address is inconsistent with the first media address, and the second mapping relationship is for example (logical block address 1-physical block Address 1-Media Address 2).
  • the first media address and the second media address are on the same die, or the first media address and the second media address are on different die; if the error rate of the data in the second media address is less than the first media address If the bit error rate of the data in the middle, the second mapping relationship is used to store the data.
  • a first mapping relationship is acquired, and the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address.
  • a second mapping relationship is generated according to the first mapping relationship, the second mapping relationship includes the first physical block address and the second media address, and the first physical block address is associated with the second media address.
  • the media addresses with centralized failures are assigned to different mapping relationships, thereby reducing the amount of error data generated by the centralized failure in a single physical block address, thereby reducing the physical
  • the length of the check bit required by the block address increases the available storage space.
  • the first mapping relationship may further include: generating a third mapping relationship according to the first mapping relationship, the third mapping relationship including the second physical block address, the third medium Address, the second physical block address is associated with the third media address, the second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, the third The media address is inconsistent with the second media address, and the third media address includes part of the first media address.
  • the first medium address included in the first mapping relationship belongs to the management of the third mapping relationship.
  • the third medium address is associated with the second physical block address, and the third medium The address includes part of the first media address. Distribute the centralized failures in the first media address to different mapping relationships, thereby reducing the amount of erroneous data generated due to centralized failures in a single physical block address, thereby reducing the length of the check bit required by the physical block address To increase the available storage space.
  • the first aspect may include: when the first data is read, a first symbol error rate (SER) is detected, where the value of the first data
  • the storage area is the address of the first medium; when the first error rate is greater than or equal to the first threshold, the first data and the second data are backed up, where the storage area of the second data is the second medium Address, the first threshold value is, for example, 5% or 8%.
  • the first error rate may also be the length of the error data.
  • the first threshold may be 5 bits; clear the data stored in the first media address and the second media address; use the second
  • the mapping relationship stores the first data, or the third mapping relationship is used to store the first data.
  • the data storage method proposed in the embodiments of this application can store data using different mapping relationships according to the bit error rate of the data when reading the data, which ensures the reliability of the data during the user’s use, and improves the efficiency of the solution. Achieve flexibility.
  • the first aspect may include: detecting a second bit error rate, where the second bit error rate is the value of the second data stored in the second media address Error rate; when the first error rate is greater than the second error rate, according to the second mapping relationship, the first data in the backup is stored in the second media address and the second media address is detected and stored
  • the bit error rate of the second data is called the second bit error rate.
  • the second data stored in the second media address needs to be backed up, and the bit error rate of the second data is detected in the process of reading the second data ,
  • the bit error rate is also the bit error rate of the second media address.
  • the storage device uses preset data to perform bit error rate detection on the second media address (corresponding storage unit) to obtain the second bit error rate.
  • the second mapping relationship is used to store the data.
  • the storage unit corresponding to the second medium address in the second mapping relationship also has a centralized failure.
  • the storage device needs to use other mapping relationships to store data.
  • the storage device after the storage device generates the second mapping relationship according to the first mapping relationship, it can detect the bit error rate (second bit error rate) of the second medium address in the second mapping relationship.
  • mapping method used when storing data is determined according to the first error rate and the second error rate. It is ensured that the bit error rate in the mapping relationship used by the storage device is low, the check bit length required by the physical block address is reduced, and the available storage space is increased.
  • the first detection instruction may include: acquiring a first detection instruction, where the first detection instruction is used to trigger detection of the bit error rate of the current data, and the first detection instruction It is an instruction that is automatically triggered periodically in the idle state, or the first detection instruction is an instruction that is actively triggered by the user.
  • the first detection instruction may be obtained in various ways, and the first detection instruction is used to trigger the bit error rate of the current data and perform subsequent steps such as selecting the mapping relationship. Improved the flexibility of the solution.
  • the storage device may include: writing third data to the first medium address according to the first detection instruction and the first mapping relationship.
  • the storage device obtains the first detection instruction.
  • the storage device writes third data to the first medium address according to the first detection instruction and the first mapping relationship.
  • the third data is the test data used when detecting the bit error rate.
  • the storage device writes the third data to the second medium address according to the first detection instruction and the second mapping relationship.
  • the media address with a higher error rate may be disabled through the first detection instruction to ensure data security.
  • the storage device backs up the data in the first media address and the data in the second media address according to the first detection instruction. Then, the storage device writes third data into the first media address and the second media address, respectively.
  • the first detection instruction may be an instruction automatically triggered when the storage device is in an idle state. It can also be an instruction that is automatically triggered by the storage device periodically, and there is no restriction here.
  • the first detection instruction and the second mapping relationship write the third data to the second media address; detect a third error rate, the third error rate is the third data in the first media address The fourth error rate is detected, and the fourth error rate is the error rate of the third data in the second media address; the stored data is determined according to the third error rate and the fourth error rate The mapping relationship used at the time.
  • the third error rate is greater than the fourth error rate
  • the first mapping relationship is used to store the data.
  • the second mapping relationship is used to store the data.
  • the third error rate is greater than the first threshold
  • the second mapping relationship is used to store the data; when the fourth error rate is greater than the first threshold, the first The mapping relationship stores data.
  • the storage device can detect the bit error rate of the media address in each current mapping relationship according to the first detection instruction before leaving the factory or during use, and determine the mapping relationship used when storing data according to the bit error rate. To improve the storage security of data.
  • an embodiment of the present application provides a storage device.
  • the storage device may include: a processing module for detecting the bit error rate of the current data; and the processing module for determining the bit error rate for The mapping relationship between data storage to the storage-level memory, where the mapping relationship includes the association relationship between the physical block address and the media address; the storage module is used to store the data using the selected mapping relationship.
  • the processing module is specifically configured to select the changed mapping relationship corresponding to the current data when the bit error rate of the current data is greater than a preset threshold;
  • the processing module is specifically used to select the original mapping relationship corresponding to the current data when the bit error rate of the current data is less than or equal to the preset threshold.
  • the acquiring module is configured to acquire a first mapping relationship, where the first mapping relationship includes the first physical block address and the first medium address, and the first physical block address Associated with the first media address; a processing module, configured to generate a second mapping relationship according to the first mapping relationship, the second mapping relationship including the first physical block address and the second media address, the first physical block address and the second media address Correlation, the second media address is inconsistent with the first media address.
  • the storage module is configured to use the second mapping if the error rate of the data in the second media address is less than the error rate of the data in the first media address Relational storage data.
  • the processing module is further configured to generate a third mapping relationship according to the first mapping relationship, and the third mapping relationship includes the second physical block address and the third media address ,
  • the second physical block address is associated with the third media address
  • the second physical block address is associated with the third media address
  • the second physical block address is inconsistent with the first physical block address
  • the third media address is inconsistent with the second media address
  • the third media address includes part of the first media address; the storage module is also used to store data using the third mapping relationship.
  • the first media address and the second media address are located on the same die, or the first media address and the second media address are located on different die.
  • the storage device further includes: a processing module, which is also used to detect the first bit error rate when reading the first data, where the first data The storage area is the first media address; the storage module is also used to back up the first data and the second data when the first error rate is greater than or equal to the first threshold value, where the storage area of the second data is the second Media address; the storage module is also used to clear the data stored in the first media address and the second media address.
  • a processing module which is also used to detect the first bit error rate when reading the first data, where the first data The storage area is the first media address; the storage module is also used to back up the first data and the second data when the first error rate is greater than or equal to the first threshold value, where the storage area of the second data is the second Media address; the storage module is also used to clear the data stored in the first media address and the second media address.
  • the storage device further includes: a storage module, further configured to store the first data using the second mapping relationship, or store the first data using the third mapping relationship .
  • the storage device further includes: a processing module, which is further configured to detect a second bit error rate, where the second bit error rate is stored in the second medium address The bit error rate of the second data; the processing module is also used to determine the mapping relationship used when storing the data according to the first bit error rate and the second bit error rate.
  • the storage module is specifically configured to store data using a second mapping relationship when the first error rate is greater than the second error rate; the storage module is specifically It is used to store data using the third mapping relationship when the first error rate is less than or equal to the second error rate.
  • the storage module is specifically configured to store the first data in the backup to the second media address according to the second mapping relationship.
  • the storage module is specifically configured to store the second data in the backup to the first media address and the third media address according to the third mapping relationship.
  • the storage device further includes: an acquisition module, which is further configured to acquire a first detection instruction, and the first detection instruction is used to trigger detection of the bit error rate of the current data,
  • the first detection instruction is an instruction that is automatically triggered in the idle state, or the first detection instruction is an instruction that is actively triggered by the user.
  • the storage device further includes: a storage module, further configured to write third data to the first medium address according to the first detection instruction and the first mapping relationship
  • the storage module is also used to write third data to the second media address according to the first detection instruction and the second mapping relationship
  • the processing module is also used to detect the third bit error rate, the third bit error rate is the first The bit error rate of the third data in the media address
  • the processing module is also used to detect the fourth bit error rate, and the fourth bit error rate is the bit error rate of the third data in the second media address
  • the processing module is also used to The third error rate and the fourth error rate determine the mapping relationship used when storing data.
  • the storage module is specifically configured to use the first mapping relationship to store data when the third error rate is greater than the fourth error rate; the storage module specifically It is used to store data using the second mapping relationship when the third error rate is less than or equal to the fourth error rate.
  • the embodiments of the present application provide a computer device.
  • the terminal device includes at least one processor, a memory, a communication port, a display, and computer-executable instructions stored in the memory and running on the processor.
  • the processor executes the foregoing first aspect or any one of the possible implementation manners of the first aspect.
  • embodiments of the present application provide a computer-readable storage medium storing one or more computer-executable instructions.
  • the processor executes the first aspect or the first aspect described above. Any one of the possible implementation methods.
  • the embodiments of the present application provide a computer program product (or computer program) that stores one or more computer-executable instructions.
  • the processor executes the above-mentioned first aspect. Or any possible implementation of the first aspect.
  • the present application provides a chip system including a processor for supporting computer equipment to implement the functions involved in the above aspects.
  • the chip system further includes a memory for storing necessary program instructions and data for the computer equipment.
  • the chip system can be composed of chips, and can also include chips and other discrete devices.
  • an embodiment of the present application also provides a storage device, the storage device includes a processor, a buffer, and a memory, the memory includes one or more storage units, and the buffer stores program instructions; wherein the The processor executes the foregoing first aspect or any one of the possible implementation manners of the first aspect, and stores data in the memory according to the program instruction; the memory is used to store data according to the instruction.
  • Figure 1 is a schematic diagram of the structure of a crossbar array
  • Figure 2 is a schematic diagram of a system framework proposed by an embodiment of the application.
  • FIG. 3 is a schematic diagram of an embodiment of a data storage method proposed in an embodiment of this application.
  • FIG. 4 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application.
  • FIG. 5 is a schematic diagram of another embodiment of a data storage method proposed in an embodiment of this application.
  • FIG. 6 is a schematic diagram of another embodiment of a data storage method proposed in an embodiment of the application.
  • FIG. 7 is a schematic diagram of a mapping relationship proposed in an embodiment of this application.
  • FIG. 8 is a schematic diagram of another mapping relationship proposed by an embodiment of the application.
  • FIG. 9 is a schematic diagram of another mapping relationship proposed in an embodiment of this application.
  • FIG. 10 is a schematic diagram of an association relationship between check digits and data involved in an embodiment of this application.
  • FIG. 11 is a schematic diagram of an embodiment of a storage device in an embodiment of the application.
  • FIG. 12 is a schematic diagram of the hardware structure of the computer device 1200 in an embodiment of the application.
  • the embodiments of the present application provide a data storage method and related devices.
  • a first mapping relationship is obtained.
  • the first mapping relationship includes a first physical block address and a first media address, and the first media address is the same as the first physical block address.
  • a second mapping relationship is generated according to the first mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with the second media address, and the second The media address is inconsistent with the first media address; again, the second mapping relationship is used to store data.
  • the check bit required by the first physical block address is longer, which leads to increased data redundancy and reduces the available storage space of the memory.
  • the second mapping relationship is generated according to the first mapping relationship.
  • the media address managed by the first physical block address is the second media address, which avoids the storage unit that has centralized failure (the first media address corresponds to the Media address). Therefore, when the second mapping relationship is used to store data, the length of the check bit required by the first physical block address can be effectively reduced, and the available storage space is increased.
  • FIG. 2 is a schematic diagram of a system framework according to an embodiment of the application.
  • the data storage method proposed in the embodiments of the present application can be applied to storage-level memory.
  • the host central processing unit, motherboard, etc.
  • the data storage instructions and data read instructions from the host are transmitted to the storage-level memory through the bus.
  • the processor in the storage-level memory processes these instructions, and then reads or writes data from die 1 to die N corresponding to these instructions, where N is a positive integer.
  • the host sends a data read instruction (or data storage instruction) to the storage-level memory through the bus, and the instruction carries the logical block address.
  • the storage-level memory After the storage-level memory receives the instruction, it determines the physical block address corresponding to the logical block address according to the mapping relationship list, and the mapping relationship list is stored in the buffer in the storage-level memory.
  • Each physical block address corresponds to one or more storage units (such as the storage unit shown in Figure 1), and each storage unit has an independent media address. These storage units can be on the same die.
  • the storage unit can also be a storage unit on a different die. Therefore, each physical block address corresponds to one or more media addresses, and the mapping relationship between these physical block addresses and media addresses is also stored in the buffer in the form of a mapping relationship list.
  • Table 1 For ease of understanding, please refer to Table 1.
  • the data storage method proposed in the embodiments of this application can be applied to other storage devices in addition to storage-level memory (SCM), and it is not limited here, such as read-only memory (read-only memory). , ROM), programmable read-only memory (programmable rom, PROM), erasable programmable read-only memory (erasable prom, EPROM), electrically erasable programmable read-only memory (electrically eprom, EEPROM) or flash memory.
  • SCM storage-level memory
  • FIG. 3 is a schematic diagram of an embodiment of a data storage method according to an embodiment of the application.
  • a data storage method proposed in an embodiment of the present application includes:
  • the storage device of the data storage method proposed in the embodiment of the present application is deployed.
  • the bit error rate when reading the current data is detected.
  • determine the mapping relationship used to store data to the storage device in this embodiment, the storage device is a storage-level memory
  • the mapping relationship includes the association relationship between the physical block address and the media address .
  • the second mapping relationship is determined as the mapping relationship, wherein, under the second mapping relationship and the first mapping relationship, the media addresses corresponding to the same physical block address are different, and the first The mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship.
  • the first mapping relationship is determined as the mapping relationship.
  • the first mapping relationship is: the physical block address A is associated with the medium address B, and the mapping relationship is still used Storing data.
  • the first mapping relationship includes a first physical address and a first media address, and the first physical address is associated with the first media address. Refer to Table 2 for the first mapping relationship.
  • the first mapping relationship is cached in a buffer in the storage-level memory in the form of a mapping relationship list.
  • the first mapping relationship may be configured by a computer device, or may be pre-configured before the storage-level memory leaves the factory. No restrictions.
  • the first media address may be multiple media addresses, which is not limited here.
  • the first mapping relationship includes the first physical block address (PBA1) and the first medium address (MA: X000/MA: X001/MA: X010/MA: X011), and the first physical block address is related to the first medium address .
  • the first physical block address manages the first media address.
  • the storage device generates a second mapping relationship according to the first mapping relationship.
  • the second mapping relationship includes the first physical block address and the second media address, the first physical block address is associated with the second media address, and the second The media address is inconsistent with the first media address.
  • the first media address may be one or more media addresses
  • the second media address may be one or more media addresses.
  • the first media address and the second media address may be located on the same die, or may be located on different dies, which is not limited here.
  • the first media address includes multiple media addresses
  • the first media address may be located in the same die or in different die.
  • the second media address may be located in the same die as the first media address, or may be located in a die different from the first media address, which is not limited here.
  • the method for determining the second media address in the second mapping relationship may be pre-configured. For example, when the storage device needs to generate the second mapping relationship, the storage device selects one of all media addresses according to the pre-configured rule. Or multiple media addresses, and a part of the media address (one or more media addresses) is selected from the first media address as the second media address in the second mapping relationship. It may also randomly select one or more media addresses from all the media addresses currently managed, and select part of the media addresses (one or more media addresses) from the first media addresses as the second media addresses in the second mapping relationship, There is no limitation here.
  • the pre-configured rule can be to select a single-digit media address, or a dual-digit media address, or to select one of the media addresses at intervals of N media addresses, where N is a positive integer, and there is no restriction here.
  • the second media address may be one or more media addresses, which is not limited here.
  • the second media address included in the second mapping relationship may be the same as the number of the first media address included in the first mapping relationship.
  • the first media address shown in Table 2 and Table 3 includes 4 media addresses, and the second The media address includes 4 media addresses; the first media address may also be inconsistent with the second media address.
  • the first media address includes: (MA:X0000/MA:X0100/MA:X0010/MA:X0110/MA: X1110)
  • the second media address includes: (MA: X0000/MA: X0100/MA: X0010/MA: X0110), there is no restriction here.
  • ECC error checking and correcting
  • check digit used to check and correct data errors.
  • ECC check bit is set after each physical block address. If some storage units in the current storage device will have a centralized failure, it is necessary to consider that the data length of some physical block addresses with errors is relatively large. Correspondingly, a longer ECC check bit needs to be designed.
  • FIG. 7 is a schematic diagram of a mapping relationship proposed in an embodiment of the application.
  • the first mapping relationship shown in FIG. 7 is the first physical block address "PBA1", and the first media address corresponding to the first physical block address is "(1)/(2)/(3)/(4)" , The first media address is located in the same die "Die1".
  • the storage unit corresponding to the first media address fails, and the data stored in "(1)/(2)/(3)/(4)" has a higher error rate.
  • the media address corresponding to the physical block address "PBA2" is "(5)/(6)/(7)/(8)".
  • a second mapping relationship is generated according to the first mapping relationship.
  • the second mapping relationship includes the first physical block address "PBA1" and the corresponding second media address "(1)/(6)/(3)/(8)".
  • the media address corresponding to the physical block address "PBA2" is "(5)/(2)/(7)/(4)".
  • the first physical block address in the first mapping relationship is "PBA1"
  • the first media address corresponding to the first physical block address is "(1)/(2)/(3) )/(4)”.
  • the second medium address corresponding to the first physical block address is "(1)/(5)/(3)/(4)".
  • FIG. 8 is a schematic diagram of another mapping relationship proposed in an embodiment of this application.
  • the first mapping relationship shown in FIG. 8 is the first physical block address "PBA1", and the first media address corresponding to the first physical block address is "(1)/(2)/(3)/(4)" , The first media address is located in the same die "Die1".
  • the media address corresponding to the physical block address "PBA2" is "(5)/(6)/(7)/(8)", which is located on the same die "Die2".
  • the second medium address corresponding to the first physical block address in the second mapping relationship is "(1)/(6)/(3)/(8)", where the medium The address "(1)/(3)” is located on the die “die1", and the media address "(6)/(8)" is located on the die "die2".
  • the second mapping relationship is stored in the buffer of the storage-level memory in the form of a mapping relationship list.
  • the second mapping relationship is used to store data. Specifically, after the storage device receives the data storage instruction, when the logical block address carried by the data storage instruction is LBA:X0b, the storage device determines the first physical block address (PBA1) corresponding to the logical block address according to the second mapping relationship And the second medium address (MA: X000/MA: X100/MA: X010/MA: X110). The storage device stores relevant data in the storage unit corresponding to the second medium address.
  • PBA1 physical block address
  • MA: X000/MA: X100/MA: X010/MA: X110 the second medium address
  • a first mapping relationship is obtained, and the first mapping relationship includes a first physical block address and a first medium address, and the first medium address is associated with the first physical block address; secondly, according to the first mapping The relationship generates a second mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with a second media address, and the second media address is inconsistent with the first media address; Again, the second mapping relationship is used to store data.
  • the second mapping relationship is generated according to the first mapping relationship.
  • the media address managed by the first physical block address is the second media address, which avoids the storage unit that has centralized failure (the first media address corresponds to the Media address). Therefore, when the second mapping relationship is used to store data, the length of the check bit required by the first physical block address can be effectively reduced, and the available storage space is increased.
  • the data storage method proposed in the embodiments of this application can be applied to a variety of different scenarios, including: (1) During the data storage and reading process of the storage device, the data storage is triggered according to the symbol error rate (SER) Method; (2) Before the storage device leaves the factory, the data storage method is used to determine a better mapping relationship to store data.
  • SER symbol error rate
  • the data storage method is triggered according to the symbol error rate (SER):
  • FIG. 4 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application.
  • the data storage method proposed in the embodiment of the application includes:
  • the storage device reads the first data according to the instruction of the host, and the data stored in the first medium address is called the first data.
  • the storage device uses the ECC check bit to perform error correction on the first data and detects the bit error rate of the first data, and the bit error rate is called the first bit error rate.
  • the first bit error rate may also be the length of the error data, which is not limited here.
  • the user issues a first detection instruction to the storage device, and the storage device reads the first data according to the first detection instruction, and detects the first error.
  • Bit rate The storage device can detect whether a concentration failure occurs in the mapping relationship corresponding to the data by detecting the bit error rate of a certain data according to the first detection instruction.
  • the storage device may also detect the entire disk data according to the first detection instruction.
  • the storage device can also detect the blank medium address (including the mapping relationship of the medium address) according to the first detection instruction, specifically: write the first data to the medium address, and detect the first bit error rate.
  • the first data and the second data are backed up, and the data stored in the second medium address is called the second data.
  • the first threshold is 5%
  • step 402 is entered, and the storage device backs up the first data and the second data to a buffer (Data Buffer). Then, the storage device clears the data in the first medium address and the second medium address.
  • step 403 is entered.
  • the method for obtaining the first mapping relationship is similar to the foregoing step 301, and will not be repeated here.
  • the method of generating the second mapping relationship according to the first mapping relationship is similar to the foregoing step 302, and will not be repeated here.
  • the third mapping relationship is generated according to the first mapping relationship.
  • the third mapping relationship includes a second physical block address, a first media address, and a third media address.
  • the second physical block address is associated with the first media address.
  • the second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, and the third media address is inconsistent with the second media address. Refer to Table 4 for the third mapping relationship.
  • FIG. 9 is a schematic diagram of another mapping relationship proposed in an embodiment of this application.
  • the second mapping relationship and the third mapping relationship are generated in the storage device according to the first mapping relationship.
  • the storage device may use the second mapping relationship to store the first data (the first data is backed up in the buffer), and use the third mapping relationship to store the second data (the second data is backed up in the buffer); or, the storage device
  • the second mapping relationship may also be used to store the second data
  • the third mapping relationship may be used to store the first data; or, the storage device may also use the second mapping relationship to store the first data and the second data; or, the storage device may use the second mapping relationship to store the first data and the second data.
  • the three mapping relationships store the first data and the second data.
  • the storage device may also use the second mapping relationship and/or the third mapping relationship to store other data, which will not be repeated here.
  • the first media address that has a centralized failure is distributed to the management of other physical block addresses, which reduces the proportion of the wrong media addresses in a certain physical block address to the total media addresses. It can effectively reduce the length of the check bit required by the physical block address and increase the available storage space.
  • FIG. 5 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application.
  • the data storage method proposed in the embodiment of the application includes:
  • the mapping used when determining the storage data Before the relationship it is necessary to check the data stored in the second media address.
  • bit error rate of the second data stored in the second media address is detected, and the bit error rate is called the second bit error rate.
  • the bit error rate is also the bit error rate of the second media address.
  • the storage device uses preset data to perform bit error rate detection on the second media address (corresponding storage unit) to obtain the second bit error rate.
  • the mapping relationship used when storing data is determined according to the first error rate and the second error rate. Specifically, when the first error rate is greater than the second error rate, the second mapping relationship is used to store the data. When the first error rate is less than or equal to the second error rate, the storage unit corresponding to the second medium address in the second mapping relationship also has a centralized failure.
  • the storage device needs to use other mapping relationships to store data, for example, using a third mapping relationship to store data.
  • the method for generating the third mapping relationship is similar to the foregoing step 405, and will not be repeated here.
  • the storage device after the storage device generates the second mapping relationship according to the first mapping relationship, it can detect the bit error rate (second bit error rate) of the second medium address in the second mapping relationship.
  • the mapping method used when storing data is determined according to the first error rate and the second error rate. It is ensured that the bit error rate in the mapping relationship used by the storage device is low, the check bit length required by the physical block address is reduced, and the available storage space is increased.
  • FIG. 6 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application.
  • the data storage method proposed in the embodiment of the application includes:
  • the storage device obtains the first detection instruction, and the storage device detects the bit error rate of the media address in each current mapping relationship according to the first detection instruction, and determines the mapping relationship used when storing data according to the bit error rate.
  • the storage device obtains the first detection instruction. First, the storage device writes third data to the first medium address according to the first detection instruction and the first mapping relationship.
  • the third data is the test data used when detecting the bit error rate, such as "000 ⁇ 000” or "111 ⁇ 111". Then, the storage device writes the third data to the second medium address according to the first detection instruction and the second mapping relationship.
  • the media address with a higher error rate may be disabled through the first detection instruction to ensure data security. Specifically, first, the storage device backs up the data in the first media address and the data in the second media address according to the first detection instruction. Then, the storage device writes third data into the first media address and the second media address, respectively.
  • the first detection instruction may be an instruction automatically triggered when the storage device is in an idle state. It can also be an instruction that is automatically triggered by the storage device periodically, and there is no restriction here.
  • the third bit error rate is the bit error rate of the third data in the first medium address.
  • the fourth error rate is the error rate of the third data in the second medium address.
  • the mapping relationship used when storing the data is determined.
  • the first mapping relationship is used to store the data.
  • the second mapping relationship is used to store the data.
  • the third error rate is greater than the first threshold
  • the second mapping relationship is used to store the data; when the fourth error rate is greater than the first threshold, the first The mapping relationship stores data.
  • the storage device can detect the bit error rate of the media address in each current mapping relationship according to the first detection instruction before leaving the factory or during use, and determine the mapping relationship used when storing data according to the bit error rate. To improve the storage security of data.
  • the above-mentioned storage device includes hardware structures and/or software modules corresponding to each function.
  • the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
  • the embodiment of the present application may divide the storage device into functional modules according to the foregoing method examples.
  • each functional module may be divided corresponding to each function, or two or more functions may be integrated into one storage module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
  • FIG. 11 is a schematic diagram of an embodiment of a storage device in an embodiment of this application.
  • the storage device 1100 includes:
  • the processing module 1101 is used to detect the bit error rate when reading the current data
  • the processing module 1101 is further configured to determine a mapping relationship for storing data to the storage-level memory according to the bit error rate, where the mapping relationship includes an association relationship between a physical block address and a media address;
  • the storage module 1102 is used to store data according to the mapping relationship.
  • the processing module 1101 is specifically configured to determine the second mapping relationship as the mapping relationship when the bit error rate is greater than the preset threshold, wherein, under the second mapping relationship and the first mapping relationship, the physical block address and the medium The association relationship between addresses is different, and the first mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship.
  • the processing module 1101 is further configured to determine the first mapping relationship as the mapping relationship when the bit error rate is less than or equal to the preset threshold.
  • the obtaining module 1103 is configured to obtain a first mapping relationship, where the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address;
  • the processing module 1101 is configured to generate a second mapping relationship according to the first mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with the second media address, and the second media address Inconsistent with the address of the first medium;
  • the processing module 1101 is also used to select the second mapping relationship.
  • the storage module 1102 is configured to use the second mapping relationship to store the data if the error rate of the data in the second media address is less than the error rate of the data in the first media address.
  • the processing module 1101 is further configured to generate a third mapping relationship according to the first mapping relationship.
  • the third mapping relationship includes a second physical block address, a third media address, and the second physical block address and the first mapping relationship.
  • the three media addresses are related, the second physical block address is related to the third media address, the second physical block address is inconsistent with the first physical block address, the third media address is inconsistent with the second media address, and the third media address includes part of the A media address.
  • the first media address and the second media address are located on the same die, or the first media address and the second media address are located on different die.
  • the storage device 1100 further includes:
  • the processing module 1101 is also configured to detect the first bit error rate when reading the first data, where the storage area of the first data is the first media address;
  • the storage module 1102 is further configured to back up the first data and the second data when the first error rate is greater than or equal to the first threshold value, where the storage area of the second data is the second media address;
  • the storage module 1102 is also used to clear data stored in the first media address and the second media address.
  • the storage device 1100 further includes:
  • the storage module 1102 is further configured to use the second mapping relationship to store the first data, or use the third mapping relationship to store the first data.
  • the storage device 1100 further includes:
  • the processing module 1101 is further configured to detect a second bit error rate, where the second bit error rate is the bit error rate of the second data stored in the second media address;
  • the processing module 1101 is further configured to determine the mapping relationship used when storing data according to the first error rate and the second error rate.
  • the storage module 1102 is specifically configured to use the second mapping relationship to store data when the first error rate is greater than the second error rate;
  • the storage module 1102 is specifically configured to use the third mapping relationship to store data when the first error rate is less than or equal to the second error rate.
  • the storage module 1102 is specifically configured to store the first data in the backup to the second media address according to the second mapping relationship.
  • the storage module 1102 is specifically configured to store the second data in the backup to the first medium address and the third medium address according to the third mapping relationship.
  • the acquiring module 1103 is also used to acquire the first detection instruction, the first detection instruction is used to trigger the detection of the error rate of the current data, the first detection instruction is automatically triggered when the first detection instruction is in the idle state, or the first detection instruction It is an instruction triggered by the user.
  • the storage device 1100 further includes:
  • the storage module 1102 is further configured to write third data to the first media address according to the first detection instruction and the first mapping relationship;
  • the storage module 1102 is further configured to write third data to the second media address according to the first detection instruction and the second mapping relationship;
  • the processing module 1101 is also used to detect a third bit error rate, where the third bit error rate is the bit error rate of the third data in the first medium address;
  • the processing module 1101 is further configured to detect a fourth bit error rate, where the fourth bit error rate is the bit error rate of the third data in the second medium address;
  • the processing module 1101 is further configured to determine the mapping relationship used when storing data according to the third error rate and the fourth error rate.
  • the storage module 1102 is specifically configured to use the first mapping relationship to store data when the third error rate is greater than the fourth error rate;
  • the storage module 1102 is specifically configured to use the second mapping relationship to store data when the third error rate is less than or equal to the fourth error rate.
  • FIG. 12 is a schematic diagram of the hardware structure of the computer device 1200 in an embodiment of the application. As shown in FIG. 12, the computer device 1200 may include:
  • the computer device 1200 includes at least one processor 1201, a communication line 1207, a memory 1203, and at least one communication interface 1204.
  • the processor 1201 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more programs for controlling the execution of the program of this application. Integrated circuits.
  • the communication line 1207 may include a path to transmit information between the aforementioned components.
  • the communication interface 1204 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet.
  • the memory 1203 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions
  • ROM read-only memory
  • RAM random access memory
  • the dynamic storage device, the memory can exist independently, and is connected to the processor through the communication line 1207.
  • the memory can also be integrated with the processor.
  • the memory 1203 is used to store computer execution instructions for executing the solution of the present application, and the processor 1201 controls the execution.
  • the processor 1201 is configured to execute computer-executable instructions stored in the memory 1203, so as to implement the data storage method provided in the foregoing embodiment of the present application.
  • the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
  • the computer device 1200 may include multiple processors, such as the processor 1201 and the processor 1202 in FIG. 12. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor.
  • the processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
  • the computer device 1200 may further include an output device 1205 and an input device 1206.
  • the output device 1205 communicates with the processor 1201, and can display information in a variety of ways.
  • the input device 1206 communicates with the processor 1201, and can receive user input in a variety of ways.
  • the input device 1206 may be a mouse, a touch screen device, a sensor device, or the like.
  • the processor 1202 may include one or more processing units, for example: the processor 1202 may include an application processor (AP), a modem processor , Graphics processing unit (GPU), image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, And/or neural-network processing unit (NPU), etc.
  • the different processing units may be independent devices or integrated in one or more processors.
  • the terminal device can be a mobile station (MS), subscriber unit (subscriber unit), cellular phone, smart phone, wireless data card, personal digital assistant (personal digital assistant, abbreviated as PDA) ) Computers, tablet computers, wireless modems, handheld devices, laptop computers, machine type communication (MTC) terminal equipment, etc.
  • MS mobile station
  • subscriber unit subscriber unit
  • cellular phone smart phone
  • wireless data card personal digital assistant
  • PDA personal digital assistant
  • Computers tablet computers, wireless modems, handheld devices, laptop computers, machine type communication (MTC) terminal equipment, etc.
  • MTC machine type communication
  • the controller may be the nerve center and command center of the computer device 1200.
  • the controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
  • a memory may also be provided in the processor 1202 for storing instructions and data.
  • the memory in the processor 1202 is a cache memory.
  • the memory can store instructions or data that have just been used or recycled by the processor 1202. If the processor 1202 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 1202 is reduced, and the efficiency of the system is improved.
  • the processor 1202 may include one or more interfaces.
  • the interface may include an integrated circuit (inter-integrated circuit, I1C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I1S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface.
  • I1C integrated circuit
  • I1S integrated circuit built-in audio
  • PCM pulse code modulation
  • PCM pulse code modulation
  • UART universal asynchronous transmitter
  • MIPI mobile industry processor interface
  • GPIO general-purpose input/output
  • SIM subscriber identity module
  • USB Universal Serial Bus
  • the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the computer device 1200.
  • the computer device 1200 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
  • the embodiment of the present application also provides a storage device.
  • the storage device includes a processor, a buffer, and a memory.
  • the memory includes one or more storage units. The steps performed by the storage device in the method described in the embodiment are also used to generate instructions; the memory is used to store data according to the instructions.
  • the storage device may be a non-embedded storage device or an embedded storage device. It should be understood that the specific expression form of the storage device should be flexibly set according to actual conditions, and is not limited here.
  • the embodiment of the present application also provides a computer program product containing storage block management instructions, which when running on a computer, causes the computer to execute the method described in the foregoing embodiments shown in FIGS. 2 to 8 as executed by the storage device A step of.
  • the embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores storage block processing instructions, and when it runs on a computer, the computer executes the instructions shown in FIGS. 2 to 8 above. The steps performed by the storage device in the method described in the embodiment.
  • the embodiments of the present application also provide a chip system
  • the chip system includes a processor, used to support network equipment to achieve the functions involved in the above aspects, for example, for example, send or process the data and/or information involved in the above methods .
  • the chip system further includes a memory, and the memory is used to store necessary program instructions and data of the network device.
  • the chip system can be composed of chips, and can also include chips and other discrete devices.
  • the computer program product includes one or more computer instructions.
  • the computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
  • Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium.
  • Computer instructions may be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
  • a cable such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center.
  • the computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or a data center integrated with one or more available media.
  • the usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium, or a semiconductor medium, such as a solid state disk (SSD).
  • the disclosed system, device, and method can be implemented in other ways.
  • the device embodiments described above are only illustrative.
  • the division of modules is only a logical function division, and there may be other divisions in actual implementation, for example, multiple modules or components can be combined or integrated. To another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may be in electrical, mechanical or other forms.
  • the modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
  • the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module.
  • the above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
  • the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium.
  • the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks and other media that can store program codes. .

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)

Abstract

Embodiments of the present application disclose a data storage method and a related device. The method is applicable to a storage class memory, and comprises: measuring a bit error rate when current data is being read; determining, according to the bit error rate, a mapping relationship used to store the data to a storage class memory, wherein the mapping relationship comprises an association between a physical block address and a memory address; and performing data storage according to the mapping relationship. A bit error rate is measured when current data is being read, so as to determine a mapping relationship for storing the data to a storage class memory, and to perform data storage according to the mapping relationship, thereby effectively avoiding the use of a mapping relationship associated with a centralized memory failure for data storage, and accordingly reducing the check bit length required for a physical block address in a mapping relationship, and increasing an available storage space.

Description

一种数据存储方法以及相关装置Data storage method and related device 技术领域Technical field
本申请涉及存储技术领域,尤其涉及一种数据存储方法以及相关装置。This application relates to the field of storage technology, and in particular to a data storage method and related devices.
背景技术Background technique
存储级内存(storage class memory,SCM)作为一种新型的非易失性存储技术,具有高读写速度以及高存储密度等特点。为了实现高存储密度的特点,存储级内存通常采用交叉开关阵列(crossbar或crosspoint)结构。如图1所示,交叉开关阵列是一种多组位线(bitline,BL)和字线(wordline,WL)交错堆叠的结构,通过位线与字线控制存储单元。Storage class memory (SCM), as a new type of non-volatile storage technology, has the characteristics of high read and write speed and high storage density. In order to achieve the characteristics of high storage density, storage-level memory usually adopts a crossbar or crosspoint structure. As shown in FIG. 1, the crossbar array is a structure in which multiple sets of bitlines (BL) and wordlines (WL) are stacked alternately, and the memory cells are controlled by the bitlines and wordlines.
在实际应用中,用户通过操作系统访问该存储级内存,具体是访问逻辑块地址(logical block address,LBA),每个LBA映射至对应的物理块地址(physical block address,PBA)。物理块地址是该存储级内存底层的物理地址,每个物理块地址对应多个存储单元,由于每个存储单元存在独立的介质地址(memory address,MA),因此,每个物理块地址对应于多个介质地址。In practical applications, the user accesses the storage-level memory through the operating system, specifically by accessing a logical block address (logical block address, LBA), and each LBA is mapped to a corresponding physical block address (physical block address, PBA). The physical block address is the underlying physical address of the storage-level memory. Each physical block address corresponds to multiple storage units. Since each storage unit has an independent media address (memory address, MA), each physical block address corresponds to Multiple media addresses.
为了纠正存储级内存存储数据时产生的错误,通常使用错误检查和纠正(error checking and correcting,ECC)对数据进行纠错,纠错时使用的校验位长度与每个物理块地址中错误数据的长度正相关。由于半导体工艺的制造缺陷,相邻的存储单元可能会同时出错,这样的错误称为集中性失效。集中性失效会增加单个物理块地址中错误数据的长度。因此,需要增加校验位的长度,以实现对集中性失效所造成的数据错误进行纠错。较长的校验位导致数据冗余增加,降低可用存储空间。In order to correct the errors generated when storing data in storage-level memory, error checking and correcting (ECC) is usually used to correct the data. The length of the check bit used in the error correction and the erroneous data in each physical block address are used. The length is positively correlated. Due to manufacturing defects in the semiconductor process, adjacent memory cells may make errors at the same time. Such errors are called concentrated failures. Concentration failure will increase the length of erroneous data in a single physical block address. Therefore, the length of the parity bit needs to be increased to implement error correction of data errors caused by centralized failure. A longer parity bit increases data redundancy and reduces available storage space.
发明内容Summary of the invention
有鉴于此,本申请实施例提供了一种数据存储方法以及相关装置,通过检测当前数据的误码率,以选择该当前数据对应的映射关系,并使用该映射关系存储数据。从而可以有效避免使用发生集中性失效的映射关系存储数据,进而减少该物理块地址所需要的校验位长度,增加了可用存储空间。In view of this, the embodiments of the present application provide a data storage method and related devices, which detect the bit error rate of the current data to select the mapping relationship corresponding to the current data, and use the mapping relationship to store the data. Therefore, it is possible to effectively avoid the use of a centralized failure mapping relationship to store data, thereby reducing the length of the check bit required by the physical block address, and increasing the available storage space.
第一方面,本申请实施例提供了一种数据存储方法,该数据存储方法应用于存储级内存,可以包括:首先,检测当前数据读取时的误码率(symbol error rate,SER)。其次,根据该误码率,确定用于将数据存储至存储级内存的映射关系,其中,该映射关系包括物理块地址与介质地址之间的关联关系,该映射关系例如(物理块地址A-介质地址B)。再次,根据映射关系进行数据存储。In the first aspect, an embodiment of the present application provides a data storage method, which is applied to storage-level memory, and may include: first, detecting a symbol error rate (SER) when reading current data. Secondly, according to the bit error rate, determine the mapping relationship used to store data to the storage-level memory, where the mapping relationship includes the association relationship between the physical block address and the media address, and the mapping relationship is, for example, (physical block address A- Media address B). Again, data storage is performed according to the mapping relationship.
本申请实施例中,存储装置可以实时地检测数据(当前数据)的误码率,然后,根据该当前数据的误码率,选择当前数据对应的映射关系。最后,根据所选择的映射关系存储数据。通过检测映射关系所对应数据的误码率,例如:介质地址B中存储数据的误码率,确定该映射关系(物理块地址A-介质地址B)中是否发生集中性失效。具体的,根据该误 码率,选择使用什么样的映射关系存储数据。通过检测当前数据读取时的误码率,以确定用于将数据存储至存储级内存的映射关系。从而可以有效避免使用发生集中性失效的映射关系(该映射关系中数据的误码率较大)存储数据,进而减少该映射关系中物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, the storage device can detect the bit error rate of the data (current data) in real time, and then select the mapping relationship corresponding to the current data according to the bit error rate of the current data. Finally, the data is stored according to the selected mapping relationship. By detecting the bit error rate of the data corresponding to the mapping relationship, for example: the bit error rate of the data stored in the media address B, it is determined whether a centralized failure occurs in the mapping relationship (physical block address A-media address B). Specifically, according to the bit error rate, choose what mapping relationship to use to store the data. By detecting the bit error rate when the current data is read, the mapping relationship used to store the data to the storage-level memory is determined. This can effectively avoid the use of a centralized failure mapping relationship (the data in the mapping relationship has a larger bit error rate) to store data, thereby reducing the check bit length required by the physical block address in the mapping relationship, and increasing the available storage space .
结合第一方面,在第一方面的一种可能的实现方式中,根据误码率,确定用于将数据存储至存储级内存的映射关系,包括:当该误码率大于预设门限时,将第二映射关系确定为该映射关系,其中,在该第二映射关系与第一映射关系下,物理块地址与介质地址之间的关联关系不同,该第一映射关系为,该当前数据读取时,该存储级内存基于该第一映射关系进行数据存储。在一种可选的实现方式中,该预设门限可以为5比特。With reference to the first aspect, in a possible implementation of the first aspect, determining the mapping relationship for storing data to the storage-level memory according to the bit error rate includes: when the bit error rate is greater than a preset threshold, The second mapping relationship is determined as the mapping relationship, where, under the second mapping relationship and the first mapping relationship, the association relationship between the physical block address and the media address is different, and the first mapping relationship is that the current data read When fetching, the storage-level memory performs data storage based on the first mapping relationship. In an optional implementation manner, the preset threshold may be 5 bits.
本申请实施例中,通过比较该误码率与预设门限之间的关系,确定映射关系。当误码率大于预设门限时,将第二映射关系确定为该映射关系。由于误码率较大,因此需要选择与现有映射关系(第一映射关系)不同的映射关系(第二映射关系),例如:第一映射关系中物理块地址A映射至介质地址1-4,物理块地址B映射至介质地址10-15,由于在读取使用该第一映射关系存储的数据时,检测到该数据的误码率较高。因此,使用第二映射关系存储数据,该第二映射关系中物理块地址A映射到介质地址1、3、5或7,物理块地址B映射到介质地址10-15。从而避免使用发生集中性失效的映射关系(该集中性失效发生于该映射关系中的某一些介质地址)存储数据。In the embodiment of the present application, the mapping relationship is determined by comparing the relationship between the bit error rate and the preset threshold. When the bit error rate is greater than the preset threshold, the second mapping relationship is determined as the mapping relationship. Due to the high bit error rate, it is necessary to select a mapping relationship (second mapping relationship) that is different from the existing mapping relationship (first mapping relationship), for example: the physical block address A in the first mapping relationship is mapped to media addresses 1-4 , The physical block address B is mapped to the media address 10-15, because when the data stored using the first mapping relationship is read, the bit error rate of the detected data is relatively high. Therefore, a second mapping relationship is used to store data, in which physical block address A is mapped to media address 1, 3, 5, or 7, and physical block address B is mapped to media address 10-15. Therefore, it is avoided to use a mapping relationship that has a centralized failure (the centralized failure occurs at certain media addresses in the mapping relationship) to store data.
结合第一方面,在第一方面的一种可能的实现方式中,根据该误码率,确定用于将数据存储至该存储级内存的映射关系,包括:当该误码率小于或等于该预设门限时,将该第一映射关系确定为该映射关系。当误码率小于或等于预设门限时,将第一映射关系确定为映射关系。由于误码率较小,因此无需变更映射关系,可以节省存储装置的读写资源。With reference to the first aspect, in a possible implementation of the first aspect, determining the mapping relationship for storing data to the storage-level memory according to the bit error rate includes: when the bit error rate is less than or equal to the When the threshold is preset, the first mapping relationship is determined as the mapping relationship. When the bit error rate is less than or equal to the preset threshold, the first mapping relationship is determined as the mapping relationship. Since the bit error rate is small, there is no need to change the mapping relationship, and the read and write resources of the storage device can be saved.
结合第一方面,在第一方面的一种可能的实现方式中,获取第一映射关系,该第一映射关系包括第一物理块地址与第一介质地址,该第一物理块地址与该第一介质地址相关联,该第一映射关系例如(逻辑块地址1-物理块地址1-介质地址1);根据该第一映射关系生成第二映射关系,该第二映射关系包括该第一物理块地址与第二介质地址,该第一物理块地址与该第二介质地址相关联,该第二介质地址与该第一介质地址不一致,该第二映射关系例如(逻辑块地址1-物理块地址1-介质地址2)。该第一介质地址与该第二介质地址位于同一裸片,或,该第一介质地址与该第二介质地址位于不同裸片;若第二介质地址中数据的误码率小于第一介质地址中数据的误码率,则使用该第二映射关系存储数据。With reference to the first aspect, in a possible implementation of the first aspect, a first mapping relationship is obtained, where the first mapping relationship includes a first physical block address and a first medium address, and the first physical block address and the second A media address is associated, the first mapping relationship is for example (logical block address 1-physical block address 1-media address 1); a second mapping relationship is generated according to the first mapping relationship, and the second mapping relationship includes the first physical The block address and the second media address, the first physical block address is associated with the second media address, the second media address is inconsistent with the first media address, and the second mapping relationship is for example (logical block address 1-physical block Address 1-Media Address 2). The first media address and the second media address are on the same die, or the first media address and the second media address are on different die; if the error rate of the data in the second media address is less than the first media address If the bit error rate of the data in the middle, the second mapping relationship is used to store the data.
本申请实施例中,获取第一映射关系,该第一映射关系包括第一物理块地址与第一介质地址,该第一物理块地址与该第一介质地址相关联。然后,根据第一映射关系生成第二映射关系,该第二映射关系包括该第一物理块地址与第二介质地址,该第一物理块地址与该第二介质地址相关联。在存储数据时,若第二介质地址中数据的误码率小于第一介质地址中数据的误码率,则使用第二映射关系存储数据。通过变更物理块地址与介质地址之间的映射关系,使得发生集中性失效的介质地址归属到不同映射关系,从而降低单个物理块地址中因集中性失效而产生的错误数据量,进而减少该物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, a first mapping relationship is acquired, and the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address. Then, a second mapping relationship is generated according to the first mapping relationship, the second mapping relationship includes the first physical block address and the second media address, and the first physical block address is associated with the second media address. When storing data, if the error rate of the data in the second media address is less than the error rate of the data in the first media address, the second mapping relationship is used to store the data. By changing the mapping relationship between the physical block address and the media address, the media addresses with centralized failures are assigned to different mapping relationships, thereby reducing the amount of error data generated by the centralized failure in a single physical block address, thereby reducing the physical The length of the check bit required by the block address increases the available storage space.
结合第一方面,在第一方面的一种可能的实现方式中,还可以包括:根据该第一映射关系生成第三映射关系,该第三映射关系包括第二物理块地址、该第三介质地址,该第二物理块地址与该第三介质地址相关联,该第二物理块地址与该第三介质地址相关联,该第二物理块地址与该第一物理块地址不一致,该第三介质地址与该第二介质地址不一致,该第三介质地址包括部分该第一介质地址。例如:第一映射关系为:第一物理块地址LBA=X0b,第一介质地址(MA:X000/MA:X001/MA:X010/MA:X011)。根据第一映射关系生成第三映射关系,包括:第二物理块地址LBA=X1b,第三介质地址(MA:X000/MA:X101/MA:X110/MA:X111),该第三介质地址中包括部分第一介质地址“MA:X000”;使用该第三映射关系存储数据。With reference to the first aspect, in a possible implementation of the first aspect, it may further include: generating a third mapping relationship according to the first mapping relationship, the third mapping relationship including the second physical block address, the third medium Address, the second physical block address is associated with the third media address, the second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, the third The media address is inconsistent with the second media address, and the third media address includes part of the first media address. For example, the first mapping relationship is: the first physical block address LBA=X0b, and the first medium address (MA: X000/MA: X001/MA: X010/MA: X011). The third mapping relationship is generated according to the first mapping relationship, including: the second physical block address LBA=X1b, the third medium address (MA: X000/MA: X101/MA: X110/MA: X111), and the third medium address is Including part of the first media address "MA: X000"; use the third mapping relationship to store data.
本申请实施例中,第一映射关系包括的第一介质地址,归属到第三映射关系的管理中,该第三映射关系中第三介质地址与第二物理块地址相关联,该第三介质地址中包括部分第一介质地址。使得第一介质地址中发生的集中性失效分散到不同的映射关系中,从而降低单个物理块地址中因集中性失效而产生的错误数据量,进而减少该物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, the first medium address included in the first mapping relationship belongs to the management of the third mapping relationship. In the third mapping relationship, the third medium address is associated with the second physical block address, and the third medium The address includes part of the first media address. Distribute the centralized failures in the first media address to different mapping relationships, thereby reducing the amount of erroneous data generated due to centralized failures in a single physical block address, thereby reducing the length of the check bit required by the physical block address To increase the available storage space.
结合第一方面,在第一方面的一种可能的实现方式中,可以包括:读取第一数据时,检测得到第一误码率(symbol error rate,SER),其中,该第一数据的存储区域为该第一介质地址;当该第一误码率大于或等于第一门限值时,备份该第一数据与第二数据,其中,该第二数据的存储区域为该第二介质地址,该第一门限值例如5%或8%。该第一误码率也可以是错误数据长度,此时,第一门限值可以是5比特(bit);清空该第一介质地址与该第二介质地址中存储的数据;使用该第二映射关系存储该第一数据,或,使用该第三映射关系存储该第一数据。本申请实施例提出的数据存储方法,可以在读取数据时,根据数据的误码率,使用不同的映射关系存储数据,保证了用户在使用过程中,数据的可靠性,并且提升了方案的实现灵活性。With reference to the first aspect, in a possible implementation of the first aspect, it may include: when the first data is read, a first symbol error rate (SER) is detected, where the value of the first data The storage area is the address of the first medium; when the first error rate is greater than or equal to the first threshold, the first data and the second data are backed up, where the storage area of the second data is the second medium Address, the first threshold value is, for example, 5% or 8%. The first error rate may also be the length of the error data. In this case, the first threshold may be 5 bits; clear the data stored in the first media address and the second media address; use the second The mapping relationship stores the first data, or the third mapping relationship is used to store the first data. The data storage method proposed in the embodiments of this application can store data using different mapping relationships according to the bit error rate of the data when reading the data, which ensures the reliability of the data during the user’s use, and improves the efficiency of the solution. Achieve flexibility.
结合第一方面,在第一方面的一种可能的实现方式中,可以包括:检测第二误码率,其中,该第二误码率为该第二介质地址中存储的该第二数据的误码率;当该第一误码率大于该第二误码率,则根据该第二映射关系,将该备份中的该第一数据存储至该第二介质地址检测第二介质地址中存储的第二数据的误码率,该误码率称为第二误码率。在一种可选的实现方式中,当生成第二映射关系前,需要备份该第二介质地址中存储的第二数据,读取该第二数据的过程中检测该第二数据的误码率,该误码率也是第二介质地址的误码率。在另一种可选的实现方式中,在备份该第二数据后,首先,清空该第二介质地址中存储的数据。其次,存储装置使用预置数据对第二介质地址(对应的存储单元)进行误码率检测,得到第二误码率。当第一误码率大于第二误码率时,使用第二映射关系存储数据。当第一误码率小于或等于第二误码率,则该第二映射关系中第二介质地址所对应的存储单元也存在集中性失效。存储装置需要使用其它的映射关系存储数据。本申请实施例中,存储装置根据第一映射关系生成第二映射关系后,可以检测第二映射关系中第二介质地址的误码率(第二误码率)。根据第一误码率与第二误码率确定存储数据时使用的映射方式。确保存储装置使用的映射关系中误码率较低,减少物理块地址所需要的校验位长度,增加了可用存储空间。With reference to the first aspect, in a possible implementation of the first aspect, it may include: detecting a second bit error rate, where the second bit error rate is the value of the second data stored in the second media address Error rate; when the first error rate is greater than the second error rate, according to the second mapping relationship, the first data in the backup is stored in the second media address and the second media address is detected and stored The bit error rate of the second data is called the second bit error rate. In an optional implementation manner, before generating the second mapping relationship, the second data stored in the second media address needs to be backed up, and the bit error rate of the second data is detected in the process of reading the second data , The bit error rate is also the bit error rate of the second media address. In another optional implementation manner, after backing up the second data, first, clear the data stored in the second media address. Secondly, the storage device uses preset data to perform bit error rate detection on the second media address (corresponding storage unit) to obtain the second bit error rate. When the first error rate is greater than the second error rate, the second mapping relationship is used to store the data. When the first error rate is less than or equal to the second error rate, the storage unit corresponding to the second medium address in the second mapping relationship also has a centralized failure. The storage device needs to use other mapping relationships to store data. In the embodiment of the present application, after the storage device generates the second mapping relationship according to the first mapping relationship, it can detect the bit error rate (second bit error rate) of the second medium address in the second mapping relationship. The mapping method used when storing data is determined according to the first error rate and the second error rate. It is ensured that the bit error rate in the mapping relationship used by the storage device is low, the check bit length required by the physical block address is reduced, and the available storage space is increased.
结合第一方面,在第一方面的一种可能的实现方式中,可以包括:获取第一检测指令, 该第一检测指令用于触发检测该当前数据的该误码率,该第一检测指令为空闲状态时周期性自动触发的指令,或,该第一检测指令为用户主动触发的指令。可以通过多种方式获取第一检测指令,该第一检测指令用于触发当前数据的误码率,并进行后续选择映射关系等步骤。提升了本方案的实现灵活性。With reference to the first aspect, in a possible implementation of the first aspect, it may include: acquiring a first detection instruction, where the first detection instruction is used to trigger detection of the bit error rate of the current data, and the first detection instruction It is an instruction that is automatically triggered periodically in the idle state, or the first detection instruction is an instruction that is actively triggered by the user. The first detection instruction may be obtained in various ways, and the first detection instruction is used to trigger the bit error rate of the current data and perform subsequent steps such as selecting the mapping relationship. Improved the flexibility of the solution.
结合第一方面,在第一方面的一种可能的实现方式中,可以包括:根据第一检测指令和该第一映射关系,向该第一介质地址写入第三数据。在一种可选的实现方式中,在存储装置出厂前,该存储装置获取该第一检测指令。首先,存储装置根据该第一检测指令和第一映射关系,向第一介质地址写入第三数据。该第三数据为检测误码率时使用的测试数据。然后,存储装置根据该第一检测指令和第二映射关系,向第二介质地址写入第三数据。在另一种可选的实现方式中,在用户使用该存储装置的过程中,可以通过第一检测指令禁用误码率较高的介质地址,以保证数据的安全性。具体的,首先,存储装置根据第一检测指令备份第一介质地址中的数据,和第二介质地址中的数据。然后,存储装置向第一介质地址与第二介质地址中分别写入第三数据。在另一种可选的实现方式中,该第一检测指令可以是存储装置处于空闲状态时,自动触发的指令。也可以是存储装置周期性自动触发的指令,此处不做限制。根据该第一检测指令和该第二映射关系,向该第二介质地址写入该第三数据;检测第三误码率,该第三误码率为该第一介质地址中该第三数据的误码率;检测第四误码率,该第四误码率为该第二介质地址中该第三数据的误码率;根据第三误码率和第四误码率,确定存储数据时使用的映射关系。在一种可选的实现方式中,当第三误码率大于第四误码率时,使用第一映射关系存储数据。当第三误码率小于或等于第四误码率时,使用第二映射关系存储数据。在另一种可选的实现方式中,当第三误码率大于第一门限值时,使用第二映射关系存储数据;当第四误码率大于第一门限值时,使用第一映射关系存储数据。With reference to the first aspect, in a possible implementation of the first aspect, it may include: writing third data to the first medium address according to the first detection instruction and the first mapping relationship. In an optional implementation manner, before the storage device leaves the factory, the storage device obtains the first detection instruction. First, the storage device writes third data to the first medium address according to the first detection instruction and the first mapping relationship. The third data is the test data used when detecting the bit error rate. Then, the storage device writes the third data to the second medium address according to the first detection instruction and the second mapping relationship. In another optional implementation manner, when the user uses the storage device, the media address with a higher error rate may be disabled through the first detection instruction to ensure data security. Specifically, first, the storage device backs up the data in the first media address and the data in the second media address according to the first detection instruction. Then, the storage device writes third data into the first media address and the second media address, respectively. In another optional implementation manner, the first detection instruction may be an instruction automatically triggered when the storage device is in an idle state. It can also be an instruction that is automatically triggered by the storage device periodically, and there is no restriction here. According to the first detection instruction and the second mapping relationship, write the third data to the second media address; detect a third error rate, the third error rate is the third data in the first media address The fourth error rate is detected, and the fourth error rate is the error rate of the third data in the second media address; the stored data is determined according to the third error rate and the fourth error rate The mapping relationship used at the time. In an optional implementation manner, when the third error rate is greater than the fourth error rate, the first mapping relationship is used to store the data. When the third error rate is less than or equal to the fourth error rate, the second mapping relationship is used to store the data. In another optional implementation manner, when the third error rate is greater than the first threshold, the second mapping relationship is used to store the data; when the fourth error rate is greater than the first threshold, the first The mapping relationship stores data.
本申请实施例中,存储装置在出厂前或使用过程中,可以根据第一检测指令检测当前各个映射关系中介质地址的误码率,根据该误码率确定存储数据时使用的映射关系。以提升数据的存储安全性。In the embodiment of the present application, the storage device can detect the bit error rate of the media address in each current mapping relationship according to the first detection instruction before leaving the factory or during use, and determine the mapping relationship used when storing data according to the bit error rate. To improve the storage security of data.
第二方面,本申请实施例提供了一种存储装置,该存储装置可以包括:处理模块,用于检测当前数据的误码率;处理模块,还用于根据该误码率,确定用于将数据存储至该存储级内存的映射关系,其中,该映射关系包括物理块地址与介质地址之间的关联关系;存储模块,用于使用所选择的映射关系存储数据。In a second aspect, an embodiment of the present application provides a storage device. The storage device may include: a processing module for detecting the bit error rate of the current data; and the processing module for determining the bit error rate for The mapping relationship between data storage to the storage-level memory, where the mapping relationship includes the association relationship between the physical block address and the media address; the storage module is used to store the data using the selected mapping relationship.
结合第二方面,在第二方面的一种可能的实现方式中,该处理模块,具体用于该当前数据的误码率大于预设门限时,选择变更后的该当前数据对应的映射关系;该处理模块,具体用于该当前数据的误码率小于或等于该预设门限时,选择原有的该当前数据对应的映射关系。With reference to the second aspect, in a possible implementation of the second aspect, the processing module is specifically configured to select the changed mapping relationship corresponding to the current data when the bit error rate of the current data is greater than a preset threshold; The processing module is specifically used to select the original mapping relationship corresponding to the current data when the bit error rate of the current data is less than or equal to the preset threshold.
结合第二方面,在第二方面的一种可能的实现方式中,获取模块,用于获取第一映射关系,第一映射关系包括第一物理块地址与第一介质地址,第一物理块地址与第一介质地址相关联;处理模块,用于根据第一映射关系生成第二映射关系,第二映射关系包括第一物理块地址与第二介质地址,第一物理块地址与第二介质地址相关联,第二介质地址与第一介质地址不一致。With reference to the second aspect, in a possible implementation of the second aspect, the acquiring module is configured to acquire a first mapping relationship, where the first mapping relationship includes the first physical block address and the first medium address, and the first physical block address Associated with the first media address; a processing module, configured to generate a second mapping relationship according to the first mapping relationship, the second mapping relationship including the first physical block address and the second media address, the first physical block address and the second media address Correlation, the second media address is inconsistent with the first media address.
结合第二方面,在第二方面的一种可能的实现方式中,存储模块,用于若第二介质地址中数据的误码率小于第一介质地址中数据的误码率,使用第二映射关系存储数据。With reference to the second aspect, in a possible implementation of the second aspect, the storage module is configured to use the second mapping if the error rate of the data in the second media address is less than the error rate of the data in the first media address Relational storage data.
结合第二方面,在第二方面的一种可能的实现方式中,处理模块,还用于根据第一映射关系生成第三映射关系,第三映射关系包括第二物理块地址、第三介质地址,第二物理块地址与第三介质地址相关联,第二物理块地址与第三介质地址相关联,第二物理块地址与第一物理块地址不一致,第三介质地址与第二介质地址不一致,第三介质地址包括部分第一介质地址;存储模块,还用于使用第三映射关系存储数据。With reference to the second aspect, in a possible implementation of the second aspect, the processing module is further configured to generate a third mapping relationship according to the first mapping relationship, and the third mapping relationship includes the second physical block address and the third media address , The second physical block address is associated with the third media address, the second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, and the third media address is inconsistent with the second media address , The third media address includes part of the first media address; the storage module is also used to store data using the third mapping relationship.
结合第二方面,在第二方面的一种可能的实现方式中,第一介质地址与第二介质地址位于同一裸片,或,第一介质地址与第二介质地址位于不同裸片。With reference to the second aspect, in a possible implementation of the second aspect, the first media address and the second media address are located on the same die, or the first media address and the second media address are located on different die.
结合第二方面,在第二方面的一种可能的实现方式中,存储装置还包括:处理模块,还用于读取第一数据时,检测得到第一误码率,其中,第一数据的存储区域为第一介质地址;存储模块,还用于当第一误码率大于或等于第一门限值时,备份第一数据与第二数据,其中,第二数据的存储区域为第二介质地址;存储模块,还用于清空第一介质地址与第二介质地址中存储的数据。With reference to the second aspect, in a possible implementation of the second aspect, the storage device further includes: a processing module, which is also used to detect the first bit error rate when reading the first data, where the first data The storage area is the first media address; the storage module is also used to back up the first data and the second data when the first error rate is greater than or equal to the first threshold value, where the storage area of the second data is the second Media address; the storage module is also used to clear the data stored in the first media address and the second media address.
结合第二方面,在第二方面的一种可能的实现方式中,存储装置还包括:存储模块,还用于使用第二映射关系存储第一数据,或,使用第三映射关系存储第一数据。With reference to the second aspect, in a possible implementation of the second aspect, the storage device further includes: a storage module, further configured to store the first data using the second mapping relationship, or store the first data using the third mapping relationship .
结合第二方面,在第二方面的一种可能的实现方式中,存储装置还包括:处理模块,还用于检测第二误码率,其中,第二误码率为第二介质地址中存储的第二数据的误码率;处理模块,还用于根据第一误码率和第二误码率,确定存储数据时使用的映射关系。With reference to the second aspect, in a possible implementation of the second aspect, the storage device further includes: a processing module, which is further configured to detect a second bit error rate, where the second bit error rate is stored in the second medium address The bit error rate of the second data; the processing module is also used to determine the mapping relationship used when storing the data according to the first bit error rate and the second bit error rate.
结合第二方面,在第二方面的一种可能的实现方式中,存储模块,具体用于当第一误码率大于第二误码率,则使用第二映射关系存储数据;存储模块,具体用于当第一误码率小于或等于第二误码率,则使用第三映射关系存储数据。With reference to the second aspect, in a possible implementation of the second aspect, the storage module is specifically configured to store data using a second mapping relationship when the first error rate is greater than the second error rate; the storage module is specifically It is used to store data using the third mapping relationship when the first error rate is less than or equal to the second error rate.
结合第二方面,在第二方面的一种可能的实现方式中,存储模块,具体用于根据第二映射关系,将备份中的第一数据存储至第二介质地址。With reference to the second aspect, in a possible implementation of the second aspect, the storage module is specifically configured to store the first data in the backup to the second media address according to the second mapping relationship.
结合第二方面,在第二方面的一种可能的实现方式中,存储模块,具体用于根据第三映射关系,将备份中的第二数据存储至第一介质地址和第三介质地址。With reference to the second aspect, in a possible implementation of the second aspect, the storage module is specifically configured to store the second data in the backup to the first media address and the third media address according to the third mapping relationship.
结合第二方面,在第二方面的一种可能的实现方式中,存储装置还包括:获取模块,还用于获取第一检测指令,第一检测指令用于触发检测当前数据的误码率,第一检测指令为空闲状态时自动触发的指令,或,第一检测指令为用户主动触发的指令。With reference to the second aspect, in a possible implementation of the second aspect, the storage device further includes: an acquisition module, which is further configured to acquire a first detection instruction, and the first detection instruction is used to trigger detection of the bit error rate of the current data, The first detection instruction is an instruction that is automatically triggered in the idle state, or the first detection instruction is an instruction that is actively triggered by the user.
结合第二方面,在第二方面的一种可能的实现方式中,存储装置还包括:存储模块,还用于根据第一检测指令和第一映射关系,向第一介质地址写入第三数据;存储模块,还用于根据第一检测指令和第二映射关系,向第二介质地址写入第三数据;处理模块,还用于检测第三误码率,第三误码率为第一介质地址中第三数据的误码率;处理模块,还用于检测第四误码率,第四误码率为第二介质地址中第三数据的误码率;处理模块,还用于根据第三误码率与第四误码率,确定存储数据时使用的映射关系。With reference to the second aspect, in a possible implementation of the second aspect, the storage device further includes: a storage module, further configured to write third data to the first medium address according to the first detection instruction and the first mapping relationship The storage module is also used to write third data to the second media address according to the first detection instruction and the second mapping relationship; the processing module is also used to detect the third bit error rate, the third bit error rate is the first The bit error rate of the third data in the media address; the processing module is also used to detect the fourth bit error rate, and the fourth bit error rate is the bit error rate of the third data in the second media address; the processing module is also used to The third error rate and the fourth error rate determine the mapping relationship used when storing data.
结合第二方面,在第二方面的一种可能的实现方式中,存储模块,具体用于当第三误码率大于第四误码率,则使用第一映射关系存储数据;存储模块,具体用于当第三误码率小于或等于第四误码率,则使用第二映射关系存储数据。With reference to the second aspect, in a possible implementation of the second aspect, the storage module is specifically configured to use the first mapping relationship to store data when the third error rate is greater than the fourth error rate; the storage module specifically It is used to store data using the second mapping relationship when the third error rate is less than or equal to the fourth error rate.
第三方面,本申请实施例提供了一种计算机设备,该终端设备包括至少一个处理器、存储器、通信端口、显示器以及存储在存储器中并可在处理器上运行的计算机执行指令,当该计算机执行指令被该处理器执行时,该处理器执行如上述第一方面或第一方面任意一种可能的实现方式。In the third aspect, the embodiments of the present application provide a computer device. The terminal device includes at least one processor, a memory, a communication port, a display, and computer-executable instructions stored in the memory and running on the processor. When the computer When the execution instruction is executed by the processor, the processor executes the foregoing first aspect or any one of the possible implementation manners of the first aspect.
第四方面,本申请实施例提供了一种存储一个或多个计算机执行指令的计算机可读存储介质,当该计算机执行指令被处理器执行时,该处理器执行如上述第一方面或第一方面任意一种可能的实现方式。In a fourth aspect, embodiments of the present application provide a computer-readable storage medium storing one or more computer-executable instructions. When the computer-executable instructions are executed by a processor, the processor executes the first aspect or the first aspect described above. Any one of the possible implementation methods.
第五方面,本申请实施例提供一种存储一个或多个计算机执行指令的计算机程序产品(或称计算机程序),当该计算机执行指令被该处理器执行时,该处理器执行上述第一方面或第一方面任意一种可能的实现方式。In the fifth aspect, the embodiments of the present application provide a computer program product (or computer program) that stores one or more computer-executable instructions. When the computer-executable instructions are executed by the processor, the processor executes the above-mentioned first aspect. Or any possible implementation of the first aspect.
第六方面,本申请提供了一种芯片系统,该芯片系统包括处理器,用于支持计算机设备实现上述方面中所涉及的功能。在一种可能的设计中,该芯片系统还包括存储器,该存储器,用于保存计算机设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。In a sixth aspect, the present application provides a chip system including a processor for supporting computer equipment to implement the functions involved in the above aspects. In a possible design, the chip system further includes a memory for storing necessary program instructions and data for the computer equipment. The chip system can be composed of chips, and can also include chips and other discrete devices.
第七方面,本申请实施例还提供了一种存储装置,该存储装置包括处理器、缓存器和存储器,该存储器包含一个或多个存储单元,该缓存器中存储有程序指令;其中,该处理器执行上述第一方面或第一方面任意一种可能的实现方式,并根据该程序指令向该存储器存储数据;该存储器用于根据该指令存储数据。In a seventh aspect, an embodiment of the present application also provides a storage device, the storage device includes a processor, a buffer, and a memory, the memory includes one or more storage units, and the buffer stores program instructions; wherein the The processor executes the foregoing first aspect or any one of the possible implementation manners of the first aspect, and stores data in the memory according to the program instruction; the memory is used to store data according to the instruction.
附图说明Description of the drawings
图1为交叉开关阵列的结构示意图;Figure 1 is a schematic diagram of the structure of a crossbar array;
图2为本申请实施例提出的一种系统框架示意图;Figure 2 is a schematic diagram of a system framework proposed by an embodiment of the application;
图3为本申请实施例提出的一种数据存储方法的实施例示意图;FIG. 3 is a schematic diagram of an embodiment of a data storage method proposed in an embodiment of this application;
图4为本申请实施例提出的数据存储方法的另一种实施例示意图;4 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application;
图5为本申请实施例提出的数据存储方法的另一种实施例示意图;FIG. 5 is a schematic diagram of another embodiment of a data storage method proposed in an embodiment of this application;
图6为本申请实施例提出的数据存储方法的另一种实施例示意图;FIG. 6 is a schematic diagram of another embodiment of a data storage method proposed in an embodiment of the application;
图7为本申请实施例提出的一种映射关系示意图;FIG. 7 is a schematic diagram of a mapping relationship proposed in an embodiment of this application;
图8为本申请实施例提出的另一种映射关系示意图;FIG. 8 is a schematic diagram of another mapping relationship proposed by an embodiment of the application;
图9为本申请实施例提出的另一种映射关系示意图;FIG. 9 is a schematic diagram of another mapping relationship proposed in an embodiment of this application;
图10为本申请实施例涉及的校验位与数据关联关系示意图;FIG. 10 is a schematic diagram of an association relationship between check digits and data involved in an embodiment of this application;
图11为本申请实施例中存储装置的一种实施例示意图;FIG. 11 is a schematic diagram of an embodiment of a storage device in an embodiment of the application;
图12为本申请实施例中的计算机设备1200的硬件结构一个示意图。FIG. 12 is a schematic diagram of the hardware structure of the computer device 1200 in an embodiment of the application.
具体实施方式Detailed ways
本申请实施例提供了一种数据存储方法以及相关装置,首先获取第一映射关系,该第一映射关系包括第一物理块地址和第一介质地址,该第一介质地址与第一物理块地址相关联;其次,根据第一映射关系生成第二映射关系,该第二映射关系包括第一物理块地址和第二介质地址,该第一物理块地址与第二介质地址相关联,该第二介质地址与第一介质地址不一致;再次,使用该第二映射关系存储数据。当集中性失效发生于第一介质地址对应的存储单元时,第一物理块地址需要的校验位较长,导致数据冗余增加,降低存储器的可用存储空间。而根据第一映射关系生成第二映射关系,该第二映射关系中第一物理块地址管理的介质地址为第二介质地址,避开了发生集中性失效的存储单元(第一介质地址对应的介质地址)。使得使用该第二映射关系存储数据时,可有效减少第一物理块地址所需要的校验位长度,增加了可用存储空间。The embodiments of the present application provide a data storage method and related devices. First, a first mapping relationship is obtained. The first mapping relationship includes a first physical block address and a first media address, and the first media address is the same as the first physical block address. Associated; secondly, a second mapping relationship is generated according to the first mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with the second media address, and the second The media address is inconsistent with the first media address; again, the second mapping relationship is used to store data. When the centralized failure occurs in the storage unit corresponding to the first media address, the check bit required by the first physical block address is longer, which leads to increased data redundancy and reduces the available storage space of the memory. The second mapping relationship is generated according to the first mapping relationship. In the second mapping relationship, the media address managed by the first physical block address is the second media address, which avoids the storage unit that has centralized failure (the first media address corresponds to the Media address). Therefore, when the second mapping relationship is used to store data, the length of the check bit required by the first physical block address can be effectively reduced, and the available storage space is increased.
为了便于理解,请参阅图2,图2为本申请实施例提出的一种系统框架示意图。本申请实施例提出的数据存储方法可以应用于存储级内存中,该存储器内存部署于计算机设备时,该计算机设备的主机(中央处理器和主板等)可以通过总线与该存储级内存建立通信连接。来自主机的数据存储指令与数据读取指令,通过总线传输至存储级内存。该存储级内存中的处理器对这些指令进行处理,然后从这些指令对应的裸片(die)1至裸片N中读取数据或写入数据,其中N为正整数。For ease of understanding, please refer to FIG. 2, which is a schematic diagram of a system framework according to an embodiment of the application. The data storage method proposed in the embodiments of the present application can be applied to storage-level memory. When the storage memory is deployed in a computer device, the host (central processing unit, motherboard, etc.) of the computer device can establish a communication connection with the storage-level memory through a bus. . The data storage instructions and data read instructions from the host are transmitted to the storage-level memory through the bus. The processor in the storage-level memory processes these instructions, and then reads or writes data from die 1 to die N corresponding to these instructions, where N is a positive integer.
具体的,主机通过总线向存储级内存发送数据读取指令(或数据存储指令),该指令携带逻辑块地址。存储级内存接收该指令后,根据映射关系列表确定该逻辑块地址对应的物理块地址,该映射关系列表存储与存储级内存中的缓存器。而每个物理块地址对应一个或多个存储单元(例如图1中所示的存储单元),每个存储单元都有独立的介质地址,这些存储单元可以是同一个裸片(die)上的存储单元,也可以是不同裸片上的存储单元。因此,每个物理块地址对应于一个或多个介质地址,这些物理块地址与介质地址的映射关系,同样以映射关系列表的形式存储与缓存器中。为了便于理解,请参阅表1。Specifically, the host sends a data read instruction (or data storage instruction) to the storage-level memory through the bus, and the instruction carries the logical block address. After the storage-level memory receives the instruction, it determines the physical block address corresponding to the logical block address according to the mapping relationship list, and the mapping relationship list is stored in the buffer in the storage-level memory. Each physical block address corresponds to one or more storage units (such as the storage unit shown in Figure 1), and each storage unit has an independent media address. These storage units can be on the same die. The storage unit can also be a storage unit on a different die. Therefore, each physical block address corresponds to one or more media addresses, and the mapping relationship between these physical block addresses and media addresses is also stored in the buffer in the form of a mapping relationship list. For ease of understanding, please refer to Table 1.
表1Table 1
Figure PCTCN2020082483-appb-000001
Figure PCTCN2020082483-appb-000001
需要说明的是,本申请实施例提出的数据存储方法,除了可应用于存储级内存(SCM)以外,还可以应用于其它存储装置,此处不作限定,例如:只读存储器(read-only memory,ROM)、可编程只读存储器(programmable rom,PROM)、可擦除可编程只读存储器(erasable prom,EPROM)、电可擦除可编程只读存储器(electrically eprom,EEPROM)或闪存。It should be noted that the data storage method proposed in the embodiments of this application can be applied to other storage devices in addition to storage-level memory (SCM), and it is not limited here, such as read-only memory (read-only memory). , ROM), programmable read-only memory (programmable rom, PROM), erasable programmable read-only memory (erasable prom, EPROM), electrically erasable programmable read-only memory (electrically eprom, EEPROM) or flash memory.
下面,结合附图对本申请实施例进行介绍。请参阅图3,图3为本申请实施例提出的一种数据存储方法的实施例示意图。以该数据存储方法应用于存储级内存为例,本申请实施例提出的一种数据存储方法包括:Hereinafter, the embodiments of the present application will be introduced with reference to the accompanying drawings. Please refer to FIG. 3, which is a schematic diagram of an embodiment of a data storage method according to an embodiment of the application. Taking the application of the data storage method to storage-level memory as an example, a data storage method proposed in an embodiment of the present application includes:
301、获取第一映射关系。301. Obtain a first mapping relationship.
本实施例中,部署本申请实施例提出的数据存储方法的存储装置,在运行过程中,首先,检测当前数据读取时的误码率。其次,根据该误码率,确定用于将数据存储至存储装置(本实施例中,该存储装置为存储级内存)的映射关系,该映射关系包括物理块地址与介质地址之间的关联关系。In this embodiment, the storage device of the data storage method proposed in the embodiment of the present application is deployed. During the operation, first, the bit error rate when reading the current data is detected. Secondly, according to the bit error rate, determine the mapping relationship used to store data to the storage device (in this embodiment, the storage device is a storage-level memory), and the mapping relationship includes the association relationship between the physical block address and the media address .
当该误码率大于预设门限时,将第二映射关系确定为该映射关系,其中,在该第二映射关系与第一映射关系下,同一物理块地址对应的介质地址不同,该第一映射关系为,该当前数据读取时,该存储级内存基于该第一映射关系进行数据存储。当该误码率小于或等于该预设门限时,将该第一映射关系确定为该映射关系,例如第一映射关系为:物理块地址A与介质地址B相关联,则仍然使用该映射关系存储数据。When the bit error rate is greater than the preset threshold, the second mapping relationship is determined as the mapping relationship, wherein, under the second mapping relationship and the first mapping relationship, the media addresses corresponding to the same physical block address are different, and the first The mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship. When the bit error rate is less than or equal to the preset threshold, the first mapping relationship is determined as the mapping relationship. For example, the first mapping relationship is: the physical block address A is associated with the medium address B, and the mapping relationship is still used Storing data.
下面,对当该误码率大于预设门限时,将第二映射关系确定为该映射关系,进行详细描述:In the following, when the bit error rate is greater than the preset threshold, determining the second mapping relationship as the mapping relationship will be described in detail:
首先,获取第一映射关系。该第一映射关系包括第一物理地址与第一介质地址,该第一物理地址与该第一介质地址相关联。该第一映射关系可参见表2。First, obtain the first mapping relationship. The first mapping relationship includes a first physical address and a first media address, and the first physical address is associated with the first media address. Refer to Table 2 for the first mapping relationship.
表2Table 2
Figure PCTCN2020082483-appb-000002
Figure PCTCN2020082483-appb-000002
具体的,该第一映射关系以映射关系列表的形式缓存于存储级内存中的缓存器,该第一映射关系可以由计算机设备配置,也可以是该存储级内存出厂前预先配置的,此处不作限制。Specifically, the first mapping relationship is cached in a buffer in the storage-level memory in the form of a mapping relationship list. The first mapping relationship may be configured by a computer device, or may be pre-configured before the storage-level memory leaves the factory. No restrictions.
需要说明的是,该第一映射关系中,第一介质地址可以是多个介质地址,此处不作限定。例如:第一映射关系包括第一物理块地址(PBA1)和第一介质地址(MA:X000/MA:X001/MA:X010/MA:X011),该第一物理块地址和第一介质地址相关。该第一物理块地址管理该第一介质地址。It should be noted that in the first mapping relationship, the first media address may be multiple media addresses, which is not limited here. For example: the first mapping relationship includes the first physical block address (PBA1) and the first medium address (MA: X000/MA: X001/MA: X010/MA: X011), and the first physical block address is related to the first medium address . The first physical block address manages the first media address.
302、根据第一映射关系生成第二映射关系。302. Generate a second mapping relationship according to the first mapping relationship.
本实施例中,该存储装置根据第一映射关系生成第二映射关系,第二映射关系包括第一物理块地址与第二介质地址,第一物理块地址与第二介质地址相关联,第二介质地址与第一介质地址不一致。该第一介质地址可以是一个或多个介质地址,该第二介质地址可以是一个或多个介质地址。该第一介质地址与第二介质地址可以位于同一裸片(die),也可以位于不同裸片,此处不作限定。当第一介质地址包括多个介质地址时,第一介质地址可以位于同一裸片中,也可以位于不同裸片中。第二介质地址可以位于与第一介质地址相同的裸片中,也可以位于与第一介质地址不同的裸片中,此处不作限定。In this embodiment, the storage device generates a second mapping relationship according to the first mapping relationship. The second mapping relationship includes the first physical block address and the second media address, the first physical block address is associated with the second media address, and the second The media address is inconsistent with the first media address. The first media address may be one or more media addresses, and the second media address may be one or more media addresses. The first media address and the second media address may be located on the same die, or may be located on different dies, which is not limited here. When the first media address includes multiple media addresses, the first media address may be located in the same die or in different die. The second media address may be located in the same die as the first media address, or may be located in a die different from the first media address, which is not limited here.
需要说明的是,第二映射关系中第二介质地址的确定方式,可以是预先配置的,例如:存储装置需要生成第二映射关系时,存储装置根据预先配置的规则在所有介质地址中选取一个或多个介质地址,并且,从第一介质地址中选取部分介质地址(一个或多个介质地址)作为第二映射关系中的第二介质地址。也可以是随机从当前管理的所有介质地址中选取一个或多个介质地址,从第一介质地址中选取部分介质地址(一个或多个介质地址)作为第二映射关系中的第二介质地址,此处不作限定。该预先配置的规则可以是选取单数位介质地址,也可以选取双数位介质地址,还可以是每间隔N个介质地址选取其中的一个介质地址,N为正整数,此处不做限制。It should be noted that the method for determining the second media address in the second mapping relationship may be pre-configured. For example, when the storage device needs to generate the second mapping relationship, the storage device selects one of all media addresses according to the pre-configured rule. Or multiple media addresses, and a part of the media address (one or more media addresses) is selected from the first media address as the second media address in the second mapping relationship. It may also randomly select one or more media addresses from all the media addresses currently managed, and select part of the media addresses (one or more media addresses) from the first media addresses as the second media addresses in the second mapping relationship, There is no limitation here. The pre-configured rule can be to select a single-digit media address, or a dual-digit media address, or to select one of the media addresses at intervals of N media addresses, where N is a positive integer, and there is no restriction here.
该第二映射关系可参见表3。Refer to Table 3 for the second mapping relationship.
表3table 3
Figure PCTCN2020082483-appb-000003
Figure PCTCN2020082483-appb-000003
需要说明的是,该第二映射关系中,第二介质地址可以是一个或多个介质地址,此处不作限定。该第二映射关系中包括的第二介质地址,可以与第一映射关系中包括的第一介质地址数量一致,例如表2与表3所示的第一介质地址包括4个介质地址,第二介质地址 包括4个介质地址;该第一介质地址也可以与第二介质地址数量不一致,例如:第一介质地址包括:(MA:X0000/MA:X0100/MA:X0010/MA:X0110/MA:X1110),第二介质地址包括:(MA:X0000/MA:X0100/MA:X0010/MA:X0110),此处不作限制。It should be noted that in the second mapping relationship, the second media address may be one or more media addresses, which is not limited here. The second media address included in the second mapping relationship may be the same as the number of the first media address included in the first mapping relationship. For example, the first media address shown in Table 2 and Table 3 includes 4 media addresses, and the second The media address includes 4 media addresses; the first media address may also be inconsistent with the second media address. For example, the first media address includes: (MA:X0000/MA:X0100/MA:X0010/MA:X0110/MA: X1110), the second media address includes: (MA: X0000/MA: X0100/MA: X0010/MA: X0110), there is no restriction here.
现有技术中,如图10所示,存储装置的每段数据后设置一段代码,该代码称为错误检查和纠正(error checking and correcting,ECC),该代码也称为校验位。用于检查并纠错数据错误。通常,每段物理块地址后设置一段ECC校验位,若当前存储装置中某些存储单元会发生集中性失效,则需要考虑某些物理块地址发生错误的数据长度较大。相应的,需要设计较长的ECC校验位。In the prior art, as shown in FIG. 10, a code is set after each piece of data in the storage device. The code is called error checking and correcting (ECC), and the code is also called check digit. Used to check and correct data errors. Generally, an ECC check bit is set after each physical block address. If some storage units in the current storage device will have a centralized failure, it is necessary to consider that the data length of some physical block addresses with errors is relatively large. Correspondingly, a longer ECC check bit needs to be designed.
在一种可选实现方式中,请参阅图7,图7为本申请实施例提出的一种映射关系示意图。图7中所示的第一映射关系为第一物理块地址“PBA1”,该第一物理块地址对应的第一介质地址为“(1)/(2)/(3)/(4)”,该第一介质地址位于同一裸片“Die1”中。当发送集中性失效时,该第一介质地址对应的存储单元发生失效,“(1)/(2)/(3)/(4)”中存储的数据误码率较高。在变更映射关系前,物理块地址“PBA2”对应的介质地址为“(5)/(6)/(7)/(8)”。为了实现失效分散,根据第一映射关系生成第二映射关系。第二映射关系包括第一物理块地址“PBA1”,和对应的第二介质地址“(1)/(6)/(3)/(8)”。物理块地址“PBA2”对应的介质地址为“(5)/(2)/(7)/(4)”。通过上述方法,第二映射关系所需要的ECC校验位长度相较于第一映射关系所需要的ECC校验位长度减半。上述介质地址位于同一裸片“Die1”中。In an optional implementation manner, please refer to FIG. 7, which is a schematic diagram of a mapping relationship proposed in an embodiment of the application. The first mapping relationship shown in FIG. 7 is the first physical block address "PBA1", and the first media address corresponding to the first physical block address is "(1)/(2)/(3)/(4)" , The first media address is located in the same die "Die1". When the transmission concentration fails, the storage unit corresponding to the first media address fails, and the data stored in "(1)/(2)/(3)/(4)" has a higher error rate. Before changing the mapping relationship, the media address corresponding to the physical block address "PBA2" is "(5)/(6)/(7)/(8)". In order to realize failure dispersion, a second mapping relationship is generated according to the first mapping relationship. The second mapping relationship includes the first physical block address "PBA1" and the corresponding second media address "(1)/(6)/(3)/(8)". The media address corresponding to the physical block address "PBA2" is "(5)/(2)/(7)/(4)". Through the above method, the ECC check bit length required by the second mapping relationship is halved compared to the ECC check bit length required by the first mapping relationship. The above media address is located in the same die "Die1".
在另一种可选的实现方式中,第一映射关系中第一物理块地址为“PBA1”,该第一物理块地址对应的第一介质地址为“(1)/(2)/(3)/(4)”。根据该第一映射关系生成的第二映射关系中,第一物理块地址对应的第二介质地址为“(1)/(5)/(3)/(4)”。In another optional implementation manner, the first physical block address in the first mapping relationship is "PBA1", and the first media address corresponding to the first physical block address is "(1)/(2)/(3) )/(4)". In the second mapping relationship generated according to the first mapping relationship, the second medium address corresponding to the first physical block address is "(1)/(5)/(3)/(4)".
在另一种可选的实现方式中,请参阅图8,图8为本申请实施例提出的另一种映射关系示意图。图8中所示的第一映射关系为第一物理块地址“PBA1”,该第一物理块地址对应的第一介质地址为“(1)/(2)/(3)/(4)”,该第一介质地址位于同一裸片“Die1”中。在变更映射关系前,物理块地址“PBA2”对应的介质地址为“(5)/(6)/(7)/(8)”,该介质地址位于同一裸片“Die2”。根据第一映射关系生成第二映射关系后,该第二映射关系中第一物理块地址对应的第二介质地址为“(1)/(6)/(3)/(8)”,其中介质地址“(1)/(3)”位于裸片“die1”,介质地址“(6)/(8)”位于裸片“die2”。In another optional implementation manner, please refer to FIG. 8. FIG. 8 is a schematic diagram of another mapping relationship proposed in an embodiment of this application. The first mapping relationship shown in FIG. 8 is the first physical block address "PBA1", and the first media address corresponding to the first physical block address is "(1)/(2)/(3)/(4)" , The first media address is located in the same die "Die1". Before changing the mapping relationship, the media address corresponding to the physical block address "PBA2" is "(5)/(6)/(7)/(8)", which is located on the same die "Die2". After the second mapping relationship is generated according to the first mapping relationship, the second medium address corresponding to the first physical block address in the second mapping relationship is "(1)/(6)/(3)/(8)", where the medium The address "(1)/(3)" is located on the die "die1", and the media address "(6)/(8)" is located on the die "die2".
具体的,该第二映射关系以映射关系列表的形式存储于存储级内存的缓存器。Specifically, the second mapping relationship is stored in the buffer of the storage-level memory in the form of a mapping relationship list.
303、使用第二映射关系存储数据。303. Use the second mapping relationship to store data.
本实施例中,存储装置生成第二映射关系后,使用该第二映射关系存储数据。具体的,该存储装置接收到数据存储指令后,当该数据存储指令携带的逻辑块地址为LBA:X0b,存储装置根据第二映射关系确定该逻辑块地址对应的第一物理块地址(PBA1)和第二介质地址(MA:X000/MA:X100/MA:X010/MA:X110)。存储装置向该第二介质地址对应的存储单元中存储相关数据。In this embodiment, after the storage device generates the second mapping relationship, the second mapping relationship is used to store data. Specifically, after the storage device receives the data storage instruction, when the logical block address carried by the data storage instruction is LBA:X0b, the storage device determines the first physical block address (PBA1) corresponding to the logical block address according to the second mapping relationship And the second medium address (MA: X000/MA: X100/MA: X010/MA: X110). The storage device stores relevant data in the storage unit corresponding to the second medium address.
本申请实施例中,首先获取第一映射关系,该第一映射关系包括第一物理块地址和第一介质地址,该第一介质地址与第一物理块地址相关联;其次,根据第一映射关系生成第二映射关系,该第二映射关系包括第一物理块地址和第二介质地址,该第一物理块地址与第二介质地址相关联,该第二介质地址与第一介质地址不一致;再次,使用该第二映射关系存储数据。当集中性失效发生于第一介质地址对应的存储单元时,第一物理块地址需要 的校验位较长,导致数据冗余增加,降低存储器的可用存储空间。而根据第一映射关系生成第二映射关系,该第二映射关系中第一物理块地址管理的介质地址为第二介质地址,避开了发生集中性失效的存储单元(第一介质地址对应的介质地址)。使得使用该第二映射关系存储数据时,可有效减少第一物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, firstly, a first mapping relationship is obtained, and the first mapping relationship includes a first physical block address and a first medium address, and the first medium address is associated with the first physical block address; secondly, according to the first mapping The relationship generates a second mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with a second media address, and the second media address is inconsistent with the first media address; Again, the second mapping relationship is used to store data. When the centralized failure occurs in the storage unit corresponding to the first media address, the check bit required by the first physical block address is longer, which leads to increased data redundancy and reduces the available storage space of the memory. The second mapping relationship is generated according to the first mapping relationship. In the second mapping relationship, the media address managed by the first physical block address is the second media address, which avoids the storage unit that has centralized failure (the first media address corresponds to the Media address). Therefore, when the second mapping relationship is used to store data, the length of the check bit required by the first physical block address can be effectively reduced, and the available storage space is increased.
本申请实施例提出的数据存储方法,可应用于多种不同的场景,包括:(一)、存储装置数据存储与读取过程中,根据误码率(symbol error rate,SER)触发该数据存储方法;(二)、存储装置出厂前,通过该数据存储方法确定较优的映射关系存储数据。下面,结合附图介绍上述方案。The data storage method proposed in the embodiments of this application can be applied to a variety of different scenarios, including: (1) During the data storage and reading process of the storage device, the data storage is triggered according to the symbol error rate (SER) Method; (2) Before the storage device leaves the factory, the data storage method is used to determine a better mapping relationship to store data. In the following, the above solution will be introduced in conjunction with the drawings.
(一)、存储装置数据存储与读取过程中,根据误码率(symbol error rate,SER)触发该数据存储方法:(1) During the data storage and reading process of the storage device, the data storage method is triggered according to the symbol error rate (SER):
请参阅图4,图4为本申请实施例提出的数据存储方法的另一种实施例示意图。本申请实施例提出的数据存储方法包括:Please refer to FIG. 4, which is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application. The data storage method proposed in the embodiment of the application includes:
401、读取第一数据,并检测第一误码率。401. Read the first data, and detect the first bit error rate.
本实施例中,存储装置根据主机的指令读取第一数据,存储于第一介质地址的数据称为第一数据。存储装置使用ECC校验位对该第一数据进行纠错并检测该第一数据的误码率,该误码率称为第一误码率。具体的,该第一误码率可以是错误数据长度与第一数据的总长度的比值,例如:错误数据长度为5比特(bit),第一数据的总长度为100比特,则第一误码率为5/100=5%。该第一误码率也可以是错误数据长度,此处不作限定。In this embodiment, the storage device reads the first data according to the instruction of the host, and the data stored in the first medium address is called the first data. The storage device uses the ECC check bit to perform error correction on the first data and detects the bit error rate of the first data, and the bit error rate is called the first bit error rate. Specifically, the first error rate may be the ratio of the length of the error data to the total length of the first data. For example, if the length of the error data is 5 bits and the total length of the first data is 100 bits, then the first error The code rate is 5/100=5%. The first bit error rate may also be the length of the error data, which is not limited here.
在另一种可选的实现方式中,用户为了确定当前存储装置的失效情况,向存储装置下发第一检测指令,存储装置根据该第一检测指令读取第一数据,并检测第一误码率。存储装置既可以根据该第一检测指令,通过检测某一个数据的误码率,检测该数据所对应的映射关系中是否发生集中性失效。该存储装置也可以根据该第一检测指令,对全盘数据进行检测。该存储装置还可以根据该第一检测指令,对空白介质地址(包括该介质地址的映射关系)进行检测,具体的:向该介质地址写入第一数据,并检测第一误码率。In another optional implementation manner, in order to determine the failure of the current storage device, the user issues a first detection instruction to the storage device, and the storage device reads the first data according to the first detection instruction, and detects the first error. Bit rate. The storage device can detect whether a concentration failure occurs in the mapping relationship corresponding to the data by detecting the bit error rate of a certain data according to the first detection instruction. The storage device may also detect the entire disk data according to the first detection instruction. The storage device can also detect the blank medium address (including the mapping relationship of the medium address) according to the first detection instruction, specifically: write the first data to the medium address, and detect the first bit error rate.
402、当第一误码率大于或等于第一门限值时,备份第一数据与第二数据。402. When the first bit error rate is greater than or equal to the first threshold value, back up the first data and the second data.
本实施例中,当第一误码率大于或等于第一门限值时,备份第一数据与第二数据,存储于第二介质地址的数据称为第二数据。例如:第一门限值为5%,当存储装置检测得到第一误码率为5%,则进入步骤402,该存储装置备份第一数据与第二数据至缓存器(Data Buffer)中。然后,该存储装置清空第一介质地址与第二介质地址中的数据。In this embodiment, when the first bit error rate is greater than or equal to the first threshold, the first data and the second data are backed up, and the data stored in the second medium address is called the second data. For example, if the first threshold is 5%, when the storage device detects that the first bit error rate is 5%, step 402 is entered, and the storage device backs up the first data and the second data to a buffer (Data Buffer). Then, the storage device clears the data in the first medium address and the second medium address.
403、获取第一映射关系。403. Acquire a first mapping relationship.
本实施例中,步骤402后,进入步骤403。具体的,获取第一映射关系的方法,与前述步骤301类似,此处不再赘述。In this embodiment, after step 402, step 403 is entered. Specifically, the method for obtaining the first mapping relationship is similar to the foregoing step 301, and will not be repeated here.
404、根据第一映射关系生成第二映射关系。404. Generate a second mapping relationship according to the first mapping relationship.
本实施例中,具体的,根据第一映射关系生成第二映射关系的方法,与前述步骤302类似,此处不再赘述。In this embodiment, specifically, the method of generating the second mapping relationship according to the first mapping relationship is similar to the foregoing step 302, and will not be repeated here.
405、根据第一映射关系生成第三映射关系。405. Generate a third mapping relationship according to the first mapping relationship.
本实施例中,根据第一映射关系生成第三映射关系,第三映射关系包括第二物理块地址、第一介质地址和第三介质地址,第二物理块地址与第一介质地址相关联,第二物理块地址与第三介质地址相关联,第二物理块地址与第一物理块地址不一致,第三介质地址与第二介质地址不一致。该第三映射关系可参见表4。In this embodiment, the third mapping relationship is generated according to the first mapping relationship. The third mapping relationship includes a second physical block address, a first media address, and a third media address. The second physical block address is associated with the first media address. The second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, and the third media address is inconsistent with the second media address. Refer to Table 4 for the third mapping relationship.
表4Table 4
Figure PCTCN2020082483-appb-000004
Figure PCTCN2020082483-appb-000004
为了便于理解,请参阅图9,图9为本申请实施例提出的另一种映射关系示意图。第一映射关系为:第一物理块地址LBA=X0b,第一介质地址(MA:X000/MA:X001/MA:X010/MA:X011)。在存储级内存的缓存器中,还存储有如下映射关系:物理块地址LBA=X1b,介质地址(MA:X000/MA:X101/MA:X110/MA:X111)。步骤405中,根据第一映射关系生成第三映射关系,包括:第二物理块地址LBA=X1b,第三介质地址(MA:X000/MA:X101/MA:X110/MA:X111)。For ease of understanding, please refer to FIG. 9, which is a schematic diagram of another mapping relationship proposed in an embodiment of this application. The first mapping relationship is: the first physical block address LBA=X0b, and the first medium address (MA: X000/MA: X001/MA: X010/MA: X011). In the buffer of the storage-level memory, the following mapping relationship is also stored: physical block address LBA=X1b, media address (MA: X000/MA: X101/MA: X110/MA: X111). In step 405, a third mapping relationship is generated according to the first mapping relationship, including: the second physical block address LBA=X1b, and the third medium address (MA: X000/MA: X101/MA: X110/MA: X111).
406、使用第二映射关系和/或第三映射关系存储数据。406. Use the second mapping relationship and/or the third mapping relationship to store data.
本实施例中,步骤405后,存储装置中根据第一映射关系生成了第二映射关系和第三映射关系。存储装置可使用第二映射关系存储第一数据(该第一数据备份于缓存器中),使用第三映射关系存储第二数据(该第二数据备份于缓存器中);或者,该存储装置也可以使用第二映射关系存储第二数据,使用第三映射关系存储第一数据;或者,该存储装置还可以使用第二映射关系存储第一数据和第二数据;或者,该存储装置使用第三映射关系存储第一数据和第二数据。存储装置还可以使用该第二映射关系和/或第三映射关系存储其它数据,此处不再赘述。In this embodiment, after step 405, the second mapping relationship and the third mapping relationship are generated in the storage device according to the first mapping relationship. The storage device may use the second mapping relationship to store the first data (the first data is backed up in the buffer), and use the third mapping relationship to store the second data (the second data is backed up in the buffer); or, the storage device The second mapping relationship may also be used to store the second data, and the third mapping relationship may be used to store the first data; or, the storage device may also use the second mapping relationship to store the first data and the second data; or, the storage device may use the second mapping relationship to store the first data and the second data. The three mapping relationships store the first data and the second data. The storage device may also use the second mapping relationship and/or the third mapping relationship to store other data, which will not be repeated here.
本申请实施例中,将发生集中性失效的第一介质地址分散至其它物理块地址的管理中,降低了某个物理块地址中出错的介质地址与总介质地址的占比。可有效减少物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, the first media address that has a centralized failure is distributed to the management of other physical block addresses, which reduces the proportion of the wrong media addresses in a certain physical block address to the total media addresses. It can effectively reduce the length of the check bit required by the physical block address and increase the available storage space.
请参阅图5,图5为本申请实施例提出的数据存储方法的另一种实施例示意图。本申请实施例提出的数据存储方法包括:Please refer to FIG. 5, which is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application. The data storage method proposed in the embodiment of the application includes:
501、读取第一数据,并检测第一误码率。501. Read the first data, and detect the first bit error rate.
本实施例中,与前述步骤401类似,此处不再赘述。In this embodiment, it is similar to the aforementioned step 401, and will not be repeated here.
502、当第一误码率大于或等于第一门限值时,备份第一数据与第二数据。502. When the first bit error rate is greater than or equal to the first threshold value, back up the first data and the second data.
本实施例中,与前述步骤402类似,此处不再赘述。In this embodiment, it is similar to the aforementioned step 402, and will not be repeated here.
503、获取第一映射关系。503. Acquire a first mapping relationship.
本实施例中,与前述步骤403类似,此处不再赘述。In this embodiment, it is similar to the aforementioned step 403, and will not be repeated here.
504、根据第一映射关系生成第二映射关系。504. Generate a second mapping relationship according to the first mapping relationship.
本实施例中,与前述步骤404类似,此处不再赘述。In this embodiment, it is similar to the aforementioned step 404, and will not be repeated here.
505、检测第二误码率。505. Detect a second bit error rate.
本实施例中,步骤504中根据第一映射关系生成的第二映射关系后,由于第二介质地址所对应的存储单元也存在发生集中性失效的可能,因此,在确定存储数据时使用的映射关系前,需要对第二介质地址中存储的数据进行检测。In this embodiment, after the second mapping relationship is generated according to the first mapping relationship in step 504, because the storage unit corresponding to the second media address may also have a centralized failure, the mapping used when determining the storage data Before the relationship, it is necessary to check the data stored in the second media address.
具体的,检测第二介质地址中存储的第二数据的误码率,该误码率称为第二误码率。在一种可选的实现方式中,当生成第二映射关系前,需要备份该第二介质地址中存储的第二数据,读取该第二数据的过程中检测该第二数据的误码率,该误码率也是第二介质地址 的误码率。Specifically, the bit error rate of the second data stored in the second media address is detected, and the bit error rate is called the second bit error rate. In an optional implementation manner, before generating the second mapping relationship, the second data stored in the second media address needs to be backed up, and the bit error rate of the second data is detected in the process of reading the second data , The bit error rate is also the bit error rate of the second media address.
在另一种可选的实现方式中,在备份该第二数据后,首先,清空该第二介质地址中存储的数据。其次,存储装置使用预置数据对第二介质地址(对应的存储单元)进行误码率检测,得到第二误码率。In another optional implementation manner, after backing up the second data, first, clear the data stored in the second media address. Secondly, the storage device uses preset data to perform bit error rate detection on the second media address (corresponding storage unit) to obtain the second bit error rate.
506、根据第一误码率和第二误码率,确定存储数据时使用的映射关系。506. Determine a mapping relationship used when storing data according to the first error rate and the second error rate.
本实施例中,根据第一误码率和第二误码率,确定存储数据时使用的映射关系。具体的,当第一误码率大于第二误码率时,使用第二映射关系存储数据。当第一误码率小于或等于第二误码率,则该第二映射关系中第二介质地址所对应的存储单元也存在集中性失效。存储装置需要使用其它的映射关系存储数据,例如:使用第三映射关系存储数据,该第三映射关系的生成方法与前述步骤405类似,此处不再赘述。In this embodiment, the mapping relationship used when storing data is determined according to the first error rate and the second error rate. Specifically, when the first error rate is greater than the second error rate, the second mapping relationship is used to store the data. When the first error rate is less than or equal to the second error rate, the storage unit corresponding to the second medium address in the second mapping relationship also has a centralized failure. The storage device needs to use other mapping relationships to store data, for example, using a third mapping relationship to store data. The method for generating the third mapping relationship is similar to the foregoing step 405, and will not be repeated here.
本申请实施例中,存储装置根据第一映射关系生成第二映射关系后,可以检测第二映射关系中第二介质地址的误码率(第二误码率)。根据第一误码率与第二误码率确定存储数据时使用的映射方式。确保存储装置使用的映射关系中误码率较低,减少物理块地址所需要的校验位长度,增加了可用存储空间。In the embodiment of the present application, after the storage device generates the second mapping relationship according to the first mapping relationship, it can detect the bit error rate (second bit error rate) of the second medium address in the second mapping relationship. The mapping method used when storing data is determined according to the first error rate and the second error rate. It is ensured that the bit error rate in the mapping relationship used by the storage device is low, the check bit length required by the physical block address is reduced, and the available storage space is increased.
(二)、存储装置出厂前,通过该数据存储方法确定较优的映射关系存储数据:(2) Before the storage device leaves the factory, use this data storage method to determine a better mapping relationship to store data:
请参阅图6,图6为本申请实施例提出的数据存储方法的另一种实施例示意图。本申请实施例提出的数据存储方法包括:Please refer to FIG. 6. FIG. 6 is a schematic diagram of another embodiment of the data storage method proposed in the embodiment of the application. The data storage method proposed in the embodiment of the application includes:
601、获取第一检测指令。601. Acquire a first detection instruction.
本实施例中,存储装置获取第一检测指令,存储装置根据该第一检测指令检测当前各个映射关系中介质地址的误码率,并根据该误码率确定存储数据时使用的映射关系。In this embodiment, the storage device obtains the first detection instruction, and the storage device detects the bit error rate of the media address in each current mapping relationship according to the first detection instruction, and determines the mapping relationship used when storing data according to the bit error rate.
在一种可选的实现方式中,在存储装置出厂前,该存储装置获取该第一检测指令。首先,存储装置根据该第一检测指令和第一映射关系,向第一介质地址写入第三数据。该第三数据为检测误码率时使用的测试数据,例如“000···000”或“111···111”。然后,存储装置根据该第一检测指令和第二映射关系,向第二介质地址写入第三数据。In an optional implementation manner, before the storage device leaves the factory, the storage device obtains the first detection instruction. First, the storage device writes third data to the first medium address according to the first detection instruction and the first mapping relationship. The third data is the test data used when detecting the bit error rate, such as "000···000" or "111···111". Then, the storage device writes the third data to the second medium address according to the first detection instruction and the second mapping relationship.
在另一种可选的实现方式中,在用户使用该存储装置的过程中,可以通过第一检测指令禁用误码率较高的介质地址,以保证数据的安全性。具体的,首先,存储装置根据第一检测指令备份第一介质地址中的数据,和第二介质地址中的数据。然后,存储装置向第一介质地址与第二介质地址中分别写入第三数据。In another optional implementation manner, when the user uses the storage device, the media address with a higher error rate may be disabled through the first detection instruction to ensure data security. Specifically, first, the storage device backs up the data in the first media address and the data in the second media address according to the first detection instruction. Then, the storage device writes third data into the first media address and the second media address, respectively.
在另一种可选的实现方式中,该第一检测指令可以是存储装置处于空闲状态时,自动触发的指令。也可以是存储装置周期性自动触发的指令,此处不做限制。In another optional implementation manner, the first detection instruction may be an instruction automatically triggered when the storage device is in an idle state. It can also be an instruction that is automatically triggered by the storage device periodically, and there is no restriction here.
602、检测第三误码率。602. Detect a third bit error rate.
本实施例中,第三误码率为第一介质地址中第三数据的误码率。In this embodiment, the third bit error rate is the bit error rate of the third data in the first medium address.
603、检测第四误码率。603. Detect a fourth bit error rate.
本实施例中,第四误码率为第二介质地址中第三数据的误码率。In this embodiment, the fourth error rate is the error rate of the third data in the second medium address.
604、根据第三误码率和第四误码率,确定存储数据时使用的映射关系。604. Determine a mapping relationship used when storing data according to the third error rate and the fourth error rate.
本实施例中,根据第三误码率和第四误码率,In this embodiment, according to the third error rate and the fourth error rate,
根据第三误码率和第四误码率,确定存储数据时使用的映射关系。在一种可选的实现方式中,当第三误码率大于第四误码率时,使用第一映射关系存储数据。当第三误码率小于或等于第四误码率时,使用第二映射关系存储数据。在另一种可选的实现方式中,当第三误码率大于第一门限值时,使用第二映射关系存储数据;当第四误码率大于第一门限值 时,使用第一映射关系存储数据。According to the third error rate and the fourth error rate, the mapping relationship used when storing the data is determined. In an optional implementation manner, when the third error rate is greater than the fourth error rate, the first mapping relationship is used to store the data. When the third error rate is less than or equal to the fourth error rate, the second mapping relationship is used to store the data. In another optional implementation manner, when the third error rate is greater than the first threshold, the second mapping relationship is used to store the data; when the fourth error rate is greater than the first threshold, the first The mapping relationship stores data.
本申请实施例中,存储装置在出厂前或使用过程中,可以根据第一检测指令检测当前各个映射关系中介质地址的误码率,根据该误码率确定存储数据时使用的映射关系。以提升数据的存储安全性。In the embodiment of the present application, the storage device can detect the bit error rate of the media address in each current mapping relationship according to the first detection instruction before leaving the factory or during use, and determine the mapping relationship used when storing data according to the bit error rate. To improve the storage security of data.
上述主要以方法的角度对本申请实施例提供的方案进行了介绍。可以理解的是,上述存储装置为了实现上述功能,其包含了执行各个功能相应的硬件结构和/或软件模块。本领域技术人员应该很容易意识到,结合本文中所公开的实施例描述的各示例的模块及算法步骤,本申请能够以硬件或硬件和计算机软件的结合形式来实现。某个功能究竟以硬件还是计算机软件驱动硬件的方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。The foregoing mainly introduces the solutions provided in the embodiments of the present application from the perspective of methods. It can be understood that, in order to implement the above-mentioned functions, the above-mentioned storage device includes hardware structures and/or software modules corresponding to each function. Those skilled in the art should easily realize that in combination with the modules and algorithm steps of the examples described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed by hardware or computer software-driven hardware depends on the specific application and design constraint conditions of the technical solution. Professionals and technicians can use different methods for each specific application to implement the described functions, but such implementation should not be considered beyond the scope of this application.
本申请实施例可以根据上述方法示例对存储装置进行功能模块的划分,例如,可以对应各个功能划分各个功能模块,也可以将两个或两个以上的功能集成在一个存储模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。需要说明的是,本申请实施例中对模块的划分是示意性的,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式。The embodiment of the present application may divide the storage device into functional modules according to the foregoing method examples. For example, each functional module may be divided corresponding to each function, or two or more functions may be integrated into one storage module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules. It should be noted that the division of modules in the embodiments of the present application is illustrative, and is only a logical function division, and there may be other division methods in actual implementation.
下面对本申请中的信息检索装置进行详细描述,请参阅图11,图11为本申请实施例中存储装置的一种实施例示意图。存储装置1100包括:The information retrieval device in this application will be described in detail below, please refer to FIG. 11, which is a schematic diagram of an embodiment of a storage device in an embodiment of this application. The storage device 1100 includes:
处理模块1101,用于检测当前数据读取时的误码率;The processing module 1101 is used to detect the bit error rate when reading the current data;
该处理模块1101,还用于根据该误码率,确定用于将数据存储至该存储级内存的映射关系,其中,该映射关系包括物理块地址与介质地址之间的关联关系;The processing module 1101 is further configured to determine a mapping relationship for storing data to the storage-level memory according to the bit error rate, where the mapping relationship includes an association relationship between a physical block address and a media address;
存储模块1102,用于根据该映射关系进行数据存储。The storage module 1102 is used to store data according to the mapping relationship.
在本申请的一些实施例中,In some embodiments of this application,
该处理模块1101,具体用于当该误码率大于预设门限时,将第二映射关系确定为该映射关系,其中,在该第二映射关系与第一映射关系下,物理块地址与介质地址之间的关联关系不同,该第一映射关系为,该当前数据读取时,该存储级内存基于该第一映射关系进行数据存储。The processing module 1101 is specifically configured to determine the second mapping relationship as the mapping relationship when the bit error rate is greater than the preset threshold, wherein, under the second mapping relationship and the first mapping relationship, the physical block address and the medium The association relationship between addresses is different, and the first mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship.
在本申请的一些实施例中,In some embodiments of this application,
该处理模块1101,还用于当该误码率小于或等于该预设门限时,将该第一映射关系确定为该映射关系。The processing module 1101 is further configured to determine the first mapping relationship as the mapping relationship when the bit error rate is less than or equal to the preset threshold.
获取模块1103,用于获取第一映射关系,第一映射关系包括第一物理块地址与第一介质地址,第一物理块地址与第一介质地址相关联;The obtaining module 1103 is configured to obtain a first mapping relationship, where the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address;
处理模块1101,用于根据第一映射关系生成第二映射关系,第二映射关系包括第一物理块地址与第二介质地址,第一物理块地址与第二介质地址相关联,第二介质地址与第一介质地址不一致;The processing module 1101 is configured to generate a second mapping relationship according to the first mapping relationship, the second mapping relationship includes a first physical block address and a second media address, the first physical block address is associated with the second media address, and the second media address Inconsistent with the address of the first medium;
处理模块1101,还用于选择第二映射关系。The processing module 1101 is also used to select the second mapping relationship.
在本申请的一些实施例中,存储模块1102,用于若第二介质地址中数据的误码率小于第一介质地址中数据的误码率,则使用第二映射关系存储数据。In some embodiments of the present application, the storage module 1102 is configured to use the second mapping relationship to store the data if the error rate of the data in the second media address is less than the error rate of the data in the first media address.
在本申请的一些实施例中,处理模块1101,还用于根据第一映射关系生成第三映射关系,第三映射关系包括第二物理块地址、第三介质地址,第二物理块地址与第三介质地址 相关联,第二物理块地址与第三介质地址相关联,第二物理块地址与第一物理块地址不一致,第三介质地址与第二介质地址不一致,第三介质地址包括部分第一介质地址。In some embodiments of the present application, the processing module 1101 is further configured to generate a third mapping relationship according to the first mapping relationship. The third mapping relationship includes a second physical block address, a third media address, and the second physical block address and the first mapping relationship. The three media addresses are related, the second physical block address is related to the third media address, the second physical block address is inconsistent with the first physical block address, the third media address is inconsistent with the second media address, and the third media address includes part of the A media address.
在本申请的一些实施例中,In some embodiments of this application,
第一介质地址与第二介质地址位于同一裸片,或,第一介质地址与第二介质地址位于不同裸片。The first media address and the second media address are located on the same die, or the first media address and the second media address are located on different die.
在本申请的一些实施例中,存储装置1100还包括:In some embodiments of the present application, the storage device 1100 further includes:
处理模块1101,还用于读取第一数据时,检测得到第一误码率,其中,第一数据的存储区域为第一介质地址;The processing module 1101 is also configured to detect the first bit error rate when reading the first data, where the storage area of the first data is the first media address;
存储模块1102,还用于当第一误码率大于或等于第一门限值时,备份第一数据与第二数据,其中,第二数据的存储区域为第二介质地址;The storage module 1102 is further configured to back up the first data and the second data when the first error rate is greater than or equal to the first threshold value, where the storage area of the second data is the second media address;
存储模块1102,还用于清空第一介质地址与第二介质地址中存储的数据。The storage module 1102 is also used to clear data stored in the first media address and the second media address.
在本申请的一些实施例中,存储装置1100还包括:In some embodiments of the present application, the storage device 1100 further includes:
存储模块1102,还用于使用第二映射关系存储第一数据,或,使用第三映射关系存储第一数据。The storage module 1102 is further configured to use the second mapping relationship to store the first data, or use the third mapping relationship to store the first data.
在本申请的一些实施例中,存储装置1100还包括:In some embodiments of the present application, the storage device 1100 further includes:
处理模块1101,还用于检测第二误码率,其中,第二误码率为第二介质地址中存储的第二数据的误码率;The processing module 1101 is further configured to detect a second bit error rate, where the second bit error rate is the bit error rate of the second data stored in the second media address;
处理模块1101,还用于根据第一误码率和第二误码率,确定存储数据时使用的映射关系。The processing module 1101 is further configured to determine the mapping relationship used when storing data according to the first error rate and the second error rate.
在本申请的一些实施例中,In some embodiments of this application,
存储模块1102,具体用于当第一误码率大于第二误码率,则使用第二映射关系存储数据;The storage module 1102 is specifically configured to use the second mapping relationship to store data when the first error rate is greater than the second error rate;
存储模块1102,具体用于当第一误码率小于或等于第二误码率,则使用第三映射关系存储数据。The storage module 1102 is specifically configured to use the third mapping relationship to store data when the first error rate is less than or equal to the second error rate.
在本申请的一些实施例中,In some embodiments of this application,
存储模块1102,具体用于根据第二映射关系,将备份中的第一数据存储至第二介质地址。The storage module 1102 is specifically configured to store the first data in the backup to the second media address according to the second mapping relationship.
在本申请的一些实施例中,In some embodiments of this application,
存储模块1102,具体用于根据第三映射关系,将备份中的第二数据存储至第一介质地址和第三介质地址。The storage module 1102 is specifically configured to store the second data in the backup to the first medium address and the third medium address according to the third mapping relationship.
在本申请的一些实施例中,In some embodiments of this application,
获取模块1103,还用于获取第一检测指令,该第一检测指令用于触发检测该当前数据的该误码率,第一检测指令为空闲状态时自动触发的指令,或,第一检测指令为用户主动触发的指令。The acquiring module 1103 is also used to acquire the first detection instruction, the first detection instruction is used to trigger the detection of the error rate of the current data, the first detection instruction is automatically triggered when the first detection instruction is in the idle state, or the first detection instruction It is an instruction triggered by the user.
在本申请的一些实施例中,存储装置1100还包括:In some embodiments of the present application, the storage device 1100 further includes:
存储模块1102,还用于根据第一检测指令和第一映射关系,向第一介质地址写入第三数据;The storage module 1102 is further configured to write third data to the first media address according to the first detection instruction and the first mapping relationship;
存储模块1102,还用于根据第一检测指令和第二映射关系,向第二介质地址写入第三数据;The storage module 1102 is further configured to write third data to the second media address according to the first detection instruction and the second mapping relationship;
处理模块1101,还用于检测第三误码率,第三误码率为第一介质地址中第三数据的误 码率;The processing module 1101 is also used to detect a third bit error rate, where the third bit error rate is the bit error rate of the third data in the first medium address;
处理模块1101,还用于检测第四误码率,第四误码率为第二介质地址中第三数据的误码率;The processing module 1101 is further configured to detect a fourth bit error rate, where the fourth bit error rate is the bit error rate of the third data in the second medium address;
处理模块1101,还用于根据第三误码率与第四误码率,确定存储数据时使用的映射关系。The processing module 1101 is further configured to determine the mapping relationship used when storing data according to the third error rate and the fourth error rate.
在本申请的一些实施例中,存储模块1102,具体用于当第三误码率大于第四误码率,则使用第一映射关系存储数据;In some embodiments of the present application, the storage module 1102 is specifically configured to use the first mapping relationship to store data when the third error rate is greater than the fourth error rate;
存储模块1102,具体用于当第三误码率小于或等于第四误码率,则使用第二映射关系存储数据。The storage module 1102 is specifically configured to use the second mapping relationship to store data when the third error rate is less than or equal to the fourth error rate.
上面从模块化功能实体的角度对本申请实施例中的存储装置进行描述,下面从硬件处理的角度对本申请实施例中的存储装置进行描述。图12为本申请实施例中的计算机设备1200的硬件结构一个示意图。如图12所示,该计算机设备1200可以包括:The storage device in the embodiment of the present application is described above from the perspective of a modular functional entity, and the storage device in the embodiment of the present application is described below from the perspective of hardware processing. FIG. 12 is a schematic diagram of the hardware structure of the computer device 1200 in an embodiment of the application. As shown in FIG. 12, the computer device 1200 may include:
该计算机设备1200包括至少一个处理器1201,通信线路1207,存储器1203以及至少一个通信接口1204。The computer device 1200 includes at least one processor 1201, a communication line 1207, a memory 1203, and at least one communication interface 1204.
处理器1201可以是一个通用中央处理器(central processing unit,CPU),微处理器,特定应用集成电路(application-specific integrated circuit,服务器IC),或一个或多个用于控制本申请方案程序执行的集成电路。The processor 1201 can be a general-purpose central processing unit (central processing unit, CPU), a microprocessor, an application-specific integrated circuit (server IC), or one or more programs for controlling the execution of the program of this application. Integrated circuits.
通信线路1207可包括一通路,在上述组件之间传送信息。The communication line 1207 may include a path to transmit information between the aforementioned components.
通信接口1204,使用任何收发器一类的装置,用于与其他装置或通信网络通信,如以太网等。The communication interface 1204 uses any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet.
存储器1203可以是只读存储器(read-only memory,ROM)或可存储静态信息和指令的其他类型的静态存储装置,随机存取存储器(random access memory,RAM)或者可存储信息和指令的其他类型的动态存储装置,存储器可以是独立存在,通过通信线路1207与处理器相连接。存储器也可以和处理器集成在一起。The memory 1203 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, random access memory (RAM), or other types that can store information and instructions The dynamic storage device, the memory can exist independently, and is connected to the processor through the communication line 1207. The memory can also be integrated with the processor.
其中,存储器1203用于存储执行本申请方案的计算机执行指令,并由处理器1201来控制执行。处理器1201用于执行存储器1203中存储的计算机执行指令,从而实现本申请上述实施例提供的数据存储方法。Among them, the memory 1203 is used to store computer execution instructions for executing the solution of the present application, and the processor 1201 controls the execution. The processor 1201 is configured to execute computer-executable instructions stored in the memory 1203, so as to implement the data storage method provided in the foregoing embodiment of the present application.
可选的,本申请实施例中的计算机执行指令也可以称之为应用程序代码,本申请实施例对此不作具体限定。Optionally, the computer-executable instructions in the embodiments of the present application may also be referred to as application program codes, which are not specifically limited in the embodiments of the present application.
在具体实现中,作为一种实施例,计算机设备1200可以包括多个处理器,例如图12中的处理器1201和处理器1202。这些处理器中的每一个可以是一个单核(single-CPU)处理器,也可以是一个多核(multi-CPU)处理器。这里的处理器可以指一个或多个装置、电路、和/或用于处理数据(例如计算机程序指令)的处理核。In a specific implementation, as an embodiment, the computer device 1200 may include multiple processors, such as the processor 1201 and the processor 1202 in FIG. 12. Each of these processors can be a single-CPU (single-CPU) processor or a multi-core (multi-CPU) processor. The processor here may refer to one or more devices, circuits, and/or processing cores for processing data (for example, computer program instructions).
在具体实现中,作为一种实施例,计算机设备1200还可以包括输出装置1205和输入装置1206。输出装置1205和处理器1201通信,可以以多种方式来显示信息。输入装置1206和处理器1201通信,可以以多种方式接收用户的输入。例如,输入装置1206可以是鼠标、触摸屏装置或传感装置等。In a specific implementation, as an embodiment, the computer device 1200 may further include an output device 1205 and an input device 1206. The output device 1205 communicates with the processor 1201, and can display information in a variety of ways. The input device 1206 communicates with the processor 1201, and can receive user input in a variety of ways. For example, the input device 1206 may be a mouse, a touch screen device, a sensor device, or the like.
当该计算机设备1200为终端设备时,该计算机设备1200中,处理器1202可以包括一个或多个处理单元,例如:处理器1202可以包括应用处理器(application processor,AP),调制解调处理器,图形处理器(graphics processing unit,GPU),图像信号处理器(image  signal processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(digital signal processor,DSP),基带处理器,和/或神经网络处理器(neural-network processing unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。When the computer device 1200 is a terminal device, in the computer device 1200, the processor 1202 may include one or more processing units, for example: the processor 1202 may include an application processor (AP), a modem processor , Graphics processing unit (GPU), image signal processor (image signal processor, ISP), controller, memory, video codec, digital signal processor (digital signal processor, DSP), baseband processor, And/or neural-network processing unit (NPU), etc. Among them, the different processing units may be independent devices or integrated in one or more processors.
该终端设备可以是移动站(mobile station,MS)、用户模块(subscriber unit)、蜂窝电话(cellular phone)、智能电话(smart phone)、无线数据卡、个人数字助理(personal digital assistant,简称:PDA)电脑、平板型电脑、无线调制解调器(modem)、手持设备(handset)、膝上型电脑(laptop computer)、机器类型通信(machine type communication,MTC)终端设备等。The terminal device can be a mobile station (MS), subscriber unit (subscriber unit), cellular phone, smart phone, wireless data card, personal digital assistant (personal digital assistant, abbreviated as PDA) ) Computers, tablet computers, wireless modems, handheld devices, laptop computers, machine type communication (MTC) terminal equipment, etc.
其中,控制器可以是计算机设备1200的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。Among them, the controller may be the nerve center and command center of the computer device 1200. The controller can generate operation control signals according to the instruction operation code and timing signals to complete the control of fetching instructions and executing instructions.
处理器1202中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器1202中的存储器为高速缓冲存储器。该存储器可以保存处理器1202刚用过或循环使用的指令或数据。如果处理器1202需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器1202的等待时间,因而提高了系统的效率。A memory may also be provided in the processor 1202 for storing instructions and data. In some embodiments, the memory in the processor 1202 is a cache memory. The memory can store instructions or data that have just been used or recycled by the processor 1202. If the processor 1202 needs to use the instruction or data again, it can be directly called from the memory. Repeated accesses are avoided, the waiting time of the processor 1202 is reduced, and the efficiency of the system is improved.
在一些实施例中,处理器1202可以包括一个或多个接口。接口可以包括集成电路(inter-integrated circuit,I1C)接口,集成电路内置音频(inter-integrated circuit sound,I1S)接口,脉冲编码调制(pulse code modulation,PCM)接口,通用异步收发传输器(universal asynchronous receiver/transmitter,UART)接口,移动产业处理器接口(mobile industry processor interface,MIPI),通用输入输出(general-purpose input/output,GPIO)接口,用户标识模块(subscriber identity module,SIM)接口,和/或通用串行总线(universal serial bus,USB)接口等。In some embodiments, the processor 1202 may include one or more interfaces. The interface may include an integrated circuit (inter-integrated circuit, I1C) interface, an integrated circuit built-in audio (inter-integrated circuit sound, I1S) interface, a pulse code modulation (pulse code modulation, PCM) interface, and a universal asynchronous transmitter (universal asynchronous transmitter) interface. receiver/transmitter, UART) interface, mobile industry processor interface (MIPI), general-purpose input/output (GPIO) interface, subscriber identity module (SIM) interface, and / Or Universal Serial Bus (USB) interface, etc.
可以理解的是,本申请实施例示意的各模块间的接口连接关系,只是示意性说明,并不构成对计算机设备1200的结构限定。在本申请另一些实施例中,计算机设备1200也可以采用上述实施例中不同的接口连接方式,或多种接口连接方式的组合。It can be understood that the interface connection relationship between the modules illustrated in the embodiment of the present application is merely a schematic description, and does not constitute a structural limitation of the computer device 1200. In other embodiments of the present application, the computer device 1200 may also adopt different interface connection modes in the foregoing embodiments, or a combination of multiple interface connection modes.
本申请实施例还提供了一种存储装置,该存储装置包括处理器、缓存器和存储器,该存储器包含一个或多个存储单元;其中,该处理器用于执行如前述图3至图10所示实施例中描述的方法中存储装置所执行的步骤,还用于生成指令;该存储器用于根据该指令存储数据。本实施例中,该存储装置可以为非嵌入式存储装置,也可以为嵌入式存储装置,应当理解,该存储装置具体的表现形式,应当根据实际情况灵活设定,此处不做限定。The embodiment of the present application also provides a storage device. The storage device includes a processor, a buffer, and a memory. The memory includes one or more storage units. The steps performed by the storage device in the method described in the embodiment are also used to generate instructions; the memory is used to store data according to the instructions. In this embodiment, the storage device may be a non-embedded storage device or an embedded storage device. It should be understood that the specific expression form of the storage device should be flexibly set according to actual conditions, and is not limited here.
本申请实施例中还提供一种包含存储块管理指令的计算机程序产品,当其在计算机上运行时,使得计算机执行如前述图2至图8所示实施例中描述的方法中存储装置所执行的步骤。The embodiment of the present application also provides a computer program product containing storage block management instructions, which when running on a computer, causes the computer to execute the method described in the foregoing embodiments shown in FIGS. 2 to 8 as executed by the storage device A step of.
本申请实施例中还提供一种计算机可读存储介质,该计算机可读存储介质中存储有存储块处理的指令,当其在计算机上运行时,使得计算机执行如前述图2至图8所示实施例中描述的方法中存储装置所执行的步骤。The embodiment of the present application also provides a computer-readable storage medium, the computer-readable storage medium stores storage block processing instructions, and when it runs on a computer, the computer executes the instructions shown in FIGS. 2 to 8 above. The steps performed by the storage device in the method described in the embodiment.
本申请实施例中还提供一种芯片系统,该芯片系统包括处理器,用于支持网络设备实现上述方面中所涉及的功能,例如,例如发送或处理上述方法中所涉及的数据和/或信息。在一种可能的设计中,所述芯片系统还包括存储器,所述存储器,用于保存网络设备必要的程序指令和数据。该芯片系统,可以由芯片构成,也可以包括芯片和其他分立器件。The embodiments of the present application also provide a chip system, the chip system includes a processor, used to support network equipment to achieve the functions involved in the above aspects, for example, for example, send or process the data and/or information involved in the above methods . In a possible design, the chip system further includes a memory, and the memory is used to store necessary program instructions and data of the network device. The chip system can be composed of chips, and can also include chips and other discrete devices.
在上述实施例中,可以全部或部分地通过软件、硬件、固件或者其任意组合来实现。 当使用软件实现时,可以全部或部分地以计算机程序产品的形式实现。In the above embodiments, it may be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented by software, it can be implemented in the form of a computer program product in whole or in part.
计算机程序产品包括一个或多个计算机指令。在计算机上加载和执行计算机程序指令时,全部或部分地产生按照本发明实施例的流程或功能。计算机可以是通用计算机、专用计算机、计算机网络、或者其他可编程装置。计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一计算机可读存储介质传输,例如,计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如同轴电缆、光纤、数字用户线(digital subscriber line,DSL))或无线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。计算机可读存储介质可以是计算机能够存储的任何可用介质或者是包含一个或多个可用介质集成的服务器、数据中心等数据存储设备。可用介质可以是磁性介质,(例如,软盘、硬盘、磁带)、光介质、或者半导体介质,例如固态硬盘(solid state disk,SSD)等。The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the processes or functions according to the embodiments of the present invention are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. Computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, computer instructions may be transmitted from a website, computer, server, or data center through a cable (such as Coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL) or wireless (such as infrared, wireless, microwave, etc.) transmission to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that can be stored by a computer or a data storage device such as a server or a data center integrated with one or more available media. The usable medium may be a magnetic medium, (for example, a floppy disk, a hard disk, and a magnetic tape), an optical medium, or a semiconductor medium, such as a solid state disk (SSD).
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and conciseness of the description, the specific working process of the above-described system, device, and unit can refer to the corresponding process in the foregoing method embodiment, which will not be repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统,装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,模块的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个模块或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或模块的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, device, and method can be implemented in other ways. For example, the device embodiments described above are only illustrative. For example, the division of modules is only a logical function division, and there may be other divisions in actual implementation, for example, multiple modules or components can be combined or integrated. To another system, or some features can be ignored, or not implemented. In addition, the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, devices or modules, and may be in electrical, mechanical or other forms.
作为分离部件说明的模块可以是或者也可以不是物理上分开的,作为模块显示的部件可以是或者也可以不是物理模块,即可以位于一个地方,或者也可以分布到多个网络模块上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。The modules described as separate components may or may not be physically separate, and the components displayed as modules may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the objectives of the solutions of the embodiments.
另外,在本申请各个实施例中的各功能模块可以集成在一个处理模块中,也可以是各个模块单独物理存在,也可以两个或两个以上模块集成在一个模块中。上述集成的模块既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, the functional modules in the various embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules may be integrated into one module. The above-mentioned integrated modules can be implemented in the form of hardware or software functional modules.
集成的模块如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(read-only memory,ROM)、随机存取存储器(random access memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to make a computer device (which can be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the methods in the various embodiments of the present application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (read-only memory, ROM), random access memory (random access memory, RAM), magnetic disks or optical disks and other media that can store program codes. .

Claims (27)

  1. 一种数据存储方法,其特征在于,所述方法应用于存储级内存,包括:A data storage method, characterized in that the method is applied to storage-level memory, and includes:
    检测当前数据读取时的误码率;Detect the bit error rate when reading the current data;
    根据所述误码率,确定用于将数据存储至所述存储级内存的映射关系,其中,所述映射关系包括物理块地址与介质地址之间的关联关系;Determining a mapping relationship for storing data to the storage-level memory according to the bit error rate, where the mapping relationship includes an association relationship between a physical block address and a media address;
    根据所述映射关系进行数据存储。Data storage is performed according to the mapping relationship.
  2. 根据权利要求1所述的方法,其特征在于,根据所述误码率,确定用于将数据存储至所述存储级内存的映射关系,包括:The method according to claim 1, wherein the determining a mapping relationship for storing data to the storage-level memory according to the bit error rate comprises:
    当所述误码率大于预设门限时,将第二映射关系确定为所述映射关系,其中,在所述第二映射关系与第一映射关系下,物理块地址与介质地址之间的关联关系不同,When the bit error rate is greater than the preset threshold, the second mapping relationship is determined as the mapping relationship, wherein, under the second mapping relationship and the first mapping relationship, the association between the physical block address and the medium address The relationship is different,
    所述第一映射关系为,所述当前数据读取时,所述存储级内存基于所述第一映射关系进行数据存储。The first mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship.
  3. 根据权利要求2所述的方法,其特征在于,根据所述误码率,确定用于将数据存储至所述存储级内存的映射关系,还包括:The method according to claim 2, wherein determining a mapping relationship for storing data to the storage-level memory according to the bit error rate, further comprising:
    当所述误码率小于或等于所述预设门限时,将所述第一映射关系确定为所述映射关系。When the bit error rate is less than or equal to the preset threshold, the first mapping relationship is determined to be the mapping relationship.
  4. 根据权利要求2至3中任一项所述的方法,其特征在于,所述误码率大于所述预设门限时,将所述第二映射关系确定为所述映射关系,包括:The method according to any one of claims 2 to 3, wherein when the bit error rate is greater than the preset threshold, determining the second mapping relationship as the mapping relationship comprises:
    获取所述第一映射关系,所述第一映射关系包括第一物理块地址与第一介质地址,所述第一物理块地址与所述第一介质地址相关联;Acquiring the first mapping relationship, where the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address;
    根据所述第一映射关系生成所述第二映射关系,所述第二映射关系包括所述第一物理块地址与第二介质地址,所述第一物理块地址与所述第二介质地址相关联,所述第二介质地址与所述第一介质地址不一致。The second mapping relationship is generated according to the first mapping relationship, the second mapping relationship includes the first physical block address and a second media address, and the first physical block address is related to the second media address The second medium address is not consistent with the first medium address.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    根据所述第一映射关系生成第三映射关系,所述第三映射关系包括第二物理块地址、所述第三介质地址,所述第二物理块地址与所述第三介质地址相关联,所述第二物理块地址与所述第三介质地址相关联,所述第二物理块地址与所述第一物理块地址不一致,所述第三介质地址与所述第二介质地址不一致,所述第三介质地址包括部分所述第一介质地址;Generating a third mapping relationship according to the first mapping relationship, where the third mapping relationship includes a second physical block address and the third media address, and the second physical block address is associated with the third media address; The second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, and the third media address is inconsistent with the second media address, so The third medium address includes part of the first medium address;
    使用所述第三映射关系存储数据。Use the third mapping relationship to store data.
  6. 根据权利要求4至5中任一项所述的方法,其特征在于,所述第一介质地址与所述第二介质地址位于同一裸片,或,所述第一介质地址与所述第二介质地址位于不同裸片。The method according to any one of claims 4 to 5, wherein the first media address and the second media address are located on the same die, or the first media address and the second media address are located on the same die. The media address is located on a different die.
  7. 根据权利要求3至6中任一项所述的方法,其特征在于,检测所述当前数据读取时的所述误码率,包括:The method according to any one of claims 3 to 6, wherein detecting the bit error rate when the current data is read comprises:
    读取第一数据时,检测得到第一误码率,其中,所述第一数据的存储区域为所述第一介质地址;When the first data is read, a first bit error rate is detected, wherein the storage area of the first data is the first medium address;
    当所述第一误码率大于或等于第一门限值时,备份所述第一数据与第二数据,其中,所述第二数据的存储区域为所述第二介质地址;When the first error rate is greater than or equal to a first threshold, back up the first data and the second data, where the storage area of the second data is the second medium address;
    清空所述第一介质地址与所述第二介质地址中存储的数据。Clear data stored in the first media address and the second media address.
  8. 根据权利要求7所述的方法,其特征在于,清空所述第一介质地址与所述第二介质地址中存储的数据之后,所述方法还包括:8. The method according to claim 7, wherein after clearing the data stored in the first media address and the second media address, the method further comprises:
    使用所述第二映射关系存储所述第一数据,或,Use the second mapping relationship to store the first data, or,
    使用所述第三映射关系存储所述第一数据。The first data is stored using the third mapping relationship.
  9. 根据权利要求7所述的方法,其特征在于,备份所述第一数据与所述第二数据之后,所述方法还包括:8. The method according to claim 7, wherein after backing up the first data and the second data, the method further comprises:
    检测第二误码率,其中,所述第二误码率为所述第二介质地址中存储的所述第二数据的误码率;Detecting a second bit error rate, where the second bit error rate is the bit error rate of the second data stored in the second media address;
    根据所述第一误码率和所述第二误码率,确定存储数据时使用的所述映射关系。According to the first error rate and the second error rate, the mapping relationship used when storing data is determined.
  10. 根据权利要求9所述的方法,其特征在于,根据所述第一误码率和所述第二误码率确定存储数据时使用的所述映射关系,包括:The method according to claim 9, wherein determining the mapping relationship used when storing data according to the first error rate and the second error rate comprises:
    当所述第一误码率大于所述第二误码率,则使用所述第二映射关系存储数据;When the first error rate is greater than the second error rate, use the second mapping relationship to store data;
    当所述第一误码率小于或等于所述第二误码率,则使用所述第三映射关系存储数据。When the first error rate is less than or equal to the second error rate, the third mapping relationship is used to store data.
  11. 根据权利要求1至10中任一项所述的方法,其特征在于,检测所述当前数据读取时的所述误码率,所述方法还包括:The method according to any one of claims 1 to 10, wherein detecting the bit error rate when the current data is read, the method further comprising:
    获取第一检测指令,所述第一检测指令用于触发检测所述当前数据的所述误码率,Acquiring a first detection instruction, the first detection instruction being used to trigger detection of the bit error rate of the current data,
    所述第一检测指令为空闲状态时自动触发的指令,The first detection instruction is an instruction that is automatically triggered when in an idle state,
    或,所述第一检测指令为用户主动触发的指令。Or, the first detection instruction is an instruction actively triggered by the user.
  12. 根据权利要求11所述的方法,其特征在于,根据所述第一映射关系生成所述第二映射关系之后,所述方法还包括:The method according to claim 11, wherein after generating the second mapping relationship according to the first mapping relationship, the method further comprises:
    根据所述第一检测指令和所述第一映射关系,向所述第一介质地址写入第三数据;Write third data to the first media address according to the first detection instruction and the first mapping relationship;
    根据所述第一检测指令和所述第二映射关系,向所述第二介质地址写入所述第三数据;Write the third data to the second media address according to the first detection instruction and the second mapping relationship;
    检测第三误码率,所述第三误码率为所述第一介质地址中所述第三数据的误码率;Detecting a third bit error rate, where the third bit error rate is the bit error rate of the third data in the first medium address;
    检测第四误码率,所述第四误码率为所述第二介质地址中所述第三数据的误码率;Detecting a fourth bit error rate, where the fourth bit error rate is the bit error rate of the third data in the second medium address;
    根据所述第三误码率与所述第四误码率,确定存储数据时使用的所述映射关系。According to the third error rate and the fourth error rate, the mapping relationship used when storing data is determined.
  13. 根据权利要求12所述的方法,其特征在于,根据所述第四误码率与所述第五误码率,确定存储数据时使用的所述映射关系,包括:The method according to claim 12, wherein determining the mapping relationship used when storing data according to the fourth error rate and the fifth error rate comprises:
    当所述第三误码率大于所述第四误码率,则使用所述第一映射关系存储数据;When the third error rate is greater than the fourth error rate, the first mapping relationship is used to store data;
    当所述第三误码率小于或等于所述第四误码率,则使用所述第二映射关系存储数据。When the third error rate is less than or equal to the fourth error rate, the second mapping relationship is used to store data.
  14. 一种存储装置,其特征在于,包括:A storage device, characterized in that it comprises:
    处理器,用于检测当前数据读取时的误码率;The processor is used to detect the bit error rate when reading the current data;
    所述处理器,还用于根据所述误码率,确定用于将数据存储至所述存储级内存的映射关系,其中,所述映射关系包括物理块地址与介质地址之间的关联关系;The processor is further configured to determine a mapping relationship for storing data to the storage-level memory according to the bit error rate, where the mapping relationship includes an association relationship between a physical block address and a media address;
    存储阵列,用于根据所述映射关系进行数据存储。The storage array is used for data storage according to the mapping relationship.
  15. 根据权利要求14所述的存储装置,其特征在于,The storage device according to claim 14, wherein:
    所述处理器,具体用于当所述误码率大于预设门限时,将第二映射关系确定为所述映射关系,其中,在所述第二映射关系与第一映射关系下,物理块地址与介质地址之间的关联关系不同,所述第一映射关系为,所述当前数据读取时,所述存储级内存基于所述第一映射关系进行数据存储。The processor is specifically configured to determine a second mapping relationship as the mapping relationship when the bit error rate is greater than a preset threshold, wherein, under the second mapping relationship and the first mapping relationship, the physical block The association relationship between the address and the media address is different, and the first mapping relationship is that when the current data is read, the storage-level memory performs data storage based on the first mapping relationship.
  16. 根据权利要求15所述的存储装置,其特征在于,The storage device according to claim 15, wherein:
    所述处理器,还用于当所述误码率小于或等于所述预设门限时,将所述第一映射关系确定为所述映射关系。The processor is further configured to determine the first mapping relationship as the mapping relationship when the bit error rate is less than or equal to the preset threshold.
  17. 根据权利要求16所述的存储装置,其特征在于,The storage device according to claim 16, wherein:
    所述处理器,还用于获取第一映射关系,所述第一映射关系包括第一物理块地址与第一介质地址,所述第一物理块地址与所述第一介质地址相关联;The processor is further configured to obtain a first mapping relationship, where the first mapping relationship includes a first physical block address and a first media address, and the first physical block address is associated with the first media address;
    所述处理器,还用于根据所述第一映射关系生成第二映射关系,所述第二映射关系包括所述第一物理块地址与第二介质地址,所述第一物理块地址与所述第二介质地址相关联,所述第二介质地址与所述第一介质地址不一致。The processor is further configured to generate a second mapping relationship according to the first mapping relationship, where the second mapping relationship includes the first physical block address and the second media address, and the first physical block address and the The second media address is associated, and the second media address is inconsistent with the first media address.
  18. 根据权利要求17所述的存储装置,其特征在于,The storage device according to claim 17, wherein:
    所述处理器,还用于根据所述第一映射关系生成第三映射关系,所述第三映射关系包括第二物理块地址、所述第三介质地址,所述第二物理块地址与所述第三介质地址相关联,所述第二物理块地址与所述第三介质地址相关联,所述第二物理块地址与所述第一物理块地址不一致,所述第三介质地址与所述第二介质地址不一致,所述第三介质地址包括部分所述第一介质地址;The processor is further configured to generate a third mapping relationship according to the first mapping relationship, where the third mapping relationship includes a second physical block address, the third medium address, and the second physical block address and the The third media address is associated, the second physical block address is associated with the third media address, the second physical block address is inconsistent with the first physical block address, and the third media address is inconsistent with the first physical block address. The second media addresses are inconsistent, and the third media addresses include part of the first media addresses;
    所述存储阵列,还用于使用所述第三映射关系存储数据。The storage array is also used to store data using the third mapping relationship.
  19. 根据权利要求16至18中任一项所述的存储装置,其特征在于,所述第一介质地址与所述第二介质地址位于同一裸片,或,所述第一介质地址与所述第二介质地址位于不同裸片。The storage device according to any one of claims 16 to 18, wherein the first medium address and the second medium address are located on the same die, or the first medium address and the first medium address are located on the same die. The two media addresses are located on different dies.
  20. 根据权利要求16至19中任一项所述的存储装置,其特征在于,The storage device according to any one of claims 16 to 19, wherein:
    所述处理器,还用于读取第一数据时,检测得到第一误码率,其中,所述第一数据的存储区域为所述第一介质地址;The processor is further configured to detect a first bit error rate when reading first data, wherein the storage area of the first data is the first media address;
    所述存储阵列,还用于当所述第一误码率大于或等于第一门限值时,备份所述第一数据与第二数据,其中,所述第二数据的存储区域为所述第二介质地址;The storage array is further configured to back up the first data and the second data when the first error rate is greater than or equal to a first threshold, wherein the storage area of the second data is the The second medium address;
    所述存储阵列,还用于清空所述第一介质地址与所述第二介质地址中存储的数据。The storage array is also used to clear data stored in the first medium address and the second medium address.
  21. 根据权利要求20所述的存储装置,其特征在于,The storage device according to claim 20, wherein:
    所述存储阵列,还用于使用所述第二映射关系存储所述第一数据,或,使用所述第三映射关系存储所述第一数据。The storage array is further configured to use the second mapping relationship to store the first data, or to use the third mapping relationship to store the first data.
  22. 根据权利要求20所述的存储装置,其特征在于,The storage device according to claim 20, wherein:
    所述处理器,还用于检测第二误码率,其中,所述第二误码率为所述第二介质地址中存储的所述第二数据的误码率;The processor is further configured to detect a second bit error rate, where the second bit error rate is the bit error rate of the second data stored in the second media address;
    所述处理器,还用于根据所述第一误码率和所述第二误码率,确定存储数据时使用的所述映射关系。The processor is further configured to determine the mapping relationship used when storing data according to the first error rate and the second error rate.
  23. 根据权利要求22所述的存储装置,其特征在于,The storage device according to claim 22, wherein:
    所述存储阵列,具体用于当所述第一误码率大于所述第二误码率,则使用所述第二映射关系存储数据;The storage array is specifically configured to use the second mapping relationship to store data when the first error rate is greater than the second error rate;
    所述存储阵列,具体用于当所述第一误码率小于或等于所述第二误码率,则使用所述第三映射关系存储数据。The storage array is specifically configured to use the third mapping relationship to store data when the first error rate is less than or equal to the second error rate.
  24. 根据权利要求14至23任一项所述的存储装置,其特征在于,The storage device according to any one of claims 14 to 23, wherein:
    所述处理器,还用于获取第一检测指令,所述第一检测指令用于触发检测所述当前数据的所述误码率,所述第一检测指令为空闲状态时自动触发的指令,或,所述第一检测指令为用户主动触发的指令。The processor is further configured to obtain a first detection instruction, the first detection instruction is used to trigger detection of the bit error rate of the current data, and the first detection instruction is an instruction that is automatically triggered when an idle state is used, Or, the first detection instruction is an instruction actively triggered by the user.
  25. 根据权利要求24所述的存储装置,其特征在于,The storage device according to claim 24, wherein:
    所述存储阵列,还用于根据所述第一检测指令和所述第一映射关系,向所述第一介质 地址写入第三数据;The storage array is further configured to write third data to the first media address according to the first detection instruction and the first mapping relationship;
    所述存储阵列,还用于根据所述第一检测指令和所述第二映射关系,向所述第二介质地址写入所述第三数据;The storage array is further configured to write the third data to the second media address according to the first detection instruction and the second mapping relationship;
    所述处理器,还用于检测第三误码率,所述第三误码率为所述第一介质地址中所述第三数据的误码率;The processor is further configured to detect a third bit error rate, where the third bit error rate is the bit error rate of the third data in the first medium address;
    所述处理器,还用于检测第四误码率,所述第四误码率为所述第二介质地址中所述第三数据的误码率;The processor is further configured to detect a fourth bit error rate, where the fourth bit error rate is the bit error rate of the third data in the second media address;
    所述处理器,还用于根据所述第三误码率与所述第四误码率,确定存储数据时使用的所述映射关系。The processor is further configured to determine the mapping relationship used when storing data according to the third error rate and the fourth error rate.
  26. 根据权利要求25所述的存储装置,其特征在于,包括:The storage device according to claim 25, further comprising:
    所述存储阵列,具体用于当所述第三误码率大于所述第四误码率,则使用所述第一映射关系存储数据;The storage array is specifically configured to use the first mapping relationship to store data when the third error rate is greater than the fourth error rate;
    所述存储阵列,具体用于当所述第三误码率小于或等于所述第四误码率,则使用所述第二映射关系存储数据。The storage array is specifically configured to use the second mapping relationship to store data when the third error rate is less than or equal to the fourth error rate.
  27. 一种存储装置,其特征在于,所述存储装置包括处理器、缓存器和存储器,所述存储器包含一个或多个存储单元,所述缓存器中存储有程序指令;A storage device, wherein the storage device includes a processor, a buffer, and a memory, the memory includes one or more storage units, and the buffer stores program instructions;
    其中,所述处理器用于根据所述程序指令向所述存储器存储数据,执行如权利要求1至13中任一所述的方法。Wherein, the processor is configured to store data in the memory according to the program instructions, and execute the method according to any one of claims 1 to 13.
PCT/CN2020/082483 2020-03-31 2020-03-31 Data storage method and related device WO2021195979A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080098749.8A CN115298654A (en) 2020-03-31 2020-03-31 Data storage method and related device
PCT/CN2020/082483 WO2021195979A1 (en) 2020-03-31 2020-03-31 Data storage method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/082483 WO2021195979A1 (en) 2020-03-31 2020-03-31 Data storage method and related device

Publications (1)

Publication Number Publication Date
WO2021195979A1 true WO2021195979A1 (en) 2021-10-07

Family

ID=77926915

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/082483 WO2021195979A1 (en) 2020-03-31 2020-03-31 Data storage method and related device

Country Status (2)

Country Link
CN (1) CN115298654A (en)
WO (1) WO2021195979A1 (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170364459A1 (en) * 2016-06-20 2017-12-21 Western Digital Technologies, Inc. Coherent controller
CN108710472A (en) * 2018-04-27 2018-10-26 北京大学深圳研究生院 For the abrasion equilibrium management method and distributed memory system inside storage unit
CN110580926A (en) * 2018-06-07 2019-12-17 三星电子株式会社 method for equalizing bit error rate of memory device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170364459A1 (en) * 2016-06-20 2017-12-21 Western Digital Technologies, Inc. Coherent controller
CN108710472A (en) * 2018-04-27 2018-10-26 北京大学深圳研究生院 For the abrasion equilibrium management method and distributed memory system inside storage unit
CN110580926A (en) * 2018-06-07 2019-12-17 三星电子株式会社 method for equalizing bit error rate of memory device

Also Published As

Publication number Publication date
CN115298654A (en) 2022-11-04

Similar Documents

Publication Publication Date Title
US9921914B2 (en) Redundant array of independent disks (RAID) write hole solutions
US11550678B2 (en) Memory management
TW201716980A (en) Data storage device and operating method thereof
US11714733B2 (en) Method and apparatus, and readable storage medium
WO2020019267A1 (en) Data processing method and device
WO2019090493A1 (en) Memory block recovery method and device
TW202038232A (en) Memory management method, memory storage device and memory control circuit unit
TWI591640B (en) Memory management method, memory control circuit unit and memory storage device
JP2019128948A (en) Integrated circuit device and storage device
US11281402B2 (en) Memory management method, memory storage device and memory control circuit unit
US20230098366A1 (en) Memory polling method, memory storage device and memory control circuit unit
TWI796882B (en) Read disturb checking method, memory storage device and memory control circuit unit
KR20150072469A (en) Nonvolatile memory devicee and data storage device including the same
US7047359B1 (en) Method, system and product for managing a virtual storage system
WO2022108620A1 (en) Peer storage devices sharing host control data
WO2021195979A1 (en) Data storage method and related device
WO2022252063A1 (en) Data access method, storage controller and storage device
WO2023056687A1 (en) Solid state disk and data manipulation method and apparatus therefor, and electronic device
US10956261B2 (en) Volatile memory device and operating method thereof
WO2023050927A1 (en) Memory detection method and apparatus
US20230152984A1 (en) Storage devices configured to obtain data of external devices for debugging
CN113094294B (en) SSD abnormal power failure processing method, SSD abnormal power failure processing device, computer equipment and storage medium
US20240143518A1 (en) Using Control Bus Communication to Accelerate Link Negotiation
TWI818370B (en) Data storing allocation method, memory storage apparatus and memory control circuit unit
CN114115739B (en) Memory management method, memory storage device and memory control circuit unit

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20928994

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20928994

Country of ref document: EP

Kind code of ref document: A1