DATA BACKUP METHOD AND DATA RECOVERY METHOD FOR NVDIMM, NVDIMM CONTROLLER, AND NVDIMM

Information

  • Patent Application
  • 20220083424
  • Publication Number
    20220083424
  • Date Filed
    December 24, 2019
    4 years ago
  • Date Published
    March 17, 2022
    2 years ago
Abstract
The present application provides a data backup method and a restoration method for an NVDIMM, an NVDIMM controller and an NVDIMM. The NVDIMM (200) comprises a DRAM (201), a NAND flash memory (202) and an NVDIMM controller (100), the NVDIMM controller (100) controlling the NVDIMM (200) and comprising a DDR controller (101), a NAND flash memory controller (102), a data backup module (103) and a data restoration module (104), the DDR controller (101) using and enabling DBI mechanism. During data backup, the DDR controller (101) reads N-bit DQi and 1-bit DBI from the DRAM (201) and sends the same to the data backup module (103). When DBIi is “1”, the data backup module (103) compares the DQi and DQi-1. If the number of bits of the DQi and the DQi-1 with different values is greater than N/2, then the DQi is inverted and the DBIi is set to “0”, and otherwise the DQi and the DBIi are remained unchanged. When the DBIi is “0”, the DQi and the DBIi are remained unchanged. The data backup module (103) sends the processed DQi and DBIi to the NAND flash memory controller (102), which then writes the processed DQi and DBIi into the NAND flash memory (202).
Description
TECHNICAL FIELD

The present application relates to the field of non-volatile memory, and in particular to a low-power data backup method and data restoration method for a Non-Volatile Dual In-line Memory Module (NVDIMM), an NVDIMM controller and an NVDIMM.


BACKGROUND ART

NVDIMM is a non-volatile memory, including a DRAM, a NAND flash memory (NAND Flash) and an NVDIMM controller. When a motherboard/CPU is abnormal or powered down, the NVDIMM controller is notified through interruptions or messages, and then the NVDIMM controller backs up the data in a DRAM to a NAND flash memory. Thereafter, when the motherboard/CPU is powered up again, it notifies the NVDIMM controller to restore the data backed up in the NAND flash memory to the DRAM, and charge supercapacitors. During data backup, the NVDIMM is powered by supercapacitors; nevertheless, the power supply capability of supercapacitors is limited and is largely attenuated as the service time and operating temperature increase. For an NVDIMM, the power consumption of data backup and the time of data backup/restoration are two important product performance indicators, which determine the capacity and reliability of supercapacitors and the cost of product. The increase in power consumption of data backup inevitably requires an increase in the capacity of supercapacitors for compensation, while the increase in the capacity of supercapacitors may increase the cost and reduce the reliability; additionally, the data backup/restoration time determines the power consumption and user experience during data backup. Therefore, a low-power and fast NVDIMM data backup and restoration method can significantly improve the competitiveness of product.


For an NVDIMM controller of DDR4, power consumption mainly comes from the interfaces of DDR and NAND. In the prior art, use of Data Bus Inversion (DBI) mechanism on the DDR interface side can reduce power consumption by about 25-40%. Because the NAND flash memory interface does not provide the signal of data inversion, it is difficult to reduce power consumption of the NAND interface. The NAND flash memory usually works at 1.8V (version lower than ONFI4.0), and is the main source of the power consumption of NVDIMM controller interface.


Chinese Patent Publication CN107861901A discloses a storage method and system based on NVDIMM-F. The method comprises sending data to be stored to the NVDIMM-F when the CPU receives the data to be stored; storing the data to be stored by the NVDIMM-F. By directly storing the data to be stored in the NVDIMM-F, the method provided by the invention greatly improves the transmission rate of the data to be stored. The method, however, only relates to the operation of storing data in a NAND by an NVDIMM, and does not relate to how to perform a low-power design on the NAND interface according to the characteristics of operation data so as to reduce the power consumption of the NAND interface.


SUMMARY OF THE INVENTION

The present application is directed to an NVDIMM controller of a DDR using DBI mechanism, wherein during data backup, the NVDIMM controller, according to the characteristics of the DDR data (DBI enable), inverts data when the DBI signal is not inverted and the adjacent DDR data conform to the inversion rules after being compared with each other, so as to reduce power consumption of the NAND interface. Optionally, the DDR data and the DBI signal are encoded and arranged in a certain format during data backup, thereby improving the rate of data restoration. The application can solve the following problems of the NVDIMM controller of the DDR using the DBI mechanism:


a) reducing the power consumption of the NAND interface;


b) improving data restoration rate.


