Data backup method and device for partition namespace solid state disk and electronic equipment
By writing data in accordance with ZNS interface specifications on solid state drives and using hardware acceleration module to generate checksums, the problem of lack of backup and recovery mechanism for writing solid state drive data to partition namespace is solved, and efficient and secure data backup and fast data are achieved recover.
Patent Information
- Application Number
- CN202411373877.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-02-11
AI Technical Summary
The prior art lacks a secure backup mechanism for writing solid-state drive data to partition namespaces and a recovery mechanism when data is incorrect.
By writing data blocks to the solid-state drive SSD according to the partition namespace ZNS interface specification, and using the hardware acceleration module for checksum operation, a checksum of the calculation cycle is generated. These checksums are stored on the SSD for data recovery when data is lost.
It realizes efficient and secure backup of SSD data written to partition namespace, and quickly and accurately restores data when data is lost, reducing system downtime.
Smart Images

Figure CN119415313A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of solid-state hard disks, and in particular to a data backup method, device and electronic device for a partition namespace solid-state hard disk. Background Art
[0002] With the rapid development of information technology, the security of information transmission, storage and use has become a focus of attention. The realization of data storage is inseparable from the support of storage media. Among them, solid-state drives (SSDs) have widely occupied the dominant position in the storage market with their significant data transmission speed and stability advantages. As an advanced storage device, SSDs far exceed traditional hard drives in performance. In addition, SSDs using Zoned Namespace (ZNS) technology effectively alleviate the device's write amplification problem by providing standardized interfaces, reduce the demand for over-provisioning (OP) space, and reduce the use of dynamic random access memory (DRAM). At the same time, they increase bandwidth and reduce latency, significantly optimizing storage performance.
[0003] However, although ZNS technology brings many advantages, it lacks a mechanism for securely backing up data and a mechanism for recovering data when errors occur.
[0004] Therefore, how to efficiently and securely back up the data written to the partition namespace solid-state drive is a technical problem that needs to be solved urgently. Summary of the invention
[0005] In view of the above problems existing in the prior art, the present invention provides a data backup method, device and electronic device of a partition namespace solid-state hard disk, so as to efficiently and safely back up the data written into the partition namespace solid-state hard disk.
[0006] The present invention provides a data backup method for a partition namespace solid state hard disk, comprising the following steps.
[0007] In accordance with the partition namespace ZNS interface specification, each data block in the data to be written is written to the solid state drive SSD in sequence; wherein the size of each data block is set according to the ZNS protocol; in the process of writing each data block to the SSD, each data block is sent to the hardware acceleration module, instructing the hardware acceleration module to use a preset algorithm to perform checksum operations on all the data blocks in a calculation cycle in units of a single data block to obtain a checksum of the calculation cycle; wherein a calculation cycle contains a preset number of data blocks; the checksum of each calculation cycle is stored, so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0008] According to a data backup method for a partitioned namespace solid-state hard disk provided by the present invention, the preset algorithm includes an XOR operation, and the checksum of the calculation cycle includes a first checksum; the preset algorithm is used to perform a checksum operation on all the data blocks in the calculation cycle in units of a single data block to obtain the checksum of the calculation cycle, including: performing an XOR operation on each data block in the calculation cycle and an initial value of the first checksum in turn, updating the checksum value one by one, and finally obtaining the first checksum.
[0009] According to a data backup method for a partition namespace solid-state hard disk provided by the present invention, the checksum of the calculation cycle also includes a second checksum; the use of a preset algorithm, taking a single data block as a unit, to perform a checksum operation on all the data blocks in the calculation cycle to obtain the checksum of the calculation cycle includes: sequentially performing a Galois field operation on each data block in the calculation cycle and an element at a corresponding position in a preset fixed value array to obtain a representation of each data block in the Galois field; sequentially performing an XOR operation on the representation of each data block in the calculation cycle in the Galois field and an initial value of the second checksum, successively updating the checksum value, and finally obtaining the second checksum.
[0010] According to a data backup method for a partitioned namespace solid-state hard disk provided by the present invention, data recovery is performed based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit, including: in response to the loss of one data block in the backup unit, each non-lost data block in the backup unit is sequentially XORed with the initial value of the first checksum, and the checksum value is updated successively to finally obtain a first recovery checksum; and the lost data block is recovered based on the XOR operation between the first checksum of the calculation cycle corresponding to the backup unit and the first recovery checksum.
[0011] According to a data backup method of a partition namespace solid state drive provided by the present invention, data recovery is performed based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, taking each data block in the backup unit as a recovery unit, including: In response to the loss of two data blocks in the backup unit, each non-lost data block in the backup unit is sequentially XORed with the initial value of the first checksum, and the checksum value is updated successively to finally obtain a second recovery checksum; each non-lost data block in the backup unit is sequentially subjected to Galois field operation with the elements at corresponding positions in the preset fixed value array to obtain a representation of each non-lost data block in the Galois field; the representation of each non-lost data block in the Galois field is sequentially XORed with the initial value of the second checksum, and the checksum value is updated successively to finally obtain a third recovery checksum; and the two lost data blocks are recovered using the second recovery checksum, the third recovery checksum, and the first and second checksums of the calculation cycle corresponding to the backup unit.
[0012] According to a data backup method for a partition namespace solid-state hard disk provided by the present invention, the method utilizes the second recovery checksum, the third recovery checksum, the first checksum and the second checksum of the calculation cycle corresponding to the backup unit to recover the two lost data blocks, including: obtaining an XOR value of the two lost data blocks according to an XOR operation between the first checksum and the second recovery checksum; obtaining an XOR value of the two lost data blocks represented in a Galois field according to an XOR operation between the second checksum and the third recovery checksum; and solving simultaneous equations according to the XOR value of the two lost data blocks and the XOR value of the two lost data blocks represented in a Galois field to obtain the two lost data blocks.
[0013] The present invention also provides a data backup device for a partition namespace solid state hard disk, comprising the following modules: A writing module is used to write each data block in the data to be written into the solid state drive SSD in sequence according to the partition name space ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol; a sending module is used to send each data block to the hardware acceleration module during the process of writing each data block into the SSD, and instruct the hardware acceleration module to perform checksum operations on all the data blocks in the calculation cycle in units of single data blocks using a preset algorithm to obtain the checksum of the calculation cycle; wherein a calculation cycle contains a preset number of data blocks; a storage module is used to store the checksum of each calculation cycle, so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0014] The present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, a data backup method for a partition namespace solid state drive as described in any one of the above-mentioned methods is implemented.
[0015] The present invention also provides a non-transitory computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the data backup method of the partition namespace solid state hard disk as described in any one of the above is implemented.
[0016] The present invention also provides a computer program product, including a computer program, which, when executed by a processor, implements any of the above-mentioned partition namespace solid state hard disk data backup methods.
[0017] The data backup method, device and electronic device of the partition namespace solid-state hard disk provided by the present invention can realize efficient data writing by orderly writing data blocks to the solid-state hard disk SSD in accordance with the partition namespace ZNS interface specification, combined with the checksum operation of the hardware acceleration module. The use of the hardware acceleration module reduces the burden on the host and makes the data writing process faster. During data recovery, the lost data blocks can be quickly restored by using the hardware acceleration module and the checksum of each calculation cycle stored, reducing system downtime. The checksum storage of each calculation cycle provides a reliable basis for data recovery. When data errors or loss occur, the data can be restored quickly and accurately. In this way, the data written to the partition namespace solid-state hard disk can be backed up efficiently and safely. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0019] Figure 1 It is a flow chart of the data backup method of the partition namespace solid state drive provided by the present invention.
[0020] Figure 2 This is one of the flow charts of the data recovery method of the partition namespace solid state drive provided by the present invention.
[0021] Figure 3 This is the second flow chart of the data recovery method of the partition namespace solid state drive provided by the present invention.
[0022] Figure 4 It is a schematic diagram of the framework of data backup and recovery of the partition namespace solid state drive provided by the present invention.
[0023] Figure 5 It is a schematic diagram of the data backup process of the partition namespace solid state drive provided by the present invention.
[0024] Figure 6 It is a schematic diagram of the data recovery process of the partition namespace solid state drive provided by the present invention.
[0025] Figure 7 It is a schematic diagram of the working process of the hardware acceleration module provided by the present invention.
[0026] Figure 8 It is a structural schematic diagram of a data backup device of a partition namespace solid state hard disk provided by the present invention.
[0027] Fig. 9 It is a structural schematic diagram of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with the drawings of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0029] Combine the following Figure 1-Figure 7 The data backup method of the partition namespace solid state hard disk of the present invention is described.
[0030] Figure 1 1 is a flow chart of the data backup method of the partition namespace solid state drive provided by the present invention. Figure 1 As shown, the method includes the following: Step 101: Write each data block in the data to be written into the solid state drive SSD in sequence according to the partition name space ZNS interface specification.
[0031] In the specific implementation process, the system is initialized first, the storage device is divided into several Zoneds, and the size of each data block in the data to be written is set through the ZNS protocol. Figure 7 As shown, the hardware acceleration module is initialized, its required registers are configured, and the state is changed to the ready state.
[0032] Users can customize the partition range to form each zone. Before writing data, the current status of the target zone must be detected to ensure that it is in a writable state. The status of the zone includes the following: ZSE (Zoned Space Empty): There is no data in the zone and it can be written.
[0033] ZSF (Zoned Space Full): The zone is full and no new data can be written.
[0034] ZNC (Zoned Not Closed): The zone is in an unclosed state, but this state is usually not directly associated with write possibility.
[0035] ZSIO (Zoned Space Implicitly Open): The zone has been implicitly opened and is ready to accept writes.
[0036] ZSEO (Zoned Space Explicitly Open): The zone has been explicitly opened and data can be written.
[0037] ZSRO (Zoned Space Read-Only): The zone is read-only and cannot be written.
[0038] ZSO (Zoned Space Offline): The zone is offline and cannot be accessed or written.
[0039] The system determines the specific status of each zone through the zone management mechanism, and allows data writing operations only when the zone is in the ZSIO or ZSEO state.
[0040] When the initialization is completed, the host sends a write command, and the data blocks to be written will be written into the SSD one by one in order. During the data writing process, the host will rely on the write pointer in each zone to determine the starting position of each data block, and will divide each data block according to the preset fixed logical block address (LBA) number as the basic unit of writing.
[0041] Step 102: When writing each data block to the SSD, each data block is sent to the hardware acceleration module, instructing the hardware acceleration module to use a preset algorithm to perform checksum operations on all data blocks in the calculation cycle in units of single data blocks to obtain a checksum of the calculation cycle.
[0042] As an example only, 64 data blocks are taken as one calculation cycle for explanation below.
[0043] In the specific implementation process, the hardware acceleration module can use a variety of preset algorithms to perform checksum operations on all data blocks in a calculation cycle with a single data block as a unit to obtain a checksum of the calculation cycle.
[0044] In some embodiments, the preset algorithm includes an XOR operation, and the checksum of the calculation cycle includes a first checksum. The hardware acceleration module sequentially performs an XOR operation on each data block in the calculation cycle and an initial value of the first checksum, updates the checksum value one by one, and finally obtains the first checksum. The formula is as follows.
[0045] A = A^D0, A = A^D1,……, A = A^D63 (1)
[0046] Among them, D0~D63 are data arranged sequentially in a data block respectively, A is the first checksum, its initial value (for example, 0) is XORed with D0, and the value of A is updated according to the XOR result with D0: A = A^D0; the updated A continues to be XORed with D1, and the value of A continues to be updated according to the XOR result with D1: A = A^D1, and so on, until the final first checksum is obtained.
[0047] In some embodiments, the checksum of the calculation cycle also includes a second checksum. The hardware acceleration module sequentially performs Galois field operations on each data block in the calculation cycle and the elements at the corresponding positions in the preset fixed value array to obtain the representation of each data block in the Galois field; sequentially performs an XOR operation on the representation of each data block in the calculation cycle in the Galois field and the initial value of the second checksum, and updates the checksum value one by one to finally obtain the second checksum. The formula is as follows.
[0048] B=B^GF(n0,D0),B=B^GF(n1,D1),… ,B=B^GF(n63,D63) (2)
[0049] Among them, B is the second checksum, n0~n63 are elements arranged in sequence in the preset fixed value array n, each data in the preset fixed value array n is different, and GF is a Galois field operation, which is a reversible operation, such as a multiplication operation.
[0050] The hardware acceleration module is a dedicated hardware component that can implement the checksum operation, and the specific implementation method is not limited by the description of this specification. For example, the hardware acceleration module can be implemented by an application-specific integrated circuit (ASIC), which can implement the first checksum operation and the second checksum operation. For another example, the hardware acceleration module can be implemented by a field programmable gate array (FPGA), which can implement the first checksum operation and the second checksum operation.
[0051] Step 103, store the checksum of each calculation cycle, so that when the data written to the SSD is lost, use the hardware acceleration module to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, and take each data block in the backup unit as the recovery unit.
[0052] In the specific implementation process, Figure 5 As shown, the first checksum and the second checksum of each calculation cycle calculated in the above steps can be stored in different storage areas. When the data written to the SSD is lost, the hardware acceleration module can be used to recover the data based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit.
[0053] The backup unit is a storage area obtained by dividing the storage space of the SSD according to the computing cycle. As an example only, the first backup unit may be the storage area where the data written to the SSD in the first computing cycle is located.
[0054] In the specific implementation process, when the system detects data loss, it sends a data recovery calculation request to the hardware acceleration module, and the hardware acceleration module performs data recovery calculation according to the situation of the lost data.
[0055] like Figure 6 As shown, in a specific implementation process, the situations where the method provided by the present invention can be used to recover lost data may include: Recovery method 1: One data block in a backup unit is lost. In this case, the first checksum or the second checksum can be used to recover the lost data. For a specific implementation, see Figure 2 The relevant content in will not be repeated here.
[0056] Recovery method 2: Two data blocks in a backup unit are lost. In this case, the first checksum and the second checksum are used to recover the lost data. For a specific implementation, see Figure 2 The relevant content in will not be repeated here.
[0057] It is also possible that one or both of the first checksum and the second checksum are lost: Recovery method 3: The first checksum of a backup unit is lost. In this case, the first checksum can be recalculated using all the data of the backup unit.
[0058] Recovery mode 4: The second checksum of a backup unit is lost. In this case, the second checksum can be recalculated using all the data of the backup unit.
[0059] Recovery mode 5: The first checksum and the second checksum of a backup unit are lost. In this case, the first checksum and the second checksum can be recalculated using all the data of the backup unit.
[0060] It is also possible that one of the first checksum and the second checksum is lost, and one data block in the backup unit is lost: Recovery method 6: If one data block in a backup unit and the first checksum are lost, the second checksum can be used to recover the lost data. The first checksum is then recalculated using the recovered data and other data in the backup unit.
[0061] Recovery method 7: If one data block in a backup unit and the second checksum are lost, the first checksum can be used to recover the lost data, and then the second checksum is recalculated using the recovered data and other data in the backup unit.
[0062] After the lost data is recovered using the hardware acceleration module, the recovered data can be stored in the host's designated location as a data security backup.
[0063] like Figure 4 As shown, in the present invention, the host writes data to the SSD through the ZNS standard interface, and at the same time, the data backup hardware acceleration unit of the hardware acceleration module calculates the first checksum and the second checksum of each calculation cycle, and stores the calculation results in the hardware storage unit; when the data in the SSD is lost, the data recovery hardware acceleration unit of the hardware acceleration module uses the stored first checksum and the second checksum to perform data recovery calculations.
[0064] Figure 2This is one of the flow charts of the data recovery method of the partition namespace solid state drive provided by the present invention. Figure 2 As shown, the method includes the following: Step 201: In response to a data block in a backup unit being lost, each non-lost data block in the backup unit is XORed with an initial value of a first checksum in turn, and the checksum value is updated successively to finally obtain a first recovery checksum.
[0065] As an example only, A is the first checksum obtained by XORing the 64 data blocks D0, D1, ..., D63 in the backup unit in sequence, and the remaining 63 data are D0, D1, ..., Dk-1, Dk+1, ..., D63. In order to restore Dk, it is necessary to calculate the first recovery checksum A', which is the result of XORing all other data except Dk, A'=D0^D1^...^Dk-1^Dk+1^D63.
[0066] Step 202: Restore the lost data block according to an XOR operation between the first checksum of the calculation cycle corresponding to the backup unit and the first recovery checksum.
[0067] In a specific implementation process, based on the characteristics of XOR operation, the first checksum of the calculation cycle corresponding to the backup unit and the first recovery checksum calculated in the above step can be XORed, and the result is the lost data block.
[0068] Figure 3 This is the second flow chart of the data recovery method of the partition namespace solid state drive provided by the present invention. Figure 3 As shown, the method includes the following: Step 301: In response to the loss of two data blocks in the backup unit, each non-lost data block in the backup unit is XORed with the initial value of the first checksum in turn, and the checksum value is updated successively to finally obtain a second recovery checksum.
[0069] As an example only, A is the first checksum obtained by XORing the 64 data blocks D0, D1, ..., D63 in the backup unit in sequence. The lost data blocks are Di and Dj. The second recovery checksum A''=D0^D1^...^Di−1^Di+1^...^Dj−1^Dj+1^...^D63 is calculated using the 62 data blocks that are not lost in the backup unit.
[0070] Step 302: perform Galois Field operations on each non-lost data block in the backup unit and the elements at corresponding positions in the preset fixed value array in turn to obtain the representation of each non-lost data block in the Galois Field.
[0071] As an example only, the 62 non-lost data blocks and a preset fixed value array may be used to calculate the representation of each non-lost data block in the Galois field: GF(n0, D0), GF(n1, D1) ... GF(n63, D63).
[0072] Step 303: perform an XOR operation on the representation of each non-lost data block in the Galois Field and the initial value of the second checksum in turn, update the checksum value one by one, and finally obtain a third restored checksum.
[0073] As an example only, B is the second checksum obtained by sequentially XORing the 64 data blocks D0, D1, ..., D63 in the backup unit. The lost data blocks are Di and Dj. The third recovery checksum B'=B'^GF(n0,D0), B'=B'^GF(n1,D1), ..., B'=B'^GF(n63,D63) is calculated using the 62 data blocks that are not lost in the backup unit.
[0074] Step 304: Recover the two lost data blocks using the second recovery checksum, the third recovery checksum, the first checksum and the second checksum of the calculation cycle corresponding to the backup unit.
[0075] In some embodiments, the XOR value of the two lost data blocks can be obtained based on the XOR operation between the first checksum and the second recovered checksum; the XOR value of the two lost data blocks represented in the Galois field can be obtained based on the XOR operation between the second checksum and the third recovered checksum; based on the XOR value of the two lost data blocks and the XOR value of the two lost data blocks represented in the Galois field, the simultaneous equations are solved to obtain the two lost data blocks.
[0076] The above process can be realized through the logical calculation of the hardware acceleration module.
[0077] The data backup device of the partition namespace solid state drive provided by the present invention is described below. The data backup device of the partition namespace solid state drive described below and the data backup method of the partition namespace solid state drive described above can be referenced to each other.
[0078] Figure 8 Schematic diagram of the structure of the data backup device of the partition namespace solid state hard disk provided by the present invention. Figure 8 As shown, the device 800 includes the following modules.
[0079] The writing module 810 is used to write each data block in the data to be written into the solid state drive SSD in sequence according to the partition name space ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol.
[0080] The sending module 820 is used to send each data block to the hardware acceleration module during the process of writing each data block into the SSD, and instruct the hardware acceleration module to use a preset algorithm to perform checksum operations on all the data blocks in a calculation cycle in units of a single data block to obtain a checksum of the calculation cycle; wherein one calculation cycle includes a preset number of data blocks.
[0081] The storage module 830 is used to store the checksum of each of the calculation cycles, so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0082] Fig. 9 An example of a physical structure diagram of an electronic device is shown in FIG. Fig. 9 As shown, the electronic device may include: a processor (processor) 910 , a communication interface (Communications Interface) 920 , a memory (memory) 930 and a communication bus 940 , wherein the processor 910 , the communication interface 920 , and the memory 930 communicate with each other through the communication bus 940 . The processor 910 can call the logic instructions in the memory 930 to execute the data backup method of the partition namespace solid state drive, which method includes: writing each data block in the data to be written to the solid state drive SSD in sequence according to the partition namespace ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol; in the process of writing each data block to the SSD, sending each data block to the hardware acceleration module, instructing the hardware acceleration module to use a preset algorithm, with a single data block as a unit, to perform a checksum operation on all the data blocks in a calculation cycle to obtain a checksum of the calculation cycle; wherein a calculation cycle contains a preset number of data blocks; storing the checksum of each calculation cycle, so that when the data written to the SSD is lost, using the hardware acceleration module, according to the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, each data block in the backup unit is used as a recovery unit to perform data recovery; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0083] In addition, the logic instructions in the above-mentioned memory 930 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art or the 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 a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program codes.
[0084] On the other hand, the present invention also provides a computer program product, which includes a computer program, which can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the data backup method of the partition namespace solid-state hard disk provided by the above methods, the method comprising: writing each data block in the data to be written to the solid-state hard disk SSD in sequence according to the partition namespace ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol; in the process of writing each data block to the SSD, sending each data block to a hardware acceleration module, instructing the hardware acceleration module to use a preset algorithm, with a single data block as a unit, to perform a checksum operation on all the data blocks in a calculation cycle to obtain a checksum of the calculation cycle; wherein a calculation cycle contains a preset number of data blocks; storing the checksum of each calculation cycle, so that when the data written to the SSD is lost, using the hardware acceleration module, according to the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, each data block in the backup unit is used as a recovery unit to perform data recovery; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0085] On the other hand, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a data backup method for a partitioned namespace solid-state hard disk provided by the above methods, the method comprising: writing each data block in the data to be written into a solid-state hard disk SSD in sequence according to the partitioned namespace ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol; in the process of writing each data block into the SSD, sending each data block to a hardware acceleration module, instructing the hardware acceleration module to perform a checksum operation on all the data blocks in a calculation cycle using a preset algorithm and taking a single data block as a unit to obtain a checksum of the calculation cycle; wherein a calculation cycle contains a preset number of data blocks; storing the checksum of each calculation cycle, so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located and taking each data block in the backup unit as a recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
[0086] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0087] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0088] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A data backup method for a partition namespace solid state drive, characterized in that: include: In accordance with the partition namespace ZNS interface specification, each data block in the data to be written is sequentially written into the solid state drive SSD; wherein the size of each data block is set according to the ZNS protocol; In the process of writing each data block into the SSD, each data block is sent to the hardware acceleration module, and the hardware acceleration module is instructed to use a preset algorithm to perform a checksum operation on all the data blocks in a calculation cycle with a single data block as a unit to obtain a checksum of the calculation cycle; wherein one calculation cycle includes a preset number of data blocks; The checksum of each of the calculation cycles is stored so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
2. The data backup method of a partition namespace solid state drive according to claim 1, characterized in that: The preset algorithm includes an XOR operation, and the checksum of the calculation cycle includes a first checksum; The method of using a preset algorithm to perform a checksum operation on all the data blocks in a calculation cycle with a single data block as a unit to obtain a checksum of the calculation cycle includes: An XOR operation is sequentially performed on each data block in the calculation cycle and the initial value of the first checksum, and the value of the checksum is updated successively to finally obtain the first checksum.
3. The data backup method of a partition namespace solid state drive according to claim 2, characterized in that: The checksum of the calculation cycle also includes a second checksum; The method of using a preset algorithm to perform a checksum operation on all the data blocks in a calculation cycle with a single data block as a unit to obtain a checksum of the calculation cycle includes: Performing Galois Field operations on each data block in the calculation cycle and the elements at corresponding positions in the preset fixed value array in turn to obtain a representation of each data block in the Galois Field; An exclusive OR operation is sequentially performed on the representation of each data block in the calculation cycle in the Galois field and the initial value of the second checksum, and the checksum value is updated successively to finally obtain the second checksum.
4. The data backup method of a partition namespace solid state drive according to claim 2, characterized in that: The method of performing data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located and taking each data block in the backup unit as a recovery unit includes: In response to a data block in the backup unit being lost, performing an XOR operation on each non-lost data block in the backup unit and the initial value of the first checksum in turn, updating the checksum value one by one, and finally obtaining a first recovery checksum; The lost data block is restored according to an XOR operation between the first checksum of the calculation cycle corresponding to the backup unit and the first recovery checksum.
5. The data backup method of a partition namespace solid state drive according to claim 3, characterized in that: The method of performing data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located and taking each data block in the backup unit as a recovery unit includes: In response to the loss of two data blocks in the backup unit, performing an XOR operation on each non-lost data block in the backup unit and the initial value of the first checksum in turn, updating the checksum value one by one, and finally obtaining a second recovery checksum; sequentially performing Galois Field operations on each non-lost data block in the backup unit and the elements at corresponding positions in the preset fixed value array to obtain a representation of each non-lost data block in the Galois Field; sequentially performing an XOR operation on the representation of each non-lost data block in the Galois field and the initial value of the second checksum, updating the checksum value one by one, and finally obtaining a third restored checksum; The two lost data blocks are restored by using the second recovery checksum, the third recovery checksum, the first checksum and the second checksum of the calculation cycle corresponding to the backup unit.
6. The data backup method of a partition namespace solid state drive according to claim 5, characterized in that: The method of restoring the two lost data blocks by using the second recovery checksum, the third recovery checksum, and the first checksum and the second checksum of the calculation cycle corresponding to the backup unit includes: Obtaining an XOR value of the two lost data blocks according to an XOR operation between the first checksum and the second recovery checksum; Obtaining an XOR value of the representation of the two lost data blocks in the Galois field according to an XOR operation between the second checksum and the third recovery checksum; The two lost data blocks are obtained by solving simultaneous equations according to an XOR value of the two lost data blocks and an XOR value of representations of the two lost data blocks in the Galois Field.
7. A data backup device for a partition namespace solid state hard disk, characterized in that: include: A writing module, used for writing each data block of the data to be written into the solid state drive SSD in sequence according to the partition name space ZNS interface specification; wherein the size of each data block is set according to the ZNS protocol; A sending module, used for sending each data block to the hardware acceleration module during the process of writing each data block into the SSD, instructing the hardware acceleration module to perform a checksum operation on all the data blocks in a calculation cycle using a preset algorithm and taking a single data block as a unit to obtain a checksum of the calculation cycle; wherein one calculation cycle includes a preset number of data blocks; A storage module is used to store the checksum of each of the calculation cycles, so that when the data written to the SSD is lost, the hardware acceleration module is used to perform data recovery based on the checksum of the calculation cycle corresponding to the backup unit where the lost data block is located, with each data block in the backup unit as the recovery unit; wherein the backup unit is a storage area obtained by dividing the storage space of the SSD according to the calculation cycle.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the data backup method of the partition namespace solid state drive according to any one of claims 1 to 6 is implemented.
9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the data backup method of the partition namespace solid state drive according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the data backup method of the partition namespace solid state drive according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
ZNS parity swap to DRAM
CN114730282A
Data writing method and device for partition namespace solid state disk and electronic equipment
CN115951839A
Data backup method and device, flash memory equipment and storage medium
CN117785562A
Parity and syndrome generation for error and correction in digital communication systems
EP0154538A2
Error correction device for many bytes
JP1995248930A