According to a first aspect of the present application, there is provided a data backup method for an NVDIMM, the NVDIMM comprising a DRAM, a NAND flash memory and an NVDIMM controller, the NVDIMM controller controlling the NVDIMM and comprising a DDR controller, a NAND flash memory controller and a data backup module, wherein the DRAM adopts and enables DBI mechanism, the data backup method comprising:


reading, by the DDR controller, N-bit DQi and 1-bit DBIi from the DRAM and sending the same to the data backup module, comparing, by the data backup module, the DQi with DQi-1 when the DBIi is “1”, if the number of bits of the DQi and the DQi-1 with different values is greater than N/2, inverting the DQi and setting the DBIi to “0”, and otherwise maintaining the DQi and the DBIi unchanged; maintaining the DQi and the DBIi unchanged when the DBIi is “0”,


sending, by the data backup module, the processed DQi and DBIi to the NAND controller, and writing, by the NAND controller, the processed DQi and DBIi into the NAND flash memory.


According to a preferred embodiment of the first aspect of the present application, wherein the data backup module arranges the order of the DQi and the DBIi with a page of the NAND flash memory as a unit.


According to a preferred embodiment of the first aspect of the present application, wherein the DRAM is DDR4.


According to a preferred embodiment according to the first aspect of the present application, wherein the DRAM is DDR4×8 or DDR4×16. Those skilled in the art should appreciate that the number N of bits of the DQi can be an integer multiple of 8.


According to a second aspect of the present application, there is provided a data restoration method for an NVDIMM, the NVDIMM comprising a DRAM, a NAND flash memory and an NVDIMM controller, the NVDIMM controller controlling the NVDIMM and comprising a DDR controller, a NAND flash memory controller and a data restoration module, wherein the DRAM adopts and enables DBI mechanism, the data restoration method comprising:


reading, by the NAND controller, N-bit DQi and 1-bit DBIi from the NAND flash memory and sending the same to the data restoration module,


judging, by the data restoration module, the values of the DQi and the DBIi, if DBIi=0 and the number of “1”s in the DQi is less than or equal to N/2, inverting the DQi and rewriting the DBIi to “1” by the data restoration module, and otherwise maintaining the DQi and the DBIi unchanged,


sending, by the data restoration module, the processed DQi and DBIi to the DDR controller, and pulling down or pulling up, by the DDR controller, the DBI of the interface of the DDR controller according to the value of the 1-bit DBIi and sending the DQi to the DRAM.


According to a preferred embodiment of the second aspect of the present application, wherein the data restoration module restores the DQi and the DBIi with a page of the NAND flash memory as a unit.


According to a preferred embodiment of the second aspect of the present application, wherein the DRAM is DDR4.


According to a preferred embodiment of the second aspect of the present application, wherein the DRAM is DDR4×8 or DDR4×16. Those skilled in the art should appreciate that the number N of bits of the DQi can be an integer multiple of 8.


According to a third aspect of the present application, there is provided an NVDIMM controller, the NVDIMM controller comprises a DDR controller and a NAND flash memory controller, and is used to control an NVDIMM, the NVDIMM comprising a DRAM and a NAND flash memory, wherein the DRAM adopts DBI mechanism, characterized in that, the NVDIMM controller further comprises:


a data backup module, which compares DQi with DQi-1 when DBIi is “1”, if the number of bits of the DQi and the DQi-1 with different values is greater than N/2, inverts the DQi, and otherwise maintains the DQi and the DBIi unchanged, and which maintains the DQi and the DBIi unchanged when the DBIi is “0”; and a data restoration module, which judges the values of DQi and DBIi received from the NAND flash memory controller, if DBIi=0 and the number of “1”s in the DQi is less than or equal to N/2, inverts the DQi and rewrites the DBIi to “1”, and otherwise maintains the DQi and the DBIi unchanged.


According to a preferred embodiment of the third aspect of the present application, wherein the data backup module arranges the order of the DQi and the DBIi with a page of the NAND flash memory as a unit.


According to a preferred embodiment of the third aspect of the present application, wherein the data restoration module restores the DQi and the DBIi with the page of the NAND flash memory as a unit.


According to a preferred embodiment of the third aspect of the present application, wherein the DRAM is DDR4.


According to a preferred embodiment of the third aspect of the present application, wherein the DRAM is DDR4×8 or DDR4×16. Those skilled in the art should appreciate that the number N of bits of the DQi can be an integer multiple of 8.


According to the fourth aspect of the present application, there is provided an NVDIMM, the NVDIMM comprising the NVDIMM controller according to the third aspect mentioned above.





DESCRIPTION OF THE FIGURES

The present application will be better understood through the following detailed description in conjunction with the figures. It should be understood that these figures are for illustrative purpose only and are not necessarily drawn in scale. In the figures:



FIG. 1 is a system block diagram of an NVDIMM controller according to an embodiment of the present application.



FIG. 2 is a schematic diagram of an NVDIMM according to an embodiment of the present application.





DETAILED DESCRIPTION

According to the present application, an NVDIMM controller achieves the non-volatile function mainly by a DDR controller, a NAND flash memory controller and a data backup/restoration module, the three of which are implemented using FPGA or ASIC. The present application is directed to DDR that uses DBI mechanism. Unless otherwise noted, DDR herein refers to DDR4; nevertheless, it should be understood that the present application is not limited to DDR4, and is also applicable to other existing and future DDR versions that support DBI mechanism.



FIG. 1 also shows a data backup and restoration method according to an embodiment of the present application. Taking DDR4×8 as an example, the interface signal related to the DDR controller is 8-bit DQ and 1-bit DBI.


The data backup method of an NVDIMM controller will be described in detail below.


The DDR controller reads data from a DRAM. Due to the DBI mechanism, there are nine possible relationships between the number of “1”s in DQ and the DBI. As shown in Table 1, when DBI is ‘0’, it is indicated that the DQ data is inverted, and otherwise the DQ data is not inverted.









TABLE 1







Values and relationships between DQ and DBI











DQ[7:0]
DBI
Description















four “1”s in DQ
1
DQ is not inverted



five “1”s in DQ
1
DQ is not inverted



five “1”s in DQ
0
DQ is inverted



six “1”s in DQ
1
DQ is not inverted



six “1”s in DQ
0
DQ is inverted



seven “1”s in DQ
1
DQ is not inverted



seven “1”s in DQ
0
DQ is inverted



eight “1”s in DQ
1
DQ is not inverted



eight “1”s in DQ
0
DQ is inverted










A data backup module processes DQ and DBI. For DQi, if the DBI of the DQi is 1, the data backup module will compare the DQi with DQi-1 and detect the number of bits of the DQi and the DQi-1 with different values. If the number of bits with different values is greater than N/2, wherein the number of bits of DQ is N, then the data backup module inverts the DQi and sets the DBI of the DQi to “0”. If the number of bits with different values is less than or equal to N/2, then the data backup module maintains the DQi and the DBIi unchanged. If the DBI of the DQ is “0”, then the data backup module does not compare the DQi with the DQi-1 and maintains the DQi and the DBIi unchanged. The data backup module will send the processed DQ and DBI to a NAND controller, and write the processed DQ and DBI into a NAND flash memory by means of the NAND controller to complete data backup. Herein, the number N of bits of DQ can be an integer multiple of 8.


When the data backup module processes DQ and DBIi it can take a page of NAND flash memory as a unit. Take a page with a size of 9 KB as an example, 8 KB DQ and 1 KB DBI are read from a DDR interface, and the DQ and the DBI are organized in the following format:


DQ0DQ1DQ2DQ3DQ4DQ5DQ6DQ7DBI0DBI1DBI2DBI3DBI4DBI5DBI6DBI7.


It should be understood that the DQi is 8 KB in size and the DBIi is 1 KB in size. In addition, it should be understood that any other suitable formats may be used.


The data restoration method of the NVDIMM controller is as follows:


The NAND controller reads DQ and DBI from a NAND flash memory and sends the same to a data restoration module. The decoding rule of the data restoration module is as follows: if DBIi=0 and the number of “1”s in the corresponding DQi is less than or equal to 4, then the data restoration module inverts the DQi and rewrites the DBIi to “1”, and otherwise maintains the DQi and the DBIi unchanged; if DBIi=0 and the number of “1”s in the corresponding DQi is greater than 4, or if DBIi=1, then the data restoration module maintains the DQi and the DBIi unchanged. Then, the data backup and restoration modules, according to DBI rules, write DQ into the DRAM by means of the DDR controller.


When the data backup module processes the DQ and the DBI with a page of the NAND flash memory as a unit, it reads and backs up the written data with the page as a unit, and parses the data according to the written format to obtain the DQ and DBI stored in the NAND flash memory.



FIG. 2 is a schematic diagram of an NVDIMM according to an embodiment of the present application. As shown in FIG. 2, an NVDIMM controller 100 comprises a DDR controller 101, a NAND flash memory controller 102, a data backup module 103, and a data restoration module 104. The NVDIMM controller controls an NVDIMM 200 including a DRAM 201 and a NAND flash memory 202, and the data backup and restoration modules implement the data backup method and the data restoration method described above with respect to FIG. 1. The DDR controller is coupled to the DRAM. The NAND flash memory controller is coupled to the NAND flash memory. The data backup module is coupled to the DDR controller and the NAND flash memory controller, and the data restoration module is coupled to the DDR controller and the NAND flash memory controller.


It should be understood that these embodiments are only for illustrative purpose, those skilled in the art can make many variations, and the scope of the present application is defined by the claims.

Claims
  • 1. A data backup method for an NVDIMM, the NVDIMM comprising a DRAM, a NAND flash memory and an NVDIMM controller, the NVDIMM controller controlling the NVDIMM and comprising a DDR controller, a NAND flash memory controller and a data backup module, wherein the DRAM adopts and enables DBI mechanism, the data backup method comprising: reading, by the DDR controller, N-bit DQi and 1-bit DBIi from the DRAM and sending the same to the data backup module,comparing, by the data backup module, the DQi and DQi-1 when the DBIi is “1”, if the number of bits of the DQi and the DQi-1 with different values is greater than N/2,inverting the DQi and setting the DBIi to “0”, and otherwise maintaining the DQi and the DBIi unchanged; maintaining the DQi and the DBIi unchanged when the DBIi is “0”,sending, by the data backup module, the processed DQi and DBIi to the NAND controller, and writing, by the NAND controller, the processed DQi and DBIi into the NAND flash memory.
  • 2. The data backup method according to claim 1, wherein the data backup module arranges the order of the DQi and the DBIi with a page of the NAND flash memory as a unit.
  • 3. The data backup method according to claim 1, wherein the DRAM is DDR4.
  • 4. The data backup method according to claim 3, wherein the DRAM is DDR4×8 or DDR4×16.
  • 5. A data restoration method for an NVDIMM, the NVDIMM comprising a DRAM, a NAND flash memory and an NVDIMM controller, the NVDIMM controller controlling the NVDIMM and comprising a DDR controller, a NAND flash memory controller and a data restoration module, wherein the DRAM adopts and enables DBI mechanism, the data restoration method comprising: reading, by the NAND controller, N-bit DQi and 1-bit DBIi from the NAND flash memory and sending the same to the data restoration module,judging, by the data restoration module, the values of the DQi and the DBIi, if DBIi=0 and the number of “1”s in the DQi is less than or equal to N/2,inverting the DQi and rewriting the DBIi to “1” by the data restoration module, and otherwise maintaining the DQi and the DBIi unchanged,sending, by the data restoration module, the processed DQi and DBIi to the DDR controller, andpulling down or pulling up, by the DDR controller, the DBI of the interface of the DDR controller according to the value of the 1-bit DBIi and sending the DQi to the DRAM.
  • 6. The data restoration method according to claim 5, wherein the data restoration module restores the DQi and the DBIi with a page of the NAND flash memory as a unit.
  • 7. The data restoration method according to claim 5, wherein the DRAM is DDR4.
  • 8. The data restoration method according to claim 7, wherein the DRAM is DDR4×8 or DDR4×16.
  • 9. An NVDIMM controller, the NVDIMM controller comprises a DDR controller and a NAND flash memory controller and is used to control an NVDIMM, the NVDIMM comprising a DRAM and a NAND flash memory, wherein the DRAM adopts DBI mechanism, characterized in that, the NVDIMM controller further comprises: a data backup module, which compares DQi with DQi-1 when DBIi is “1”, if the number of bits of DQi and DQi-1 with different values is greater than N/2, inverts the DQi and otherwise maintains the DQi and the DBIi unchanged, and which maintains the DQi and the DBIi unchanged when the DBIi is “0”; anda data restoration module, which judges the values of DQi and DBIi received from the NAND flash memory controller, if DBIi=0 and the number of “1”s in the DQi is less than or equal to N/2, inverts the DQi and rewrites the DBIi to “1”, and otherwise maintains the DQi and the DBIi unchanged.
  • 10. The NVDIMM controller according to claim 9, wherein the data backup module arranges the order of the DQi and the DBIi with a page of the NAND flash memory as a unit.
  • 11. The NVDIMM controller according to claim 10, wherein the data restoration module restores the DQi and the DBIi with the page of the NAND flash memory as a unit.
  • 12. The NVDIMM controller according to claim 10, wherein the DRAM is DDR4.
  • 13. The NVDIMM controller method according to claim 12, wherein the DRAM is DDR4×8 or DDR4×16.
  • 14. An NVDIMM, comprising the NVDIMM controller as claimed in claim 9.
  • 15. The data backup method according to claim 2, wherein the DRAM is DDR4.
  • 16. The data backup method according to claim 15, wherein the DRAM is DDR4×8 or DDR4×16.
  • 17. The data restoration method according to claim 6, wherein the DRAM is DDR4.
  • 18. The data restoration method according to claim 17, wherein the DRAM is DDR4×8 or DDR4×16.
Priority Claims (1)
Number Date Country Kind
201811641838.3 Dec 2018 CN national
PCT Information
Filing Document Filing Date Country Kind
PCT/CN2019/127883 12/24/2019 WO 00